<template>
  <div class="prizeSwiperDivAlla" ref="swiperPrize70" @click="styleClick('click', 'swiperPrize70')"
    @mousemove="styleClick('mousemove', 'swiperPrize70')" @mouseout="styleClick('mouseout')"
    :style="styleData.prizeSwiperDivAll">
    <div :style="styleData.titlePrize"></div>
    <div style="color: #fff;font-size: .24rem;margin:0 auto 0.03rem auto;text-align: left;width: 6.34rem;" v-if="memberType == '1'&&receiveStatus == '0'">注意：奖品只可领取一次，领取后不可更改</div>
    <div style="color: #fff;font-size: .24rem;margin:0 auto 0.03rem auto;text-align: left;width: 6.34rem;" v-if="memberType == '1'&&receiveStatus == '1'">注意：满足对应奖励的门槛时，可领取对应奖品</div>
    <!-- <div :style="styleData.numWord" v-if="awardNum >= 0 && dayWinStatus == '1'">
      邀请成功后，您还有{{awardNum - alreadyPrizeNum}}次领奖机会</div> -->
    <div :style="styleData.prizeDivAll">
      <div :style="styleData.swiperDivAll" :key="timer">
        <div class="swiper-container">
          <div class="swiper-wrapper" :style="styleData.swiperWrapper">
            <div class="swiper-slide swiper-slide-active" :style="styleData.swiperSlide"
              v-for="(item, index) in prizeList" :key="index">
              <div class="imgbox" :style="styleData.imgbox">
                <img class="imgdiv" :src="item.showImg" :style="styleData.imgdiv" alt="图片1加载失败" />
                <!-- <div :style="styleData.backName" class="back" v-if="item.prizeType == '1'">京豆</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '2'">优惠券</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '3'">实物</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '4'">积分</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '5'">专享价</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '6'">红包</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '7'">礼品卡</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '8'">京东E卡</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '9'">plus会员卡</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '10'">爱奇艺会员卡</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '11'">积分</div>
                <div :style="styleData.backName" class="back" v-if="item.prizeType == '12'">福禄奖品</div> -->
              </div>

              <div class="rightDivAll1" :style="styleData.rightDivAll1">
                <div :style="styleData.rightDivAll">
                  <div :style="styleData.prizeName">{{ item.prizeName }}</div>
                  <div :style="styleData.seccessfulNum">成功邀请{{item.shareNum
                      }}位好友可领取</div>
                  <div :style="styleData.prizeNum">奖品剩余：{{ item.leftNum }}份</div>
                </div>
                <!-- <div :style="styleData.butBox"> -->
                  
               <!---已发完---->
               <div
                  v-if="item.leftNum == 0 && (((item.status == 0||item.status == 3) && memberType == 1) || alreadyPrizeNum <= 0 )"
                  :style="styleData.receiveBnt" :disabled="preventContinuous"></div>
                <!---已领取---->
                <div v-else-if="
                  ((item.status == 1|| item.status == 2) && memberType == 1) ||
                  (memberType == 0  && alreadyPrizeNum >0 && !item.canReceive||
                  (item.leftNum == 0 && alreadyPrizeNum > 0))
                   " :style="styleData.alreadyReceived" @click="getDrawFail(index,item)"></div>
                   <!---立即领取置灰---->
                <div v-else-if="!item.canReceive" :style="styleData.noGetBnt" @click="drawFail(index,item)"></div>
                <!---立即领取---->
                <div
                  v-else-if="(getPrizeNum > 0 || item.canReceive) &&  ( dayWinStatus == '1'?(awardNum - alreadyPrizeNum) > 0:true ) && item.leftNum > 0 "
                  :style="styleData.getBnt" @click="drawprize(index,item,getPrizeNum)"></div>
                <!-- </div> -->
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Swiper from 'swiper/swiper-bundle.min.js';

import 'swiper/swiper.scss'
import apis1 from '../../../util/apis1.js';
let { immediatelyDraw, getMemderPrizeList, immediatelyDrawGray, getMemderInviteNum, getInviteRanking } = apis1;
import { toastPopComService } from '../../../util/comCreate.js';

