index.wxml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <view wx:if="{{ active.active_id }}" class="container">
  2. <!-- 富文本组件 -->
  3. <import src="../../../wxParse/wxParse.wxml"></import>
  4. <!-- 滚动容器 -->
  5. <scroll-view class="scroll-container" bindscroll="onScrollEvent" scroll-top="{{ scrollTop }}" scroll-y="true">
  6. <!-- 商品图片 -->
  7. <view class="goods-swiper">
  8. <swiper autoplay="{{ autoplay }}" bindchange="setCurrent" class="banner-box swiper-box" duration="{{duration}}"
  9. indicator-dots="{{indicatorDots}}" interval="{{interval}}" circular="{{true}}">
  10. <swiper-item wx:for="{{ goods.image }}" wx:key="this" catchtap="onPreviewImages" data-index="{{ index }}">
  11. <image class="slide-image" mode="aspectFill" src="{{ item.file_path }}"></image>
  12. </swiper-item>
  13. </swiper>
  14. <view class="banner-num">
  15. <text>{{ currentIndex }}</text>
  16. <text>/</text>
  17. <text>{{ goods.image.length }}</text>
  18. </view>
  19. </view>
  20. <!-- 商品信息 -->
  21. <view class="goods-info m-top20">
  22. <!-- 价格、销量 -->
  23. <view class="info-item info-item__top dis-flex flex-x-between flex-y-end">
  24. <view class="block-left dis-flex flex-y-end">
  25. <view class="active-tag">
  26. <text>限时秒杀</text>
  27. </view>
  28. <!-- 秒杀价 -->
  29. <text class="floor-price__samll">¥</text>
  30. <text class="floor-price">{{ goods.goods_sku.seckill_price }}</text>
  31. <!-- 原价 -->
  32. <text class="original-price">¥{{ goods.goods_sku.original_price }}</text>
  33. </view>
  34. <view class="block-right dis-flex">
  35. <!-- 销量 -->
  36. <view class="goods-sales">
  37. <text>已抢{{ active.sales_actual }}件</text>
  38. </view>
  39. </view>
  40. </view>
  41. <!-- 标题、分享 -->
  42. <view class="info-item info-item__name dis-flex flex-y-center">
  43. <view class="goods-name flex-box">
  44. <text class="twolist-hidden">{{ goods.goods_name }}</text>
  45. </view>
  46. <view class="goods-share__line"></view>
  47. <view class="goods-share">
  48. <form bindsubmit="onClickShare">
  49. <button formType="submit" class="share-btn dis-flex flex-dir-column">
  50. <text class="share__icon iconfont icon-fenxiang"></text>
  51. <text class="f-24">分享</text>
  52. </button>
  53. </form>
  54. </view>
  55. </view>
  56. <!-- 商品卖点 -->
  57. <view wx:if="{{ goods.selling_point }}" class="info-item info-item_selling-point">
  58. <text>{{ goods.selling_point }}</text>
  59. </view>
  60. <!-- 活动倒计时 -->
  61. <view wx:if="{{ active.active_status != ActiveStatusEnum.STATE_END.value }}"
  62. class="info-item info-item_status info-item_countdown dis-flex flex-y-center">
  63. <text class="countdown-icon iconfont icon-naozhong"></text>
  64. <text>距离秒杀{{ active.active_status == ActiveStatusEnum.STATE_SOON.value ? '开始' : '结束' }}</text>
  65. <text class="m-r-10">还剩</text>
  66. <countdown wx:if="{{ countDownTime }}" date="{{ countDownTime }}" bind:finish="onCountDownEnd" />
  67. </view>
  68. <!-- 活动已结束 -->
  69. <view wx:else class="info-item info-item_status info-item_end">
  70. <text class="countdown-icon iconfont icon-naozhong"></text>
  71. <text>秒杀活动已结束,下次记得早点来哦~</text>
  72. </view>
  73. </view>
  74. <!-- 商品评价 -->
  75. <view class="goods-comment m-top20 b-f" wx:if="{{ goods.comment_data.length }}">
  76. <view class="item-title dis-flex">
  77. <view class="block-left flex-box">
  78. <text>评价 ({{ goods.comment_data_count }}条)</text>
  79. </view>
  80. <view class="block-right">
  81. <text catchtap="onTargetToComment" class="show-more col-9">查看更多</text>
  82. <text class="iconfont icon-xiangyoujiantou"></text>
  83. </view>
  84. </view>
  85. <!-- 评论列表 -->
  86. <view class="comment-list">
  87. <view class="comment-item" wx:for="{{ goods.comment_data }}" wx:key="this">
  88. <view class="comment-item_row dis-flex flex-y-center">
  89. <view class="user-info dis-flex flex-y-center">
  90. <image class="avatar" src="{{ item.user.avatarUrl }}"></image>
  91. <text class="user-name">{{ item.user.nickName }}</text>
  92. </view>
  93. <view class="star-rating">
  94. <text class="star-icon iconfont icon-shoucang active"></text>
  95. <block wx:if="{{ item.score < 30 }}">
  96. <text class="star-icon iconfont icon-shoucang active"></text>
  97. <text class="star-icon iconfont icon-shoucang active"></text>
  98. </block>
  99. <block wx:if="{{ item.score < 20 }}">
  100. <text class="star-icon iconfont icon-shoucang active"></text>
  101. <text class="star-icon iconfont icon-shoucang active"></text>
  102. </block>
  103. </view>
  104. </view>
  105. <view class="goods-comment-cont m-top20">
  106. <text class="f-26 twolist-hidden">{{ item.content }}</text>
  107. </view>
  108. <view class="f-22 col-9 m-top10">{{ item.create_time }}</view>
  109. </view>
  110. </view>
  111. </view>
  112. <!-- 商品描述 -->
  113. <view class="goods-content m-top20">
  114. <view class="item-title b-f">
  115. <text>商品描述</text>
  116. </view>
  117. <block wx:if="{{ goods.content != '' }}">
  118. <view class="goods-content__detail b-f">
  119. <template is="wxParse" data="{{ wxParseData:content.nodes }}"></template>
  120. </view>
  121. </block>
  122. <block wx:else>
  123. <view class="yoshop-notcont">
  124. <text class="iconfont icon-wushuju"></text>
  125. <text class="cont">亲,暂无商品描述</text>
  126. </view>
  127. </block>
  128. </view>
  129. </scroll-view>
  130. <!-- 底部选项卡 -->
  131. <view class="footer-fixed">
  132. <view class="footer-container dis-flex">
  133. <!-- 导航图标 -->
  134. <view class="foo-item-fast dis-flex flex-x-center flex-y-center">
  135. <form bindsubmit="onTargetHome" report-submit>
  136. <button class="btn-normal" formType="submit">
  137. <view class="fast-item fast-item_home">
  138. <view class="fast-icon">
  139. <text class="iconfont icon-shouye"></text>
  140. </view>
  141. <view class="fast-text">
  142. <text>首页</text>
  143. </view>
  144. </view>
  145. </button>
  146. </form>
  147. <button class="btn-normal" open-type="contact">
  148. <view class="fast-item">
  149. <view class="fast-icon">
  150. <text class="iconfont icon-kefu1"></text>
  151. </view>
  152. <view class="fast-text">
  153. <text>客服</text>
  154. </view>
  155. </view>
  156. </button>
  157. </view>
  158. <!-- 操作按钮 -->
  159. <view class="foo-item-trigger flex-box">
  160. <form bindsubmit="onToggleTrade" report-submit>
  161. <button wx:if="{{ active.active_status == ActiveStatusEnum.STATE_BEGIN.value }}"
  162. class="opt-btn btn-main btn-normal" form-type="submit">
  163. <text>立即购买</text>
  164. </button>
  165. <button wx:else class="opt-btn btn-gray btn-normal">
  166. <text>{{ active.active_status == ActiveStatusEnum.STATE_SOON.value ? '活动未开始' : '活动已结束' }}</text>
  167. </button>
  168. </form>
  169. </view>
  170. </view>
  171. </view>
  172. <!-- 分享按钮 -->
  173. <zan-actionsheet show="{{ share.show }}" actions="{{ share.actions }}" cancel-text="{{ share.cancelText }}"
  174. cancel-with-mask="{{ share.cancelWithMask }}" bind:cancel="onCloseShare" bind:actionclick="onClickShareItem"
  175. mask-class="tiny" />
  176. <!-- 商品海报 弹出层 -->
  177. <zan-popup show="{{ share.showPopup }}" bindclose="onTogglePopup">
  178. <view class="pop-poster pop-example__container">
  179. <!-- 关闭按钮 -->
  180. <view class="pop-close dis-flex flex-x-center flex-y-center" catchtap="onTogglePopup">
  181. <text class="iconfont icon-shanchu f-30 col-9"></text>
  182. </view>
  183. <form bindsubmit="onSavePoster">
  184. <view class="poster__image">
  185. <image mode="widthFix" src="{{ qrcode }}"></image>
  186. </view>
  187. <view class="poster__tips m-top10 t-c">
  188. </view>
  189. <view class="padding-box m-top10 profile-btn">
  190. <button formType="submit">保存图片</button>
  191. </view>
  192. </form>
  193. </view>
  194. </zan-popup>
  195. <!-- 确认购买弹窗 -->
  196. <zan-popup show="{{ showBottomPopup }}" type="bottom" bindclose="onToggleTrade">
  197. <view class="popup__trade">
  198. <!-- 关闭按钮 -->
  199. <view class="trade-close dis-flex flex-x-center flex-y-center" catchtap="onToggleTrade">
  200. <text class="iconfont icon-close f-26"></text>
  201. </view>
  202. <!-- 主体信息 -->
  203. <view class="trade-main">
  204. <view class="goods-info dis-flex">
  205. <!-- 图片名称 -->
  206. <view class="goods-image" catchtap="onPreviewSkuImage">
  207. <image src="{{ skuCoverImage }}"></image>
  208. </view>
  209. <view class="block-right flex-box">
  210. <view class="block-item dis-flex flex-y-end">
  211. <!-- 商品价 -->
  212. <view class="goods-price col-m">
  213. <text class="f-26">¥</text>
  214. <text class="f-36">{{ seckill_price }}</text>
  215. </view>
  216. <!-- 划线价 -->
  217. <view class="line-price" wx:if="{{ original_price > 0 }}">
  218. <text>{{ original_price }}</text>
  219. </view>
  220. </view>
  221. <view class="goods-stock dis-flex flex-x-between">
  222. <text class="f-26 col-7">库存:{{ seckill_stock }}</text>
  223. <text wx:if="{{ goods.limit_num > 0 }}" class="f-26 col-7">限购:{{ goods.limit_num }}件</text>
  224. </view>
  225. </view>
  226. </view>
  227. <!-- 规格列表 -->
  228. <view class="goods-attr">
  229. <!-- 滚动容器 -->
  230. <scroll-view class="goods-attr--scroll" scroll-y="{{ true }}">
  231. <view class="group-item" wx:for="{{ goodsMultiSpec.spec_attr }}" wx:for-item="attr" wx:for-index="attr_idx"
  232. wx:key="this">
  233. <view class="tips-text" data-id="{{ attr.group_id }}">{{ attr.group_name }}</view>
  234. <view class="spec-item {{ item.checked ? 'cur' : '' }}" wx:for="{{ attr.spec_items }}"
  235. wx:for-index="item_idx" wx:key="this" data-attr-idx="{{ attr_idx }}" data-item-idx="{{ item_idx }}"
  236. catchtap="onSwitchSpec">
  237. {{ item.spec_value }}
  238. </view>
  239. </view>
  240. </scroll-view>
  241. </view>
  242. <!-- 购买数量 -->
  243. <view class="goods-number">
  244. <view class="tips-text">
  245. <text>购买数量</text>
  246. </view>
  247. <view class="select-number">
  248. <form bindsubmit="onDecGoodsNumber">
  249. <button formType="submit" class="default {{ goods_num > 1 ? '' : 'disabled' }}" type="default">-</button>
  250. </form>
  251. <input bindinput="onInputGoodsNum" type="number" value="{{ goods_num }}"></input>
  252. <form bindsubmit="onIncGoodsNumber">
  253. <button formType="submit" class="default" type="default">+</button>
  254. </form>
  255. </view>
  256. </view>
  257. </view>
  258. <!-- 底部操作栏 -->
  259. <view class="footer-fixed f-30">
  260. <view wx:if="{{ seckill_stock > 0 }}" class="flex-box">
  261. <form bindsubmit="onCheckout" report-submit>
  262. <button class="opt-btn btn-main btn-normal" formType="submit">
  263. <text>确定</text>
  264. </button>
  265. </form>
  266. </view>
  267. <view class="flex-box opt-btn btn-gray" wx:else>暂无现货</view>
  268. </view>
  269. </view>
  270. </zan-popup>
  271. <!-- 快捷导航 -->
  272. <shortcut bottom="120rpx"></shortcut>
  273. <!-- 返回顶部 -->
  274. <view catchtap="onScrollTop" class="widget-goTop" wx:if="{{ showTopWidget }}">
  275. <text class="iconfont icon-fanhuidingbu"></text>
  276. </view>
  277. </view>