<view class="container">
  <view class="service-policy">
    <!-- <view class="item">30分钟速达</view>
    <view class="item">每日优选生鲜</view>
    <view class="item">满88元免配送费</view> -->
    <view class="item">新用户可领取5元优惠券</view>
  </view> 
  <view class="no-cart" wx:if="{{cartGoods.length <= 0}}">
    <view class="c">
      <view class="title-box">
        购物车空空如也～
      </view>
      <view class="to-index-btn" bindtap="toIndexPage">
        去逛逛
      </view>
    </view>
  </view>
  <view class="cart-view" >
    <!-- <view class="group-item" wx:if="{{couponInfoList.length > 0}}">
      <view class="coupon-info header" wx:for="{{couponInfoList}}" wx:key="{{item}}">
        <text class="txt" wx:if="{{item.type===0}}">{{item.msg}}</text>
        <navigator wx:if="{{item.type===1}}" url="../catalog/catalog" open-type="switchTab">
          <text class="txt">{{item.msg}}，去凑单  >>></text>
        </navigator>
      </view>
    </view> -->
    <view class="list">
      <view class="group-item">
        <view class="goods">
          <view wx:if="{{cartGoods00.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus00 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="00">
          <image src="../../../static/images/service-bao.png" class="search-icon-shop"></image>
          <text class="title-name ">保税仓</text></view>
          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 00}}" wx:key="{{item.id}}">
            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
            <view class="cart-goods">
              <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                <image class="img" src="{{item.list_pic_url}}"></image>
              </navigator>
              <view class="info">
                <view class="t">
                  <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                    <text class="name">{{item.goods_name}}</text>
                  </navigator>
                  <view class="goods-do">
                    <text class="price">￥{{item.retail_price}}</text>
                    <text class="org-price line-through">￥{{item.market_price}}</text>
                  </view>
                </view>
                <view class="attr">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}
                </view>
                <!-- //数量加减 -->
                <view class="number-item">
                  <view class="selnum">
                    <view class="cut" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="cutNumber"></view>
                    <input value="{{item.number}}" class="number" disabled="true" type="number" />
                    
                    <image class="add2" src="{{item.number < item.stockNum ? '/static/images/service-hsjh.png':'/static/images/service-ehsjh.png'}}" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" catchtap="{{item.number < item.stockNum ?  'addNumber' : ''}}"></image>
                    
                  </view>
                </view>
                <view class="handle">
                  <image catchtap="deleteCart" data-cart-id="{{item.id}}" data-goods-name="{{item.goods_name}}" class="del" src="/static/images/del-address.png"></image>
                </view>
              </view>
            </view>
          </view>

        <view wx:if="{{cartGoods02.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus02 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="02">
          <image src="../../../static/images/service-zs.png" class="search-icon-shop"></image>
          <text class="title-name">保税展示</text>
        </view>

          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 02}}" wx:key="{{item.id}}">
            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
            <view class="cart-goods">
              <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                <image class="img" src="{{item.list_pic_url}}"></image>
              </navigator>
              <view class="info">
                <view class="t">
                  <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                    <text class="name">{{item.goods_name}}</text>
                  </navigator>
                  <view class="goods-do">
                    <text class="price">￥{{item.retail_price}}</text>
                    <text class="org-price line-through">￥{{item.market_price}}</text>
                  </view>
                </view>
                <view class="attr">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}
                </view>
                <!-- //数量加减 -->
                <view class="number-item">
                  <view class="selnum">
                    <view class="cut" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="cutNumber"></view>
                    <input value="{{item.number}}" class="number" disabled="true" type="number" />
                    
                    <image class="add2" src="{{item.number < item.stockNum ? '/static/images/service-hsjh.png':'/static/images/service-ehsjh.png'}}" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" catchtap="{{item.number < item.stockNum ?  'addNumber' : ''}}"></image>
                    
                  </view>
                </view>
                <view class="handle">
                  <image catchtap="deleteCart" data-cart-id="{{item.id}}" data-goods-name="{{item.goods_name}}" class="del" src="/static/images/del-address.png"></image>
                </view>
              </view>
            </view>
          </view>

   
          <view wx:if="{{cartGoods10.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus10 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="10">
            <image src="../../../static/images/service-ziti.png" class="search-icon-shop"></image>
            <text class="title-name">现场速递</text>
          </view>

          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 10}}" wx:key="{{item.id}}">
            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
            <view class="cart-goods">
              <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                <image class="img" src="{{item.list_pic_url}}"></image>
              </navigator>
              <view class="info">
                <view class="t">
                  <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                    <text class="name">{{item.goods_name}}</text>
                  </navigator>
                  <view class="goods-do">
                    <text class="price">￥{{item.retail_price}}</text>
                    <text class="org-price line-through">￥{{item.market_price}}</text>
                  </view>
                </view>
                <view class="attr">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}
                </view>
                <!-- //数量加减 -->
                <view class="number-item">
                  <view class="selnum">
                    <view class="cut" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="cutNumber"></view>
                    <input value="{{item.number}}" class="number" disabled="true" type="number" />
                    
                    <image class="add2" src="{{item.number < item.stockNum ? '/static/images/service-hsjh.png':'/static/images/service-ehsjh.png'}}" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" catchtap="{{item.number < item.stockNum ?  'addNumber' : ''}}"></image>
                    
                  </view>
                </view>
                <view class="handle">
                  <image catchtap="deleteCart" data-cart-id="{{item.id}}" data-goods-name="{{item.goods_name}}" class="del" src="/static/images/del-address.png"></image>
                </view>
              </view>
            </view>
          </view>
   

          <view wx:if="{{cartGoods11.length != 0}}" class="checkbox-biz-type {{checkedTypeStatus11 ? 'checked' : ''}}" bindtap="checkedAllGoodType" data-goods-Biz-Type="11">
            <image src="../../../static/images/service-ptsp.png" class="search-icon-shop"></image>
            <text class="title-name">普通商品</text>
          </view>

          <view class="item" wx:for="{{cartGoods}}" wx:if="{{item.goodsBizType == 11}}" wx:key="{{item.id}}">
            <view class="checkbox {{item.checked ? 'checked' : ''}}" bindtap="checkedItem" data-item-index="{{index}}"></view>
            <view class="cart-goods">
              <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                <image class="img" src="{{item.list_pic_url}}"></image>
              </navigator>
              <view class="info">
                <view class="t">
                  <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                    <text class="name">{{item.goods_name}}</text>
                  </navigator>
                  <view class="goods-do">
                    <text class="price">￥{{item.retail_price}}</text>
                    <text class="org-price line-through">￥{{item.market_price}}</text>
                  </view>
                </view>
                <view class="attr">{{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}
                </view>
                <view class="number-item">
                  <view class="selnum">
                    <view class="cut" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" bindtap="cutNumber"></view>
                    <input value="{{item.number}}" class="number" disabled="true" type="number" />
                   
                    <image class="add2" src="{{item.number < item.stockNum ? '/static/images/service-hsjh.png':'/static/images/service-ehsjh.png'}}" data-goods-id="{{item.id}}" data-item-index="{{index}}" data-product-id="{{item.product_id}}" catchtap="{{item.number < item.stockNum ?  'addNumber' : ''}}"></image>
                    
                  </view>
                </view>
                <view class="handle">
                  <image catchtap="deleteCart" data-cart-id="{{item.id}}" data-goods-name="{{item.goods_name}}" class="del" src="/static/images/del-address.png"></image>
                </view>
              </view>
            </view>
          </view>

          </view>
      </view>
    </view>

    <view class="list" wx:if="{{validCartList.length > 0}}">
      <view class="group-item">
        <view style='margin-left: 8rpx;margin-top: 8rpx;float:left;width:166px;'>
          <text style='font-size:24rpx;color:rgba(87, 86, 86, 0.63);'>失效宝贝{{validCartList.length}}件</text>
        </view>
        <view style='float:right;width:90px;margin-top: 8rpx;' bindtap='deleteValidCart'>
          <text style='font-size:24rpx;color:red;'>清空失效宝贝</text>
        </view>
        <view class="goods">
          <view class="item" wx:for="{{validCartList}}" wx:key="{{item.id}}">
            <view class="shixiao">失效</view>
            <view class="cart-goods">
              <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                <image class="img" src="{{item.list_pic_url}}"></image>
              </navigator>
              <view class="info">
                <view class="t">
                  <navigator url="/pages/goods/goods?id={{item.goods_id}}">
                    <text class="name" style='color:rgba(87, 86, 86, 0.63);'>{{item.goods_name}} {{null==item.goods_specification_name_value?"":item.goods_specification_name_value}}</text>
                  </navigator>
                </view>
                <view class="number-item-text">
                  商品已不能购买，请联系卖家
                </view>
                <!-- <view class="handle">
                  找相似
                </view> -->
              </view>
            </view>
          </view>
          </view>
      </view>
    </view>

    <view class="a-guess" wx:if="{{footprintList.length > 0}}">
      <view class="h">
        <view>
          <text class="txt">猜你喜欢</text>
        </view>
      </view>
      <view class="b">
        <block wx:for="{{footprintList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="unique">
          <navigator wx:if="{{iitem.retail_price > 0}}" class="item {{iindex % 2 == 0 ? 'item-b' : '' }}" url="../goods/goods?id={{iitem.goods_id}}">
            <image class="img2" src="{{iitem.list_pic_url}}" background-size="cover"></image>
            <text class="name">{{iitem.name}}</text>
            <view class="price" data-goods-id="{{iitem.goods_id}}" catchtap='addCart' >￥{{iitem.retail_price}}
              <image data-goods-id="{{iitem.goods_id}}" catchtap='addCart' class="cart" src="/static/images/cart.png" background-size="cover"></image>
            </view>
          </navigator>
        </block>
      </view>

       <view wx:if="{{openAttr}}" class="attr-pop">
              <view class="attr-close" bindtap="switchAttrPop">X</view>
              <view class="img-info">
                <image class="img" src="{{goodsVo.list_pic_url}}"></image>
                <view class="info">
                  <view class="c">
                    <view class="p">价格：￥{{goodsVo.retail_price}}</view>
                    <view class="a" wx:if="{{productList.length>0}}">已选择：{{checkedSpecText}}</view>
                  </view>
                </view>
              </view>
              <view class="spec-con">
                <view class="spec-item" wx:for="{{specificationList}}" wx:key="{{item.specification_id}}"  wx:for-index="itemIndex">
                  <view class="name">{{item.name}}</view>
                  <view class="values">
                    <view class="value {{vitem.checked ? 'selected' : ''}}" bindtap="clickSkuValue" wx:for="{{item.valueList}}" wx:for-item="vitem" wx:key="{{vitem.id}}"   data-index="{{itemIndex}}"
                     data-value-id="{{vitem.id}}" data-name-id="{{vitem.specification_id}}">{{vitem.value}}</view>
                  </view>
                </view>

                <view class="number-item">
                  <view class="name">数量</view>
                  <view class="selnum">
                    <view class="cut" bindtap="cutNumber2">-</view>
                    <input value="{{number}}" class="number" disabled="true" type="number" />
                    <view class="{{number+cartNumber>= stockNum? 'addEnabel':'addCart'}}" bindtap="{{number+cartNumber>= stockNum ? '':'addNumber2'}}">+</view>
                  </view>
                </view>
              </view>
                <view class="bottom-btn">
               <view class="r" bindtap="addToCart">加入购物车</view>
                </view>
            </view>
    </view>

    <view class="cart-bottom">
      <view class="checkbox {{checkedAllStatus ? 'checked' : ''}}" bindtap="checkedAll">全选({{cartTotal.checkedGoodsCount}})</view>
      <view class="total">{{'￥'+cartTotal.checkedGoodsAmount}}</view>
      <view class="checkout" bindtap="checkoutOrder" wx:if="{{!isEditCart}}">下单</view>
    </view>
  </view>
</view>