index.axml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <import-sjs
  2. name="utils"
  3. from="../mall-car-popup/index.sjs"
  4. />
  5. <import-sjs
  6. name="checkUtils"
  7. from="../mall-shopcar-button/index.sjs"
  8. />
  9. <import-sjs
  10. from="../utils-component/index.sjs"
  11. name="totalUtils"
  12. />
  13. <import-sjs
  14. name="carUtils"
  15. from="./index.sjs"
  16. />
  17. <import-sjs
  18. from="../goods-item/index.sjs"
  19. name="numUtils"
  20. />
  21. <wrapper>
  22. <mas-adc-nav-bar
  23. zIndex="100"
  24. onCallback="onReadyHeader"
  25. background="linear-gradient(138.81deg,#007dff 0%,#75c4ff 73%,#6eddff 100%)"
  26. a:if="{{header === 'show'}}"
  27. />
  28. <!-- 盒子 -->
  29. <view class="goods-detail-container">
  30. <!-- 轮播 -->
  31. <view
  32. class="swiper-container"
  33. a:if="{{goodsDetail}}"
  34. >
  35. <swiper onChange="onSwiperChange">
  36. <swiper-item
  37. key="swiper-item-{{index}}"
  38. a:for="{{goodsDetail.picList || ['img']}}"
  39. >
  40. <stock-img
  41. width="750rpx"
  42. height="750rpx"
  43. borderRadius="0"
  44. imgSrc="{{item || 'error'}}"
  45. stockHight="98rpx"
  46. isNoStock="{{goodsDetail.stockStatus === 'Y' && !goodsDetail.stock}}"
  47. currentIndex="{{index+1}}"
  48. >{{""}}
  49. </stock-img>
  50. </swiper-item>
  51. </swiper>
  52. <view
  53. a:if="{{goodsDetail.stockStatus === 'Y' && !goodsDetail.stock}}"
  54. class="swiper-stock"
  55. >补货中</view>
  56. <view class="swiper-num">
  57. {{currentIndex}}/{{goodsDetail.picList.length || 1}}
  58. </view>
  59. </view>
  60. <!-- 详情 -->
  61. <view class="detail-container">
  62. <!-- 头部板块 -->
  63. <view
  64. a:if="{{goodsDetail}}"
  65. class="head"
  66. >
  67. <!-- 标题 -->
  68. <view class="head-title">{{goodsDetail.name}}</view>
  69. <!-- 库存 -->
  70. <view
  71. a:if="{{goodsDetail.stockStatus === 'Y'}}"
  72. class="head-stock {{goodsDetail.stock ? '' : 'red'}}"
  73. >库存:{{goodsDetail.stock || 0}}</view>
  74. <!-- 限购 -->
  75. <view class="goods-limit">
  76. <goods-tag
  77. a:if="{{goodsDetail.buyLimitType === 'GENERAL'}}"
  78. text="限{{goodsDetail.buyLimitCount}}份"
  79. fontSize="20rpx"
  80. padding="6rpx"
  81. />
  82. <goods-tag
  83. a:if="{{goodsDetail.userLimitType === 'BESPEAK'}}"
  84. text="{{goodsDetail.isbespeak ? '已预约' : '去预约'}}"
  85. isbespeak="{{goodsDetail.isbespeak}}"
  86. clickTip="{{goodsDetail.activity.joinLinkTip}}"
  87. url="{{goodsDetail.activity.joinLink}}"
  88. linkType="{{goodsDetail.activity.joinLinkType}}"
  89. fontSize="20rpx"
  90. padding="6rpx"
  91. />
  92. <goods-tag
  93. a:if="{{goodsDetail.deliverType.indexOf('AUTO') > -1 || goodsDetail.deliverType.indexOf('MANUAL') > -1}}"
  94. text="到店自提"
  95. fontSize="20rpx"
  96. padding="6rpx"
  97. />
  98. <goods-tag
  99. a:if="{{goodsDetail.deliverType.indexOf('DELIVERY') > -1}}"
  100. text="可配送"
  101. fontSize="20rpx"
  102. padding="6rpx"
  103. />
  104. </view>
  105. <view style="margin-top: 12rpx">
  106. <price-tag
  107. a:if="{{isMember}}"
  108. price="{{memberPrice}}"
  109. fontSize="28rpx"
  110. padding="2px 4px"
  111. />
  112. </view>
  113. <!-- monety and 添加购物车按钮 -->
  114. <view class="head-money-car">
  115. <!-- 价格 -->
  116. <view class="price">
  117. <view class="price-icon">¥</view>
  118. <view class="price-text">
  119. {{goodsDetail.sellPrice}}
  120. </view>
  121. <view
  122. class="pre-price"
  123. a:if="{{goodsDetail.price !== goodsDetail.sellPrice}}"
  124. >¥{{goodsDetail.price}}</view>
  125. </view>
  126. <!-- car -->
  127. <view
  128. hidden="{{carUtils.getQuantity(globalCar.carts, skuId)}}"
  129. class="car {{carUtils.isActive(goodsDetail) ? '' : 'inactive'}}"
  130. onTap="handleAddCarClick"
  131. >
  132. 加入购物车
  133. </view>
  134. <!-- 步进器 -->
  135. <view
  136. class="step {{carUtils.isActive(goodsDetail) ? '' : 'disable'}}"
  137. hidden="{{!carUtils.getQuantity(globalCar.carts, skuId)}}"
  138. >
  139. <stepper
  140. catchChange="changeNum"
  141. defaultNum="{{carUtils.getQuantity(globalCar.carts, skuId)}}"
  142. maxNum="{{numUtils.getMaxBuyNum(goodsDetail)}}"
  143. targetId="{{targetId}}"
  144. numType="{{numUtils.getNumType(goodsItem)}}"
  145. />
  146. </view>
  147. </view>
  148. </view>
  149. <block a:if="{{jumpStoreId}}">
  150. <!-- 商店store -->
  151. <view class="detail-title">当前门店</view>
  152. <store
  153. jumpStoreId="{{jumpStoreId}}"
  154. productId="{{productId}}"
  155. />
  156. </block>
  157. <block a:if="{{goodsDetail}}">
  158. <!-- 详情板块 -->
  159. <view class="detail-title">商品详情</view>
  160. <!-- 详情内容 -->
  161. <view class="detail-info">
  162. <!-- 规格 -->
  163. <view class="detail-info-title">商品规格:
  164. <view class="detail-info-title-text">{{goodsDetail.specDesc}}</view>
  165. </view>
  166. <!-- 描述 -->
  167. <view class="detail-info-title">商品描述:</view>
  168. <mas-adc-rich-pro
  169. errorImg="{{errorImg}}"
  170. content="{{goodsDetail.content || '暂无描述'}}"
  171. />
  172. </view>
  173. </block>
  174. </view>
  175. <!-- 底部按钮 -->
  176. <mall-car-popup
  177. a:if="{{goodsDetail}}"
  178. ref="saveCarRef"
  179. startDeliveryAmount="{{startDeliveryAmount}}"
  180. showFlag="{{showFlag}}"
  181. text="立刻去商城领取会员卡"
  182. type="detail"
  183. >
  184. <mall-footer-button
  185. a:if="{{goodsDetail && showFlag && checkUtils.isOnlyDeliver(globalCar.carts)}}"
  186. selectNum="{{utils.getCheckedNum(globalCar.carts)}}"
  187. showIcon="{{true}}"
  188. discountShow="{{true}}"
  189. totalPrice="{{globalCar.totalPrice}}"
  190. showColorBtn="{{!!globalCar.carts.length}}"
  191. position="fixed"
  192. onCarClick="handleCarClick"
  193. disCountTotalPrice="{{globalCar.disCountTotalPrice}}"
  194. showTip="{{true}}"
  195. startDeliveryAmount="{{startDeliveryAmount}}"
  196. showColorCar="{{totalUtils.calcNumber(globalCar.disCountTotalPrice, globalCar.deliveryPackingFee || 0) >= startDeliveryAmount}}"
  197. buttonText="{{totalUtils.calcNumber(globalCar.disCountTotalPrice, globalCar.deliveryPackingFee || 0) >= startDeliveryAmount ? '去结算' : `差${totalUtils.calcNumber(startDeliveryAmount, totalUtils.calcNumber(globalCar.disCountTotalPrice, globalCar.deliveryPackingFee || 0), 'sub')}起送`}}"
  198. onConfirmClick="{{totalUtils.calcNumber(globalCar.disCountTotalPrice, globalCar.deliveryPackingFee || 0) >= startDeliveryAmount ? 'handleConfirm' : ''}}"
  199. />
  200. <mall-footer-button
  201. a:else
  202. selectNum="{{utils.getCheckedNum(globalCar.carts)}}"
  203. showIcon="{{true}}"
  204. discountShow="{{true}}"
  205. buttonText="{{btnText}}"
  206. totalPrice="{{globalCar.totalPrice}}"
  207. disCountTotalPrice="{{globalCar.disCountTotalPrice}}"
  208. showColorBtn="{{!!globalCar.carts.length}}"
  209. position="fixed"
  210. onConfirmClick="handleConfirm"
  211. onCarClick="handleCarClick"
  212. />
  213. </mall-car-popup>
  214. </view>
  215. </wrapper>