index.axml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <import-sjs
  2. name="utils"
  3. from="./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. from="../mall-index/index.sjs"
  15. name="carUtils"
  16. />
  17. <wrapper>
  18. <!-- 弹框内容 -->
  19. <popup-container
  20. show="{{ popUpShow && globalCar.carts.length }}"
  21. title=""
  22. onClose="onClosePopup"
  23. disableScroll="{{globalCar.carts.length <= 4}}"
  24. >
  25. <!-- 标题栏 -->
  26. <view
  27. class="mall-car-popup-head"
  28. slot="header"
  29. >
  30. <am-checkbox
  31. ctrlChecked="{{utils.isCheckedAll(globalCar.carts || [])}}"
  32. onChange="checkedAllChange"
  33. />
  34. <view class="head-text">
  35. 全选(已选 {{utils.getCheckedNum(globalCar.carts || [])}} 件)
  36. </view>
  37. <view
  38. class="head-clear"
  39. onTap="clearCar"
  40. >
  41. <am-icon
  42. type="DeleteOutline"
  43. size="16"
  44. />
  45. <view class="head-clear-text">
  46. 清空
  47. </view>
  48. </view>
  49. </view>
  50. <view class="mall-car-container">
  51. <!-- 物品列表栏 -->
  52. <block a:for="{{globalCar.carts}}">
  53. <view
  54. key="{{'car'+item.skuId}}"
  55. class="car-item-container"
  56. >
  57. <view
  58. class="goods-item-checkbox"
  59. data-skuId="{{item.skuId}}"
  60. data-status="{{item.status}}"
  61. data-checkedState="{{item.checkedState}}"
  62. onTap="handelItemCheck"
  63. >
  64. <am-checkbox ctrlChecked="{{item.checkedState === 'Y'}}" />
  65. </view>
  66. <view class="car-goods-item">
  67. <goods-item
  68. targetId="#carBottomEnd"
  69. goodsItem="{{item}}"
  70. defaultNum="{{item.quantity}}"
  71. onItemChange="handelItemChange"
  72. showStock="{{item.stockStatus === 'Y'}}"
  73. showAuto="{{utils.isShowAuto(globalCar)}}"
  74. showBooking="{{item.userLimitType === 'BESPEAK' && !item.isbespeak}}"
  75. ></goods-item>
  76. </view>
  77. </view>
  78. </block>
  79. </view>
  80. <!-- 商品页面 购物总价 底部 fixed按钮 -->
  81. <mall-footer-button
  82. a:if="{{showFlag && checkUtils.isOnlyDeliver(globalCar.carts)}}"
  83. selectNum="{{utils.getCheckedNum(globalCar.carts)}}"
  84. disCountTotalPrice="{{globalCar.disCountTotalPrice}}"
  85. totalPrice="{{globalCar.totalPrice}}"
  86. showTip="{{true}}"
  87. startDeliveryAmount="{{startDeliveryAmount}}"
  88. showColorCar="{{totalUtils.calcNumber(globalCar.disCountTotalPrice, globalCar.deliveryPackingFee || 0) >= startDeliveryAmount}}"
  89. buttonText="{{totalUtils.calcNumber(globalCar.disCountTotalPrice, globalCar.deliveryPackingFee || 0) >= startDeliveryAmount ? '去结算' : `差${totalUtils.calcNumber(startDeliveryAmount, totalUtils.calcNumber(globalCar.disCountTotalPrice, globalCar.deliveryPackingFee || 0), 'sub')}起送`}}"
  90. onConfirmClick="{{totalUtils.calcNumber(globalCar.disCountTotalPrice, globalCar.deliveryPackingFee || 0) >= startDeliveryAmount ? 'handelCreateOrder' : ''}}"
  91. />
  92. <mall-footer-button
  93. a:else
  94. selectNum="{{utils.getCheckedNum(globalCar.carts)}}"
  95. disCountTotalPrice="{{globalCar.disCountTotalPrice}}"
  96. totalPrice="{{globalCar.totalPrice}}"
  97. onConfirmClick="handelCreateOrder"
  98. />
  99. </popup-container>
  100. <!-- popup 选择结算商品 -->
  101. <popup-container
  102. show="{{ deliveryPopShow }}"
  103. title="选择结算商品"
  104. onClose="onClosePopup"
  105. backGroundColor="#f2f2f2"
  106. overFlow="unset"
  107. >
  108. <view
  109. class="choose-goods-header"
  110. slot="header"
  111. >选择结算商品
  112. <view class="choose-chancel-icon">
  113. <am-icon
  114. type="CloseOutline"
  115. size="15"
  116. onTap="cancelClick"
  117. />
  118. </view>
  119. </view>
  120. <view class="choose-goods-list">
  121. <deliver-card
  122. showFlag="{{showFlag}}"
  123. startDeliveryAmount="{{startDeliveryAmount}}"
  124. a:for="{{deliverTypeList}}"
  125. title="{{item.deliverType === 'SELF_PICK_UP_DELIVERY' ? '门店自提' : '发货速配'}}"
  126. item="{{item}}"
  127. itemIndex="{{index}}"
  128. isChecked="{{item.isChecked}}"
  129. onCheckBoxClick="onCheckBoxClick"
  130. />
  131. </view>
  132. <!-- 商品页面 购物总价 底部 fixed按钮 -->
  133. <mall-footer-button
  134. a:if="{{showFlag && deliverTypeList[itemIndex].deliverType === 'DELIVERY_LOGISTICS' }}"
  135. selectNum="{{utils.getCheckedNum(deliverTypeList[itemIndex].carts)}}"
  136. disCountTotalPrice="{{deliverTypeList[itemIndex].disCountTotalPrice || 0}}"
  137. totalPrice="{{deliverTypeList[itemIndex].totalPrice || 0}}"
  138. packingFee="{{deliverTypeList[itemIndex].packingFee || 0}}"
  139. item="{{deliverTypeList[itemIndex]}}"
  140. showColorCar="{{deliverTypeList[itemIndex].canOrder}}"
  141. onConfirmClick="{{deliverTypeList[itemIndex].canOrder ? 'gotoCreateOrder' : ''}}"
  142. />
  143. <mall-footer-button
  144. a:else
  145. selectNum="{{utils.getCheckedNum(deliverTypeList[itemIndex].carts)}}"
  146. packingFee="{{deliverTypeList[itemIndex].packingFee || 0}}"
  147. disCountTotalPrice="{{deliverTypeList[itemIndex].disCountTotalPrice || 0}}"
  148. totalPrice="{{deliverTypeList[itemIndex].totalPrice || 0}}"
  149. onConfirmClick="gotoCreateOrder"
  150. showColorCar="{{!!deliverTypeList[itemIndex]}}"
  151. item="{{deliverTypeList[itemIndex]}}"
  152. />
  153. </popup-container>
  154. <member-car-popup
  155. a:if="{{memberItem && memberPopUpShow}}"
  156. memberItem="{{memberItem}}"
  157. onBtnClick="handleMemberBtnClick"
  158. memberPopUpShow="{{memberPopUpShow}}"
  159. onPopClose="onMemberPopClose"
  160. text={{text}}
  161. />
  162. </wrapper>
  163. <view>
  164. <slot></slot>
  165. </view>