goods.wxml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <!--goods.wxml-->
  2. <view class="{{(show_attr_picker||show||no_scroll)?'no-scroll':''}}">
  3. <view class="attr-picker" wx:if="{{show_attr_picker}}">
  4. <view class="content-box">
  5. <view class="flex-row" style="border-bottom: 1rpx solid #e3e3e3;padding: 24rpx 28rpx">
  6. <view class="flex-grow-0">
  7. <view class="goods-pic-box">
  8. <block wx:if="{{goods.attr_pic}}">
  9. <image mode="aspectFill" src="{{goods.attr_pic}}"></image>
  10. </block>
  11. <block wx:else>
  12. <image mode="aspectFill" src="{{goods.pic_list[0].pic_url}}"></image>
  13. </block>
  14. </view>
  15. </view>
  16. <view class="flex-grow-1" style="padding: 0 24rpx">
  17. <block wx:if="{{miaosha_data && miaosha_data.rest_num>0}}">
  18. <view style="margin-bottom: 12rpx;">
  19. <view>
  20. <text style="color:#ff4544;font-weight: bold">¥{{miaosha_data.miaosha_price}}</text>
  21. <text style="color:#888;text-decoration: line-through;font-size: 9pt;margin-left: 8rpx">¥{{goods.price}}</text>
  22. </view>
  23. </view>
  24. </block>
  25. <block wx:else>
  26. <view style="color:#ff4544;margin-bottom: 12rpx;font-weight: bold">¥{{goods.price}}</view>
  27. </block>
  28. <view style="font-size:9pt">
  29. <block wx:if="{{miaosha_data && miaosha_data.rest_num>0}}">库存{{miaosha_data.rest_num}}件
  30. </block>
  31. <block wx:else>库存{{goods.num}}件</block>
  32. </view>
  33. </view>
  34. <view class="flex-grow-0">
  35. <view bindtap="hideAttrPicker" class="flex-x-center flex-y-center" style="width: 100rpx;height: 100rpx">
  36. <image style="width: 30rpx;height: 30rpx" src="/images/icon-close.png" />
  37. </view>
  38. </view>
  39. </view>
  40. <scroll-view scroll-y="true" style="max-height: 650rpx;">
  41. <view style="padding: 24rpx 28rpx">
  42. <view>
  43. <view class="attr-group" wx:for="{{attr_group_list}}" wx:for-item="attr_group" wx:if="{{attr_group.attr_list.length>0}}">
  44. <view class="attr-group-name">{{attr_group.attr_group_name}}</view>
  45. <view class="attr-list">
  46. <text class="attr-item {{item.checked?'active':''}}" wx:for="{{attr_group.attr_list}}" data-group-id="{{attr_group.attr_group_id}}" data-id="{{item.attr_id}}" bindtap="attrClick">{{item.attr_name}}
  47. </text>
  48. </view>
  49. </view>
  50. </view>
  51. <view style="height: 0;border-bottom: 1rpx solid #e3e3e3;margin-bottom: 40rpx"></view>
  52. <view style="padding-bottom: 40rpx">
  53. <view class="flex-row flex-y-center mb-20">
  54. <view class="flex-grow-1">数量</view>
  55. <view class="flex-grow-0">
  56. <view class="flex-row number-input-box">
  57. <view class="flex-grow-0 flex-x-center flex-y-center number-btn number-sub {{form.number<=1?'disabled':''}}" bindtap="numberSub">-
  58. </view>
  59. <view class="flex-grow-0">
  60. <input class="flex-grow-1 number-input" value="{{form.number}}" type="number" step="1" min="1" bindblur="numberBlur" />
  61. </view>
  62. <view class="flex-grow-0 flex-x-center flex-y-center number-btn number-add" bindtap="numberAdd">+
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </scroll-view>
  70. </view>
  71. </view>
  72. <view style="padding-bottom: 120rpx">
  73. <swiper class="goods-image-swiper" autoplay="{{autoplay}}" interval="5000" duration="300" indicator-dots="true" circular="true" bindchange="hide">
  74. <block wx:for="{{goods.pic_list}}">
  75. <swiper-item>
  76. <block wx:if="{{goods.video_url}}">
  77. <!-- <view style='width:750rpx;height:700rpx;position:absolute;top:0;left:0;'> -->
  78. <image class="play {{img_hide}}" src="/images/video-play.png" data-url="{{goods.video_url}}" bindtap="play"></image>
  79. <!-- </view> -->
  80. </block>
  81. <image bindtap="onGoodsImageClick" data-index="{{index}}" class="goods-image" src="{{item.pic_url}}" mode="aspectFill" />
  82. </swiper-item>
  83. </block>
  84. </swiper>
  85. <view wx:if="{{goods&&goods.miaosha}}" class="miaosha-bar flex-row">
  86. <view class="flex-grow-1 flex-row miaosha-bar-left">
  87. <view class="flex-grow-0 flex-y-center">
  88. <view class="flex-y-bottom miaosha-price">
  89. <text class="cny">¥</text>
  90. <text>{{goods.miaosha.miaosha_price}}</text>
  91. </view>
  92. </view>
  93. <view class="flex-grow-1 flex-y-center">
  94. <view>
  95. <view class="goods-price">¥{{goods.price}}</view>
  96. <view class="sell-num">已抢{{goods.miaosha.sell_num}}件</view>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="flex-grow-0 flex-y-center miaosha-bar-right">
  101. <view>
  102. <view class="time-over-text">距离结束仅剩</view>
  103. <view class="timer">
  104. <text class="timer-num">{{miaosha_end_time_over.h}}</text>
  105. <text class="timer-split">:</text>
  106. <text class="timer-num">{{miaosha_end_time_over.m}}</text>
  107. <text class="timer-split">:</text>
  108. <text class="timer-num">{{miaosha_end_time_over.s}}</text>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. <view class="goods-info" style="background: #fff;padding:32rpx 24rpx;border-bottom: 1rpx solid #eee ">
  114. <view style="font-weight: bold;">{{goods.name}}</view>
  115. <view class="flex-row flex-y-center">
  116. <view class="flex-grow-1 flex-row flex-y-bottom">
  117. <block wx:if="{{goods && goods.miaosha}}">
  118. <view class="flex-grow-0" style="font-weight: bold;color: #ff4544;margin-right: 32rpx">
  119. <text style="font-size: 9pt;">¥</text>
  120. <text style="font-size: 13pt">{{goods.miaosha.miaosha_price}}</text>
  121. </view>
  122. </block>
  123. <block wx:else>
  124. <view class="flex-grow-0" style="font-weight: bold;color: #ff4544;margin-right: 32rpx">
  125. <text style="font-size: 9pt;">¥</text>
  126. <text style="font-size: 13pt">{{goods.price}}</text>
  127. </view>
  128. <view class="flex-grow-0" style="margin-right: 32rpx">
  129. <text style="font-size: 9pt;color: #888;text-decoration: line-through">¥{{goods.original_price}}
  130. </text>
  131. </view>
  132. </block>
  133. <view class="flex-grow-0" style="margin-right: 32rpx">
  134. <text style="font-size: 9pt;color: #888;">销量 {{goods.sales_volume}} {{goods.unit}}</text>
  135. </view>
  136. </view>
  137. <view class="flex-grow-0">
  138. <button bindtap="showShareModal" class="share-btn" plain="true">
  139. <image style="width: 40rpx;height: 40rpx" src="/images/icon-share-red.png" />
  140. <view style="color: #888">分享</view>
  141. </button>
  142. </view>
  143. </view>
  144. </view>
  145. <view wx:if="{{goods.service_list&&goods.service_list.length>0}}" class="bg-white mb-20 flex-row check-list">
  146. <view class="check-item flex-y-center" wx:for="{{goods.service_list}}">
  147. <image src="/images/icon-check.png"></image>
  148. <text>{{item}}</text>
  149. </view>
  150. </view>
  151. <view wx:else class="mb-20"></view>
  152. <view bindtap="showAttrPicker" class="flex-row flex-y-center" style="background: #fff;padding:0 24rpx;margin-bottom: 20rpx;height: 100rpx;">
  153. <view class="flex-grow-1 flex-row flex-y-center">
  154. <text>选择</text>
  155. <text style="margin-left: 40rpx;font-size: 9pt;color: #888888">规格</text>
  156. </view>
  157. <view class="flex-grow-0">
  158. <image style="width: 16rpx;height: 26rpx" src="/images/icon-jiantou-r.png" />
  159. </view>
  160. </view>
  161. <view class="tab-group">
  162. <view class="flex-row tab-group-header">
  163. <view bindtap="tabSwitch" data-tab="detail" class="flex-grow-1 flex-x-center tab-group-item {{tab_detail}}">
  164. <text class="flex-y-center">商品详情</text>
  165. </view>
  166. <view bindtap="tabSwitch" data-tab="comment" class="flex-grow-1 flex-x-center tab-group-item {{tab_comment}}">
  167. <text class="flex-y-center">评价</text>
  168. </view>
  169. </view>
  170. <view class="tab-group-body">
  171. <view class="tab-group-item {{tab_detail}}">
  172. <view class="goods-detail">
  173. <import src="../../wxParse/wxParse.wxml" />
  174. <template is="wxParse" data="{{wxParseData:detail.nodes}}" />
  175. </view>
  176. </view>
  177. <view class="tab-group-item {{tab_comment}}">
  178. <view class="comment-count flex-row">
  179. <view bindtap='change' data-type='0' class="comment-count-item flex-grow-1 flex-x-center flex-col {{type==0 ? 'comment_active': ''}}">
  180. <view>全部</view>
  181. <view>({{comment_count.score_all>999?'999+':comment_count.score_all}})</view>
  182. </view>
  183. <view bindtap='change' data-type='3' class="comment-count-item flex-grow-1 flex-x-center flex-col {{type==3 ? 'comment_active': ''}}">
  184. <view>好评</view>
  185. <view>({{comment_count.score_3>999?'999+':comment_count.score_3}})</view>
  186. </view>
  187. <view bindtap='change' data-type='2' class="comment-count-item flex-grow-1 flex-x-center flex-col {{type==2 ? 'comment_active': ''}}">
  188. <view>中评</view>
  189. <view>({{comment_count.score_2>999?'999+':comment_count.score_2}})</view>
  190. </view>
  191. <view bindtap='change' data-type='1' class="comment-count-item flex-grow-1 flex-x-center flex-col {{type==1 ? 'comment_active': ''}}">
  192. <view>差评</view>
  193. <view>({{comment_count.score_1>999?'999+':comment_count.score_1}})</view>
  194. </view>
  195. </view>
  196. <view class="comment-list">
  197. <view class="comment-item flex-row" wx:for="{{comment_list}}">
  198. <view class="flex-grow-0" style="overflow: visible">
  199. <image src="{{item.avatar_url}}" style="width: 70rpx;height: 70rpx;border-radius: 1000rpx" mode="aspectFill"></image>
  200. </view>
  201. <view class="flex-grow-1">
  202. <view class="flex-row mb-20">
  203. <view class="flex-grow-1 flex-y-center nickname">{{item.nickname}}</view>
  204. <view class="flex-grow-0 flex-y-center addtime">{{item.addtime}}</view>
  205. </view>
  206. <view class="mb-20 content">{{item.up_down == 1 ? item.content_min : item.content}}</view>
  207. <view bindtap='changeState' data-state='{{item.up_down == 1 ? 0 : 1}}' data-type='content' data-index='{{index}}' wx:if='{{item.up_down_state == 1}}' style='float: right; color: #EC5962; font-size:25rpx;'>{{item.up_down == 1 ? '查看更多' : '收起评价'}}</view>
  208. <view class="pic-list" wx:if="{{item.pic_list&&item.pic_list.length>0&&item.pic_list[0]!=''}}" style='clear: both;'>
  209. <image wx:if="{{item}}!=''" bindtap="commentPicView" wx:for="{{item.pic_list}}" wx:for-index="{{pic_index}}" data-index="{{index}}" data-pic-index="{{pic_index}}" src="{{item}}" mode="aspectFill" class="pic-item"></image>
  210. </view>
  211. <view wx:if="{{item.reply_content}}" class="reply content">
  212. <view>
  213. 商家: <view class="reply-content">{{item.reply_up_down == 1 ? item.reply_content_min : item.reply_content}}</view>
  214. </view>
  215. <view bindtap='changeState' data-state='{{item.reply_up_down == 1 ? 0 : 1}}' data-type='reply_content' data-index='{{index}}' wx:if='{{item.reply_up_down_state == 1}}' style='float: right; color: #EC5962; font-size:25rpx;'>{{item.reply_up_down == 1 ? '查看更多' : '收起评价'}}</view>
  216. </view>
  217. </view>
  218. </view>
  219. </view>
  220. </view>
  221. </view>
  222. </view>
  223. </view>
  224. <navigator url="/pages/cart/cart" class="cart-nav" open-type="redirect">
  225. <image src="/images/nav-icon-cart.png"></image>
  226. <view class='budge'>{{goods.cat_num}}</view>
  227. </navigator>
  228. <view class="flex-row bar-bottom">
  229. <view class="flex-grow-0 flex-row">
  230. <button wx:if="{{store.show_customer_service==1 && false}}" class="flex-grow-0 flex-y-center bar-bottom-btn" open-type="contact" plain="true">
  231. <view>
  232. <image src="/images/icon-user-kf.png"></image>
  233. <text>客服</text>
  234. </view>
  235. </button>
  236. <button class="flex-grow-0 flex-y-center bar-bottom-btn" bindtap='call'>
  237. <view>
  238. <image src="/images/icon-service-good.png"></image>
  239. <text>客服</text>
  240. </view>
  241. </button>
  242. <view wx:if="{{goods.is_favorite && goods.is_favorite==1}}" bindtap="favoriteRemove" class="flex-grow-0 flex-y-center bar-bottom-btn">
  243. <view>
  244. <image src="/images/icon-favorite-star-active.png"></image>
  245. <text>已收藏</text>
  246. </view>
  247. </view>
  248. <view wx:else bindtap="favoriteAdd" class="flex-grow-0 flex-y-center bar-bottom-btn">
  249. <view>
  250. <image src="/images/icon-favorite-star.png"></image>
  251. <text>收藏</text>
  252. </view>
  253. </view>
  254. </view>
  255. <view class="flex-grow-1 flex-row">
  256. <view class="flex-grow-1 flex-y-center flex-x-center add-cart" bindtap="addCart">加入购物车</view>
  257. <view class="flex-grow-1 flex-y-center flex-x-center buy-now" bindtap="buyNow">立即购买</view>
  258. </view>
  259. </view>
  260. <include src="/commons/get-coupon/get-coupon.wxml" />
  261. <!-- <include src="/commons/float-icon/float-icon.wxml" /> -->
  262. </view>
  263. <view class='modal flex-row {{hide}}' bindtap='close'>
  264. <view class='flex-y-center' style='width:100%;'>
  265. <video src='{{url}}' id="video" autoplay="true"></video>
  266. </view>
  267. </view>
  268. <view class="share-modal {{share_modal_active}}">
  269. <view class="share-modal-body">
  270. <view class="flex-row">
  271. <view class="flex-grow-1 flex-x-center">
  272. <button open-type="share" class="share-bottom">
  273. <image src="/images/icon-share-friend.png"></image>
  274. <view>分享给朋友</view>
  275. </button>
  276. </view>
  277. <view class="flex-grow-1 flex-x-center">
  278. <view bindtap="getGoodsQrcode" class="share-bottom">
  279. <image src="/images/icon-share-qrcode.png"></image>
  280. <view>生成商品海报</view>
  281. </view>
  282. </view>
  283. </view>
  284. <view bindtap="shareModalClose" class="share-modal-close flex-y-center flex-x-center">关闭</view>
  285. </view>
  286. </view>
  287. <view class="goods-qrcode-modal {{goods_qrcode_active}}">
  288. <view class="goods-qrcode-body flex-col">
  289. <view class="flex-grow-1" style="position: relative">
  290. <view style="position: absolute;left: 0;top:0;width: 100%;height: 100%;padding: 100rpx 100rpx 60rpx">
  291. <view class="goods-qrcode-box">
  292. <view class="goods-qrcode-loading flex-x-center flex-y-center">
  293. <view class="flex-x-center flex-col">
  294. <image style="width: 150rpx;height: 150rpx" src="/images/loading2.svg"></image>
  295. <view style="color: #888">海报生成中</view>
  296. </view>
  297. </view>
  298. <image bindtap="goodsQrcodeClick" mode="aspectFill" class="goods-qrcode {{goods_qrcode?'active':''}}" data-src="{{goods_qrcode}}" src="{{goods_qrcode}}"></image>
  299. </view>
  300. </view>
  301. </view>
  302. <view class="flex-grow-0 flex-col flex-x-center" style="padding: 0 60rpx 80rpx">
  303. <view style="margin-bottom: 20rpx;padding: 0 40rpx">
  304. <button wx:if="{{goods_qrcode}}" bindtap="saveGoodsQrcode" style="background: #ff4544;color: #fff;">
  305. 保存图片
  306. </button>
  307. <button wx:else style="opacity: .4">保存图片</button>
  308. </view>
  309. <view style="color: #888;font-size: 9pt;text-align: center">保存至相册</view>
  310. </view>
  311. <view class="goods-qrcode-close" bindtap="goodsQrcodeClose">
  312. <image src="/images/icon-close2.png" style="width: 50rpx;height: 50rpx;display: block"></image>
  313. </view>
  314. </view>
  315. </view>