goods.wxml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <view class="container">
  2. <swiper class="goodsimgs" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
  3. <swiper-item wx:for="{{goods.gallery}}" wx:key="*this">
  4. <image src="{{item}}" background-size="cover"></image>
  5. </swiper-item>
  6. </swiper>
  7. <!-- 分享 -->
  8. <view class='goods_name'>
  9. <view class='goods_name_left'>{{goods.name}}</view>
  10. <view hidden="{{!canShare}}" class="goods_name_right" bindtap="shareFriendOrCircle">分享</view>
  11. </view>
  12. <view class="share-pop-box" hidden="{{!openShare}}">
  13. <view class="share-pop">
  14. <view class="close" bindtap="closeShare">
  15. <van-icon class="icon" name="cross" />
  16. </view>
  17. <view class='share-info'>
  18. <button class="sharebtn" open-type="share" wx:if="{{!isGroupon}}">
  19. <image class='sharebtn_image' src='/static/images/wechat.png'></image>
  20. <view class='sharebtn_text'>分享给好友</view>
  21. </button>
  22. <button class="savesharebtn" open-type="openSetting" bindopensetting="handleSetting" wx:if="{{(!isGroupon) && (!canWrite)}}" >
  23. <image class='sharebtn_image' src='/static/images/friend.png'></image>
  24. <view class='sharebtn_text'>生成海报</view>
  25. </button>
  26. <button class="savesharebtn" bindtap="saveShare" wx:if="{{!isGroupon && canWrite}}">
  27. <image class='sharebtn_image' src='/static/images/friend.png'></image>
  28. <view class='sharebtn_text'>生成海报</view>
  29. </button>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="goods-info">
  34. <view class="c">
  35. <text class="desc">{{goods.brief}}</text>
  36. <view class="price">
  37. <view class="counterPrice">原价:¥{{goods.counterPrice}}</view>
  38. <view class="retailPrice">现价:¥{{checkedSpecPrice}}</view>
  39. </view>
  40. <view class="brand" wx:if="{{brand.name}}">
  41. <navigator url="../brandDetail/brandDetail?id={{brand.id}}">
  42. <text>{{brand.name}}</text>
  43. </navigator>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="section-nav section-attr" bindtap="switchAttrPop">
  48. <view class="t">{{checkedSpecText}}</view>
  49. <van-icon class="i" name="arrow" />
  50. </view>
  51. <view class="comments" wx:if="{{comment.count > 0}}">
  52. <view class="h">
  53. <navigator url="/pages/comment/comment?valueId={{goods.id}}&type=0">
  54. <text class="t">评价({{comment.count > 999 ? '999+' : comment.count}})</text>
  55. <view class="i">
  56. 查看全部
  57. <van-icon name="arrow" />
  58. </view>
  59. </navigator>
  60. </view>
  61. <view class="b">
  62. <view class="item" wx:for="{{comment.data}}" wx:key="id">
  63. <view class="info">
  64. <view class="user">
  65. <image src="{{item.avatar}}"></image>
  66. <text>{{item.nickname}}</text>
  67. </view>
  68. <view class="time">{{item.addTime}}</view>
  69. </view>
  70. <view class="content">
  71. {{item.content}}
  72. </view>
  73. <view class="imgs" wx:if="{{item.picList.length > 0}}">
  74. <image class="img" wx:for="{{item.picList}}" wx:key="*this" wx:for-item="iitem" src="{{iitem}} "></image>
  75. </view>
  76. <view class="customer-service" wx:if="{{item.adminContent}}">
  77. <text class="u">商家回复:</text>
  78. <text class="c">{{item.adminContent}}</text>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. <view class="goods-attr">
  84. <view class="t">商品参数</view>
  85. <view class="l">
  86. <view class="item" wx:for="{{attribute}}" wx:key="name">
  87. <text class="left">{{item.attribute}}</text>
  88. <text class="right">{{item.value}}</text>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="detail">
  93. <import src="/lib/wxParse/wxParse.wxml" />
  94. <template is="wxParse" data="{{wxParseData:goodsDetail.nodes}}" />
  95. </view>
  96. <view class="common-problem">
  97. <view class="h">
  98. <view class="line"></view>
  99. <text class="title">常见问题</text>
  100. </view>
  101. <view class="b">
  102. <view class="item" wx:for="{{issueList}}" wx:key="id">
  103. <view class="question-box">
  104. <text class="spot"></text>
  105. <text class="question">{{item.question}}</text>
  106. </view>
  107. <view class="answer">
  108. {{item.answer}}
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. <!-- 大家都在看 -->
  114. <view class="related-goods" wx:if="{{relatedGoods.length > 0}}">
  115. <view class="h">
  116. <view class="line"></view>
  117. <text class="title">大家都在看</text>
  118. </view>
  119. <view class="b">
  120. <view class="item" wx:for="{{relatedGoods}}" wx:key="id">
  121. <navigator url="/pages/goods/goods?id={{item.id}}">
  122. <image class="img" src="{{item.picUrl}}" background-size="cover"></image>
  123. <text class="name">{{item.name}}</text>
  124. <text class="price">¥{{item.retailPrice}}</text>
  125. </navigator>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- 规格选择界面 -->
  131. <view class="attr-pop-box" hidden="{{!openAttr}}">
  132. <view class="attr-pop">
  133. <view class="close" bindtap="closeAttr">
  134. <van-icon class="icon" name="cross" />
  135. </view>
  136. <view class="img-info">
  137. <image class="img" src="{{goods.picUrl}}"></image>
  138. <view class="info">
  139. <view class="c">
  140. <view class="p">价格:¥{{checkedSpecPrice}}</view>
  141. <view class="a">{{tmpSpecText}}</view>
  142. </view>
  143. </view>
  144. </view>
  145. <!-- 规格列表 -->
  146. <view class="spec-con">
  147. <view class="spec-item" wx:for="{{specificationList}}" wx:key="name">
  148. <view class="name">{{item.name}}</view>
  149. <view class="values">
  150. <view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickSkuValue" wx:for="{{item.valueList}}" wx:for-item="vitem" wx:key="id" data-value-id="{{vitem.id}}" data-name="{{vitem.specification}}">{{vitem.value}}</view>
  151. </view>
  152. </view>
  153. <view class="spec-item" wx:if="{{groupon.length > 0}}">
  154. <view class="name">团购立减</view>
  155. <view class="values">
  156. <view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickGroupon" wx:for="{{groupon}}" wx:for-item="vitem" wx:key="{{vitem.id}}" data-value-id="{{vitem.id}}" data-name="{{vitem.specification}}">¥{{vitem.discount}} ({{vitem.discountMember}}人)</view>
  157. </view>
  158. </view>
  159. <!-- 数量 -->
  160. <view class="number-item">
  161. <view class="name">数量</view>
  162. <view class="selnum">
  163. <view class="cut" bindtap="cutNumber">-</view>
  164. <input value="{{number}}" class="number" disabled="true" type="number" />
  165. <view class="add" bindtap="addNumber">+</view>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. <!-- 联系客服 -->
  172. <view class="contact">
  173. <contact-button style="opacity:0;position:absolute;" type="default-dark" session-from="weapp" size="27">
  174. </contact-button>
  175. </view>
  176. <!-- 底部按钮 -->
  177. <view class="bottom-btn">
  178. <view class="l l-collect" bindtap="addCollectOrNot" wx:if="{{!isGroupon}}">
  179. <van-icon class="icon" name="star" color="#ab956d" wx:if="{{collect}}"/>
  180. <van-icon class="icon" name="star-o" wx:else/>
  181. </view>
  182. <view class="l l-cart" wx:if="{{!isGroupon}}">
  183. <view class="box">
  184. <text class="cart-count">{{cartGoodsCount}}</text>
  185. <van-icon bindtap="openCartPage" class="icon" name="cart-o" />
  186. </view>
  187. </view>
  188. <view class="r" bindtap="addToCart" wx:if="{{!soldout}}" wx:if="{{!isGroupon}}">加入购物车</view>
  189. <view class="c" bindtap="addFast" wx:if="{{!soldout}}">{{isGroupon?'参加团购':'立即购买'}}</view>
  190. <view class="n" wx:if="{{soldout}}">商品已售空</view>
  191. </view>