<!--packageH/blindBox/blindBoxDetail/blindBoxDetail.wxml-->
<wxs module="isNumber">
  function get(time, now) {
    let num = time - now * 1000
    return num;
  }

  module.exports = get;
</wxs>
<view class="head {{activity.top_img_src?'':'headMr'}}" >
  <image src="{{activity.top_img_src}}" mode="widthFix" wx:if="{{activity.top_img_src}}"></image>
  <view class="titleBox" wx:if="{{activity.title_show == 1}}">
    <view class="isTitle">{{ activity.activity_name }}</view>
  </view>
</view>
<view class="postionBtn">
  <view class="posBtn" catchtap="goOrder" style="background-color: {{activity.background_color}};">我的订单</view>
  <view class="posBtn" style="margin-top:15rpx;background-color: {{activity.background_color}};" catchtap="contactShowTap">联系商家</view>
</view>
<view class="contenBox" style="background: {{activity.background_color}};">
  <view class="countDown" wx:if="{{activity.activity_start > currentTime}}"
    style="color: {{activity.background_color}});">开始倒计时
    <van-count-down time="{{(activity.activity_start - currentTime) * 1000}}" class="countDownText"
      style="--iscolor--:{{activity.background_color}};" format="DD天HH时mm分ss秒">
    </van-count-down>
  </view>
  <view class="countDown" style="color: {{activity.background_color}};"
    wx:elif="{{activity.activity_end > currentTime}}">结束倒计时
    <van-count-down time="{{(activity.activity_end - currentTime) * 1000}}" class="countDownText"
      style="--iscolor--:{{activity.background_color}};" format="DD天HH时mm分ss秒">
    </van-count-down>
  </view>
  <view class="countDown" style="color: {{activity.background_color}};" wx:else>活动已结束</view>
  <view class=" poster_pay" catchtap="getPoster">
    <view class="lineBorder" style="border: 1rpx solid {{activity.background_color}};">
      <icon class="iconfont icon-fontclass-tishi" style="color: {{activity.background_color}};"></icon>
      <view class="text">海报</view>
    </view>
  </view>
  <view class="poster" catchtap="seeTips" wx:if="{{luckdrawCountDown > 0}}">
    <view class="lineBorder" style="border: 1rpx solid {{activity.background_color}};">
      <icon class="iconfont icon-fontclass-tishi1" style="color: {{activity.background_color}};"></icon>
      <view class="text">提示</view>
      <view class="num" wx:if="{{activity.tips - activity.tips_count > 0}}">{{ activity.tips - activity.tips_count }}
      </view>
    </view>
  </view>
  <!-- {{gifShow?'blindBoxGif':'blindBox'}} -->
  <view class="{{gifShow?'blindBoxGif':'blindBox'}}"></view>
  <!-- <view class="blindBoxGif"></view>
  <view class="blindBox"></view> -->

  <view class="blindBoxTap {{luckdrawCountDown <= 0?'disabled':''}}"
    wx:if="{{isBlindBoxTap && currentTime<activity.activity_end && currentTime > activity.activity_start}}"
    catchtap="startLuckDraw">
    {{ activity.activity_type == 0 ? "抽取盲盒" : "免费抽取" }}
    <view style="letter-spacing: 0;" wx:if="{{luckdrawCountDown > 0}}">({{ luckdrawCountDown }}S)</view>
  </view>

  <!-- 已结束 -->
  <view class="blindBoxTap disabled" wx:elif="{{currentTime < activity.activity_start}}">活动未开始</view>
  <!-- end -->
  <!-- 已结束 -->
  <view class="blindBoxTap disabled" wx:elif="{{currentTime > activity.activity_end}}">活动已结束</view>
  <!-- end -->

  <!-- 付费盲盒 -->
  <!-- <view class="payBox" wx:if="{{isBlindBoxTapPay}}">
    <view class="blindBoxTapPay" catchtap="gotoOrder">立即购买￥{{ activity.price }}</view>
  </view> -->
  <!-- <view class="txtPay" wx:if="{{isBlindBoxTapPay}}" catchtap="onceMore">再抽一次</view> -->
  <!-- end -->
  <!-- <view class="invitePlanBox" wx:if="{{isAddress}}" catchtap="gotoOrder">填写地址</view> -->
  <!-- 邀请好友进度 -->
  <view class="invitePlan" wx:if="{{isInvitePlan}}">
    <view class="invitePlanBox" wx:if="{{assist.status != 1}}" catchtap="shareWeixin">
      <view>再邀请{{ assist.invitation - assist.assist_log_count }}位好友</view>
      <view>可免费抽取</view>
      <button open-type="share" class="posShareBtn"></button>
    </view>
    <view class="invitePlanBox" wx:if="{{assist.status == 1}}" catchtap="freePrize">免费抽取</view>
    <view class="inviteTime" wx:if="{{assist.status != 1}}">
      <view class="inviteTimeR">
        <van-count-down use-slot time="{{ (assist.expire - currentTime) * 1000 }}" finish="timeEnd"
          bind:change="onChange">
          <text class="item">{{ timeData.hours<10?'0' + timeData.hours: timeData.hours}}:</text>
          <text class="item">{{ timeData.minutes<10?'0' + timeData.minutes: timeData.minutes}}:</text>
          <text class="item">{{ timeData.seconds<10?'0' + timeData.seconds: timeData.seconds }}</text>
        </van-count-down>
      </view>后消失
    </view>
  </view>
  <!-- end -->
  <!-- 进度详情 -->
  <view class="planDetail" wx:if="{{isInvitePlan}}">
    <view class="isPlan">好友进度{{ assist.assist_log_count }}/{{ assist.invitation }}人</view>
    <view class="isPlanConten">
      <view class="fans">
        <block wx:if="{{assist.assist_log.length > 0}}">
          <view class="fansUser" wx:for="{{assist.assist_log}}" wx:key="index">
            <image src="{{item.member.avatar_image}}"></image>
            <view class="fansName">{{ item.member.nickname }}</view>
          </view>
        </block>
        <view class="planNot" wx:else>暂无好友助力~</view>
      </view>
    </view>
  </view>
  <!-- end -->
  <!-- 可能抽中的盲盒 -->
  <view class="maybeIcon">
    <view class="circle" style="width: 6rpx;height: 6rpx;"></view>
    <view class="circle" style="width: 10rpx;height: 10rpx;margin-left:0;margin-right:14rpx;"></view>
    <view class="circle" style="width: 13rpx;height: 13rpx;margin-left:0;margin-right:14rpx;"></view>
    可能抽中的盲盒
    <view class="circle" style="width: 13rpx;height: 13rpx;"></view>
    <view class="circle" style="width: 10rpx;height: 10rpx;margin-left:0;margin-right:14rpx;"></view>
    <view class="circle" style="width: 6rpx;height: 6rpx;margin-left:0;margin-right:14rpx;"></view>
  </view>
  <view class="shopBox">
    <block wx:if="{{activity.pattern == 0}}">
      <view class="shoplist" wx:for="{{goods}}" wx:key="index" catchtap="openGoodsDetailsPopup" data-item="{{item}}">
        <view class="shopImg">
          <image src="{{item.goods.thumb_src}}"></image>
        </view>
        <view class="shopBottom">
          <view class="shopTxt">{{ item.goods.title }}</view>
          <view class="price">￥{{ item.goods.price }}</view>
        </view>
      </view>
    </block>
    <block wx:if="{{activity.pattern == 1}}">
      <view class="shoplist" wx:for="{{goods}}" wx:key="index" catchtap="seeCombinationGoods" data-item="{{item}}">
        <view class="shopImg">
          <image src="{{item.thumb_src}}"></image>
        </view>
        <view class="shopBottom">
          <view class="shopTxt">{{ item.combination.combination_name }}</view>
          <view class="price">￥{{ item.combination.price }}</view>
        </view>
      </view>
    </block>
  </view>
  <!-- <view class="tapMore">查看更多<icon class="iconfont icon-member-bottom"></icon> -->
  <!-- 活动规则 -->
  <view class="rule" wx:if="{{activity.activity_rule}}">
    <view class="ruleBox">
      <view class="circle" style="width: 6rpx;height: 6rpx;"></view>
      <view class="circle" style="width: 10rpx;height: 10rpx;margin-left:0;margin-right:14rpx;"></view>
      <view class="circle" style="width: 13rpx;height: 13rpx;margin-left:0;margin-right:14rpx;"></view>
      活动规则
      <view class="circle" style="width: 13rpx;height: 13rpx;"></view>
      <view class="circle" style="width: 10rpx;height: 10rpx;margin-left:0;margin-right:14rpx;"></view>
      <view class="circle" style="width: 6rpx;height: 6rpx;margin-left:0;margin-right:14rpx;"></view>
    </view>
    <view class="ruleTxt">
      <rich-text nodes="{{activity.activity_rule}}"></rich-text>
    </view>
    <!-- <view class="ruleLine"></view>
    <view class="ruleLine" style="width: 575rpx;"></view> -->
  </view>
  <!-- end -->
