shoppingCartProductCell.wxml 5.88 KB
<import src="/pages/shopCart/cells/shoppingCartOneProductCell.wxml" />

<template name="shoppingCartProductCell">
  <view class="commonProductCellContainer">
    <block wx:if="{{item.promotion_list.length}}">
      <view class="promotionViewContainer">
        <block wx:for="{{item.promotion_list}}" wx:for-item="promotionItem" wx:for-index="promotionIndex" wx:key="promotion">
          <view class="promotionCell" data-promotion-item="{{promotionItem}}" bindtap="navToPromotionPage" wx:if="{{promotionIndex == 0 || item.isPromotionExpanded}}">
            <view class='promotionTitleContainer'>
              <view class='viewCenterStyle'>
                <image class="promotionIcon" src="./images/shoppingcart_promotion_icon@2x.png"></image>
              </view>
              <view class="promotionDesc">{{promotionItem.promotion_desc}}</view>
            </view>
            <view class='promotionRightContainer'>
              <view class="{{promotionItem.seldoutStyle ? 'statuStringSeldOut' : 'statuString'}}" wx:if="{{promotionItem.statuString.length > 0}}">{{promotionItem.statuString}}</view>
              <view class='viewCenterStyle'>
                <image class="rightArrow" src="./images/goodslist_screen_right_icon@2x.png"></image>
              </view>
            </view>
          </view>
        </block>
        <block wx:if="{{item.promotion_list.length > 1}}">
          <view class="promotioMoreArrowContainer" bindtap="flexOrUnflexPromotion" data-type="{{index}}">
            <image class="promotioMoreArrow" wx:if="{{!item.isPromotionExpanded}}" src="./images/promotionDown@2x.png"></image>
            <image class="promotioMoreArrow" wx:if="{{item.isPromotionExpanded}}" src="./images/promotionUp@2x.png"></image>
          </view>
        </block>
      </view>
      <view class='sepLineStyle'>
      </view>
    </block>
    <block wx:if="{{item.sub_pool.length}}">
      <block wx:for="{{item.sub_pool}}" wx:for-item="subPoolItem" wx:for-index="subPoolIndex" wx:key="subPool">
        <block wx:for="{{subPoolItem.promotion_list}}" wx:for-item="subPromotionItem" wx:for-index="subPromotionIndex" wx:key="subPromotion">
          <view class='cellLine' wx:if="{{subPoolIndex > 0}}">
          </view>
          <view class="subPromotionCell" data-promotion-item="{{subPromotionItem}}" bindtap="navToPromotionPage" wx:if="{{subPromotionIndex == 0 || subPromotionItem.isPromotionExpanded}}">
            <view class='promotionTitleContainer'>
              <view style="flex-shrink: 0;">
                <view class="subPromotionTypeString">{{subPromotionItem.typeString}}</view>
              </view>
              <view class="promotionDesc">{{subPromotionItem.promotion_desc}}</view>
            </view>
            <view class='promotionRightContainer'>
              <view class="{{subPromotionItem.seldoutStyle ? 'statuStringSeldOut' : 'statuString'}}" wx:if="{{subPromotionItem.statuString.length > 0}}">{{subPromotionItem.statuString}}</view>
              <view class='viewCenterStyle'>
                <image class="rightArrow" src="./images/goodslist_screen_right_icon@2x.png"></image>
              </view>
            </view>
          </view>
        </block>
        <block wx:for="{{subPoolItem.goods_list}}" wx:for-item="subPoolGoodsItem" wx:for-index="subPoolGoodsIndex" wx:key="subPoolGoods">
          <view class="cellLine" wx:if="{{subPoolIndex > 0 || (subPoolItem.promotion_list.length > 0)}}">
          </view>

          <view class="poolGoodCellContainer">
            <template is="shoppingCartOneProductCell" data="{{goodsItem:subPoolGoodsItem,isEditing,deleteAnimation,tempSku}}"></template>
          </view>
        </block>
      </block>
    </block>
    <block wx:if="{{item.pool_type == 3 && item.pool_batch_no}}">
      <view class='bundleHeaderView'>
        <view class='titleContainer'>
          <view class='leftTitleContainer'>
            <image bindtap='tapBundleProductHeader' data-bundledata='{{item}}' class='selectStatusImage' src="{{item.selected == 'Y' ? './images/gwc_choose@2x.png' : './images/gwc_n@2x.png'}}"></image>
            <view class='bundleFirstTitle'>优惠套装</view>
            <view class='bundleTitle'>{{item.pool_title}}</view>
          </view>
          <view wx:if="{{!isEditing}}" class='bundleBuyNumbText'>x {{item.pool_buy_number}}</view>
        </view>
        <view wx:if="{{isEditing}}" class='editNumberContainer'>
          <view class='bundleEidtLeftContainer'>
            <view class='bundleNumber'>套餐数量</view>
            <view class='bundleEidtView'>
              <view class='reduceActionBtn' bindtap='{{item.int_pool_buy_number > 1 ? "bundleReduceTap" : ""}}' data-item='{{item}}'>
                <image class='reduceImage' src='{{item.int_pool_buy_number > 1 ? "./images/jian_h@2x.png" : "./images/jian_disable@2x.png"}}'></image>
              </view>
              <view class='buyNumberActionText'>
                <view class='currentNumber'>{{item.pool_buy_number}}</view>
              </view>
              <view class='addActionBtn' bindtap='{{item.int_pool_buy_number < item.int_pool_storage_number ? "bundleAddTap" : ""}}' data-item='{{item}}'>
                <image class='addImage' src='{{item.int_pool_buy_number < item.int_pool_storage_number ? "./images/and_normal@2x.png" : "./images/and_h@2x.png"}}'></image>
              </view>
            </view>
          </view>
        </view>
      </view>
      <view class='sepLineStyle'>
      </view>
    </block>
    <block wx:if="{{item.goods_list.length}}">
      <block wx:for="{{item.goods_list}}" wx:for-item="goodsItem" wx:for-index="goodsIndex" wx:key="goodsitem">

        <view class='cellLine' wx:if="{{goodsIndex> 0}}">
        </view>
        <view class="poolGoodCellContainer">
          <template is="shoppingCartOneProductCell" data="{{goodsItem,isEditing,deleteAnimation,tempSku}}"></template>
        </view>
      </block>
    </block>
    <view class="bottonGray"></view>
  </view>

</template>