gxlist.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <view class="content">
  3. <view class="top"></view>
  4. <view class="search flex">
  5. <view class="input-box flex">
  6. <view class=" input-content flex">
  7. <view class="iconfont iconsearch"></view>
  8. <view class="input"><input type="text" placeholder-class="place" v-model="name"
  9. placeholder="请输入关键词搜索" />
  10. </view>
  11. <view class="btn" @click="search">
  12. 搜索
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="main">
  18. <view class="main-item" v-for="(item,index) in list">
  19. <view class="main-title flex">
  20. <view class="maint-left" @click="show(item)">
  21. <view class="maint-font">{{item.name}}</view>
  22. <image class="maint-iconh" v-if="item.isshow == 0" src="../../static/img/jt.png" mode="">
  23. </image>
  24. <image class="maint-icon" v-else src="../../static/icon/downxia.png" mode=""></image>
  25. </view>
  26. <view class="maint-right" @click="allChoose(item)">
  27. <view class="maint-all">全选</view>
  28. <view class="maint-allicon">
  29. <image :src="item.isall == 1?'../../static/icon/have.png':'../../static/icon/null.png'"
  30. mode="widthFix"></image>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="main-info flex" v-for="(itm,ind) in item.orderlist" v-if="item.isshow == 1">
  35. <view class="maini-left">
  36. {{itm.name}}(<text>¥{{itm.number}}</text>)
  37. </view>
  38. <view class="maini-right" @click="choose(itm,item)">
  39. <image :src="itm.ischoose == 1?'../../static/icon/have.png':'../../static/icon/null.png'"
  40. mode="widthFix"></image>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. list: [{
  52. name: '加工',
  53. isall: 0,
  54. isshow: 1,
  55. orderlist: [{
  56. name: '缝纫',
  57. number: 100,
  58. ischoose: 0
  59. },
  60. {
  61. name: '缝纫',
  62. number: 100,
  63. ischoose: 0
  64. },
  65. {
  66. name: '缝纫',
  67. number: 100,
  68. ischoose: 0
  69. },
  70. {
  71. name: '缝纫',
  72. number: 100,
  73. ischoose: 0
  74. },
  75. {
  76. name: '缝纫',
  77. number: 100,
  78. ischoose: 0
  79. }
  80. ]
  81. },
  82. {
  83. name: '大标题',
  84. isall: 0,
  85. isshow: 0,
  86. orderlist: [{
  87. name: '缝纫',
  88. number: 100,
  89. ischoose: 0
  90. },
  91. {
  92. name: '缝纫',
  93. number: 100,
  94. ischoose: 0
  95. },
  96. {
  97. name: '缝纫',
  98. number: 100,
  99. ischoose: 0
  100. },
  101. {
  102. name: '缝纫',
  103. number: 100,
  104. ischoose: 0
  105. },
  106. {
  107. name: '缝纫',
  108. number: 100,
  109. ischoose: 0
  110. }
  111. ]
  112. }
  113. ]
  114. };
  115. },
  116. onLoad() {},
  117. onShow() {},
  118. onReachBottom() {},
  119. onReady() {},
  120. methods: {
  121. show(item) {
  122. item.isshow = !item.isshow
  123. },
  124. allChoose(item) {
  125. if (item.isall == 0) {
  126. item.isall = 1
  127. item.orderlist.forEach(e => {
  128. e.ischoose = 1
  129. })
  130. } else {
  131. item.isall = 0
  132. item.orderlist.forEach(e => {
  133. e.ischoose = 0
  134. })
  135. }
  136. },
  137. choose(son, father) {
  138. if (son.ischoose == 0) {
  139. son.ischoose = 1;
  140. let fengshu = 1
  141. father.orderlist.forEach(e => {
  142. if (e.ischoose == 0) {
  143. fengshu = 0
  144. }
  145. })
  146. father.isall = fengshu
  147. } else {
  148. son.ischoose = 0;
  149. father.isall = 0
  150. }
  151. }
  152. }
  153. };
  154. </script>
  155. <style lang="scss">
  156. page,
  157. .content {
  158. min-height: 100%;
  159. height: auto;
  160. background: #ffffff;
  161. }
  162. .top {
  163. background: #f8f8f8;
  164. width: 750rpx;
  165. height: 20rpx;
  166. }
  167. .search {
  168. justify-content: flex-start;
  169. padding: 10rpx 32rpx 20rpx;
  170. align-items: center;
  171. background-color: #fff;
  172. .input-box {
  173. margin-left: 10rpx;
  174. position: relative;
  175. z-index: 99;
  176. width: 710rpx;
  177. height: 60rpx;
  178. background: #eeeeee;
  179. border-radius: 30rpx;
  180. .input-content {
  181. position: relative;
  182. z-index: 11;
  183. border-radius: 99rpx;
  184. flex-grow: 1;
  185. padding: 5rpx 30rpx;
  186. background: #eeeeee;
  187. .iconfont {
  188. display: flex;
  189. align-items: center;
  190. justify-content: center;
  191. width: 30rpx;
  192. height: 14rpx;
  193. line-height: 1;
  194. margin-left: 4rpx;
  195. &.active {
  196. color: $base-color;
  197. }
  198. }
  199. .iconsearch {
  200. font-size: 50rpx;
  201. color: #cbcbcb;
  202. }
  203. .input {
  204. margin-left: 19rpx;
  205. flex-grow: 1;
  206. .place {
  207. color: #cbcbcb;
  208. }
  209. }
  210. }
  211. }
  212. }
  213. .main {
  214. margin-top: 30rpx;
  215. border-top: 1px solid #F0F0F0;
  216. image {
  217. width: 100%;
  218. height: 100%;
  219. }
  220. .main-title {
  221. padding: 32rpx 42rpx;
  222. border-bottom: 1px solid #F0F0F0;
  223. .maint-left {
  224. display: flex;
  225. align-items: center;
  226. .maint-font {
  227. font-size: 32rpx;
  228. font-family: PingFang SC;
  229. font-weight: bold;
  230. color: #3F454B;
  231. margin-right: 20rpx;
  232. }
  233. .maint-icon {
  234. width: 20rpx;
  235. height: 11rpx;
  236. }
  237. .maint-iconh {
  238. width: 11rpx;
  239. height: 20rpx;
  240. }
  241. }
  242. .maint-right {
  243. display: flex;
  244. align-items: center;
  245. .maint-all {
  246. margin-right: 20rpx;
  247. font-size: 28rpx;
  248. font-family: PingFang SC;
  249. font-weight: 500;
  250. color: #3F454B;
  251. }
  252. .maint-allicon {
  253. width: 38rpx;
  254. height: 38rpx;
  255. border-radius: 50%;
  256. }
  257. }
  258. }
  259. .main-info {
  260. margin: 0 24rpx;
  261. border-bottom: 1px solid #F0F0F0;
  262. padding: 38rpx 18rpx 28rpx;
  263. .maini-left {
  264. font-size: 32rpx;
  265. font-family: PingFang SC;
  266. font-weight: bold;
  267. color: #3F454B;
  268. text {
  269. color: #FF4C4C;
  270. }
  271. }
  272. .maini-right {
  273. width: 38rpx;
  274. height: 38rpx;
  275. border-radius: 50%;
  276. }
  277. }
  278. }
  279. </style>