<!--packageE/orderullPackage/orderullPackage.wxml-->
<!-- 满额包邮 -->
<page-meta page-style="{{ showCarList ? 'overflow: hidden;' : '' }}" />
<view id="full_package">
  <van-sticky>
    <view class="flex-main top-category">
      <view class="category-child {{activeCat == item.id?'active-class':''}}" wx:for="{{categoryList}}"
        catchtap="changeCategory" data-id="{{item.id}}">{{ item.name }}</view>
    </view>
    <view class="flex-main">
      <view class="sort-child {{activeSort == item.value?'active-class':''}}" wx:for="{{sortOption}}"
        catchtap="changeSort" data-value="{{item.value}}">{{ item.name }}</view>
    </view>
  </van-sticky>

  <block wx:for="{{goodList}}">
    <good-cell item="{{item}}" index="{{index}}" bind:add="addCart" bind:show="showGoodDetail"
      bind:change="changeCart"></good-cell>
  </block>
  <view wx:if="{{goodList.length == 0}}" style="padding: 150rpx 0 0;text-align: center;">该分类暂无商品 ~</view>

  <view class="bottom-fixed-button" catchtap="openCartListPopup">
    <block wx:if="{{freight && freight > 0}}">
      还差<em style="color:#f15053;"> {{ freight }} </em>元可免运费
    </block>
    <block wx:if="{{freight == 0}}"> 已免运费 </block>
    <view class="button">
      去结算<em class="carts-num">{{ cartsNum }}</em>
    </view>
  </view>

  <!-- 购物车列表弹窗 -->
  <yz-cartList show="{{showCarList}}" cardata="{{cartList}}" bind:cartInputBlur="changeCarList"
    bind:addCart="changeCarList" bind:reduceCart="changeCarList" bind:popupcartListbtn="close_yz_cartList_popup">
    <!-- 底部购物车 -->
    <view class="bottom-car set-pc-styleLeft" slot="button">
      <view class="car-box">
        <view class="car-num" catchtap="showCarList = false">
          <view class="car-num-box">
            <i class="iconfont icon-all_buycar" style="font-size: 32px;"></i>
            <view class="carnum-style">{{ cartsNum }}</view>
          </view>

          <!-- <view class="small-price">{{ $i18n.t("money") }}</view> -->
          <block wx:if="{{freight && freight > 0}}">
            还差<em style="color:#f15053;"> {{ freight }} </em>元可免运费
          </block>
          <block wx:if="{{freight == 0}}"> 已免运费 </block>
        </view>
        <view class="car-add" catchtap="checkGoods">去结算</view>
      </view>
    </view>
  </yz-cartList>
  <!-- 购物车结算配送方式冲突 -->
  <van-popup show="{{showChoose}}" round close-on-click-overlay="true"
    custom-style="width: 600rpx;border-radius: 30rpx;">
    <view class="wrapper">
      <view class="block">
        <view class="choose-title">
          您的购物车配送方式有冲突，请选择其中一种配送方式~
        </view>

        <view class="choose-content">
          <van-radio-group value="{{radioChoose}}" bind:change="typeChange">
            <view wx:for="{{dispatch_types}}" wx:for-item="item" wx:for-index="idx" wx:key="idx"
              style="padding: 20rpx 0;">
              <van-radio name="{{idx}}" checked-color="#ff4949">
                <view class="radio-title">{{item.name}}({{item.member_carts.length}}件)</view>
              </van-radio>
              <view class="radio-list ul">
                <view class="radio-item li" wx:for="{{item.member_carts}}" wx:for-item="goods" wx:for-index="i"
                  wx:key="{{i}}">
                  <view class="p">{{goods.title}}</view>
                  <view class="p" wx:if="{{goods.option_title}}" style="font-size: 12px;color: #666666;">
                    规格：{{goods.option_title}}</view>
                </view>
              </view>
            </view>
          </van-radio-group>
        </view>

        <view class="buttons">
          <view class="button-item">
            <view class="button-content" catchtap="closeChoose">返回</view>
          </view>
          <view class="button-item">
            <view class="button-content red" catchtap="toOrder">去结算</view>
          </view>
        </view>
      </view>
    </view>
  </van-popup>

  <!-- 商品详情页弹窗 -->
  <yz-goodsPopup show="{{showgp}}" bind:addCart="showgoodspecs" goodsInfo="{{goodinfo}}"></yz-goodsPopup>
  <!-- 商品规格弹窗 -->

  <block wx:if="{{popupSpecs}}">
    <yz-specs goodsInfo="{{goodinfo}}" cartList="{{categoryList}}" popupSpecs="{{popupSpecs}}"
      bind:closeSpecsPopup="close_yz_specs_popup"></yz-specs>
  </block>
</view>