basket.wxml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <!--pages/basket/basket.wxml-->
  2. <view class='container basket'>
  3. <view class="prod-list">
  4. <view wx:for="{{shopCartOrders}}" wx:for-item="shopCart" wx:for-index="topIndex" wx:key="index" class="shop-item">
  5. <!-- 头部店铺 -->
  6. <view class="head-shop">
  7. <view class="btn choose-btn">
  8. <label>
  9. <checkbox bindtap='onSelectedShopItem' data-item="{{shopCart}}" data-topindex="{{topIndex}}" checked="{{shopCart.checked}}" color="#105c3e" />
  10. </label>
  11. </view>
  12. <view class="shop-box">
  13. <!-- <view class="shop-icon">
  14. <image src="../../images/icon/shop.png"></image>
  15. </view> -->
  16. <view class="shop-name">{{shopCart.shopName}}</view>
  17. </view>
  18. </view>
  19. <!-- /头部店铺 -->
  20. <block wx:for="{{shopCart.shopCartItemDiscounts}}" wx:key='index' wx:for-index="scIndex">
  21. <view class='prod-block {{item.chooseDiscountItemDto?"discount":""}}'>
  22. <!-- 满减提示 -->
  23. <view class='discount-tips' hidden='{{!item.chooseDiscountItemDto}}'>
  24. <text class='text-block'>{{wxs.parseDiscount(item.chooseDiscountItemDto.discountRule)}}</text>
  25. <text class='text-list'>{{wxs.parseDiscountMsg(item.chooseDiscountItemDto.discountRule,item.chooseDiscountItemDto.needAmount,item.chooseDiscountItemDto.discount)}}</text>
  26. <text class='text-list reduce-amount' wx:if="{{item.chooseDiscountItemDto.reduceAmount > 0}}">已优惠 ¥{{wxs.parsePrice(item.chooseDiscountItemDto.reduceAmount)[0]}}.{{wxs.parsePrice(item.chooseDiscountItemDto.reduceAmount)[1]}}</text>
  27. </view>
  28. <!-- 商品item -->
  29. <block wx:for="{{item.shopCartItems}}" wx:key='index' wx:for-item="prod">
  30. <view class="goods-item">
  31. <view class="disable" wx:if="{{prod.isDelete == 1}}"></view>
  32. <!-- 商品信息 -->
  33. <view class='item'>
  34. <view class="btn">
  35. <label>
  36. <checkbox bindtap='onSelectedItem' data-topindex="{{topIndex}}" data-scindex="{{scIndex}}" data-index="{{index}}" data-stock="{{prod.stock}}" value="{{prod.prodId}}" checked="{{prod.checked}}" color="#105c3e" />
  37. </label>
  38. </view>
  39. <view class='prodinfo'>
  40. <view class="pic-box">
  41. <image class="pic" src="{{prod.pic}}" mode="" bindtap="toProdPage" data-prodid="{{prod.prodId}}" />
  42. <view class="sell-out" wx:if="{{prod.stock == 0}}">
  43. <view class="sell-out-text">已售罄</view>
  44. </view>
  45. </view>
  46. <!-- <view class="pic" bindtap="toProdPage" data-prodid="{{prod.prodId}}">
  47. <image src='{{prod.pic}}' />
  48. </view> -->
  49. <view class="opt">
  50. <view class='prod-name'>{{prod.prodName}}</view>
  51. <view class="prod-center-row">
  52. <view class="prod-discount" bindtap="onChooseDiscount" data-discounts="{{prod.discounts}}" data-basketid="{{prod.basketId}}" data-discountid="{{prod.discountId}}" wx:if="{{prod.discounts.length>0}}">
  53. <view class="discount-name">{{wxs.getCurrDiscountName(prod.discountId,prod.discounts)}}</view>
  54. <view class="down-arrow"></view>
  55. </view>
  56. <view class='prod-info-text {{prod.skuName?"":"empty-n"}}' wx:if="{{prod.skuName}}">{{prod.skuName}}</view>
  57. </view>
  58. <view class='price-count' wx:if="{{prod.isDelete == 0}}">
  59. <view class='price'>
  60. <text class=''>¥</text>
  61. <text class=''>{{wxs.parsePrice(prod.price)[0]}}</text>
  62. <text class=''>.{{wxs.parsePrice(prod.price)[1]}}</text>
  63. </view>
  64. <view class="m-numSelector" class="num-box">
  65. <image bindtap='onCountMinus' class="btn" data-topindex="{{topIndex}}" data-scindex="{{scIndex}}" data-index="{{index}}" src="/images/icon/reduce.png" mode=""/>
  66. <input class="num" type='number' value='{{prod.prodCount}}' disabled></input>
  67. <image bindtap='onCountPlus' class="btn" data-topindex="{{topIndex}}" data-scindex="{{scIndex}}" data-index="{{index}}" src="/images/icon/add.png" mode=""/>
  68. </view>
  69. </view>
  70. <view class="del-box" wx:else>
  71. <view class="del-label">商品已被删除</view>
  72. <view class="del-btn" bindtap='onDelProd' data-basketid="{{prod.basketId}}">删除</view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </block>
  79. </view>
  80. </block>
  81. </view>
  82. </view>
  83. <!-- 底部按钮 -->
  84. <view class="cart-footer" wx:if="{{shopCartOrders.length>0}}">
  85. <image src="/images/icon/basket-icon.png" mode="" class="icon"/>
  86. <view class="all">
  87. <label bindtap='onSelAll'>
  88. <checkbox checked='{{allChecked}}' color='#f7d731;' />全选</label>
  89. </view>
  90. <view class="del" bindtap='onDelBasket'>
  91. <text>删除</text>
  92. </view>
  93. <view class="total" bindtap="showPriDet">
  94. <view class="total-con">
  95. <view class="finally">
  96. <text class="blod">总计:</text>
  97. <view class='price'>
  98. <text class='symbol'>¥</text>
  99. <text class='big-num'>{{wxs.parsePrice(finalMoney)[0]}}</text>
  100. <text class='small-num'>.{{wxs.parsePrice(finalMoney)[1]}}</text>
  101. </view>
  102. </view>
  103. <view class="total-msg" wx:if="{{subtractMoney>0}}">
  104. <!-- 总额:¥{{wxs.toPrice(totalMoney)}} -->
  105. 已优惠:¥{{wxs.toPrice(subtractMoney)}}
  106. </view>
  107. </view>
  108. <view class="arrow-icon">
  109. <image src="../../images/icon/down-arrow.png" wx:if="{{hidePriModal}}"></image>
  110. <image src="../../images/icon/up-arrow.png" wx:if="{{!hidePriModal}}"></image>
  111. </view>
  112. </view>
  113. <view class="settle" bindtap='toFirmOrder'>
  114. <text>结算</text>
  115. </view>
  116. </view>
  117. <!-- end 底部按钮 -->
  118. <!-- 底部活动选择弹框 -->
  119. <view class="modals modals-bottom-dialog" hidden="{{hideModal}}">
  120. <view class="modals-cancel" bindtap="hideModal"></view>
  121. <view class="bottom-dialog-body bottom-pos radius" animation="{{animationData}}">
  122. <view class="discount-title radius">选择促销活动</view>
  123. <view class="radio-group">
  124. <radio-group bindchange="radioChange" class="discount-radio">
  125. <view wx:for="{{prodDiscounts}}" wx:key="index">
  126. <label>
  127. <radio color="#eb2444" value="{{item.discountId}}" checked="{{item.discountId==discountid}}"></radio>{{item.discountName}}
  128. </label>
  129. </view>
  130. <view>
  131. <label>
  132. <radio color="#eb2444" value="-1" checked="{{-1==discountid}}"></radio>不参加促销
  133. </label>
  134. </view>
  135. </radio-group>
  136. </view>
  137. </view>
  138. </view>
  139. <!-- 底部金额明细弹框 -->
  140. <view class="pri-modal modals-bottom-dialog" hidden="{{hidePriModal}}">
  141. <view class="modals-cancel" bindtap="hidePriModal"></view>
  142. <view class="bottom-dialog-box bottom-pos radius" animation="{{animationData}}">
  143. <view class="discount-title radius">金额明细</view>
  144. <view class="price-detail">
  145. <view class="price-detail-item">
  146. <view class="det-tit">商品总额</view>
  147. <view class="det-num">¥{{wxs.toPrice(totalMoney)}}</view>
  148. </view>
  149. <view class="price-detail-item" wx-if="{{subtractMoney > 0}}">
  150. <view class="det-tit">促销立减</view>
  151. <view class="det-num">-¥{{wxs.toPrice(subtractMoney)}}</view>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <!-- 底部end -->
  157. <!-- 空 -->
  158. <view class="empty" wx:if="{{!shopCartOrders.length}}">
  159. <view class="empty-icon">
  160. <image src="../../images/icon/empty-basket.png"></image>
  161. </view>
  162. <view class="empty-text">您还没有添加商品到购物车哦~</view>
  163. <view class="btn" bind:tap="goShopping">去逛逛</view>
  164. </view>
  165. <tabbar class="my-tabbar" active="2" style="box-shadow: none;"></tabbar>
  166. </view>
  167. <wxs module="wxs" src="../../wxs/number.wxs" />