<template>
  <div>
    <!-- <div class="usernamediv" :style="styleData.usernamediv">
      <img
        class="userTouxiangimg"
        :src="attrTouXiang"
        :style="styleData.userTouxiangimg"
      />
      <span>{{ userInfo.nicknameShow }}</span>
    </div>
    <div class="sendend" :style="styleData.sendend" v-if="timer">
      很抱歉您来晚了，奖品已经发放完毕了哟~
    </div> -->
  </div>
</template>
<script>
import store from "../../../store/store";
import bus from "../../../util/bus.js";
import { goToShopPage } from "../../../util/tools.js";
import apis1 from "../../../util/apis1.js";
import { Toast } from "vant";
let {
  getPoints,
  pointsDraw,
  followShop,
  drawPrize,
  setSharePrize,
  bargainFriends,
  myprize,
} = apis1;
export default {
  props: ["isTemplate", "datas", "keyData", "styleData", "templateData"],
  components: {},
  data() {
    return {
      attrTouXiang:
        "https://img10.360buyimg.com/imgzone/jfs/t1/9529/39/3166/1273/5bd67241E2d74c9d5/19440fb8b44dd788.png", //默认用户头像
      userInfo: {
        nicknameShow: "预览",
        timer: true,
      }, // 用户信息
      timer: false,
    };
  },
  created() {
    this.initData();
  },
  methods: {
    initData() {
      var datasAll = this.templateData;
      if (this.isTemplate == true) {
        if (datasAll) {
          console.log(datasAll, "ccccc");
          if (datasAll.drawChanceData.mostPartakeCount) {
            this.limitTimes = datasAll.drawChanceData.mostPartakeCount;
          }
          if (datasAll.sharePolite.isFollow == 1) {
            this.needFollow = 1;
          }
          this.myjifen = 10;
        } else {
          this.limitTimes = 1;
          this.myjifen = 10;
        }
      } else {
        // setSharePrize((data) => {
        //   //调用分享有礼接口
        //   this.userInfo.nicknameShow = data.data.nickName; //将用户名赋值
        //   this.attrTouXiang = data.data.userImg; //将用户头像赋值
        //   bus.$emit("data", data.data); //将数据提供


        //   drawPrize((data1) => {
        //     //调用礼品列表接口
        //     bus.$emit("ourprizeList", data1.data.prizeInfo); //将数据提供
        //     bargainFriends((data2) => {
        //       //调用邀请助力接口
        //       bus.$emit("helpList", data2); //将数据提供出去
        //       bus.$emit("num", data2.data.num); //将数据提供出去
        //     });
        //   });

        //   var nowStatus = 0;
        //   data.data.shareSuccessTimesList.forEach((v, i) => {
        //     if (v.status == 0) {
        //       nowStatus++;
        //     }
        //     if (nowStatus == data.data.shareSuccessTimesList.length) {
        //       this.timer = true;
        //     }
        //   });
        // });
      }
    },
  },
};
</script>