<!--packageE/lottery/lottery.wxml-->
<view class="component-wrapper {{'component-'+ component_id}}"  style="--bgColor: {{datas.preview_color.color}};--tips_bg_color: {{datas.tips_bg_color}};--time_bg_color: {{datas.time_bg_color}};">
  <view class="lottery-box size-con" wx:if="{{datas.activity && datas.activity.id}}" style="background-color: {{datas.preview_color.color}}; background-image: url({{datas.preview_color.isColor == 2? datas.preview_color.image || emptyImage: ''}});background-size: 100% 100%;background-position: center;background-repeat: no-repeat;">
    <view class="activity-info">
      <view class="info">
        <view class="activity-name">{{activity.activity_name}}</view>
        <view class="count-down active">
          <view wx:if="{{activity.status == 0 && (currentTime < activity.activity_start)}}">距离活动开始还有</view>
          <view wx:elif="{{activity.status === 0 && (activity.activity_end > currentTime)}}">距离活动结束还剩</view>
          <view wx:else>活动已结束</view>
          <block wx:if="{{countTime}}">
            <van-count-down use-slot time="{{ countTime }}" bind:change="onChange">
              <view class="bottom-time">
                <text class="radius-box">{{ timeData.days }}</text>
                <text class="text">天</text>
                <text class="radius-box">{{ timeData.hours }}</text>
                <text class="text">:</text>
                <text class="radius-box">{{ timeData.minutes }}</text>
                <text class="text">:</text>
                <text class="radius-box">{{ timeData.seconds }}</text>
              </view>
            </van-count-down>
          </block>
        </view>
      </view>
      <!-- 商品信息 -->
      <view class="com-info" catchtap="toActivity">
        <image src="{{activity.bind_goods.thumb_src}}" class="com-left-img"></image>
        <view class="com-right-box">
          <view class="com-title">{{activity.bind_goods.title}}</view>
          <view class="com-opt"  wx:if="{{activity.bind_goods.has_option == 1}}" >
            规格：{{activity.goods_option.title}}
          </view>
          <view class="com-price">￥{{activity.bind_goods.price}}</view>
          <view class="com-deposit">
            <text style="line-height: 30px;">定金： ￥{{activity.deposit}}</text>
            <view class="num">
              <view class="reduce-goods" >-</view>
              <view class="good-num" >1</view>
              <view class="add-goods" >+</view>
            </view>
          </view>
        </view>
      </view>
    </view>

    <!-- 活动规则 -->
    <view class="activity-rule container-box">
      <view class="panel-title-decoration">
        <view class="panel-title-decoration-item"></view>
        <view class="panel-title-decoration-item"></view>
      </view>
      <view class="title">活动规则</view>
      <view class="panel-title-decoration">
        <view class="panel-title-decoration-item"></view>
        <view class="panel-title-decoration-item"></view>
      </view>


      <view class="steps_box">
        <!-- 进度条 -->
        <yz-progress wx:if="{{activity.status == 0 && (activity.activity_start <= currentTime) && (currentTime<= activity.activity_end )}}" steps="{{steps}}" tips_bg_color="{{datas.tips_bg_color}}" stepsList="{{ladderList}}"></yz-progress>

    </view>

      <block>
        <view class="rule-condition act-state {{index === 0 ? 'active' : ''}}"  wx:for="{{ladderList}}" wx:key="index">
          <view class="diff-tip" wx:if="{{steps === index && index !== ladderList.length - 1}}">
            <view class="current-ladder">当前梯队</view>
            <view style="line-height: 24px;" wx:if="{{activity.ladder_type === 0}}">
              还差<text>{{ladderList[index + 1].deal_num - activity.order_count}}</text>人可以进入下一梯队
            </view>
            <view style="line-height: 24px;" wx:else>
              还差<text>{{ladderList[index + 1].sale_num - activity.sale_count}}</text>件可以进入下一梯队
            </view>
          </view>
          <view>
            <text>{{(activity.ladder_type === 0)?'支付':'销售'}}</text>达到
            <text class="red-text">{{(activity.ladder_type === 0)?item.deal_num:item.sale_num}}</text>
            <text>{{activity.ladder_type === 0 ? '人':'件'}}</text>
            <text wx:if="{{index === 0}}">以下</text>，价格<text class="red-text">￥{{item.deal_price}}</text>
          </view>
        </view>
      </block>
    </view>

    <view class="btn-buy" catchtap="toActivity" style="background-color: {{datas.class_bg_color}}; border-radius: {{datas.class_border_radius}}px; font-size: {{datas.class_font_size}}px; color: {{datas.class_font_color}};">
      立即下定
    </view>
  </view>
</view>
