cart.wxml 3.48 KB
<wxs src="../../wxs/helper.wxs" module="helper" />

<import src="../product/detail/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 style="height: 100%;">
    <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}}"/>

    <!-- 商品列表 -->
    <view wx:if="{{goodsList}}">
      <template is="cartGoodsList" data="{{goodsList, isEditing}}"/>
      <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>