index.wxml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <wxs src="./index.wxs" module="handlePromotion" />
  2. <wxs src="./utils.wxs" module="utils" />
  3. <view class="cart-group">
  4. <view class="goods-wrap" wx:for="{{_storeGoods}}" wx:for-item="store" wx:for-index="si" wx:key="storeId">
  5. <view class="cart-store">
  6. <t-icon
  7. size="40rpx"
  8. color="{{store.isSelected ? '#FA4126' : '#BBBBBB'}}"
  9. name="{{store.isSelected ? 'check-circle-filled' : 'circle'}}"
  10. class="cart-store__check"
  11. bindtap="selectStore"
  12. data-store-index="{{si}}"
  13. />
  14. <view class="cart-store__content">
  15. <view class="store-title">
  16. <t-icon prefix="wr" size="40rpx" color="#333333" name="store" />
  17. <view class="store-name">{{store.storeName}}</view>
  18. </view>
  19. <view class="get-coupon" catch:tap="gotoCoupons">优惠券</view>
  20. </view>
  21. </view>
  22. <block wx:for="{{store.promotionGoodsList}}" wx:for-item="promotion" wx:for-index="promoindex" wx:key="promoindex">
  23. <view
  24. class="promotion-wrap"
  25. wx:if="{{handlePromotion.hasPromotion(promotion.promotionCode)}}"
  26. bindtap="gotoBuyMore"
  27. data-promotion="{{promotion}}"
  28. data-store-id="{{store.storeId}}"
  29. >
  30. <view class="promotion-title">
  31. <view class="promotion-icon">{{promotion.tag}}</view>
  32. <view class="promotion-text">{{promotion.description}}</view>
  33. </view>
  34. <view class="promotion-action action-btn" hover-class="action-btn--active">
  35. <view class="promotion-action-label"> {{promotion.isNeedAddOnShop == 1 ? '去凑单' : '再逛逛'}} </view>
  36. <t-icon name="chevron-right" size="32rpx" color="#BBBBBB" />
  37. </view>
  38. </view>
  39. <view
  40. class="goods-item"
  41. wx:for="{{promotion.goodsPromotionList}}"
  42. wx:for-item="goods"
  43. wx:for-index="gi"
  44. wx:key="extKey"
  45. >
  46. <swipeout right-width="{{ 72 }}">
  47. <view class="goods-item-info">
  48. <view class="check-wrap" catchtap="selectGoods" data-goods="{{goods}}">
  49. <t-icon
  50. size="40rpx"
  51. color="{{goods.isSelected ? '#FA4126' : '#BBBBBB'}}"
  52. name="{{goods.isSelected ? 'check-circle-filled' : 'circle'}}"
  53. class="check"
  54. />
  55. </view>
  56. <view class="goods-sku-info">
  57. <goods-card
  58. layout="horizontal-wrap"
  59. thumb-width="{{thumbWidth}}"
  60. thumb-height="{{thumbHeight}}"
  61. centered="{{true}}"
  62. data="{{goods}}"
  63. data-goods="{{goods}}"
  64. catchspecs="specsTap"
  65. catchclick="goGoodsDetail"
  66. >
  67. <view slot="thumb-cover" class="stock-mask" wx:if="{{goods.shortageStock || goods.stockQuantity <= 3}}">
  68. 仅剩{{goods.stockQuantity}}件
  69. </view>
  70. <view slot="append-body" class="goods-stepper">
  71. <view class="stepper-tip" wx:if="{{goods.shortageStock}}">库存不足</view>
  72. <t-stepper
  73. classname="stepper-info"
  74. value="{{goods.quantity}}"
  75. min="{{1}}"
  76. max="{{999}}"
  77. data-goods="{{goods}}"
  78. data-gi="{{gi}}"
  79. data-si="{{si}}"
  80. catchchange="changeStepper"
  81. catchblur="input"
  82. catchoverlimit="overlimit"
  83. theme="filled"
  84. />
  85. </view>
  86. </goods-card>
  87. </view>
  88. </view>
  89. <view slot="right" class="swiper-right-del" bindtap="deleteGoods" data-goods="{{goods}}"> 删除 </view>
  90. </swipeout>
  91. </view>
  92. <view
  93. class="promotion-line-wrap"
  94. wx:if="{{handlePromotion.hasPromotion(promotion.promotionCode) && promoindex != (store.promotionGoodsList.length - 2)}}"
  95. >
  96. <view class="promotion-line" />
  97. </view>
  98. </block>
  99. <block wx:if="{{store.shortageGoodsList.length>0}}">
  100. <view
  101. class="goods-item"
  102. wx:for="{{store.shortageGoodsList}}"
  103. wx:for-item="goods"
  104. wx:for-index="gi"
  105. wx:key="extKey"
  106. >
  107. <swipeout right-width="{{ 72 }}">
  108. <view class="goods-item-info">
  109. <view class="check-wrap">
  110. <view class="unCheck-icon" />
  111. </view>
  112. <view class="goods-sku-info">
  113. <goods-card
  114. layout="horizontal-wrap"
  115. thumb-width="{{thumbWidth}}"
  116. thumb-height="{{thumbHeight}}"
  117. centered="{{true}}"
  118. data="{{goods}}"
  119. data-goods="{{goods}}"
  120. catchspecs="specsTap"
  121. catchclick="goGoodsDetail"
  122. >
  123. <view slot="thumb-cover" class="no-storage-mask" wx:if="{{goods.stockQuantity <=0}}">
  124. <view class="no-storage-content">无货</view>
  125. </view>
  126. </goods-card>
  127. </view>
  128. </view>
  129. <view slot="right" class="swiper-right-del" bindtap="deleteGoods" data-goods="{{goods}}"> 删除 </view>
  130. </swipeout>
  131. </view>
  132. <view
  133. class="promotion-line-wrap"
  134. wx:if="{{handlePromotion.hasPromotion(promotion.promotionCode) && promoindex != (store.promotionGoodsList.length - 2)}}"
  135. >
  136. <view class="promotion-line" />
  137. </view>
  138. </block>
  139. </view>
  140. </view>
  141. <specs-popup
  142. show="{{isShowSpecs}}"
  143. title="{{currentGoods.title || ''}}"
  144. price="{{currentGoods.price || ''}}"
  145. thumb="{{utils.imgCut(currentGoods.thumb, 180, 180)}}"
  146. specs="{{currentGoods.specs || []}}"
  147. zIndex="{{11001}}"
  148. bindclose="hideSpecsPopup"
  149. />
  150. <t-toast id="t-toast" />