<template>
  <div class="shopGiftBasicMessageDivAllC">
    <!-- {{templateId}}----{{giftType}} -->
    <div v-if="giftType == '1'">
      <tem566a v-if="templateId == '7498bc9d-0be3-480d-ae9d-59b8a074566a'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem566a>
      <tem566b v-if="templateId == '7498bc9d-0be3-480d-ae9d-59b8a074566b'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem566b>
      <tem566c v-if="templateId == '7498bc9d-0be3-480d-ae9d-59b8a074566c'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem566c>
      <tem676f v-if="templateId == 'b2107433-4965-412c-9eb5-99a78a9c676f'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem676f>
      <tem999f v-if="templateId == '439c7c00-2525-4cc7-865f-a942ca82b1c6'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem999f>
      <tem9ad2 v-if="templateId == '5493e267-37fb-4baf-be64-3d2c9fc79ad2'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem9ad2>
      <temdb1c v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48ab494db1c'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temdb1c>
      <temc657 v-if="templateId == 'c4f725c9-5488-4c1b-b867-b4b76c53c657'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temc657>
      <!-- 粉色 -->
      <tem999a v-if="templateId == '22b9b605-3794-4023-a47b-be6fa0a915e7'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem999a>
      <!-- 模板-2 -->
      <tem999b v-if="templateId == '961f8942-10e0-464b-b343-509aba65b7c3'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem999b>
      <!-- 模板-3 -->
      <tem999c v-if="templateId == 'bd1bf9ca-fe3c-4078-990f-25a149c2512e'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem999c>
      <!-- 模板-4 -->
      <tem999d v-if="templateId == '5eccf686-e1f5-4374-9e6e-48b568ed1ca4'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem999d>
      <!-- 夏日模板1 -->
      <tem1107 v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48a05151107'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem1107>
      <!-- 夏日模板2 -->
      <tem1108 v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48a05151108'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem1108>
      <temd123 v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48ab494d123'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temd123>
      <temd1109 v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48a05151109'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temd1109>
      <temd1118 v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48a05151118'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temd1118>
      <temdb1z v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48ab494db1z'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temdb1z>
      <temdb1x v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48ab494db1x'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temdb1x>
      <temdb1w v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48ab494db1w'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temdb1w>
      <tem1103 v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48a05151103'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem1103>
      <tem1102 v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48a05151102'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem1102>
      <tem1101 v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48a05151101'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem1101>
      <tem1201 v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48a05151201'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem1201>
      <temdb2b v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48ab494db2b'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temdb2b>
      <temdb2c v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48ab494db2c'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temdb2c>
      <temdb2a v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48ab494db2a'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temdb2a>

      <!-- 夏日 -->
      
      <temdb1y v-if="templateId == '0abfbe80-230f-4b3c-8ddf-f48ab494db1y'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temdb1y>
    </div>

    <div v-else-if="giftType == '3'">
      <tem577a v-if="templateId == '7498bc9d-0be3-480d-ae9d-59b8a074577a'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem577a>
      <tem3113 v-else-if="templateId == 'ac32288d-5efb-4a3f-a344-9f2722473113'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem3113>
      <temce95 v-else-if="templateId == '769075fe-b131-4e28-842d-0ec8dd9ace95'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temce95>
      <tem4066 v-else-if="templateId == '58180995-4ef6-461c-9fd8-e7e670c84066'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem4066>
      <teme97a v-else-if="templateId == '6a935c55-c6bc-4954-b414-65940cc4e97a'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></teme97a>
      <temGift3Common v-else :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></temGift3Common>
    </div>

    <div v-else-if="giftType == '4'">
      <tem599a v-if="templateId == '7498bc9d-0be3-480d-ae9d-59b8a074599a'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem599a>
      <tem599b v-if="templateId == '7498bc9d-0be3-480d-ae9d-59b8a074599b'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem599b>
      <tem7121 v-if="templateId == '3bdc29c9-60d7-4938-9db8-0ea149027121'" :styleData="styleData" :giftBagData="giftBagData" @btnClickEmit="btnClickEmit"></tem7121>
    </div>

    <div v-else-if="giftType == '2'" :key='timer'>
      <temOpenCard
        v-if="dynamicEffect"
        :styleData="styleData"
        :giftBagData="giftBagData"
        :dynamicEffect="dynamicEffect"
        :isMember="isMember"
        @btnClickEmit="btnClickEmit"
      ></temOpenCard>
    </div>
    <div v-else-if="giftType == '15'" :key='timer'>
      <temOpenCardPlus
        v-if="giftBagData.biGift.url"
        :styleData="styleData"
        :giftBagData="giftBagData"
        :isMember="isMember"
        :isTemplate="isTemplate"
        @btnClickEmit="btnClickEmit"
      ></temOpenCardPlus>
    </div>

    <div v-else><BICustomTem v-if="biGift" :styleData="styleData" :biGift="biGift" :isMember="isMember" @btnClickEmit="btnClickEmit"></BICustomTem></div>
  </div>
