shopCart.ttml 4.32 KB

<view tt:if="{{curShoppingCartData.has_product_in_shop_cart}}" class="container">
  
  <view tt:if="{{curShoppingCartData.shipping_cost_prompt.shipping_cost_tips != '' || curShoppingCartData.price_down_prompt.price_down_tips != ''}}" class="floatHeaderContainer">
    <view tt:if="{{curShoppingCartData.price_down_prompt.price_down_tips && !has_close_price_down_tip}}" class="priceDownTipsContainer">
      <text class="shippingCostTip priceDownTitle">{{curShoppingCartData.price_down_prompt.price_down_tips}}</text>
      <image class="priceDownTipsClose" bindtap='tapPriceDownTipsAction' src="../../images/close_icon@2x.png"></image> 
    </view>
    <view tt:else class="shippingCostTip">{{curShoppingCartData.shipping_cost_prompt.shipping_cost_tips}}</view>
    <view class="editBtn" bindtap="editBtnSelected" tt:if="{{!isEditing}}">编辑商品</view>
    <view class="editBtn" bindtap="editCompletedAction" tt:if="{{isEditing}}">完成</view> 
  </view>

  <scroll-view scroll-y="{{enableScroll}}" class="contentContainer" style="position: absolute;top:{{scrollerViewTop}}px;height:{{scrollerViewHeight}}px" enable-back-to-top="true">
    <!--商品池  -->
    <view tt:if="{{curShoppingCartData.goods_pool_list.length}}" class="goodsPoolListContainer">
      <block tt:for="{{curShoppingCartData.goods_pool_list}}" tt:key="{{index}}" tt:for-item="item">
        <shoppingCartProductCell data="{{{item, index,isEditing,deleteAnimation,tempSku}}}" bindshoppingCartProductAction="onShoppingCartProductAction" bindmoveStart="moveStart" bindmoveEnd="moveEnd"></shoppingCartProductCell>
      </block>
    </view>
  
    <!-- 商品列表 -->
    <block class="" tt:if="{{curShoppingCartData.goods_list.length}}">
      <block tt:for="{{curShoppingCartData.goods_list}}" tt:for-item="goodsItem" tt:for-index="goodsIndex" tt:key="{{goodsIndex}}">
        <view class="poolGoodCellContainer">
          <view class="cellLine" tt:if="{{goodsIndex > 0}}"></view>
          <shoppingCartOneProductCell data="{{{goodsItem,isEditing,deleteAnimation,tempSku}}}" bindshoppingCartProductAction="onShoppingCartProductAction"  bindmoveStart="moveStart" bindmoveEnd="moveEnd"></shoppingCartOneProductCell>
        </view>
      </block>
      <view class="bottonGray"></view>
    </block>

    <!--加价购 & 赠品   -->
    <block tt:if="{{curShoppingCartData.gGiftAndPriceGiftList.length}}">
      <shoppingCartGiftOrPriceCell data="{{{giftList:curShoppingCartData.gGiftAndPriceGiftList}}}" bindnavToGiftPage="navToGiftPage"></shoppingCartGiftOrPriceCell>
    </block>

    <!--无效商品  -->
    <block tt:if="{{curShoppingCartData.invalidGoodsList.length}}">
      <shoppingCartInvalidProductCell data="{{{invalidGoodsList:curShoppingCartData.invalidGoodsList,isEditing,deleteAnimation,tempSku}}}"></shoppingCartInvalidProductCell>
    </block>
    
    <!-- 已参与活动 -->
    <block tt:if="{{curShoppingCartData.promotion_info.length}}">
      <shoppingCartPromotionCell data="{{{promotionList:curShoppingCartData.promotion_info}}}"></shoppingCartPromotionCell>
    </block>

    <!-- 总计价格 -->
    <block tt:if="{{curShoppingCartData.shopping_cart_data}}">
      <text class="totalCost">{{curShoppingCartData.shopping_cart_data.promotion_formula}}</text>
      <view class="bottonGray"></view>
    </block>
  </scroll-view>

  <!-- footer -->
  <shoppingCartFooterView data="{{{item:curShoppingCartData.shopping_cart_data,isSelectAll:curShoppingCartData.isValidGoodsSelectAll,isEditing}}}"  bindonSelectAllGoodsAction="selectAllGoodsAction" bindonPaymentAction="paymentAction" bindonMutilDeleteEditing="mutilDeleteEditing"></shoppingCartFooterView>

  <picker id="picker"
          pickerData="{{pickerData}}" isloadingForPayment="{{isloadingForPayment}}"
          pickerShow="{{pickerShow}}"
          bind:showChange="showChange"
          bind:errorToast="errorToast"
          bind:chooseSizeColorCompleted="chooseSizeColorCompleted"
  ></picker>

  <import src="../../vendors/toast/wetoast.ttml"/>
  <template is="wetoast" data="{{...__wetoast__}}"/>
</view>

<view tt:else>
  <view class='empty-view'>
    <image src='../../images/shoppingcart_empty@2x.png' class='shoppingcart-empty-icon'></image>
    <text class='shoppingcart-empty-title'>购物车空空如也\n去挑选中意的商品</text>
    <view class='shoppingcart-empty-btn' bindtap='navToNewArriaval'>去逛逛</view>
  </view>
</view>