help.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="wrap">
  3. <view class="header">
  4. <scroll-view scroll-x style="white-space:nowrap;padding-left:32rpx;box-sizing:border-box;">
  5. <view :class="['header_item', active === index?'active':'']" @tap="changeActive(item,index)" v-for="item,index in header" :key="index">{{item.title}}
  6. <view class="line"></view>
  7. </view>
  8. </scroll-view>
  9. </view>
  10. <view class="help_list">
  11. <view class="list_item" v-for="item,index in info" :key="index">
  12. <view class="list_item_quest clear" @tap="changeSelect(index)">
  13. <view class="quest_lf clear">
  14. <view class="answer_img" style="margin:34rpx 10rpx 0 0;"> <image src="https://wx.fujinyangche.com/nvrnetwork/images/quest_img.png"></image></view>
  15. <view class="quest_lf_text">{{item.infotitle}}</view>
  16. </view>
  17. <view :class="['iconfont',item.select == 1?'top':'more']"></view>
  18. </view>
  19. <view :class="['answer', item.select ===1?'show':'','clear']">
  20. <view class="answer_img"> <image src="https://wx.fujinyangche.com/nvrnetwork/images/answer_img.png"></image></view>
  21. <view class="answer_text" v-html="item.infodetail"></view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import api from "../../../../api.js";
  29. let app = getApp();
  30. export default {
  31. data() {
  32. return {
  33. header:'',//头部
  34. info:'',//下方列表
  35. active:0,//导航栏选中
  36. }
  37. },
  38. onLoad() {
  39. this.getData();
  40. },
  41. methods: {
  42. //加载数据
  43. getData(){
  44. api.getUserHelp().then((res)=>{
  45. console.log(res);
  46. let type = res.data.data.type;
  47. let info = res.data.data.info;
  48. for (let i = 0; i < info.length;i++){
  49. info[i].select = 0;
  50. }
  51. type.unshift({id:0,title:'全部'});
  52. this.header = type;
  53. this.info = info;
  54. })
  55. },
  56. //点击展开
  57. changeSelect(index){
  58. if(this.info[index].select == 0){
  59. this.info[index].select = 1;
  60. }else{
  61. this.info[index].select = 0;
  62. }
  63. },
  64. changeActive(item,index){
  65. this.active = index;
  66. let data = {
  67. type:item.id
  68. }
  69. api.getUserHelpHeader(data).then((res)=>{
  70. // console.log(res);
  71. let info = res.data.data;
  72. for (let i = 0; i < info.length;i++){
  73. info[i].select = 0;
  74. }
  75. this.info = info;
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style>
  82. .clear:after{
  83. content: "";
  84. display: block;
  85. clear: both;
  86. }
  87. page{
  88. width:100%;
  89. height:100%;
  90. background-color:#F9F9F9;
  91. }
  92. .header{
  93. height:86rpx;
  94. line-height: 86rpx;
  95. border-top:1px solid #f2f2f2;
  96. box-sizing: border-box;
  97. background-color: #ffffff;
  98. }
  99. .header_item{
  100. text-align: center;
  101. font-size:30rpx;
  102. color:#222222;
  103. margin-right: 50rpx;
  104. display: inline-block;
  105. position: relative;
  106. }
  107. .line{
  108. width:38rpx;
  109. height:4rpx;
  110. background:linear-gradient(270deg,rgba(254,107,21,1) 0%,rgba(254,163,48,1) 100%);
  111. position: absolute;
  112. bottom:0rpx;
  113. left:50%;
  114. transform: translateX(-50%);
  115. display: none;
  116. }
  117. .active{
  118. font-size:34rpx;
  119. font-weight:600;
  120. background:linear-gradient(270deg, rgba(254,107,21,1) 0%, rgba(254,163,48,1) 100%);
  121. -webkit-background-clip:text;
  122. -webkit-text-fill-color:transparent;
  123. }
  124. .active .line{
  125. display: block;
  126. }
  127. .help_list{
  128. width:100%;
  129. margin-top:20rpx;
  130. }
  131. .list_item{
  132. width:100%;
  133. margin-bottom:20rpx;
  134. padding:0 30rpx;
  135. box-sizing: border-box;
  136. background-color: #ffffff;
  137. }
  138. .list_item_quest{
  139. height:108rpx;
  140. line-height: 108rpx;
  141. }
  142. .quest_lf{
  143. float:left;
  144. }
  145. .quest_lf_text{
  146. width:600rpx;
  147. white-space: nowrap;
  148. text-overflow: ellipsis;
  149. overflow: hidden;
  150. font-size: 30rpx;
  151. color:#222222;
  152. float:left;
  153. }
  154. .more{
  155. font-size: 26rpx;
  156. color:#999999;
  157. float:right;
  158. }
  159. .top{
  160. font-size: 26rpx;
  161. color:#999999;
  162. float:right;
  163. }
  164. .answer{
  165. border-top:1px dashed #E5E5E5;
  166. padding:32rpx 0 34rpx 0;
  167. box-sizing: border-box;
  168. display: none;
  169. }
  170. .show{
  171. display: block;
  172. }
  173. .answer_img{
  174. width:38rpx;
  175. height:38rpx;
  176. float:left;
  177. }
  178. .answer_img image{
  179. display: block;
  180. width:100%;
  181. height:100%;
  182. margin-top:2rpx;
  183. float:left;
  184. }
  185. .answer_text{
  186. width:calc(100% - 48rpx);
  187. font-size: 26rpx;
  188. color:#666666;
  189. line-height: 40rpx;
  190. float:left;
  191. margin-left: 10rpx;
  192. }
  193. </style>