</template>

<script>
import { jumpGetCoupon, closeGiftPop } from '../../../util/shopGiftBag.js';
import api1 from '../../../util/apis1.js';
let { getTemplate, shopGiftMain, drawShopGift } = api1;

import store from '../../../store/store.js';
import tem566a from './temPlateDiv/tem566a.vue';
import tem566b from './temPlateDiv/tem566b.vue';
import tem566c from './temPlateDiv/tem566c.vue';
import tem676f from './temPlateDiv/tem676f.vue';
import tem999f from './temPlateDiv/tem999f.vue';
import temc657 from './temPlateDiv/temc657.vue';
import tem1107 from './temPlateDiv/tem1107.vue';
import tem1108 from './temPlateDiv/tem1108.vue';
import temd1109 from './temPlateDiv/temd1109.vue';
import temd123 from './temPlateDiv/temd123.vue';
import temd1118 from './temPlateDiv/temd1118.vue';
import temdb1z from './temPlateDiv/temdb1z.vue';
import temdb1y from './temPlateDiv/temdb1y.vue';
import temdb1x from './temPlateDiv/temdb1x.vue';
import temdb1w from './temPlateDiv/temdb1w.vue';
import tem1103 from './temPlateDiv/tem1103.vue';
import tem1102 from './temPlateDiv/tem1102.vue';
import tem1101 from './temPlateDiv/tem1101.vue';
import tem1201 from './temPlateDiv/tem1201.vue';
import temdb2b from './temPlateDiv/temdb2b.vue';
import temdb2c from './temPlateDiv/temdb2c.vue';
import temdb2a from './temPlateDiv/temdb2a.vue';

import tem9ad2 from './temPlateDiv/tem9ad2.vue';
import tem577a from './temPlateDiv/tem577a.vue';
import temdb1c from './temPlateDiv/temdb1c.vue';
import temOpenCard from './temPlateDiv/openCardTem.vue';
import temOpenCardPlus from './temPlateDiv/openCardTemPlus.vue';
import tem599a from './temPlateDiv/tem599a.vue';
import tem599b from './temPlateDiv/tem599b.vue';
import tem7121 from './temPlateDiv/tem7121_4.vue';
import tem3113 from './temPlateDiv/tem3113.vue';
import temce95 from './temPlateDiv/temce95.vue';
import tem4066 from './temPlateDiv/tem4066.vue';
import teme97a from './temPlateDiv/teme97a.vue';
import BICustomTem from './temPlateDiv/BICustomTem.vue';
import tem999a from './temPlateDiv/tem999a.vue';
import tem999b from './temPlateDiv/tem999b.vue';
import tem999c from './temPlateDiv/tem999c.vue';
import tem999d from './temPlateDiv/tem999d.vue';
import temGift3Common from './temPlateDiv/temGift3Common.vue';

