<template>
	<div id="index" class="indexClass" :style="mainStyle" prizeName="prizeName" v-lz-scroll>
		<div class="compontDiv">
			<component
				ref="dataRef"
				v-for="(value, key, index) in componentsData"
				:key="index"
				:is="value.config.name"
				:isTemplate="isTemplate"
				:styleData="value.config.styleData"
				:datas="value.config.defaultDatas"
				:keyData="value.config.keyData"
				:templateData="templateData"
			></component>
		</div>
		<div class="bottomDivAll" v-if="isShowBottomDiv">
			<!-- <div><img src="//img10.360buyimg.com/imgzone/jfs/t1/194391/37/24804/4894/628c738eEa1cb17bd/e87be1c62a6036c2.png" /></div> -->
			<div class="bottomPromptDiv">我也是有底线的哦~</div>
		</div>
	</div>
</template>

<script>
import Vue from 'vue';
import dataJson from '../../../src/data.json';
import { getQueryObject, getUrlQueryValueByKey } from '../../util/tools';
import { callShare } from '../../util/share';
import 'vant/lib/index.css';
import store from '../../store/store';
import apis1 from '../../util/apis1.js';
let { priviewDate, getTemplate } = apis1;
// import { Toast, CountDown, Notify } from 'vant';
// Vue.use(Toast, Notify, CountDown);
import activity1Json from '../../json/activity1Version2.json';
import activity1_2Json from '../../json/activity1Version3.json'; //YSL累计签到抽奖
import activity2Json from '../../json/activity2.json';
import activity2_2Json from '../../json/activity2-2.json';
import activity3_1Json from '../../json/activity3-1.json';
import activity3_2Json from '../../json/activity3-2.json';
import activity4Json from '../../json/activity4.json';
import activity5Json from '../../json/activity5.json';
import activity6_1Json from '../../json/activity6-1.json';
import activity6_2Json from '../../json/activity6-2.json';
import activity6_3Json from '../../json/activity6-3.json'; //YSL邀请入会有礼
import activity6_4Json from '../../json/activity6-4.json'; //YSL邀请入会有礼
import activity7Json from '../../json/activity7.json';
import activity7_1Json from '../../json/activity7-1.json';
import activity8Json from '../../json/activity8.json';
import activity9Json from '../../json/activity9.json';
import activity10Json from '../../json/activity10.json';
import activityqaJson from '../../json/qa.json';
import activityQuestionnaireJson from '../../json/questionnaire.json';
import sharePictureVideoJson from '../../json/sharePictureVideo.json';
import activity15Json from '../../json/activity15.json';
import activity14Json from '../../json/activity14.json';
import activity20Json from '../../json/activity20.json';
import activity21Json from '../../json/activity21.json';
import activity21_1Json from '../../json/activity21-1.json';
import activity21_3Json from '../../json/activity21-3.json'; //YSL大转盘抽奖
import activity21_2Json from '../../json/activity21-2.json';
import activity22Json from '../../json/activity22.json';
import activity23Json from '../../json/activity23.json';
import activity23_1Json from '../../json/activity23-1.json';
import activity24Json from '../../json/activity24.json';
import activity25Json from '../../json/activity25.json';
import activity30Json from '../../json/activity30.json';
import activity26Json from '../../json/activity26.json';
import activity26_1Json from '../../json/activity26-1.json';
import activity27Json from '../../json/activity27.json';
import activity28Json from '../../json/activity28.json';
import activity32Json from '../../json/activity32.json';
import activity32_1Json from '../../json/activity32-1.json';
import activity32_2Json from '../../json/activity32-2.json';
import activity33Json from '../../json/activity33.json';
import activity34Json from '../../json/activity34.json';
import activity35Json from '../../json/activity35.json';
import activity31Json from '../../json/activity31.json';
import activity40Json from '../../json/activity40.json';
import activity39Json from '../../json/activity39.json'; //知识达人
import activity41Json from '../../json/activity41.json'; //骰子
import activity42Json from '../../json/activity42.json'; //刮刮乐
import activity43Json from '../../json/activity43.json'; //分享有礼
import activity37Json from '../../json/activity37.json';
import activity47Json from '../../json/activity47.json'; //盖楼有礼
import activity45Json from '../../json/activity45.json'; //买家秀
import activity45_1Json from '../../json/activity45-1.json'; //YSL买家秀
import activity36Json from '../../json/activity36.json';
import activity36_1Json from '../../json/activity36-1.json'; //ysl购物车锦鲤
import activity36_2Json from '../../json/activity36-2.json'; //ysl购物车锦鲤
import activity46Json from '../../json/activity46.json'; //老虎机
import activity44Json from '../../json/activity44.json'; //投票有礼
import activity48Json from '../../json/activity48.json'; //限时抢券
import activity49Json from '../../json/activity49.json'; //完善信息
import activity50Json from '../../json/activity50.json'; //会员试用
import activity51Json from '../../json/activity51.json'; //0元砍
import activity52Json from '../../json/activity52.json'; //助力抢红包
import activity54Json from '../../json/activity54.json'; //上上签
import activity60Json from '../../json/activity60.json'; //优惠券营销
import activity64Json from '../../json/activity64.json'; //优惠券营销
import activity57Json from '../../json/activity57.json'; //让福袋飞
import activity38Json from '../../json/activity38.json'; //拉人砍价
import activity55Json from '../../json/activity55.json'; //N元试用

