cart.wxml
3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<wxs src="../../wxs/helper.wxs" module="helper" />
<import src="../goodsDetail/picker/picker.wxml"/>
<import src="./template/cart/goods-pool.wxml"/>
<import src="./template/cart/goods-list.wxml"/>
<import src="./template/cart/gift-list.wxml"/>
<import src="./template/cart/invalid-list.wxml"/>
<block wx:if="{{isEmptyCart}}">
<view class="empty-cart">
<image src='../../static/images/empty_cart.png' class='empty-img'></image>
<text class='empty-desc'>购物车空空如也\n去挑选中意的商品</text>
<view class='shopping-btn' bindtap='goShopping'>去逛逛</view>
</view>
</block>
<block wx:else>
<scroll-view scroll-y class="cart-scoll-wrap" bindtouchstart="touchStartAction">
<view class="tips-wrap" wx:if="{{priceDownTips || shippingCostTips}}">
<view class="hold-text">
<text>{{priceDownTips || shippingCostTips}}</text>
</view>
<view wx:if="{{shippingCostTips || priceDownTips}}" class="fixed-top-tips">
<view wx:if="{{priceDownTips}}" class="price-down-tips">
<text>{{priceDownTips}}</text>
<text class="iconfont icon-top" bindtap='tapPriceDownTipsAction'></text>
</view>
<view wx:else class="shipping-cost-tips">{{shippingCostTips}}</view>
<view class="edit-cart-btn" bindtap="editCartStatus">{{isEditing ? '完成' : '编辑商品'}}</view>
</view>
</view>
<!-- 商品池 -->
<template is="cartGoodsPool" data="{{goodsPoolList, isEditing, isEditSelectAll, promotionMoreStatus, touchKey}}"/>
<!-- 商品列表 -->
<view wx:if="{{goodsList}}">
<template is="cartGoodsList" data="{{goodsList, isEditing, isEditSelectAll, touchKey}}"/>
<view class="split-line"></view>
</view>
<!-- 加价购&赠品 -->
<template is="cartGiftList" data="{{giftList: gGiftAndPriceGiftList}}"/>
<!-- 无效商品 -->
<template is="cartInvalidList" data="{{invalidGoodsList}}"/>
<!-- 已参与活动 -->
<view class="used-promotion" wx:if="{{promotionInfo}}">
<view class="promotion-title">已参与活动</view>
<block wx:for="{{promotionInfo}}" wx:key="unique">
<view class="promotion-item">• {{item.promotion_title}}</view>
</block>
</view>
<!-- 总计价格 -->
<block wx:if="{{shoppingCartData}}">
<view class="total-cost">{{shoppingCartData.promotion_formula}}</view>
<view class="split-line"></view>
<view class="footer-wrap">
<view class="footer-fixed">
<view class="select-all-btn" bindtap="selectAllGoods">
<text class="iconfont icon-duihao-fill" wx:if="{{isSelectAll}}"></text>
<text class="iconfont icon-round" wx:else></text>
<text>全选</text>
</view>
<view class="settlement-block">
<view class="delete-btn footer-option-btn" bindtap="mutilRemoveGoods" wx:if="{{isEditing}}">
<text>删除</text>
</view>
<block wx:else>
<view class="footer-total-cost">
<text class="cost">总计¥{{helper.round(shoppingCartData.last_order_amount)}}({{shoppingCartData.selected_goods_count}})件</text>
<text class="no-freight">不含运费</text>
</view>
<view class="payment-btn footer-option-btn" bindtap="paymentAction" style="{{shoppingCartData.selected_goods_count > 0 ? '' : 'background-color: #b0b0b0'}}">
<text>结算</text>
</view>
</block>
</view>
</view>
</view>
</block>
</scroll-view>
<template is="Picker" data="{{pickerData, loadingForPayment}}"/>
</block>