export default {
  props: ['isTemplate', 'datas', 'keyData', 'styleData', 'templateData', 'isWebClick', 'modifyContent'],
  components: {
    tem566a,
    tem566b,
    tem566c,
    tem676f,
    temOpenCard,
    temOpenCardPlus,
    tem577a,
    tem599a,
    tem599b,
    tem7121,
    tem3113,
    BICustomTem,
    tem999f,
    tem9ad2,
    temdb1c,
    temc657,
    tem999a,
    tem999b,
    tem999c,
    tem999d,
    tem1107,
    tem1108,
    temd1109,
    temd123,
    temd1118,
    temdb1z,
    temdb1y,
    temdb1x,
    temdb1w,
    tem1103,
    tem1102,
    tem1101,
    tem1201,
    temdb2b,
    temdb2c,
    temdb2a,
    temGift3Common,
    temce95,
    tem4066,
    teme97a
  },
  data() {
    return {
      timer:new Date().getTime(),
      isMember: null, //是否是会员
      templateId: '',
      giftType: '', //礼包类型
      temData: {
        templateBg: '',
        topicImage: ''
      }, //模板数据
      prizeTypeArr: [
        {
          prizeType: '1',
          name: '京豆'
        },
        {
          prizeType: '101',
          name: '京券'
        },
        {
          prizeType: '102',
          name: '东券'
        },
        {
          prizeType: '4',
          name: '积分'
        }
      ],
      giftBagData: {
        gifyBagType: '1',
        prizeData: [],
        exposedGoods: [],
        isShowPrice:null
      },

      dynamicEffect: null,
      biGift: null //千人千面数据
    };
  },
  created() {
    this.initData();
  },
  methods: {
  async  initData() {
      this.giftType = sessionStorage.getItem('giftType');
      this.isGiftTrue = sessionStorage.getItem('isGiftTrue');
      //  await shopGiftMain(shopGiftMain => {
      //    if(shopGiftMain.resp_code == 0){
      //      sessionStorage.setItem('templateId',shopGiftMain.data.shopGiftRule.templateCode)
      //    }
      //  })
      if (this.giftType == '1' || this.giftType == '2' || this.giftType == '3' || this.giftType == '4' || this.giftType == '15' ) {
      //  await getTemplate(templatData => {

          let templatData1 = JSON.parse(sessionStorage.getItem('templatData1'));
          console.log(templatData1,'templatData1templatData1templatData1templatData1')
          var datasAll = this.templateData;
          //如果有模板信息
          if (templatData1.basicJson && this.giftType != '3') {
            let basicJson = JSON.parse(templatData1.basicJson);
            this.temData.templateBg = basicJson.noOpenImagePath;
            this.temData.topicImage = basicJson.noOpenImagePath;
            this.temData.cardTemplateBg = basicJson.openImagePath;
            this.temData.cardTopicImage = basicJson.openImagePath;
            this.temData.isSetOpen = basicJson.isSetOpen;
            this.temData.enterAnimateName = basicJson.enterAnimateName;
            this.temData.outAnimateName = basicJson.outAnimateName;
            this.temData.noOpenVipUrl = basicJson.noOpenVipUrl;
            this.temData.openVipUrl = basicJson.openVipUrl;
            this.temData.animateName = this.temData.enterAnimateName;

            templatData1.topicWidth = 650;
            templatData1.topicHeight = 1000;
            this.styleData.uiModalBody['width'] = templatData1.topicWidth / 100 + 'rem';
            this.styleData.uiModalBody['height'] = templatData1.topicHeight / 100 + 'rem';
            this.styleData.uiModalBody['left'] = `calc(50% - ${templatData1.topicWidth / 100 / 2}rem)`;
            this.styleData.uiModalBody['background-image'] = `url(${this.temData.topicImage})`;
            this.styleData.uiModalBody['top'] = `calc(50% - ${templatData1.topicHeight / 100 / 2}rem)`;
            this.dynamicEffect = this.temData;
            console.log(this.dynamicEffect, '111111111111');
            if(this.giftType != '15'){
              if(this.temData.topicImage.indexOf('mp4') != '-1'){
                this.styleData.isShowVideo = true;
                this.styleData.topicImage = this.temData.topicImage;
              }else{
                this.styleData.isShowVideo = false 
              }
            }
            
          } else {
            this.temData.templateBg = templatData1.templateBg;
            this.temData.topicImage = templatData1.topicImage;
            this.styleData.uiModalBody['background-image'] = `url(${this.temData.topicImage})`;
            this.styleData.uiModalBody['width'] = templatData1.topicWidth / 100 + 'rem';
            this.styleData.uiModalBody['height'] = templatData1.topicHeight / 100 + 'rem';

            this.styleData.uiModalBody['left'] = `calc(50% - ${templatData1.topicWidth / 100 / 2}rem)`;
            this.styleData.uiModalBody['top'] = `calc(50% - ${templatData1.topicHeight / 100 / 2}rem)`;

            // this.styleData.uiModalBody['left'] = "50%";
            // this.styleData.uiModalBody['top'] = "50%";

            // this.styleData.uiModalBody['marginTop'] = "50%";
            // this.styleData.uiModalBody['top'] = "50%";
            if(this.temData.topicImage.indexOf('mp4') != '-1'){
              this.styleData.isShowVideo = true;
              this.styleData.topicImage = this.temData.topicImage;
            }else{
              this.styleData.isShowVideo = false 
            }
          }
          //奖品信息
          if (templatData1.templateJson) {
            var templateJson1 = JSON.parse(templatData1.templateJson);
            var mostSupportPrizeCount = templateJson1.data.prizeConfig.mostSupportPrizeCount;
            this.giftBagData.mostSupportPrizeCount = mostSupportPrizeCount;

            if (templateJson1.data.goodConfig && templateJson1.data.goodConfig.addSkuNum) {
              //加购礼包
              var addSkuNum = templateJson1.data.goodConfig.addSkuNum;
            }
          } else {
            this.giftBagData.mostSupportPrizeCount = 0;
          }
          this.templateId = sessionStorage.getItem('templateId');
          this.giftType = sessionStorage.getItem('giftType');

          this.styleDataNew = this.styleData;
          console.log(this.styleData.uiModalBody, 'this.uiModalBody');
          this.$forceUpdate();
          if (this.isTemplate) {
            if (this.templateData) {
              console.log(this.templateData, '预览数据');
              let shopGift = this.templateData.shopGift;
              if (shopGift.draw && shopGift.draw.prizeList && shopGift.draw.prizeList.length > 0) {
                for (var j = 0; j < shopGift.draw.prizeList.length; j++) {
                  for (var i = 0; i < this.prizeTypeArr.length; i++) {
                    if (this.prizeTypeArr[i].prizeType == shopGift.draw.prizeList[j].prizeType) {
                      shopGift.draw.prizeList[j].prizeTypeName = this.prizeTypeArr[i].name;
                    }
                  }
                }
                this.giftBagData.prizeData = shopGift.draw.prizeList;
              }
            } else {
              //没有真实数据
              console.log('奖品数量');
              for (var m = 0; m < addSkuNum; m++) {
                var obj = {
                  skuImg: 'https://img10.360buyimg.com/n1/jfs/t1/111877/7/13696/149040/5f227effE4515386e/6b3c7c925c6c54cf.jpg',
                  skuName: '演示商品1',
                  skuPrice: '9.9',
                  skuId: '20972513544'
                };
                obj.name = obj.name + m;
                obj.price = parseFloat(obj.price) - m;
                this.giftBagData.exposedGoods = this.giftBagData.exposedGoods.concat(obj);
              }
              for (var j = 0; j < this.giftBagData.mostSupportPrizeCount; j++) {
                var obj = {
                  prizeType: '',
                  beanNum: '',
                  prizeTypeName: '',
                  priceInfo: ''
                };
                let randomNum = parseInt(Math.random() * 4); //Math.ceil(Math.random()*10); //parseInt(Math.random()*1+1,4);
                let beanNum = parseInt(Math.random() * 100);
                let priceInfo = parseInt(Math.random() * 100);
                obj.prizeType = this.prizeTypeArr[randomNum].prizeType;
                obj.beanNum = beanNum;
                obj.priceInfo = priceInfo;

                this.giftBagData.prizeData = this.giftBagData.prizeData.concat(obj);
                for (var i = 0; i < this.prizeTypeArr.length; i++) {
                  if (this.prizeTypeArr[i].prizeType == this.giftBagData.prizeData[j].prizeType) {
                    obj.prizeTypeName = this.prizeTypeArr[i].name;
                  }
                }
                this.giftBagData.prizeData[j] = obj;
              }
              console.log(this.giftBagData, '奖品数据');
            }
          } else {
            //创建礼包成功
            shopGiftMain(shopGiftMain => {
              console.log(shopGiftMain, '真实数据shopGiftMain');
              let shopGiftDataAll = shopGiftMain.data;
              // memberUser  1是会员  0不是会员
              this.isMember = shopGiftDataAll.memberUser; // 是否已经是会员
              this.getPrizeData = {
                flag: shopGiftDataAll.flag,
                memberUser: shopGiftDataAll.memberUser,
                name: shopGiftDataAll.name,
                visitor: shopGiftDataAll.visitor,
                position:shopGiftDataAll.position
              };
              console.log(this.getPrizeData, 'this.getPrizeData');
              let giftType = shopGiftDataAll.shopGiftRule.giftType;
              sessionStorage.setItem('giftType', giftType);
              this.giftType = giftType;
              if (shopGiftDataAll.prizeInfoList && shopGiftDataAll.prizeInfoList.length > 0) {
                for (var j = 0; j < shopGiftDataAll.prizeInfoList.length; j++) {
                  for (var i = 0; i < this.prizeTypeArr.length; i++) {
                    if (this.prizeTypeArr[i].prizeType == shopGiftDataAll.prizeInfoList[j].prizeType) {
                      shopGiftDataAll.prizeInfoList[j].prizeTypeName = this.prizeTypeArr[i].name;
                    }
                  }
                }
                this.giftBagData.prizeData = shopGiftDataAll.prizeInfoList;
              }
              if (shopGiftDataAll.skuInfos && shopGiftDataAll.skuInfos.length > 0) {
                this.giftBagData.exposedGoods = shopGiftDataAll.skuInfos;
                // skuInfos
              }
              if(shopGiftDataAll.shopGiftRule.isShowPrice){
                this.giftBagData.isShowPrice = shopGiftDataAll.shopGiftRule.isShowPrice
              }
              if(shopGiftDataAll.outAnimateName){
                this.giftBagData.autoHalfType = shopGiftDataAll.autoHalfType
                this.giftBagData.outAnimateName = shopGiftDataAll.outAnimateName
                this.giftBagData.enterAnimateName = shopGiftDataAll.enterAnimateName
                this.giftBagData.biGift = shopGiftDataAll.biGift
                // this.giftBagData.biGift.url = shopGiftDataAll.biGift.url?shopGiftDataAll.biGift.url:''
                this.giftBagData.newOpenCardUrl = shopGiftDataAll.newOpenCardUrl
                this.giftBagData.flag = shopGiftDataAll.flag
                this.giftBagData.name = shopGiftDataAll.name
                this.giftBagData.position = shopGiftDataAll.position
              }
              
              console.log(this.isMember, '真实数据');
              this.$forceUpdate();
              this.timer = new Date().getTime();
            });
          }
        // });
      } else {
        //千人千面没有预览
        if (!this.isTemplate) {
          shopGiftMain(shopGiftMain => {
            this.biGift = shopGiftMain.data.biGift;
            this.getPrizeData = {
              flag: shopGiftMain.data.flag,
              memberUser: shopGiftMain.data.memberUser,
              name: shopGiftMain.data.name,
              visitor: shopGiftMain.data.visitor,
              position:shopGiftMain.data.position,
            };
            // console.log(this.getPrizeData,'this.getPrizeData')
            console.log(this.biGift, '千人千面主接口1111111');
            this.$forceUpdate();
          });
        } else {
          let imageMessage = JSON.parse(sessionStorage.getItem('imageMessage'));
          console.log(imageMessage, 'imageMessage');
          this.biGift = {
            imgWidth: imageMessage.imgWidth,
            imgHigh: imageMessage.imgHigh,
            showImg: imageMessage.showImg
          };
        }
      }
    },

    btnClickEmit(data) {
      this.isGiftTrue = sessionStorage.getItem('isGiftTrue');
      console.log(this.isGiftTrue, '点击收下礼包');
      if (this.isTemplate) {
        // this.$toast('收下礼包成功');
        this.$toast('仅供预览');
        // closeGiftPop(this, () => {});
      } else {
        if (this.isGiftTrue == 'true' || this.isGiftTrue == true) {
          if (this.giftType == '2') {
            if (!this.temData.isSetOpen) {
              //未设置会员礼包样式
              if (this.isMember > 0) {
                //是会员但是没有设置会员样式则不跳转直接关闭
                drawShopGift(this.getPrizeData, drawData => {
                  this.$toast('收下礼包成功');
                  // 关弹窗
                  // 如果有链接 跳转链接 
                });
                closeGiftPop(this, () => {});

              } else {
                //不是会员且没有设置会员样式则打开非会员开卡样式
                // 如果有链接 跳转链接
                drawShopGift(this.getPrizeData, drawData => {
                  this.$toast('收下礼包成功');
                });
                closeGiftPop(this, () => {});
                if (this.temData.noOpenVipUrl) {
                  console.log(this.temData.noOpenVipUrl,'noOpenVipUrl');
                  jumpGetCoupon(this.temData.noOpenVipUrl, () => {});
                }
              }
            } else {
              //设置会员开卡样式
             
              if (this.isMember > 0) {
                //是会员但是没有设置会员样式则不跳转直接关闭
                drawShopGift(this.getPrizeData, drawData => {
                  this.$toast('收下礼包成功'); 
                });
                // 关弹窗
                // 如果有链接 跳转链接
                closeGiftPop(this, () => {});
                if (this.temData.openVipUrl) {
                   console.log(this.temData.openVipUrl,'openVipUrl');
                  jumpGetCoupon(this.temData.openVipUrl, () => {});
                }
              } else {
                //不是会员且没有设置会员样式则打开非会员开卡样式
                // 如果有链接 跳转链接
                drawShopGift(this.getPrizeData, drawData => {
                  this.$toast('收下礼包成功');  
                });
                closeGiftPop(this, () => {});
                if (this.temData.noOpenVipUrl) {
                  console.log(this.temData.noOpenVipUrl,'noOpenVipUrl');
                  jumpGetCoupon(this.temData.noOpenVipUrl, () => {});
                }
              }
            }
          } else if (this.giftType == '1' || this.giftType == '3' || this.giftType == '4') {
            drawShopGift(this.getPrizeData, drawData => {
              this.$toast('收下礼包成功');
            });
            closeGiftPop(this, () => {});
            //现在没有链接不跳转
          } else {
            drawShopGift(this.getPrizeData, drawData => {
              this.$toast('收下礼包成功');
            });
            closeGiftPop(this, () => {});
            if (this.biGift.url) {
              jumpGetCoupon(this.biGift.url, () => {});
            }
          }
        }
        else {
          console.log('不进行任何操作');
          this.$toast('仅供预览');
        }
      }
    }
  }
};
</script>

<style lang="scss" scoped="scoped">
.shopGiftBasicMessageDivAllC {
  width: 100%;
  min-height: 100vh;
  position: absolute;
  top: 0;
}
</style>