import activity53Json from '../../json/activity53.json'; //关注商品有礼

import activity58Json from '../../json/activity58.json'; //店铺礼包
import activity66Json from '../../json/activity66.json'; //排行榜
import activity68Json from '../../json/activity68.json'; //邀请关注店铺有礼
import activity69Json from '../../json/activity69.json'; //新的关注店铺有礼
import activity70Json from '../../json/activity70.json'; //邀请入会有礼排行榜
import activity71Json from '../../json/activity71.json';
import activity70_2Json from '../../json/activity70-2.json';
import activity73Json from '../../json/activity73.json';
import activity74Json from '../../json/activity74.json'; //买家秀
import activity74_1Json from '../../json/activity74-1.json';


import activity59Json from '../../json/activity59.json';
import activity63Json from '../../json/activity63.json';
import activity62Json from '../../json/activity62.json';
import activity69_2Json from '../../json/activity69-2.json'; //新的关注店铺有礼
import activity69_3Json from '../../json/activity69-3.json'; //新的关注店铺有礼

import activity15_2Json from '../../json/activity15-2.json';
export default {
	name: 'Index',

	data() {
		return {
			isShowBottomDiv: false, //是否显示底部标志
			isTemplate: true, //是否是B端的模板浏览
			templateData: '', //预览数据
			mainStyle: {
				'padding-bottom': '40px',
				// background: ' #fd1d25',
				'min-height': '100vh',
				width: '100%'
			}, //整个背景样式
			componentsData: {},
			basicJson: '',
			previewCode: ''
		};
	},

	// 父beforeCreated ->父created ->父beforeMounted ->子beforeCreated ->子created ->子beforeMounted ->子mounted -> 父mounted
	async created() {
		let shareUserId1 = getQueryObject('?', location.href);
		console.log(shareUserId1, 'shareUserId1shareUserId1shareUserId1');

		this.priviewId = shareUserId1.activityData;
		this.previewCode = shareUserId1.previewCode;
		let shareUserId = shareUserId1.shareUserId;
		let tabValue = shareUserId1.tabValue;

		store.commit('setTabValue', tabValue);
		store.commit('setPriviewId', this.priviewId);
		store.commit('setShareUserId', shareUserId); //13441 85866492006402
		this.activityType = sessionStorage.getItem('activityType');

		await this.initAppData();
		if (sessionStorage.getItem('templateId')) {
			console.log('xxzxczxczxczxczxczxccxccccccc', this.activityType);
			getTemplate(data => {
				console.log(this.previewCode, 'this.previewCodethis.previewCode');
				if (this.previewCode) {
					this.basicJson = data.data.basicJson;
				}
				// console.log(data.data.basicJson,'data.data.basicJsondata.data.basicJson')

				//B端自定义入口打开去掉改判断
				if (this.activityType == 10081 || this.activityType == 10032) {
					this.basicJson = data.data.basicJson;
				}

				this.templateId = sessionStorage.getItem('templateId');
				sessionStorage.setItem('customizedStatus', data.data.customizedStatus);

				if (this.activityType == 1 || this.activityType == 10001) {
					if (this.templateId == '202204181603ljqdysl002') {
						var comAllData = activity1_2Json;
					} else {
						// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity1Json;
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity1Json;
						}
					}

					// var comAllData = activity58Json
				} else if (this.activityType == 2 || this.activityType == 10002) {
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity2Json;
					if (this.templateId == '2020122808330ljqdsl02') {
						var comAllData = activity2_2Json;
					}
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity2Json;
					}
				} else if (this.activityType == 3 || this.activityType == 10003) {
					if (this.templateId == '20201228083300ljqdsl01') {
						var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity3_1Json;
					} else if (this.templateId == '20201228083300ljqdsl02') {
						var comAllData = activity3_2Json;
					} else {
						// var comAllData = JSON.parse(data.data.basicJson);
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity3_1Json;
						}
					}
				} else if (this.activityType == 4 || this.activityType == 10004) {
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity4Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity4Json;
					}
				} else if (this.activityType == 5 || this.activityType == 10005) {
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity5Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity5Json;
					}
				} else if (this.activityType == 6 || this.activityType == 10006) {
					if (this.templateId == '20201228083300yqrhyl01') {
						var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity6_1Json;
					} else if (this.templateId == '20201228083300yqrhyl02') {
						var comAllData = activity6_2Json;
					} else if (this.templateId == '202204181615yqrhylysl01') {
						var comAllData = activity6_3Json;
					} else if (this.templateId == '20201228083300yqrhyl0111') {
						var comAllData = activity6_4Json;
					} else {
						// var comAllData = JSON.parse(data.data.basicJson);
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity6_1Json;
						}
					}
				} else if (this.activityType == 7 || this.activityType == 10007) {
					if (this.templateId == '20201228083300yqrhkj02') {
						var comAllData = activity7_1Json;
					} else {
						// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity7Json;
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity7Json;
						}
					}
				} else if (this.activityType == 10008) {
					// var comAllData = activity8Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity8Json;
					}
				} else if (this.activityType == 10009) {
					// var comAllData = activity9Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity9Json;
					}
				} else if (this.activityType == 10010) {
					// var comAllData = activity10Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity10Json;
					}
				} else if (this.activityType == 10011) {
					// 答题有礼
					// var comAllData = activityqaJson;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activityqaJson;
					}
				} else if (this.activityType == 10012) {
					// 问卷有礼
					// var comAllData = activityQuestionnaireJson;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activityQuestionnaireJson;
					}
				} else if (this.activityType == 10013) {
					// 分享图片视频有礼
					// var comAllData = sharePictureVideoJson;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = sharePictureVideoJson;
					}
				} else if (this.activityType == 10015) {
					// 评价有礼
					if (this.templateId == '202518190900ldati11') {
						var comAllData = activity15_2Json;
					} else {
						// var comAllData =
						//   data.data.customizedStatus == 2
						//     ? JSON.parse(data.data.basicJson)
						//     : activity15Json;
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity15Json;
						}
					}
				} else if (this.activityType == 10014) {
					// 上传图片点赞
					// var comAllData = activity14Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity14Json;
					}
				} else if (this.activityType == 10020) {
					// 九宫格抽奖
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity20Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity20Json;
					}
				} else if (this.activityType == 10021) {
					// 大转盘抽奖
					console.log(this.templateId, 'klklklklkl');
					if (this.templateId == '20220321151200dzpcj02') {
						//阿玛尼定制模板
						var comAllData = activity21_1Json;
					} else if (this.templateId == '20220418140400dzpcj04') {
						var comAllData = activity21_2Json;
					} else if (this.templateId == '20220418140200dzpysl03') {
						//YSL定制模板
						var comAllData = activity21_3Json;
					} else {
						console.log(this.basicJson, 'this.basicJson2312323');
						// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity21Json;
						if (this.basicJson && this.basicJson != '{}') {
							console.log(this.basicJson, 'this.basicJson2312323');
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity21Json;
						}
					}
				} else if (this.activityType == 10022) {
					// 每日抢好礼
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity22Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity22Json;
					}
				} else if (this.activityType == 10023) {
					if (this.templateId == '2020122808330rlqd01') {
						//定制模板
						var comAllData = activity23_1Json;
					} else {
						// 日历签到
						// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity23Json;
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity23Json;
						}
					}
				} else if (this.activityType == 10024) {
					// 加购有礼
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity24Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity24Json;
					}
				} else if (this.activityType == 10025) {
					// 关注店铺有礼
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity25Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity25Json;
					}
				} else if (this.activityType == 10030) {
					// 下单有礼
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity30Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity30Json;
					}
				} else if (this.activityType == 10031) {
					//扭蛋机抽奖
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity31Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity31Json;
					}
				} else if (this.activityType == 10026) {
					console.log(this.templateId, 'this.templateId');
					// 积分抽奖
					if (this.templateId == '20220422152500jfcj02') {
						var comAllData = activity26_1Json;
					} else {
						console.log('进入了');
						// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity26Json;
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity26Json;
						}
					}
				} else if (this.activityType == 10027) {
					// 积分猜PK
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity27Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity27Json;
					}
				} else if (this.activityType == 10028) {
					// 积分猜大小
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity28Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity28Json;
					}
				} else if (this.activityType == 10032) {
					if (this.templateId == '20220425142200jkyl01') {
						var comAllData = activity32_1Json;
					} else if (this.templateId == '20210621190900jkyl0291') {
						var comAllData = activity32_2Json;
					} else {
						// console.log('进来',this.basicJson)
						// 集卡有礼
						// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity32Json;
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity32Json;
						}
					}
				} else if (this.activityType == 10033) {
					// 组队瓜分奖品
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity33Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity33Json;
					}
				} else if (this.activityType == 10034) {
					// 裂变神券
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity34Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity34Json;
					}
				} else if (this.activityType == 10035) {
					// 读秒拼手速
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity35Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity35Json;
					}
				} else if (this.activityType == 10038) {
					// 拉人砍价
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity38Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity38Json;
					}
				} else if (this.activityType == 10055) {
					// N元试用
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity55Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity55Json;
					}
				} else if (this.activityType == 10039) {
					// 知识超人
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity39Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity39Json;
					}
				} else if (this.activityType == 10041) {
					// 骰子
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity41Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity41Json;
					}
				} else if (this.activityType == 10037) {
					// 粉丝互动
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity37Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity37Json;
					}
				} else if (this.activityType == 10036) {
					// 粉丝互动
					if (this.templateId == '202204181609gwcjlysl01') {
						var comAllData = activity36_1Json;
					} else if (this.templateId == '2021070590900gwcjl0891') {
						var comAllData = activity36_2Json;
					} else {
						// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity36Json;
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity36Json;
						}
					}
				} else if (this.activityType == 10042) {
					// 刮刮乐
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity42Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity42Json;
					}
				} else if (this.activityType == 10040) {
					// 7日签到
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity40Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity40Json;
					}
				} else if (this.activityType == 10047) {
					// 盖楼有礼
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity47Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity47Json;
					}
				} else if (this.activityType == 10045) {
					// 买家秀
					if (this.templateId == '202204181613mjxysl01') {
						var comAllData = activity45_1Json;
					} else {
						// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity45Json;
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity45Json;
						}
					}
				} else if (this.activityType == 10046) {
					// 老虎机抽奖
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity46Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity46Json;
					}
				} else if (this.activityType == 10059) {
					// 老虎机抽奖
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity59Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity59Json;
					}
				} else if (this.activityType == 10044) {
					// 投票有礼
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity44Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity44Json;
					}
				} else if (this.activityType == 10043) {
					// 分享有礼
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity43Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity43Json;
					}
				} else if (this.activityType == 10048) {
					// 限时抢券
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity48Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity48Json;
					}
				} else if (this.activityType == 10051) {
					// 0元砍
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity51Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity51Json;
					}
				} else if (this.activityType == 10049) {
					// 完善信息有礼
					// var comAllData = activity49Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity49Json;
					}
				} else if (this.activityType == 10050) {
					// 会员试用
					// var comAllData = activity50Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity50Json;
					}
				} else if (this.activityType == 10052) {
					// 助力抢红包
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity52Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity52Json;
					}
				} else if (this.activityType == 10054) {
					// 上上签
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity54Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity54Json;
					}
				} else if (this.activityType == 10053) {
					// 关注商品有礼
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity53Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity53Json;
					}
				} else if (this.activityType == 10057) {
					// 让福袋飞
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity57Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity57Json;
					}
				} else if (this.activityType == 10060) {
					// 优惠券营销
					// var comAllData = activity60Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity60Json;
					}
				} else if (this.activityType == 10058) {
					// 优惠券营销
					var comAllData = activity58Json;
					// if (this.basicJson  && this.basicJson != '{}') {
					//   var comAllData = JSON.parse(this.basicJson)
					// } else {
					//   var comAllData = activity58Json
					// }
				} else if (this.activityType == 10064) {
					// 前N名优惠
					// var comAllData = activity64Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity64Json;
					}
				} else if (this.activityType == 10065) {
					// 专享价营销
					// var comAllData = activity65Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity65Json;
					}
				} else if (this.activityType == 10066) {
					// 排行榜
					// var comAllData = activity66Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity66Json;
					}
				} else if (this.activityType == 10068) {
					// 排行榜
					// var comAllData = activity68Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity68Json;
					}
				} else if (this.activityType == 10069) {
					// 新的关注店铺有礼
					if (this.templateId == 'ac8b6564-aa35-4ba5-aa62-55b0ce61b5d1') {
						var comAllData = activity69_2Json;
					} else if (this.templateId == '059c0910-b0cb-48a7-bc9d-4490c466933c') {
						var comAllData = activity69_3Json;
					} else {
						// var comAllData = activity69Json;
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity69Json;
						}
					}
				} else if (this.activityType == 10070) {
					// 邀请入会排行榜
					// 邀请入会有礼排行榜
					var comAllData = activity70Json;
					if (this.templateId == '9440237d-5260-4010-974a-01b118809876') {
						var comAllData = activity70_2Json;
					} else {
						// var comAllData = activity70Json;
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity70Json;
						}
					}
				} else if (this.activityType == 10071) {
					// 评价有礼
					// var comAllData = data.data.customizedStatus == 2 ? JSON.parse(data.data.basicJson) : activity71Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity71Json;
					}
				} else if (this.activityType == 10073) {
					// 新积分抽奖
					// var comAllData = activity73Json;
					console.log(this.basicJson, 'this.basicJson');
					if (this.basicJson && this.basicJson != '{}') {
						console.log('122222222222');
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity73Json;
					}
				} else if (this.activityType == 10074) {
					// 新买家秀
					if (this.templateId == '202204181613mjxysl013') {
						var comAllData = activity74_1Json;
					} else {
						if (this.basicJson && this.basicJson != '{}') {
							console.log('122222222222');
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity74Json;
						}
					}
				} else if (this.activityType == 10063) {
					// 翻牌抽大奖
					// var comAllData = activity63Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity63Json;
					}
				} else if (this.activityType == 10062) {
					// 砸金蛋
					// var comAllData = activity62Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity62Json;
					}
				} else if (this.activityType == 10075) {
					// 砸金蛋
					// var comAllData = activity75Json;
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity75Json;
					}
				} else if (this.activityType == 10076) {
					// 积分猜大小
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity76Json;
					}
				} else if (this.activityType == 10077) {
					// 首购有礼
					if (this.templateId == '20210824190900zxjyx0111222') {
						var comAllData = activity77_1Json;
					} else {
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity77Json;
						}
					}
				} else if (this.activityType == 10078) {
					var comAllData = '';
					var actType = JSON.parse(data.data.taskJson);

					if (actType.needTaskList[0] == '103') {
						if (this.templateId == '20220902xfylmd0101') {
							var comAllData = activity78_3_3Json;
						} else {
							var comAllData = activity78_3Json;
						}
					} else if (actType.needTaskList[0] == '101') {
						if (this.templateId == '20210824190900zxjyx011127801') {
							var comAllData = activity78_1_1Json;
						} else {
							var comAllData = activity78_1Json;
						}
					} else if (actType.needTaskList[0] == '102') {
						if (this.templateId == '20220902xfylmj0101') {
							var comAllData = activity78_2_2Json;
						} else {
							var comAllData = activity78_2Json;
						}
					}
				} else if (this.activityType == 10079) {
					if (this.templateId == '202209051007jfdh1') {
						var comAllData = activity79_1Json;
					} else {
						if (this.basicJson && this.basicJson != '{}') {
							var comAllData = JSON.parse(this.basicJson);
						} else {
							var comAllData = activity79Json;
						}
					}
				} else if (this.activityType == 10080) {
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity80Json;
					}
				} else if (this.activityType == 10081) {
					if (this.basicJson && this.basicJson != '{}') {
						var comAllData = JSON.parse(this.basicJson);
					} else {
						var comAllData = activity81Json;
					}
				}
				// console.log(this.basicJson,comAllData,activity76Json,'comAllData')
				//动态注册组件
				comAllData.comMessage.forEach(app => {
					Vue.component(app.config.name, res => require([`../../${app.config.path}`], res).default);
				});
				this.mainStyle = comAllData.activityMessage.mainStyle;
				if (this.activityType == 10081) {
					this.mainStyle.backgroundImage = 'url(' + this.templateData.activity.topicImage + ')';
				}
				this.$forceUpdate();
				this.componentsData = comAllData.comMessage;
				if (this.activityType == 10014 || this.activityType == 10013 || this.activityType == 10058) {
					this.isShowBottomDiv = false;
				} else {
					var a = setTimeout(() => {
						this.isShowBottomDiv = true;
						clearTimeout(a);
					}, 1000);
				}
			});
		} else {
			console.log(this.activityType, 'this.activityType ');
			if (this.activityType == 10058) {
				// 优惠券营销
				var comAllData = activity58Json;
			}
			//动态注册组件
			comAllData.comMessage.forEach(app => {
				Vue.component(app.config.name, res => require([`../../${app.config.path}`], res).default);
			});
			this.mainStyle = comAllData.activityMessage.mainStyle;
			this.componentsData = comAllData.comMessage;
			if (this.activityType == 10014 || this.activityType == 10013 || this.activityType == 10058) {
				this.isShowBottomDiv = false;
			} else {
				var a = setTimeout(() => {
					this.isShowBottomDiv = true;
					clearTimeout(a);
				}, 1000);
			}
		}
	},

	methods: {
		async initAppData() {
			if (this.priviewId) {
				// console.log('priviewId', this.priviewId);
				await priviewDate(data => {
					// console.log(data, 'data1111111111111');
					this.templateData = data.data;
					this.basicJson = data.commonVO.customJsonData;
				});
			} else {
				this.templateData = null;
				// let index = 0;
				// for (let i in this.componentsData) {
				//   // this.$refs.dataRef[index].initData();
				//   this.templateData = null
				//   index = index + 1;
				// }
			}
		}
	}
};
</script>

<style lang="scss" scoped="scoped">
.indexClass {
	.compontDiv {
		position: relative;
	}
	.bottomDivAll {
		// position: absolute;
		// bottom: 0;
		margin-top: 0.2rem;
		padding-bottom: 1rem;
		img {
			width: 1.5rem;
			height: 0.9rem;
		}
		.bottomPromptDiv {
			font-size: 0.24rem;
			font-family: PingFang SC;
			font-weight: 500;
			color: #000;
			line-height: 0.2rem;
		}
	}
}
</style>
