<template>
  <div class="conditionDivAllC" v-if="show" @click='clickEmpty()'>
    <div @click='stopClickEmpty'>
      <div class="bgTitleDiv" :style="styleDataNew.bgTitleDiv">
        <div>活动获奖条件</div>
        <div><img class="closeDiv" @click="closeClick()" src="//img10.360buyimg.com/imgzone/jfs/t1/133343/17/19838/1158/5fd5c798E72ccdde6/51194de08ba1e3dc.png" /></div>
      </div>
      <div class="contentDivAll">
        <div class="itemDiv" :style="styleDataNew.itemDiv">活动的复购规则：</br><span class="contentSpan" :style="styleDataNew.contentSpan">近{{joinData.day}}天在店铺已有购买订单，可参与活动</span></div>
        <div class="itemDiv" :style="styleDataNew.itemDiv">下单时间：</br><span class="contentSpan" :style="styleDataNew.contentSpan">在{{joinData.orderStartTime | filterDate}} - {{joinData.orderEndTime | filterDate}}</span></div>

        <div class="itemDiv" :style="styleDataNew.itemDiv" v-if="joinData.orderState == '1'">订单笔数：</br><span class="contentSpan" :style="styleDataNew.contentSpan">大于等于{{joinData.orderStateNum}}笔</span></div>
        <div class="itemDiv" :style="styleDataNew.itemDiv" v-if="joinData.orderState == '0'">订单笔数：单笔</div>

        <div class="itemDiv" :style="styleDataNew.itemDiv">{{joinData.orderState == '0' ? '任意单笔金额：' : '总订单金额：'}}</br><span class="contentSpan" :style="styleDataNew.contentSpan">大于等于{{joinData.orderState == '0' ? joinData.orderPriceOne : joinData.orderPriceTotal}}元</span></div>

        <div class="itemDiv" :style="styleDataNew.itemDiv">订单商品：</br><span class="contentSpan" :style="styleDataNew.contentSpan">购买在活动页面展示的指定商品，或者通过底部按钮进入店铺挑选心动好物</span></div>
        <div class="itemDiv" :style="styleDataNew.itemDiv">其他限制：</br>
          <span class="contentSpan" :style="styleDataNew.contentSpan">1，整个活动期间，每人只可领取奖品一次</span></br>
          <span class="contentSpan" :style="styleDataNew.contentSpan">2，奖品先到先得，发完为止</span></br>
          <span class="contentSpan" :style="styleDataNew.contentSpan">3，订单需确认收货</br>(订单状态为完成时)才能领奖</span>
       </div>

      </div>
    </div>
  </div>
</template>

<script>
  import apis from '../../../util/apis1.js';
let { getActivityBasicRepurchase } = apis;
export default {
  data() {
    return {
      joinData:{
        day:0,
        orderEndTime:null,
        orderStartTime:null,
        orderState:'',// 0 单笔 1多笔
        orderStateNum:0,
        orderPriceOne:0,
        orderPriceTotal:0
      }
    };
  },
  created() {
    this.initData();
  },
  methods: {
    initData(){
      getActivityBasicRepurchase((responseData)=>{
        console.log(responseData,'responseData');
        this.joinData = responseData.data;

      })
    },
    closeClick() {
      this.canScroll();
      this.submit();
    },
    //点击空白处关闭弹框
    clickEmpty(){
      this.closeClick();
    },
    //阻止冒泡
    stopClickEmpty(event){
      event.stopPropagation();
    },
  }
};
</script>

<style lang="scss">
.conditionDivAllC {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;

  .closeDiv {
    position: absolute;
    top: 0.3rem;
    right: 0.26rem;
    width: 0.22rem;
    height: 0.22rem;
  }
  .contentDivAll{
    margin-top: -0.1rem;
    width: 5rem;
    // height: 6.02rem;
    background: #FFFFFF;
    border-radius: 0.1rem;
    position: relative;
    padding: 0.34rem 0.34rem 0.45rem 0.34rem;

  }
}
</style>
