<page-meta page-style="{{ cartListShow ? 'overflow: hidden;' : '' }}" />
<view class="fixedPrice" wx:if="{{status!='3'}}">
  <view class="top" wx:if="{{info.rule=='0'}}">
    <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/bgimg.png"></image>
    <view class="text">
      <view style="margin-bottom:30rpx;font-size:32rpx;">以下商品{{info.pack_price}}元任选{{info.goods_count}}件</view>

      <view style="font-size:26rpx;display:flex;" wx:if="{{status==='2'}}">

        距离活动结束还剩{{rest_time.day}}天
        <view class="block" style="margin-left:20rpx;display:flex;">
          <view class="item">
            {{rest_time.hours}}
          </view>
          <view style="margin:0 10rpx;">:</view>
          <view class="item">
            {{rest_time.minutes}}
          </view>
          <view style="margin:0 10rpx;">:</view>
          <view class="item">
            {{rest_time.seconds}}
          </view>
        </view>

      </view>
      <view style="font-size:26rpx;display:flex;" wx:if="{{status==='1'}}">
        距开抢{{rest_time.day}}天
        <view class="block" style="margin-left:20rpx;display:flex;">
          <view class="item">
            {{rest_time.hours}}
          </view>
          <view style="margin:0 10rpx;">:</view>
          <view class="item">
            {{rest_time.minutes}}
          </view>
          <view style="margin:0 10rpx;">:</view>
          <view class="item">
            {{rest_time.seconds}}
          </view>
        </view>

      </view>
    </view>
    <view class="rule" bindtap="open">
      规则详情
      <i class="iconfont icon-advertise-next"></i>

    </view>
  </view>
  <view class="ohter" wx:if="{{info.rule=='1'}}">
    <image src="{{info.custom_thumb_url}}"></image>
    <view class="rule" style="margin-bottom:29rpx;">
      <view style="display:flex;" wx:if="{{status==='2'}}">
        <view>距离活动结束还剩</view>
        <view style="margin-left:20rpx;color: #f14e4e;">{{rest_time.day}}天</view>
        <view class="block" style="margin-left:20rpx;display:flex;">
          <view class="item">
            {{rest_time.hours}}
          </view>
          <view style="margin:0 10rpx;">:</view>
          <view class="item">
            {{rest_time.minutes}}
          </view>
          <view style="margin:0 10rpx;">:</view>
          <view class="item">
            {{rest_time.seconds}}
          </view>

        </view>

      </view>
      <view style="display:flex;" wx:if="{{status==='1'}}">
        <view>距开抢</view>
        <view style="margin-left:20rpx;color: #f14e4e;">{{rest_time.day}}天</view>
        <view class="block" style="margin-left:20rpx;display:flex;">
          <view class="item">
            {{rest_time.hours}}
          </view>
          <view style="margin:0 10rpx;">:</view>
          <view class="item">
            {{rest_time.minutes}}
          </view>
          <view style="margin:0 10rpx;">:</view>
          <view class="item">
            {{rest_time.seconds}}
          </view>

        </view>

      </view>
      <view style="color: #999999;display:flex;align-items:center;" bindtap="open">规则详情
        <i class="iconfont icon-advertise-next"></i>
      </view>
    </view>
  </view>
  <view class="goodlist" :style="{info.rule=='0'?marginTop:-80rpx:0;}">
    <view wx:for="{{list}}" class="good" wx:index="index" wx:key="index">
      <view class="left">
        <image src="{{item.thumb}}" bindtap="openGoodsDetail" data-item="{{item}}"></image>
      </view>
      <view class="right">
        <view class="good-title">{{item.title}}</view>
        <view class="bottom">
          <view class="cash">
            <text style="font-size:24rpx;">{{language['money']}}</text>{{item.price}}
          </view>
          <view class="select" wx:if="{{item.has_option==0}}">
            <icon bindtap="reduceCartNum" wx:if="{{goodsCartsTotal[item.id] && goodsCartsTotal[item.id].total>0}}" data-cartid="{{goodsCartsTotal[item.id].id}}" data-item="{{item}}" class="iconfont icon-life-game-sign"></icon>
            <input bindblur="updateCartNum" data-cartid="{{goodsCartsTotal[item.id].id}}" data-item="{{item}}" wx:if="{{goodsCartsTotal[item.id] && goodsCartsTotal[item.id].total>0}}" type="number" value="{{goodsCartsTotal[item.id].total}}" style="width:50rpx;text-align:center;+"
            />
            <icon bindtap="addCartNum" data-item="{{item}}" data-cartid="{{goodsCartsTotal[item.id].id}}" confirm-type="done" class="iconfont icon-life-game-plus"></icon>
          </view>
          <view class="select" wx:if="{{item.has_option==1}}" bindtap="openSpecs" data-item="{{item}}">
            <view class="option-text-btn">选规格
              <text class="num" wx:if="{{goodsCartsTotal[item.id]}}">{{ goodsCartsTotal[item.id].total }}</text>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
  <view>

  </view>
  <view class="fixed-btn" wx:if="{{!specsShow}}">

    <view class="left">
      <view style="position:absolute;" bindtap="openCartListPopup">
        <icon class="iconfont icon-all_buycar" style="font-size: 64rpx;color: #f14e4e;"></icon>
        <view class="num" style="position:absolute;right:0;top:-10rpx;padding:0 10rpx;min-height:30rpx;text-align:center;background: #f14e4e;color: #fff;border-radius:50%;">
          {{cartsNum}}
        </view>
      </view>
      <view style="margin-left:80rpx;text-align:left;">
        <view>
          <text style="font-size: 32rpx;">合计：</text>
          <text style="font-size: 30rpx;color: #f14e4e;">{{language['money']}}{{cartsTotal}}</text>
          <image bindtap="openTip" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/actips.png" style="width: 23rpx;height: 24rpx;display:inline-block;margin-left:10rpx;"></image>
        </view>

        <view wx:if="{{cartsNum<=0}}">赶快选购商品参与促销活动吧</view>
        <view wx:if="{{cartsNum - info.goods_count < 0 && cartsTotal != 0}}">
          再买{{ info.goods_count - cartsNum }}件,下单立享【{{ info.pack_price }}元任选{{ info.goods_count }}件】
        </view>
        <view wx:if="{{cartsNum>=info.goods_count}}" style="color:#f14e4e;">条件已满足</view>
      </view>
      <!-- <view>再买2件，下单立享【{{info.pack_price}}元任选{{info.goods_count}}件】</view> -->
    </view>
    <view class="right" bindtap="checkGoods">去结算</view>
  </view>
  <van-popup show="{{tipShow}}" position="bottom" bind:close="close" custom-style="background-color: transparent">
    <view class="pop">
      <view class="title">
        提示
        <i catchtap="closeTip" class="iconfont icon-adsystem_icon_cancle"></i>
      </view>
      <view class="tips" style="color: #202020;font-size:34rpx;">
        合计金额及提示仅为初步预估，请以最终下单金额为准"
      </view>
      <view class="know" catchtap="closeTip">我知道了</view>
    </view>
  </van-popup>
  <yz-goodsPopup show="{{goodsPopupShow}}" bind:addCart="goodsDetailCartAdd" goodsInfo="{{hand_goods_obj}}" status="{{status}}"></yz-goodsPopup>
  <yz-cartList show="{{cartListShow}}" cardata="{{carList}}" bind:cartInputBlur="cartListInputBlur" bind:addCart="cartListAdd" bind:reduceCart="cartListReduce" bind:popupcartListbtn="close_yz_cartList_popup">
  </yz-cartList>
  <van-popup show="{{show}}" position="bottom" bind:close="close" custom-style="background-color: transparent">
    <view class="pop">
      <view class="title">
        规则详情
        <i catchtap="close" class="iconfont icon-adsystem_icon_cancle"></i>
      </view>
      <view class="time" style="margin-bottom:20rpx;">
        <view style="margin-bottom:20rpx;font-size:30rpx;">活动时间</view>
        <view>{{info.start_time}} 至 {{info.end_time}}</view>
      </view>
      <view class="content" style="margin-bottom:20rpx">
        <view style="margin-bottom:20rpx;font-size:30rpx;">活动内容</view>
        <view>1、活动范围内，任选{{info.goods_count}}件仅需{{info.pack_price}}元</view>
        <view>2、此优惠卷可无限叠加，买的越多优惠越多</view>
      </view>
      <view class="add" style="margin-bottom:20rpx">
        <view style="margin-bottom:20rpx;font-size:30rpx;">优惠叠加</view>
        <view>不可以与其他优惠互动同时使用</view>
      </view>
    </view>
  </van-popup>
  <van-popup show="{{tipShow}}" position="bottom" bind:close="close" custom-style="background-color: transparent">
    <view class="pop">
      <view class="title">
        提示
        <i catchtap="closeTip" class="iconfont icon-adsystem_icon_cancle"></i>
      </view>
      <view class="tips" style="color: #202020;font-size:34rpx;">
        合计金额及提示仅为初步预估，请以最终下单金额为准"
      </view>
      <view class="know" catchtap="closeTip">我知道了</view>
    </view>
  </van-popup>
  <view class="share-wrap">
    <block wx:if="{{icon}}" >
        <view class="share" style="width:100rpx;height:100rpx;margin-bottom:15rpx;color:#fff;" bindtap="toMember">会员中心</view>
      <view class="share" style="width:100rpx;height:100rpx;margin-bottom:15rpx;color:#fff;" bindtap="toIndex">主页</view>
      <view class="share" catchtap="openShare" style="width:100rpx;height:100rpx;margin-bottom:15rpx;color:#fff; ">分享</view>
    </block>
    <view class="share" >
      <image  bindtap="changeIcon" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/more_btn.png" style="width:40rpx;height:40rpx" wx:if="{{!icon}}"></image>
       <image bindtap="closeIcon" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/close_btn.png" style="width:40rpx;height:40rpx" wx:if="{{icon}}"></image>
    </view>
  </view>
  <van-popup show="{{share}}" position="bottom" bind:close="close" custom-style="background-color: transparent">
    <view class="sharepop">
      <view class="title">
        立即分享给好友

      </view>
      <view class="icon-wrap">
        <view class="icon">
          <image catchtap="copy" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/copy_link.png" style="width: 87rpx;height: 87rpx;"></image>
          <text style="font-size: 26rpx;margin-top:21rpx;">复制链接</text>
        </view>
        <view class="icon">
          <image catchtap="openposter" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/create_poster.png" style="width: 87rpx;height: 87rpx;"></image>
          <text style="font-size: 26rpx;margin-top:21rpx;">分享海报</text>
        </view>
        <view class="icon" style="position:relative;">
          <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/share_wechat.png" style="width: 87rpx;height: 87rpx;"></image>
          <text style="font-size: 26rpx;margin-top:21rpx;">微信</text>
          <button open-type="share" style="width:83rpx;height:83rpx;position:absolute;opacity:0;top:0;"></button>
        </view>
        <view class="line" style="width:100%;height:10rpx;background:#7f7f7f;margin-top:20rpx;"></view>
        <view class="cancel" catchtap="closeShare">
          取消
        </view>
      </view>
    </view>
  </van-popup>
  <van-popup show="{{poster}}" closeable close-on-click-overlay="true" bind:close="posterClose" custom-style="background:none;" class="posterPopup_style" position="bottom">
    <view class="code_box">
      <image wx:if="{{info.applets_poster}}" src="{{info.applets_poster}}" mode='widthFix' />
      <image wx:if="{{!info.applets_poster}}" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/img_default.png" mode='widthFix' />
    </view>
    <view class="icon_btn">
      <view class="box" catchtap='previewImage'>
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/images/poster_share.png" />
        <text>分享好友</text>
      </view>
      <view class="box" catchtap='saveImg'>
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/images/poster_save.png" />
        <text>保存海报</text>
      </view>
    </view>
    <!-- 关闭图标 -->
    <view class="icon_close" style="{{iPnoneBottomBol?'padding-bottom: 34px;':''}}" catchtap="closeposter">取消</view>
  </van-popup>
  <van-popup show="{{showChoose}}" round close-on-click-overlay="true" custom-style="width: 600rpx;border-radius: 30rpx;">
    <view class="wrapper">
      <view class="block-box">
        <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="submitGoods">去结算</view>
          </view>
        </view>
      </view>
    </view>
  </van-popup>
  <block wx:if="{{specsShow}}">
    <yz-specs goodsInfo="{{hand_goods_obj}}" cartList="{{carList}}" popupSpecs="{{specsShow}}" bind:closeSpecsPopup="close_yz_specs_popup"></yz-specs>
  </block>


</view>
<view class="noac" wx:else>
  <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/acend.png" />
  <view style="margin-top:52rpx;font-size:38rpx;">活动已结束</view>
  <view class="btn" bindtap="toIndex">去逛逛</view>
</view>