</view>
<!-- end -->


<!--  (单个商品) -->
<van-popup show="{{singlePopupInfo.show}}" bind:click-overlay="singlePopupInfoTap"
  custom-style="background-color:transparent;display: flex;justify-content: center;flex-direction: column;align-items: center;">
  <view class="freeHint" style="height:480rpx;background-color: {{activity.background_color}};" wx:if="{{singlePopupInfo.show}}">
    <view style="margin-bottom:35rpx;margin-top:40rpx;font-size: 40rpx;color: #ffffff;">{{ singlePopupInfo.title }}
    </view>
    <view class='freeHintShop'>
      <image src="{{singlePopupInfo.info.goods.thumb_src}}"
        wx:if="{{singlePopupInfo.info && singlePopupInfo.info.pattern == 0}}"></image>
      <image src="{{singlePopupInfo.info.combination.combination_img_src}}"
        wx:if="{{singlePopupInfo.info && singlePopupInfo.info.pattern == 1}}"></image>
    </view>
  </view>
  <icon class="iconfont icon-adsystem_icon_cancle" style="color:#fff;font-size: 60rpx;" catchtap="singlePopupInfoTap">
  </icon>
</van-popup>
<!-- end -->
<!-- （包含商品） -->
<van-popup show="{{multiplePopupInfo.show}}" bind:click-overlay="multiplePopupInfoTap"
  custom-style="background-color:transparent;display: flex;justify-content: center;flex-direction: column;align-items: center;">
  <view class="freeHint" style="width:604rpx;height:598rpx;background-color: {{activity.background_color}};" wx:if="{{multiplePopupInfo.show}}">
    <view class="freeTxt">包含以下商品</view>
    <view class="goodsWrapper" >
      <view class="goodsItem" wx:for="{{multiplePopupInfo.info.combination_goods}}" wx:key="{{item.id}}" catchtap="openGoodsDetailsPopup" data-item="{{item}}">
        <view class="goods_img">
          <image src="{{item.goods.thumb_src}}" alt="" ></image>
        </view>
        <view class="content">
          <view class="name">{{ item.goods.title }}</view>
          <view class="price">{{ item.goods.price }}</view>
        </view>
      </view>
    </view>
    <!-- <view style="margin-bottom:35rpx;margin-top:40rpx;font-size: 40rpx;color: #ffffff;">{{ multiplePopupInfo.title }}
    </view>
    <view class='freeHintShop'>
      <image src="{{multiplePopupInfo.info.combination_img_src}}"></image>
    </view>
    <view class="freeTxt">包含以下商品</view>
    <view class="relevance">
      <view class="relevanceList" style="border: solid 1rpx {{activity.background_color}};" wx:for="{{multiplePopupInfo.info.combination_goods}}" wx:key="index">
        <image src="{{item.goods.thumb_src}}" catchtap="openGoodsDetailsPopup" data-item="{{item}}"></image>
      </view>
    </view> -->
  </view>
  <icon class="iconfont icon-adsystem_icon_cancle" style="color:#fff;font-size: 60rpx;" catchtap="multiplePopupInfoTap"
    wx:if="{{multiplePopupInfo.show}}">
  </icon>