import { PrizeResultPopComService70_4, NoPrizeResultPopComService,singleClaimPopComService } from '../../../util/hdzxtcomCreate.js';
export default {

  name: 'carouselImg',
  props: ['isTemplate', 'datas', 'keyData', 'styleData', 'templateData', 'isWebClick'],

  data() {
    return {
      basic: {
        receivePrizeTimeStartTime: '', //领奖开始时间
        receivePrizeTimeEndTime: '' //领奖结束时间
      },
      nowDate: new Date().getTime(), //当前时间
      prizeList: [], //奖品列表
      prizeNum: 0, //当前奖品数量
      prizeName: '', //当前奖品名称
      signDay: 0, //签到天数
      start: true, //开始领奖倒计时
      end: false, //结束领奖倒计时
      buttonText: '', //按钮文案
      sign: true, //按钮状态
      isShow: true, //整个是否展示
      receivePrizesList: [],
      voteSelectCount: '', // 参与人数
      swiperss: '',
      activityType: '',
      awardNum: "",
      memberType: '',
      getPrizeNum: 0, // 单一型奖品可领次数
      alreadyPrizeNum: 0, // 单一型已经领取次数
      timer: new Date().getTime(),
      dayWinStatus: '',
      preventContinuous: false,
      rankOpenStatus: 0,
      doubleDots: false,
      receiveStatus:''
    };
  },
  created() {
    this.activityType = sessionStorage.getItem('activityType');
    this.publicData.$on('reloadPrize', datas => {
      if (datas == 'true' || datas == true) {
        this.initData();
      }
    });
    this.publicData.$on('voteSelectCount', data => {
      this.voteSelectCount = data;
    });

  },
  mounted() {
    this.initData();
  },
  methods: {
    //点击可修改位置的方法
    styleClick(type, refName) {
      if (this.isWebClick) {
        //传值给B端
        let byValue = {
          modifyContent: this.modifyContent,
          refName: refName,
          styleData: this.styleData,
          isCustomSwitching: this.receive,
          c_this: this,
          styleDataOld: this.styleDataOld
        };
        this.$emit('opertaionCom', type, byValue);
      }
    },
    initData() {
      var datas = this.templateData;
      if (this.isTemplate == true) {
        if (datas) {
          this.voteSelectCount = 0;
          this.datasTemplate = datas;
          // console.log(datas,datas.receive,'datasdatasdatasdatas')
          this.nowDate = this.nowTime;
          if (datas.newMember) {
            this.prizeList = datas.newMember.draw.prizeList;
            for (var i = 0; i < this.prizeList.length; i++) {
              this.prizeList[i].leftNum = this.prizeList[i].totalPrizeNum
              this.prizeList[i].shareNum = this.prizeList[i].cotinueSignDay
            }


            this.prizeNum = this.prizeList[0].totalPrizeNum;
            this.prizeName = this.prizeList[0].prizeName;
            this.signDay = this.prizeList[0].cotinueSignDay;
            this.leftNum = this.prizeList[0].totalPrizeNum;
            this.memberType = datas.newMember.memberType;
            this.receiveStatus = datas.newMember.receiveStatus;


          }
          if (this.memberType == 0) {
            this.awardNum = this.prizeList[0].winNumberDay
            this.dayWinStatus = String(this.prizeList[0].dayWinStatus)
          } else {
            this.awardNum = undefined
          }
          console.log(this.awardNum, 'this.awardNum')
          if (datas.rank) {
            this.publicData.$emit('isOpen', datas.rank.isOpen)
          }


          var that = this;
          this.$nextTick(() => {
            var mySwiper = new Swiper('.swiper-container', {
              loop: false, // 循环模式选项
              loopedSlides: 1,
              width: (document.documentElement.clientWidth - (0.58/7.5)*document.documentElement.clientWidth) + '',
              navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev'
              },
              pagination: {
                el: '.swiper-pagination',
                type: 'bullets'
              },
              autoplay: {
                delay: 3000,
                stopOnLastSlide: false,
                disableOnInteraction: true
              }
            });
            mySwiper.on('slideChange', function () {
              that.activeIndex11 = this.activeIndex;
              that.prizeNum = that.prizeList[this.activeIndex].totalPrizeNum;
              that.prizeName = that.prizeList[this.activeIndex].prizeName;
              that.signDay = that.prizeList[this.activeIndex].cotinueSignDay;
              that.leftNum = that.prizeList[this.activeIndex].totalPrizeNum;
            });
          });
        } else {
          this.basic[this.keyData.receivePrizeTimeStartTime] = 1621506683000;
          this.basic[this.keyData.receivePrizeTimeEndTime] = 1683887483000;
          this.nowDate = this.nowTime = new Date().getTime();
          this.awardNum = 1
          this.publicData.$emit('isOpen', '1')
          this.prizeList = [
            {
              showImg: '//img10.360buyimg.com/imgzone/jfs/t1/135708/33/20224/53331/5fd996ffE527ce925/d8282829b61c16d5.png',
              allNum: 1,
              days: 1,
              prizeName: '戴高活页笔记本',
              prizeType: 4,
              leftNum: 12,
              shareNum: 1
            },
            {
              showImg: '//img10.360buyimg.com/imgzone/jfs/t1/149370/34/18647/46712/5fd996ffE13b5f450/db0928bd887bf1bc.png',
              allNum: 2,
              days: 2,
              prizeName: '京豆',
              prizeType: 1,
              leftNum: 2,
              shareNum: 2
            },
            {
              showImg: '//img10.360buyimg.com/imgzone/jfs/t1/163244/9/827/6488/5ff2b579E956f2913/d18f15bfc917fbb2.png',
              allNum: 3,
              days: 3,
              prizeName: '优惠券',
              prizeType: 2,
              leftNum: 22,
              shareNum: 3
            }
          ];
          this.prizeNum = this.prizeList[0].allNum;
          this.prizeName = this.prizeList[0].prizeName;
          this.signDay = this.prizeList[0].days;
          var that = this;
          this.$nextTick(() => {
            var mySwiper = new Swiper('.swiper-container', {
              loop: false, // 循环模式选项
              loopedSlides: 1,
              width: (document.documentElement.clientWidth - (0.58/7.5)*document.documentElement.clientWidth) + '',
              navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev'
              },
              pagination: {
                el: '.swiper-pagination',
                type: 'bullets'
              },
              autoplay: {
                delay: 3000,
                stopOnLastSlide: false,
                disableOnInteraction: true
              }
            });
            mySwiper.on('slideChange', function () {
              that.activeIndex11 = this.activeIndex;
              that.prizeNum = that.prizeList[this.activeIndex].allNum;
              that.prizeName = that.prizeList[this.activeIndex].prizeName;
              that.signDay = that.prizeList[this.activeIndex].days;
            });
          });

          //自动刷新
          this.signStartTime = this.basic[this.keyData.receivePrizeTimeStartTime];
          this.signEndTime = this.basic[this.keyData.receivePrizeTimeEndTime]; //1609736010000 1614418856000;

          if (this.basic[this.keyData.receivePrizeTimeStartTime] > this.nowDate) {
            this.start = true;
            this.end = false;
            this.sign = false;
            this.buttonText = '未开始';

            this.signStartTime = this.basic[this.keyData.receivePrizeTimeStartTime];
            this.signEndTime = this.basic[this.keyData.receivePrizeTimeEndTime]; //1609736010000 1614418856000;
          } else if (this.basic[this.keyData.receivePrizeTimeStartTime] < this.nowDate && this.nowDate < this.basic[this.keyData.receivePrizeTimeEndTime]) {
            this.start = false;
            this.end = true;
            this.sign = false;
            this.buttonText = '已领完';
          } else if (this.nowDate > this.basic[this.keyData.receivePrizeTimeEndTime]) {
            this.isShow = false;
          }
        }
      } else {
        var that = this;
        // getInviteRanking((initDtasAll) => {
        //   this.rankOpenStatus = initDtasAll.data.openStatus
        // })

        getMemderPrizeList(prizesData => {
          let prizesDataAll = prizesData;
          this.memberType = prizesData.data.memberType
          that.prizeList = prizesDataAll.data.prizeInfo;
          this.getInviteNum()
          that.prizeNum = that.prizeList[0].allNum;
          that.prizeName = that.prizeList[0].prizeName;
          that.activeIndex11 = 0;

          if (this.memberType == 0) {
            this.dayWinStatus = that.prizeList[0].dayWinStatus
            if (this.dayWinStatus == 0) {
              this.awardNum = undefined
            } else {
              this.awardNum = that.prizeList[0].winNumberDay
            }
          } else {
            this.awardNum = undefined
          }

          this.endTime = prizesData.data.activityEndTime
          that.publicData.$emit('prizeList', prizesDataAll.data);
          this.getPrizeLIst()
          this.$nextTick(() => {
            var mySwiper = new Swiper('.swiper-container', {
              loop: false, // 循环模式选项
              loopedSlides: 1,
              width: (document.documentElement.clientWidth - (0.58/7.5)*document.documentElement.clientWidth) + '',
              navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev'
              },
              pagination: {
                el: '.swiper-pagination',
                type: 'bullets'
              },
              autoplay: {
                delay: 3000,
                stopOnLastSlide: false,
                disableOnInteraction: true
              }
            });
            mySwiper.on('slideChange', function () {
              that.activeIndex11 = this.activeIndex;
              that.prizeNum = that.prizeList[this.activeIndex].allNum;
              that.prizeName = that.prizeList[this.activeIndex].prizeName;
              that.signDay = that.prizeList[this.activeIndex].days;
            });
          });

        });
      }
    },
    getPrizeLIst() {
      this.getPrizeNum = 0
      this.alreadyPrizeNum = 0
      this.preventContinuous = false
      immediatelyDrawGray(data => {
        //单一奖品
        if (this.memberType == 0) {
          data.data.receivePrizesDay.forEach(i => {
            if (i.prizeInfoId == this.prizeList[0].id && i.status == 0) {
              this.getPrizeNum++
            }
            if (i.prizeInfoId == this.prizeList[0].id && (i.status == 1 || i.status == 2)) {
              this.alreadyPrizeNum++
            }
          })
          if(this.getPrizeNum > 0 && (this.dayWinStatus == '1'?(this.awardNum - this.alreadyPrizeNum) > 0:true ) && this.prizeList[0].leftNum > 0){
                this.prizeList[0].canReceive = true
          }
        } else {
          this.receiveStatus = data.data.receiveStatus;
          this.prizeList.forEach(i => {
            // let list = data.data.receivePrizes.filter(item => item.prizeInfoId == i.id)
            // console.log(data.data.receivePrizes.find(j => j.prizeInfoId == i.id),'list.find(j => j.prizeInfoId == i.id)')
            if (data.data.receivePrizes.find(j => j.prizeInfoId == i.id)) {
              i.status = data.data.receivePrizes.find(j => j.prizeInfoId == i.id).status;
              i.receiveStatus = data.data.receivePrizes.find(j => j.prizeInfoId == i.id).receiveStatus;

            }
            if (data.data.receivePrizes.some(item => item.prizeInfoId == i.id && item.status == 0)) {
              i.canReceive = true
            } else {
              i.canReceive = false
            }


          })
        }
        console.log(this.alreadyPrizeNum, 'alreadyPrizeNumalreadyPrizeNum')
        this.timer = new Date().getTime();
        let that = this
        this.$nextTick(() => {
          // if (that.swiperss) {
          //   that.swiperss.destroy(false);
          // }
          that.swiperss = new Swiper('.swiper-container', {
            loop: false, // 循环模式选项
            loopedSlides: 1,
            width: (document.documentElement.clientWidth - (0.58/7.5)*document.documentElement.clientWidth) + '',
            navigation: {
              nextEl: '.swiper-button-next',
              prevEl: '.swiper-button-prev'
            },
            pagination: {
              el: '.swiper-pagination',
              type: 'bullets'
            },
            autoplay: {
              delay: 3000,
              stopOnLastSlide: false,
              disableOnInteraction: true
            }
          });
          that.swiperss.navigation.update();
          that.swiperss.on('slideChange', function () {
            that.activeIndex11 = this.activeIndex;
            that.prizeNum = that.prizeList[this.activeIndex].allNum;
            that.prizeName = that.prizeList[this.activeIndex].prizeName;

            // that.checkStatus();
          });
        });
      })
    },

    //检查领奖状态
    checkStatus() {
      if (this.basic[this.keyData.receivePrizeTimeStartTime] > this.nowDate) {
        this.start = true;
        this.end = false;
        this.sign = false;
        this.buttonText = '未开始';
      } else if (this.basic[this.keyData.receivePrizeTimeStartTime] < this.nowDate && this.nowDate < this.basic[this.keyData.receivePrizeTimeEndTime]) {
        if (this.nowDate < 1624190400000) {
          // 1624190400000
          if (this.prizeList[this.activeIndex11].prizeType == '3') {
            this.sign = false;
            this.buttonText = '敬请期待';
          } else {
            this.sign = false;
            this.buttonText = '未达成领取资格';
            let receivePrizesList = this.receivePrizesList; //可领取奖品列表
            if (this.receiveListData.data.canReceive == false) {
              this.sign = false;
              this.buttonText = '已达领取上限';
            } else {
              for (var i = 0; i < receivePrizesList.length; i++) {
                if (this.prizeList[this.activeIndex11].id == receivePrizesList[i].prizeInfoId) {
                  if (receivePrizesList[i].status == 0) {
                    if (this.prizeList[this.activeIndex11].leftNum > 0) {
                      this.sign = true;
                    } else {
                      this.sign = false;
                      this.buttonText = '已抢完';
                    }
                  } else if (receivePrizesList[i].status == 1) {
                    this.sign = false;
                    this.buttonText = '已领取';
                  } else if (receivePrizesList[i].status == 2) {
                    this.sign = false;
                    this.buttonText = '立即领取';
                  }
                }
              }
            }
            this.start = false;
            this.end = true;
          }
        } else {
          this.sign = false;
          this.buttonText = '未达成领取资格';
          let receivePrizesList = this.receivePrizesList; //可领取奖品列表
          if (this.receiveListData.data.canReceive == false) {
            this.sign = false;
            this.buttonText = '已达领取上限';
          } else {
            for (var i = 0; i < receivePrizesList.length; i++) {
              if (this.prizeList[this.activeIndex11].id == receivePrizesList[i].prizeInfoId) {
                if (receivePrizesList[i].status == 0) {
                  if (this.prizeList[this.activeIndex11].leftNum > 0) {
                    this.sign = true;
                  } else {
                    this.sign = false;
                    this.buttonText = '已抢完';
                  }
                } else if (receivePrizesList[i].status == 1) {
                  this.sign = false;
                  this.buttonText = '已领取';
                } else if (receivePrizesList[i].status == 2) {
                  this.sign = false;
                  this.buttonText = '立即领取';
                }
              }
            }
          }
          this.start = false;
          this.end = true;
        }
      }
    },
    //立即领取点击按钮
    drawprize(index, item, getPrizeNum) {
      if (this.isWebClick) {
        return
      }
      if (this.isTemplate) {
        this.$toast('活动预览，仅供查看');
        return;
      } else if (!this.isTemplate) {
        let actStatus = sessionStorage.getItem('actStatus');
        if (actStatus == 1) {
          this.$toast('活动尚未开始');
          return;
        } else if (actStatus == 2) {
          this.$toast('您来晚了，活动已结束');
          return;
        }
        if ((new Date().getTime() >= (this.endTime - 49 * 60 * 60 * 1000)) && this.rankOpenStatus == 1) {
          this.$toast('您来晚了，活动已不能领奖了');
          return
        }
        if (this.doubleDots) {
          return
        }
       if(item.receiveStatus == '0'){
        singleClaimPopComService.create(this.styleData, submit => {
            if(submit){
              this.preventContinuous = true
              this.doubleDots = true;
              immediatelyDraw(item.id, receiveData => {
                // this.doubleDots = false;
                if (receiveData.resp_code == 0) {
                  if (getPrizeNum > 0) {
                    this.getPrizeNum = this.getPrizeNum - 1
                  }

                  if (receiveData.data.result == true) {
                    var obj = {
                      datas: {},
                      keyData: {
                        prizeUrl: 'showImg',
                        prizeName: 'prizeName',
                        prizeType: 'prizeType',
                        priceInfo: 'priceInfo',
                        discountType: 'discountType',
                        couponType: 'couponType'
                      }
                    };
                    obj.datas = receiveData.data;
                    console.log(receiveData.data, obj, '---1-----1----1---receiveData.datareceiveData.data')
                    PrizeResultPopComService70_4.create(obj, receiveData.data, this.styleData, submit => {
                      this.initData();
                      PrizeResultPopComService70_4.close();
                      this.preventContinuous = false
                    });
                  } else {
                    NoPrizeResultPopComService.create(
                      this.styleData,
                      submit => {
                        this.initData();
                        NoPrizeResultPopComService.close();
                        this.preventContinuous = false
                      }
                    );
                  }
                  this.doubleDots = false;
                } else if (receiveData.resp_code == 1000) {
                  this.$toast('已领取');
                  this.doubleDots = false;
                }
                else if (receiveData.resp_code == 60010) {
                  toastPopComService.create('奖品已经发完啦~', submit => {
                    toastPopComService.close();
                  });
                  this.doubleDots = false;
                  this.initData();
                }
              });
            }
            singleClaimPopComService.close();
        })
       }else{
        this.preventContinuous = true
        this.doubleDots = true;
        immediatelyDraw(item.id, receiveData => {
          // this.doubleDots = false;
          if (receiveData.resp_code == 0) {
            if (getPrizeNum > 0) {
              this.getPrizeNum = this.getPrizeNum - 1
            }

            if (receiveData.data.result == true) {
              var obj = {
                datas: {},
                keyData: {
                  prizeUrl: 'showImg',
                  prizeName: 'prizeName',
                  prizeType: 'prizeType',
                  priceInfo: 'priceInfo',
                  discountType: 'discountType',
                  couponType: 'couponType'
                }
              };
              obj.datas = receiveData.data;
              console.log(receiveData.data, obj, '---1-----1----1---receiveData.datareceiveData.data')
              PrizeResultPopComService70_4.create(obj, receiveData.data, this.styleData, submit => {
                this.initData();
                PrizeResultPopComService70_4.close();
                this.preventContinuous = false
              });
            } else {
              NoPrizeResultPopComService.create(
                this.styleData,
                submit => {
                  this.initData();
                  NoPrizeResultPopComService.close();
                  this.preventContinuous = false
                }
              );
            }
            this.doubleDots = false;
          } else if (receiveData.resp_code == 1000) {
            this.$toast('已领取');
            this.doubleDots = false;
          }
          else if (receiveData.resp_code == 60010) {
            toastPopComService.create('奖品已经发完啦~', submit => {
              toastPopComService.close();
            });
            this.doubleDots = false;
            this.initData();

          }
        });
       }
        
      }
    },
    //不可领取时候提示
    drawFail(index, item) {
      if (this.isWebClick) {
        return
      }
      if (this.isTemplate) {
        this.$toast('活动预览，仅供查看');
        return;
      } else if (!this.isTemplate) {
        let actStatus = sessionStorage.getItem('actStatus');
        if (actStatus == 1) {
          this.$toast('活动尚未开始');
          return;
        } else if (actStatus == 2) {
          this.$toast('您来晚了，活动已结束');
          return;
        }
      }
      let isReceive = false
      this.prizeList.forEach(ele=>{
        if((ele.status == '1' || ele.status == '2') && this.receiveStatus == '0'){
          isReceive = true
        }
      })
      if(item.receiveStatus == '0' || (isReceive && this.memberType == '1')){
        this.$toast('您已领取奖励，所有奖励只可领取一个');
        return
      }
      console.log(new Date().getTime(), (this.endTime - 49 * 60 * 60 * 1000), 'new Date().getTime() >= (this.endTime - 49*60*60*1000)')
      if (new Date().getTime() >= (this.endTime - 49 * 60 * 60 * 1000) && this.rankOpenStatus == 1) {
        this.$toast('您来晚了，活动已不能领奖了');
      } else {
        this.$toast('您需要邀请足够的好友入会，才能领取奖品，奖品先到先得哦~')

      }
    },
    getDrawFail(index, item) {
      if (this.isWebClick) {
        return
      }
      if (this.isTemplate) {
        this.$toast('活动预览，仅供查看');
        return;
      } else if (!this.isTemplate) {
        let actStatus = sessionStorage.getItem('actStatus');
        if (actStatus == 1) {
          this.$toast('活动尚未开始');
          return;
        } else if (actStatus == 2) {
          this.$toast('您来晚了，活动已结束');
          return;
        }
      }
      if (this.memberType == 1) {
        this.$toast('奖品您已领取~')
      } else if ((this.awardNum - this.alreadyPrizeNum) <= 0) {
        this.$toast('抱歉，您已达到活动奖品领取上限~')
      } else if (item.leftNum == 0) {
        this.$toast('奖品已经发完啦~')
      } else
        if ((this.awardNum - this.alreadyPrizeNum) > 0 || (!this.awardNum && (this.awardNum - this.alreadyPrizeNum) != 0)) {
          this.$toast('奖品您已领取。如邀请更多好友入会，可以再次领奖。奖品先到先得哦~')
        }
    },
    getInviteNum() {
      getMemderInviteNum(data => {
        console.log(data, 'data------------')
        if (data.data) {
          this.prizeList.forEach(i => {
            if (data.data.find(j => j.prizeInfoId == i.id)) {
              this.$set(i, 'shareNum', data.data.find(j => j.prizeInfoId == i.id).shareNum);
            }
          })
          console.log(this.prizeList, 33333)
        }

      })
    }
  }
};
</script>

