index.wxml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <!--index.wxml-->
  2. <view class="container">
  3. <view class="search">
  4. <navigator url="/pages/search/search" class="input">
  5. <van-icon name="search"/>
  6. <text class="txt">商品搜索, 共{{goodsCount}}款好物</text>
  7. </navigator>
  8. </view>
  9. <swiper class="banner" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
  10. <swiper-item wx:for="{{banner}}" wx:key="id">
  11. <block wx:if="{{item.link>0}}">
  12. <navigator url="/pages/goods/goods?id={{item.link}}">
  13. <image src="{{item.url}}" background-size="cover"></image>
  14. </navigator>
  15. </block>
  16. <block wx:else>
  17. <image src="{{item.url}}" background-size="cover"></image>
  18. </block>
  19. </swiper-item>
  20. </swiper>
  21. <view class="m-menu">
  22. <navigator class="item" url="/pages/category/category?id={{item.id}}" wx:for="{{channel}}" wx:key="id">
  23. <image src="{{item.iconUrl}}" background-size="cover"></image>
  24. <text>{{item.name}}</text>
  25. </navigator>
  26. </view>
  27. <view class="a-section a-coupon" wx:if="{{coupon.length > 0}}">
  28. <view class="h">
  29. <view class="title">
  30. <view>
  31. <navigator url="/pages/coupon/coupon">
  32. <text class="txt">优惠券</text>
  33. </navigator>
  34. </view>
  35. </view>
  36. </view>
  37. <view wx:if="{{coupon.length>0}}" class="b">
  38. <view class="item" wx:for="{{coupon}}" wx:for-index="index" wx:for-item="item" wx:key="id" bindtap="getCoupon" data-index="{{item.id}}">
  39. <view class="tag">{{item.tag}}</view>
  40. <view class="content">
  41. <view class="left">
  42. <view class="discount">{{item.discount}}元</view>
  43. <view class="min"> 满{{item.min}}元使用</view>
  44. </view>
  45. <view class="right">
  46. <view class="name">{{item.name}}</view>
  47. <view class="desc">{{item.desc}}</view>
  48. <view class="time" wx:if="{{item.days != 0}}">有效期:{{item.days}}天</view>
  49. <view class="time" wx:else> 有效期:{{item.startTime}} - {{item.endTime}}</view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="a-section a-groupon" wx:if="{{groupons.length > 0}}">
  56. <view class="h">
  57. <view class="title">
  58. <view>
  59. <navigator url="/pages/groupon/grouponList/grouponList">
  60. <text class="txt">团购专区</text>
  61. </navigator>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="b">
  66. <view class="item" wx:for="{{groupons}}" wx:for-index="index" wx:for-item="item" wx:key="id">
  67. <navigator url="/pages/goods/goods?id={{item.id}}">
  68. <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
  69. <view class="right">
  70. <view class="text">
  71. <view class="header">
  72. <text class="name">{{item.name}}</text>
  73. <van-tag type="primary">{{item.grouponMember}}人成团</van-tag>
  74. </view>
  75. <view class="expire">
  76. <van-tag round type="warning">有效期至 {{item.expireTime}}</van-tag>
  77. </view>
  78. <text class="desc">{{item.brief}}</text>
  79. <view class="price">
  80. <view class="counterPrice">现价:¥{{item.retailPrice}}</view>
  81. <view class="retailPrice">团购价:¥{{item.grouponPrice}}</view>
  82. </view>
  83. </view>
  84. </view>
  85. </navigator>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="a-section a-brand">
  90. <view class="h">
  91. <navigator url="../brand/brand">
  92. <text class="txt">品牌制造商直供</text>
  93. </navigator>
  94. </view>
  95. <view class="b">
  96. <view class="item item-1" wx:for="{{brands}}" wx:key="id">
  97. <navigator url="/pages/brandDetail/brandDetail?id={{item.id}}">
  98. <view class="wrap">
  99. <image class="img" src="{{item.picUrl}}" mode="aspectFill"></image>
  100. <view class="mt">
  101. <text class="brand">{{item.name}}</text>
  102. <text class="price">{{item.floorPrice}}</text>
  103. <text class="unit">元起</text>
  104. </view>
  105. </view>
  106. </navigator>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="a-section a-new" wx:if="{{newGoods.length > 0}}">
  111. <view class="h">
  112. <view>
  113. <navigator url="../newGoods/newGoods">
  114. <text class="txt">周一周四 · 新品首发</text>
  115. </navigator>
  116. </view>
  117. </view>
  118. <view class="b">
  119. <view class="item" wx:for="{{newGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
  120. <navigator url="../goods/goods?id={{item.id}}">
  121. <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
  122. <text class="name">{{item.name}}</text>
  123. <text class="price">¥{{item.retailPrice}}</text>
  124. </navigator>
  125. </view>
  126. </view>
  127. </view>
  128. <view class="a-section a-popular" wx:if="{{hotGoods.length > 0}}">
  129. <view class="h">
  130. <view>
  131. <navigator url="../hotGoods/hotGoods">
  132. <text class="txt">人气推荐</text>
  133. </navigator>
  134. </view>
  135. </view>
  136. <view class="b">
  137. <view class="item" wx:for="{{hotGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
  138. <navigator url="/pages/goods/goods?id={{item.id}}">
  139. <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
  140. <view class="right">
  141. <view class="text">
  142. <text class="name">{{item.name}}</text>
  143. <text class="desc">{{item.brief}}</text>
  144. <text class="price">¥{{item.retailPrice}}</text>
  145. </view>
  146. </view>
  147. </navigator>
  148. </view>
  149. </view>
  150. </view>
  151. <view class="a-section a-topic" wx:if="topics.length > 0" hidden="{{topics.length <= 0}}">
  152. <view class="h">
  153. <view>
  154. <navigator url="/pages/topic/topic">
  155. <text class="txt">专题精选</text>
  156. </navigator>
  157. </view>
  158. </view>
  159. <view class="b">
  160. <scroll-view scroll-x class="list">
  161. <view class="item" wx:for="{{topics}}" wx:for-index="index" wx:for-item="item" wx:key="id">
  162. <navigator url="../topicDetail/topicDetail?id={{item.id}}">
  163. <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
  164. <view class="np">
  165. <text class="name">{{item.title}}</text>
  166. <text class="price">¥{{item.price}}元起</text>
  167. </view>
  168. <text class="desc">{{item.subtitle}}</text>
  169. </navigator>
  170. </view>
  171. </scroll-view>
  172. </view>
  173. </view>
  174. <view class="good-grid" wx:for="{{floorGoods}}" wx:key="id">
  175. <view class="h" wx:if="{{item.goodsList.length>0}}">
  176. <text>{{item.name}}</text>
  177. </view>
  178. <view class="b">
  179. <block wx:for="{{item.goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
  180. <view class="item {{iindex % 2 == 0 ? '' : 'item-b'}}">
  181. <navigator url="../goods/goods?id={{iitem.id}}" class="a">
  182. <image class="img" src="{{iitem.picUrl}}" background-size="cover"></image>
  183. <text class="name">{{iitem.name}}</text>
  184. <text class="price">¥{{iitem.retailPrice}}</text>
  185. </navigator>
  186. </view>
  187. </block>
  188. </view>
  189. <navigator url="/pages/category/category?id={{item.id}}" class="t" wx:if="{{item.goodsList.length>0}}">
  190. <view class="txt">{{'更多'+item.name+'好物 >'}}</view>
  191. </navigator>
  192. </view>
  193. </view>