sort_list.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <view>
  3. <!--标题栏-->
  4. <bar-search-title bgColor="bg-white" content="苹果8p" @contentTap="searchTap">
  5. <block slot="right">
  6. <text class="cuIcon-service"/>
  7. </block>
  8. </bar-search-title>
  9. <!--轮播图-->
  10. <view class="bg-white zaiui-swiper-box">
  11. <swiper class="screen-swiper square-dot c" autoplay circular indicator-dots :current="swiperIndex" @change="swiperChange">
  12. <swiper-item v-for="(item,index) in swiperList" :key="index">
  13. <view class="swiper-padding">
  14. <image :src="item.img" mode="widthFix"/>
  15. </view>
  16. </swiper-item>
  17. </swiper>
  18. </view>
  19. <!--投资-->
  20. <view class="bg-white zaiui-invest-title-box">
  21. <view class="text-box">
  22. <text class="cuIcon-title text-black"/>
  23. <text class="text-lg text-bold text-black">腾讯战略投资</text>
  24. <text class="text-sm margin-left-sm">严格质检消毒,4重保障放心购买</text>
  25. </view>
  26. <view class="img" style="background-image:url(/static/images/home/sundry/16.png)"/>
  27. </view>
  28. <!--圆图标导航-->
  29. <view class="bg-white zaiui-grid-round-box">
  30. <view class="cu-list grid col-5 no-border">
  31. <block v-for="(item,index) in gridRoundList" :key="index" v-if="index < 5">
  32. <view class="cu-item">
  33. <view class="grid-icon">
  34. <image class="icon" :src="item.img" mode="widthFix"/>
  35. </view>
  36. <view class="cu-tag badge z bg-orange" v-if="item.badge">{{item.badge}}</view>
  37. <text class="text-black">{{item.name}}</text>
  38. </view>
  39. </block>
  40. </view>
  41. </view>
  42. <!--小图标导航-->
  43. <view class="zaiui-grid-sm-box">
  44. <view class="cu-list grid col-5 no-border">
  45. <block v-for="(item,index) in gridSmList" :key="index" v-if="index < 10">
  46. <view class="cu-item">
  47. <view class="grid-icon">
  48. <image class="icon" :src="item.img" mode="widthFix"/>
  49. </view>
  50. <text class="text-black">{{item.name}}</text>
  51. </view>
  52. </block>
  53. </view>
  54. </view>
  55. <!--限时秒杀-->
  56. <view class="bg-white zaiui-seckill-list-view-box">
  57. <view class="list-title-box">
  58. <view class="text-view">
  59. <text class="text-red text-lg text-bold">限时秒杀</text>
  60. <text class="cu-tag bg-black radius sm">00</text>
  61. <text class="text-black sm colon">:</text>
  62. <text class="cu-tag bg-black radius sm">07</text>
  63. <text class="text-black sm colon">:</text>
  64. <text class="cu-tag bg-black radius sm">50</text>
  65. </view>
  66. <view class="text-gray text-sm text-right-view">
  67. <text>更多</text>
  68. <text class="cuIcon-right"/>
  69. </view>
  70. </view>
  71. <view class="seckill-goods-list-view">
  72. <scroll-view class="recommend-scroll" scroll-x>
  73. <block v-for="(items,indexs) in goodsSortListData" :key="indexs">
  74. <view :id="['scroll' + (indexs + 1 )]" class="recommend-scroll-item">
  75. <view class="goods-img-view">
  76. <view class="cu-avatar xl radius" :style="[{backgroundImage:'url('+ items.img +')'}]"/>
  77. <text class="cu-tag radius sm bg-gradual-pink">直降200</text>
  78. </view>
  79. <view class="text-cut-2 text-sm text-black text-bold margin-tb-sm">{{items.title}}</view>
  80. <view class="text-red text-price margin-top-sm text-lg">{{items.price}}</view>
  81. <view class="text-gray text-through text-sm">¥{{items.cost_price}}</view>
  82. <text class="cu-tag round sm bg-orange rob-tag">抢</text>
  83. </view>
  84. </block>
  85. </scroll-view>
  86. </view>
  87. </view>
  88. <!--宫格活动-->
  89. <view class="zaiui-gird-hot-goods-box">
  90. <view class="bg-white margin">
  91. <view class="cu-list grid col-2">
  92. <view class="cu-item">
  93. <view class="text-view">
  94. <text class="text-title">热销榜</text>
  95. <view class="text-gray text-sm text-right-view">
  96. <text class="text-m">更多</text>
  97. <text class="cuIcon-right icon"/>
  98. </view>
  99. </view>
  100. <view class="grid col-2 margin-top-sm">
  101. <view class="goods-item">
  102. <view class="cu-avatar xl radius" style="background-image:url(/static/images/home/goods/4.png);"/>
  103. <text class="text-goods-title">iPhoneX</text>
  104. </view>
  105. <view class="goods-item">
  106. <view class="cu-avatar xl radius" style="background-image:url(/static/images/home/goods/1.png);"/>
  107. <text class="text-goods-title">iPhone7</text>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="cu-item">
  112. <view class="text-view">
  113. <text class="text-title">卖手机</text>
  114. <text class="cu-tag bg-red radius sm">红包</text>
  115. </view>
  116. <view class="margin-top-sm zaiui-list-2-view">
  117. <view class="goods-img-view">
  118. <view class="cu-avatar xl radius" style="background-image:url(/static/images/home/goods/5.png);"/>
  119. <view class="zaiui-text-view">
  120. <view class="text-price text-red text-lg">2999</view>
  121. <view class="text-gray text-sm">比回收价高760</view>
  122. <view class="text-gray text-sm">500w+人已卖</view>
  123. </view>
  124. </view>
  125. <text class="text-goods-title">
  126. <text class="text-title-1">本机</text>
  127. <text class="text-title-2">iPhone7 Plus</text>
  128. </text>
  129. </view>
  130. </view>
  131. <view class="cu-item">
  132. <view class="text-view">
  133. <text class="text-title">iPhone X 特惠</text>
  134. <view class="text-sm text-gray">低至3600元起</view>
  135. </view>
  136. <view class="grid col-2 margin-top-sm">
  137. <view class="text-left goods-item">
  138. <view class="cu-avatar xl radius" style="background-image:url(/static/images/home/goods/6.png);"/>
  139. </view>
  140. <view class="text-left goods-item">
  141. <view class="cu-avatar xl radius" style="background-image:url(/static/images/home/goods/10.png);"/>
  142. </view>
  143. </view>
  144. </view>
  145. <view class="cu-item">
  146. <view class="text-view">
  147. <text class="text-title">自营准新机专区</text>
  148. <view class="text-sm text-gray">99新!5折起</view>
  149. </view>
  150. <view class="grid col-2 margin-top-sm">
  151. <view class="text-left goods-item">
  152. <view class="cu-avatar xl radius" style="background-image:url(/static/images/home/goods/11.png);"/>
  153. </view>
  154. <view class="text-left goods-item">
  155. <view class="cu-avatar xl radius" style="background-image:url(/static/images/home/goods/9.png);"/>
  156. </view>
  157. </view>
  158. </view>
  159. </view>
  160. </view>
  161. </view>
  162. <!--商品列表-->
  163. <view class="bg-white margin-top padding-bottom-sm padding-top-sm zaiui-goods-list-view-box">
  164. <scroll-view scroll-x class="nav z">
  165. <view class="flex text-center">
  166. <block v-for="(item,index) in goodsTab" :key="index">
  167. <view class="cu-item flex-sub text-black" :class="index==TabCur?'select':''" @tap="tabSelect" :data-id="index">
  168. <view>{{item}}</view>
  169. <view class="tab-dot bg-red"/>
  170. </view>
  171. </block>
  172. </view>
  173. </scroll-view>
  174. <!--商品列表1-->
  175. <goods-sort-list :list_data="goodsSortListData" @listTap="goodsSortListTap" :show="TabCur==0?true:false"></goods-sort-list>
  176. <!--商品列表2-->
  177. <goods-sort-list :list_data="goodsSortListData" @listTap="goodsSortListTap" :show="TabCur==1?true:false"></goods-sort-list>
  178. </view>
  179. <!--加号按钮-->
  180. <view class="zaiui-footer-fixed zaiui-add-btn-view-box">
  181. <button class="cu-btn cuIcon-add bg-red"/>
  182. </view>
  183. </view>
  184. </template>
  185. <script>
  186. import barSearchTitle from '@/components/zaiui-common/basics/bar-search-title';
  187. import goodsSortList from '@/components/zaiui-common/list/goods-sort-list';
  188. import _sort_list_data from '@/static/zaiui/data/sort_list.js'; //虚拟数据
  189. import _tool from '@/static/zaiui/util/tools.js'; //工具函数
  190. export default {
  191. components: {
  192. barSearchTitle, goodsSortList,
  193. },
  194. data() {
  195. return {
  196. swiperIndex: 0, swiperList: [], gridRoundList: [], gridSmList: [], goodsTab: ['推荐','官方自营'], TabCur: 0, goodsSortListData: [],
  197. }
  198. },
  199. onLoad() {
  200. this.swiperList = _sort_list_data.swiperListData();
  201. this.gridRoundList = _sort_list_data.gridRoundList();
  202. this.gridSmList = _sort_list_data.gridSmList();
  203. this.goodsSortListData = _sort_list_data.goodsSortListData();
  204. },
  205. onReady() {
  206. _tool.setBarColor(true);
  207. uni.pageScrollTo({
  208. scrollTop: 0,
  209. duration: 0
  210. });
  211. },
  212. methods: {
  213. swiperChange(e) {
  214. this.swiperIndex = e.detail.current;
  215. },
  216. tabSelect(e) {
  217. this.TabCur = e.currentTarget.dataset.id;
  218. },
  219. goodsSortListTap(e) {
  220. console.log(e);
  221. },
  222. searchTap() {
  223. uni.navigateTo({
  224. url: "/pages/home/search"
  225. });
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="scss">
  231. /* #ifdef APP-PLUS */
  232. @import "../../static/colorui/main.css";
  233. @import "../../static/colorui/icon.css";
  234. @import "../../static/zaiui/style/app.scss";
  235. /* #endif */
  236. @import "../../static/zaiui/style/sort_list.scss";
  237. </style>