<style lang="scss">
.prizeSwiperDivAlla {
  .swiper-container {
    z-index: 0 !important;
    width: 6.92rem;
    overflow: hidden;
    margin: 0 auto;
  }
  .swiper-container .swiper-wrapper .swiper-slide {
    display: flex;
    width: 6.92rem !important;
    height: 2.7rem;
    margin: 0 auto;
    // background:#fff;
    // border-radius:.1rem
  }
  .swiper-pagination {
    position: initial;
    /* bottom: 0; */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 0.2rem;
  }

  .title {
    background: rgba(0, 0, 0, 0.7);
    background-image: url("//img10.360buyimg.com/imgzone/jfs/t1/154087/9/21095/16555/6040a5feEb4e16989/e566e45702a66e92.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    width: 4.6rem;
    height: 0.95rem;
    margin: 0.5rem auto;
  }
  .signPrize {
    margin-top: 0.3rem;
    color: white;
    font-size: 0.33rem;
  }
  .signDay {
    font-size: 0.33rem;
    color: #68ae7c;
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
  }
  .prizeButton {
    margin-top: 1rem;
  }
  .signButton {
    width: 3.1rem;
    height: 0.8rem;
    line-height: 0.8rem;
    background-color: #cbcbcb;
    border-radius: 0.5rem;
    margin: auto;
    font-size: 0.4rem;
    color: #7f7f7f;
    margin-top: -1rem;
  }
  .button {
    width: 3.1rem;
    height: 0.8rem;
    line-height: 0.8rem;
    background-color: #ddba71;
    border-radius: 0.5rem;
    margin: auto;
    font-size: 0.4rem;
    color: #7f5935;
  }
  .swiper-button-prev {
    color: white;
    margin-top: 11rem;
    --swiper-navigation-size: 30px;
  }
  .swiper-button-next {
    color: white;
    margin-top: 11rem;
    --swiper-navigation-size: 30px;
  }
  .button {
    margin-top: -1rem;
  }
  .left {
    width: 0.33rem;
    height: 0.57rem;
    float: left;
    margin-left: 0.25rem;
  }
  .right {
    width: 0.33rem;
    height: 0.57rem;
    float: right;
    margin-right: 0.25rem;
  }
  .swiper-container .swiper-wrapper .swiper-slide img {
    width: 2rem;
    height: 2rem;
  }
  .imgbox {
  }
}
</style>