</van-popup>
<!-- end -->
<!-- 联系商家 -->
<van-popup show="{{contactShow}}" bind:click-overlay="contactShowClose"
  custom-style="background-color:transparent;display: flex;justify-content: center;flex-direction: column;align-items: center;">
  <view class="freeHint" style="height:480rpx;">
    <view class="merchant">
      <image src="{{activity.cservice_code_src}}" catchtap="previewImage"></image>
    </view>
    <view class="merchantTxt">长按识别二维码联系我们</view>
    <view class="blindBoxContact" catchtap="callPhone"></view>
  </view>
  <icon class="iconfont icon-adsystem_icon_cancle" style="color:#fff;font-size: 60rpx;" catchtap="contactShowClose">
  </icon>
</van-popup>
<!-- end -->
<!-- 好友助力成功弹窗 -->
<van-popup show="{{friendsShow}}"
  custom-style="background-color:transparent;display: flex;justify-content: center;flex-direction: column;align-items: center;">
  <view class="freeHint" style="height:480rpx;">
    <view class="helpTxt">
      <van-checkbox value="checked" bind:change="onChange" checked-color="#d72c11" icon-size="10px"></van-checkbox>
      好友助力成功
    </view>
    <view class="help">
      <image src=""></image>
    </view>
    <view class="helpText">恭喜您获得 <view class="helpTextD"> 免费抽取盲盒 </view> 的机会</view>
    <view class="introduction">《查看活动》</view>
    <view class="invite"></view>
  </view>
  <icon class="iconfont icon-adsystem_icon_cancle" style="color:#fff;font-size: 60rpx;"></icon>
