<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">在{{giftData.consumptionGiftCRuleVo.orderStartTime | filterDate}} - {{giftData.consumptionGiftCRuleVo.orderEndTime | filterDate}}</span></div>

        <div class="itemDiv" :style="styleDataNew.itemDiv">消费有礼类型：</br>
        <span v-if="giftData.consumptionGiftCRuleVo.orderType == '0'" class="contentSpan" :style="styleDataNew.contentSpan">满额有礼</span>
        <span v-if="giftData.consumptionGiftCRuleVo.orderType == '1'" class="contentSpan" :style="styleDataNew.contentSpan">满次有礼</span>
        <span v-if="giftData.consumptionGiftCRuleVo.orderType == '2'" class="contentSpan" :style="styleDataNew.contentSpan">满件有礼</span>
        </div>

        <div class="itemDiv" :style="styleDataNew.itemDiv">领奖条件：</br>
        <span v-if="giftData.consumptionGiftCRuleVo.orderType == '0'" class="contentSpan" :style="styleDataNew.contentSpan">
           {{giftData.consumptionGiftCRuleVo.computeType == '0' ? '累计' : '单笔'}}
           已确认收货的订单金额达到指定门槛 （{{giftData.consumptionGiftCRuleVo.priceType == '0' ? '京东价' : '实付价'}}{{msg}}），且在规定领奖有效期内完成领奖操作，方可获得对应档位奖励。
        </span>
         <span v-if="giftData.consumptionGiftCRuleVo.orderType == '1'" class="contentSpan" :style="styleDataNew.contentSpan">
           {{giftData.consumptionGiftCRuleVo.computeType == '0' ? '累计' : '单笔'}}
           已确认收货的订单有效笔数达到指定门槛（{{msg}}），且在规定领奖有效期内完成领奖操作，方可获得对应档位奖励。
        </span>
         <span v-if="giftData.consumptionGiftCRuleVo.orderType == '2'" class="contentSpan" :style="styleDataNew.contentSpan">
           {{giftData.consumptionGiftCRuleVo.computeType == '0' ? '累计' : '单笔'}}
           已确认收货的商家件数达到指定门槛（{{msg}}），且在规定领奖有效期内完成领奖操作，方可获得对应档位奖励。
        </span>
        </div>

         <div class="itemDiv" :style="styleDataNew.itemDiv">订单商品：</br>
        <span v-if="giftData.consumptionGiftCRuleVo.skuType == '1'" class="contentSpan" :style="styleDataNew.contentSpan">
            购买在活动页面展示的指定商品
        </span>
        <span v-if="giftData.consumptionGiftCRuleVo.skuType == '0'" class="contentSpan" :style="styleDataNew.contentSpan">
            购买本店全部商品
        </span>
        <span v-if="giftData.consumptionGiftCRuleVo.skuType == '2'" class="contentSpan" :style="styleDataNew.contentSpan">
            购买除在活动页面展示的排除商品
        </span>
        </div>

        <div class="itemDiv" :style="styleDataNew.itemDiv">其他限制：</br>
        <span class="contentSpan" :style="styleDataNew.contentSpan" v-if="giftData.consumptionGiftCRuleVo.receiveStatus == '0'">
            1，活动期间内，消费满足对应门槛条件，则可获得对应门槛奖品，奖品仅限领取一次；
        </span>
        <span class="contentSpan" :style="styleDataNew.contentSpan" v-if="giftData.consumptionGiftCRuleVo.receiveStatus == '1'">
            1，活动期间内，用户如满足多个消费门槛并及时确认收货，用户即可领取全部对应门槛奖品（同一门槛的奖品只能领取一次）；
        </span></br>
        <span class="contentSpan" :style="styleDataNew.contentSpan">
           2，奖品先到先得，发完为止；
        </span></br>
        <span class="contentSpan" :style="styleDataNew.contentSpan">
           <!-- 3，订单需确认收货（订单状态为完成时）才能领奖 -->
           <span v-if="giftData.consumptionGiftCRuleVo.awardType == '0'">3，订单需确认收货（订单状态为完成时）才能领奖</span>
           <span v-else>3.需提前预约奖品并在活动结束前({{ giftData.consumptionGiftCRuleVo.orderEndTime | filterDate }})完成确认收货，奖品将在确认收货{{giftData.consumptionGiftCRuleVo.awardDay}}天后自动发放，</span>
        </span></br>
        <span class="contentSpan" :style="styleDataNew.contentSpan">
           4，虚拟订单没有物流信息，暂不支持参与活动
        </span>
        </div>


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

<script>
export default {
  data() {
    return {
        giftData:{},
        msg:''
    };
  },
  created() {
    console.log(this.basicData);
    this.giftData = this.basicData
    var rule = ''
    if(this.giftData.consumptionGiftCRuleVo.orderType == '0'){
        rule = '元'
    }else if(this.giftData.consumptionGiftCRuleVo.orderType == '1'){
        rule = '次'
    }else if(this.giftData.consumptionGiftCRuleVo.orderType == '2'){
        rule = '件'
    }
    this.giftData.consumptionGiftCRuleVo.rule.map((item,i)=>{
        this.msg += item.num + rule
        if(i != this.giftData.consumptionGiftCRuleVo.rule.length - 1){
            this.msg += '、'
        } 
    })
  },
  methods: {
    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>
