checkout.wxml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <view class="container p-bottom" wx:if="{{ goods_list.length }}">
  2. <!-- 顶部选项卡 -->
  3. <view wx:if="{{ isShowTab }}" class="swiper-tab dis-flex flex-y-center flex-x-around">
  4. <view wx:for="{{ DeliveryTypeEnum }}" wx:key="this"
  5. class="swiper-tab-item {{ curDelivery == item.value ? 'on' : '' }}" data-current="{{ item.value }}"
  6. catchtap="onSwichDelivery">
  7. {{ item.name }}
  8. </view>
  9. </view>
  10. <!-- 快递配送:配送地址 -->
  11. <view wx:if="{{ curDelivery == DeliveryTypeEnum.EXPRESS.value }}" catchtap="onSelectAddress" class="flow-delivery">
  12. <view class="flow-delivery__detail dis-flex flex-y-center">
  13. <view class="detail-location dis-flex">
  14. <text class="iconfont icon-dingwei"></text>
  15. </view>
  16. <view class="detail-content flex-box">
  17. <block wx:if="{{ address.address_id }}">
  18. <view class="detail-content__title dis-flex">
  19. <text class="f-30">{{ address.name }}</text>
  20. <text class="detail-content__title-phone f-28">{{ address.phone }}</text>
  21. </view>
  22. <view class="detail-content__describe">
  23. <text class="col-7">{{address.region.province}} {{address.region.city}} {{address.region.region}}
  24. {{address.detail}}</text>
  25. </view>
  26. </block>
  27. <block wx:else>
  28. <view class="detail-content__describe dis-flex">
  29. <text class="col-6">请选择配送地址</text>
  30. </view>
  31. </block>
  32. </view>
  33. <view class="detail-arrow dis-flex">
  34. <text class="iconfont icon-xiangyoujiantou user-orderJtou"></text>
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 上门自提:自提门店 -->
  39. <block wx:if="{{ curDelivery == DeliveryTypeEnum.EXTRACT.value }}">
  40. <view catchtap="onSelectExtractPoint" class="flow-delivery">
  41. <view class="flow-delivery__detail dis-flex flex-y-center">
  42. <view class="detail-location dis-flex">
  43. <text class="iconfont icon-dingwei"></text>
  44. </view>
  45. <view class="detail-content flex-box">
  46. <block wx:if="{{ extract_shop.shop_id }}">
  47. <view class="detail-content__title dis-flex">
  48. <text class="f-30">{{ extract_shop.shop_name }}</text>
  49. </view>
  50. <view class="detail-content__describe">
  51. <text class="col-7">{{extract_shop.region.province}} {{extract_shop.region.city}}
  52. {{extract_shop.region.region}} {{extract_shop.address}}</text>
  53. </view>
  54. </block>
  55. <block wx:else>
  56. <view class="detail-content__describe dis-flex">
  57. <text class="col-6">请选择自提点</text>
  58. </view>
  59. </block>
  60. </view>
  61. <view class="detail-arrow dis-flex">
  62. <text class="iconfont icon-xiangyoujiantou user-orderJtou"></text>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- 自提联系方式 -->
  67. <view class="flow-extract-contact m-top20 b-f">
  68. <view class="contact-item dis-flex">
  69. <view class="item_label dis-flex flex-x-end flex-y-center">
  70. <text>联系人:</text>
  71. </view>
  72. <view class="item_ipt flex-box dis-flex flex-y-center">
  73. <input placeholder="请填写联系人姓名" bindinput="onInputLinkman" value="{{ linkman }}"></input>
  74. </view>
  75. </view>
  76. <view class="contact-item dis-flex">
  77. <view class="item_label dis-flex flex-x-end flex-y-center">
  78. <text>联系电话:</text>
  79. </view>
  80. <view class="item_ipt flex-box dis-flex flex-y-center">
  81. <input placeholder="请填写联系电话" bindinput="onInputPhone" value="{{ phone }}"></input>
  82. </view>
  83. </view>
  84. </view>
  85. </block>
  86. <!-- 商品列表 -->
  87. <view class="m-top20">
  88. <view class="checkout_list" wx:for="{{ goods_list }}" wx:key="this">
  89. <form bindsubmit="onTargetGoods" data-id="{{ item.goods_id }}" report-submit="true">
  90. <button formType="submit" class="btn-normal">
  91. <view class="flow-shopList dis-flex" data-index="{{ index }}">
  92. <!-- 商品图片 -->
  93. <view class="flow-list-left">
  94. <image mode="scaleToFill" src="{{ item.goods_image }}"></image>
  95. </view>
  96. <view class="flow-list-right flex-box">
  97. <!-- 商品名称 -->
  98. <text class="f-30 col-3 twolist-hidden">{{ item.goods_name }}</text>
  99. <!-- 商品sku信息 -->
  100. <text class="f-24 col-7">{{ item.goods_sku.goods_attr }}</text>
  101. <!-- 商品数量和单价 -->
  102. <view class="flow-list-cont dis-flex flex-x-between flex-y-center">
  103. <text class="small">×{{ item.total_num }}</text>
  104. <text class="flow-cont {{ item.is_user_grade ? 'price-delete' : '' }}">¥{{ item.goods_price }}</text>
  105. </view>
  106. <!-- 会员折扣价 -->
  107. <view wx:if="{{ item.is_user_grade }}" class="grade-price">
  108. <text>会员折扣价:¥{{ item.grade_goods_price }}</text>
  109. </view>
  110. </view>
  111. </view>
  112. </button>
  113. </form>
  114. </view>
  115. <view class="flow-num-box b-f padding-box">
  116. <text>共{{order_total_num}}件商品,合计:</text>
  117. <text class="flow-money col-m">¥{{ order_total_price }}</text>
  118. </view>
  119. </view>
  120. <!-- 商品金额 -->
  121. <view class="flow-all-money b-f m-top20">
  122. <view class="flow-all-list dis-flex">
  123. <text class="flex-five">订单总金额:</text>
  124. <view class="flex-five t-r">
  125. <text class="col-m">¥{{ order_total_price }}</text>
  126. </view>
  127. </view>
  128. <!-- 优惠券 -->
  129. <view class="flow-all-list dis-flex">
  130. <text class="flex-five">优惠券:</text>
  131. <view class="flex-five t-r">
  132. <view catchtap="onTogglePopupCoupon">
  133. <block wx:if="{{ coupon_list.length > 0 }}">
  134. <text class="col-m" wx:if="{{ coupon_id > 0 }}">-¥{{ coupon_money }}</text>
  135. <text class="col-m" wx:else>有{{ coupon_list.length }}张优惠券</text>
  136. <text class="iconfont icon-xiangyoujiantou user-orderJtou"></text>
  137. </block>
  138. <text wx:else class="">无优惠券可用</text>
  139. </view>
  140. </view>
  141. </view>
  142. <!-- 积分抵扣 -->
  143. <view wx:if="{{ is_allow_points }}" class="points flow-all-list dis-flex flex-y-center">
  144. <view class="block-left flex-five">
  145. <form class="flex-five" bindsubmit="onShowPoints" report-submit="true">
  146. <button formType="submit" class="btn-normal">
  147. <text class="title">可用{{ setting.points_name }}抵扣:</text>
  148. <text class="iconfont icon-help"></text>
  149. </button>
  150. </form>
  151. </view>
  152. <view class="flex-five dis-flex flex-x-end flex-y-center">
  153. <text class="points-money col-m">¥{{ points_money }}</text>
  154. <van-switch checked="{{ isUsePoints }}" size="48rpx" active-color="#07c160" bind:change="onTriggerPoints" />
  155. </view>
  156. </view>
  157. <!-- 配送费用 -->
  158. <view wx:if="{{ curDelivery == DeliveryTypeEnum.EXPRESS.value }}" class="dis-flex flow-all-list">
  159. <text class="flex-five">配送费用:</text>
  160. <view class="flex-five t-r">
  161. <view wx:if="{{address.address_id}}">
  162. <text class="col-m" wx:if="{{ intra_region }}">+¥{{ express_price }}</text>
  163. <text wx:else>不在配送范围</text>
  164. </view>
  165. <view wx:else>
  166. <text class="col-7">请先选择配送地址</text>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. <!-- 支付方式 -->
  172. <view class="pay-method flow-all-money b-f m-top20">
  173. <view class="flow-all-list dis-flex">
  174. <text class="flex-five">支付方式</text>
  175. </view>
  176. <form bindsubmit="onSelectPayType" data-value="{{ PayTypeEnum.WECHAT.value }}" report-submit="true">
  177. <button formType="submit" class="btn-normal">
  178. <view class="pay-item dis-flex flex-x-between">
  179. <view class="item-left dis-flex flex-y-center">
  180. <view class="item-left_icon wechat">
  181. <text class="iconfont icon-weixinzhifu"></text>
  182. </view>
  183. <view class="item-left_text">
  184. <text>{{ PayTypeEnum.WECHAT.name }}</text>
  185. </view>
  186. </view>
  187. <view class="item-right col-m" wx:if="{{ curPayType == PayTypeEnum.WECHAT.value }}">
  188. <text class="iconfont icon-duihao"></text>
  189. </view>
  190. </view>
  191. </button>
  192. </form>
  193. <form bindsubmit="onSelectPayType" data-value="{{ PayTypeEnum.BALANCE.value }}" report-submit="true">
  194. <button formType="submit" class="btn-normal">
  195. <view class="pay-item dis-flex flex-x-between">
  196. <view class="item-left dis-flex flex-y-center">
  197. <view class="item-left_icon balance">
  198. <text class="iconfont icon-qiandai"></text>
  199. </view>
  200. <view class="item-left_text">
  201. <text>{{ PayTypeEnum.BALANCE.name }}</text>
  202. </view>
  203. </view>
  204. <view class="item-right col-m" wx:if="{{ curPayType == PayTypeEnum.BALANCE.value }}">
  205. <text class="iconfont icon-duihao"></text>
  206. </view>
  207. </view>
  208. </button>
  209. </form>
  210. </view>
  211. <!-- 买家留言 -->
  212. <view class="flow-all-money b-f m-top20">
  213. <view class="ipt-wrapper dis-flex flow-all-list">
  214. <input bindinput="bindRemark" placeholder="选填:买家留言(50字以内)" value="{{remark}}"></input>
  215. </view>
  216. </view>
  217. <!-- 提交订单 -->
  218. <view class="flow-fixed-footer b-f m-top10">
  219. <view class="dis-flex chackout-box">
  220. <view class="chackout-left pl-12">实付款:
  221. <text class="col-m">¥{{ order_pay_price }}</text>
  222. </view>
  223. <view catchtap="onSubmitOrder" class="chackout-right">
  224. <text class="flow-btn f-32">提交订单</text>
  225. </view>
  226. </view>
  227. </view>
  228. <!-- 优惠券弹出框 -->
  229. <zan-popup show="{{ showBottomPopup }}" type="bottom" bindclose="onTogglePopupCoupon">
  230. <view class="popup__coupon">
  231. <view class="coupon__title f-32">选择优惠券</view>
  232. <!-- 优惠券列表 -->
  233. <view class="coupon-list">
  234. <scroll-view scroll-y="{{ true }}" style="height: 565rpx;">
  235. <view class="coupon-item" wx:for="{{ coupon_list }}" wx:key="this">
  236. <view class="item-wrapper color__{{ item.is_apply ? item.color.text : 'gray' }}" catchtap="onSelectCoupon"
  237. data-index="{{ index }}" data-id="{{ item.user_coupon_id }}">
  238. <view class="coupon-type">{{ item.coupon_type.text }}</view>
  239. <view class="tip dis-flex flex-dir-column flex-x-center">
  240. <view wx:if="{{ item.coupon_type.value == 10 }}">
  241. <text class="f-30">¥</text>
  242. <text class="money">{{ item.reduce_price }}</text>
  243. </view>
  244. <text class="money" wx:if="{{ item.coupon_type.value == 20 }}">{{ item.discount }}折</text>
  245. <text class="pay-line">满{{ item.min_price }}元可用</text>
  246. </view>
  247. <view class="split-line"></view>
  248. <view class="content dis-flex flex-dir-column flex-x-between">
  249. <view class="title">{{ item.name }}</view>
  250. <view class="bottom dis-flex flex-y-center">
  251. <view class="time flex-box">
  252. <text>有效期:{{ item.start_time.text }}~{{ item.end_time.text }}</text>
  253. </view>
  254. <!-- <view class="state flex-box">
  255. <text>-¥{{ item.reduced_price }}</text>
  256. </view> -->
  257. </view>
  258. </view>
  259. </view>
  260. </view>
  261. </scroll-view>
  262. </view>
  263. <!-- 不使用优惠券 -->
  264. <view class="coupon__do_not dis-flex flex-y-center flex-x-center">
  265. <view class="control dis-flex flex-y-center flex-x-center" catchtap="onNotUseCoupon">
  266. <text class="f-26">不使用优惠券</text>
  267. </view>
  268. </view>
  269. <!-- <view class="footer-fixed f-32">
  270. <view catchtap="onTogglePopupCoupon" class="order-bt" style="width:100%">关闭</view>
  271. </view> -->
  272. </view>
  273. </zan-popup>
  274. <!-- 积分说明弹框 -->
  275. <zan-dialog id="zan-base-dialog"></zan-dialog>
  276. <!-- Toast组件 -->
  277. <zan-toast id="zan-toast"></zan-toast>
  278. </view>
  279. <!-- 快捷导航 -->
  280. <!-- <shortcut></shortcut> -->