</van-popup>

<!-- end -->
<!-- 查看盲盒 -->
<van-overlay show="{{seePrizeShow}}" bind:click="seePrizeShowTap">
  <view style="display: flex; align-items: center; justify-content: center; height: 100%;">
    <view class="popupWrapper " style="perspective: 1000rpx; width: 580rpx; height: 835.008rpx;">
      <view class="seePrizeWrapper {{seePrizeAnimation?'active':''}}">
        <view class="posCheckBtn {{order_ids?'orderInclass':''}}">
          <view class="checkBtn" wx:if="{{order_ids}}">查看盲盒商品</view>
          <view class="buyBtn"  wx:if="{{!order_ids && isBlindBoxTapPay}}" catchtap="gotoOrder">
            立即购买￥{{ activity.price }}
          </view>
          <view class="txtPay" wx:if="{{isBlindBoxTapPay && !order_ids}}" catchtap="onceMore">再抽一次</view>
          <block wx:if="{{assist.status == 1}}">
            <!-- <view class="invitePlanBox" wx:if="{{isAddress}}" catchtap="gotoOrder">填写地址</view> -->
            <view class="buyBtn"  wx:if="{{isAddress}}" catchtap="gotoOrder">
              填写地址
            </view>
          </block>
        </view>
      </view>
    </view>
  </view>
</van-overlay>

<!-- end -->

<!-- 商品规格弹窗 -->
<yz-goodsPopup show="{{goodsDetailsPopupInfo.show}}" bind:addCart="goodsDetailCartAdd"
  goodsInfo="{{goodsDetailsPopupInfo.info}}"></yz-goodsPopup>
<!-- end -->
<!-- 海报 -->
<van-overlay show="{{posterPopupInfo.show}}" bind:click="posterPopupInfoClose">
  <view style="display: flex; align-items: center; justify-content: center; height: 100%;">
    <view class="popupWrapper" wx:if="{{posterPopupInfo.show}}">
      <view class="posterWrapper">
        <image src="{{posterPopupInfo.src}}" catchtap="previewImagesss"></image>
      </view>
      <view class="close">
        <icon class="iconfont icon-adsystem_icon_cancle" catchtap="posterPopupInfoClose" style="font-size: 55rpx;">
        </icon>
      </view>
    </view>
  </view>
</van-overlay>
<!-- endF -->


<!-- <shopfoot></shopfoot> -->