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

import apis1 from "../../../util/apis1.js";
let { followShopTask, followShop, startAnswer, shareTask } = apis1;

import bus from "../../../util/bus.js";

export default {
  props: ["isTemplate", "datas", "keyData", "styleData", "templateData"],
  components: {},
  data() {
    return {
      winPrize: "0",
      followStatus: "0", //是否参与过
      newUser: "1", //是否需要新用户
      shopName: "",
      fuhuka: 0, //复活卡次数
      numLife: 2, //当前剩余答题次数
      dataList: [], //总数据
    };
  },
  created() {
    this.initData();
  },
  mounted() {},
  updated() {},
  methods: {
    async initData() {
      if (this.isTemplate) {
        var datasAll = this.templateData;
        if (datasAll) {
          // 获取关注店铺主接口

          // 关注店铺FLag
          var inFlag = 0;
          // 分享任务
          var shareTask = 0;
          this.prizeList = datasAll.draw.prizeList;
          if (datasAll.activeConditions) {
            if (datasAll.activeConditions.involvementFlag == 1) {
              inFlag = 1;
            }
          }
          if (datasAll.basicTask.taskList.length > 1) {
            shareTask = 1;
          }
          this.dataList = {
            involvementFlag: inFlag,
            nickName: "预览",
            reviveCount: 0,
            shareStatus: shareTask,
            userImg:
              "https://img10.360buyimg.com/imgzone/jfs/t1/9529/39/3166/1273/5bd67241E2d74c9d5/19440fb8b44dd788.png",
          };
        }
      } else {
        let actStatus = sessionStorage.getItem("actStatus");
        if (actStatus == 2) {
          this.$toast("活动已结束");
          return;
        }
        if (actStatus == 1) {
          this.$toast("活动未开始");
          return;
        }
        // 获取关注店铺主接口
        bus.$on("data", (content) => {
          console.log(content, "asdasdsssssssssssssssss");
          this.dataList = content;
          this.numLife = content.anCount;
        });
        bus.$on("prizeList", (content) => {
          this.prizeList = content;
        });
        bus.$on("fuhuka", (content) => {
          this.fuhuka = content;
        });
      }
    },
  },
};
</script>
<style lang="scss" scoped>

</style>