<template>
  <div :style="styleData.distancePopStyle" v-show="show">
    <!-- v-show控制弹窗 -->
    <div :style="styleData.box" @click='clickEmpty()'>
      <div :style="styleData.distancePopBoxStyle" @click='stopClickEmpty'>
        <div :style="styleData.titleImgStyle">
          <img :style="styleData.titleImgStyleImg" :src="styleData.titleImgStyleImg.titleImg" />
        </div>
        <div class="builtinfo" :style="styleData.builtinfo">
          <div>开工时间：{{ nowStartTime }}</div>
          <div>竣工时间：{{ time }}</div>
          <div>竣工楼层：{{ buildHigh }}</div>
          <div>施工人数：{{ buildManNum }}</div>
          <div style="color: rgb(252, 60, 44);">中奖人数：{{ long }}</div>
        </div>
        <div :style="styleData.btnimgboxStyle" @click="PopButton()" class="btnimgbox">参观大楼</div>

        <div>
          <div :style="styleData.closeStyle" @click="PopButton()">
            <img :src="styleData.closeStyle.closeImg" alt />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import bus from '../../../util/bus.js';
export default {
  props: [],
  data() {
    return {
      starttime: 1626775200,
      endtime: 1626775200,
      distanceShadow: false,
      timeed: '',
      time: '',
      time1: null,
      nowStartTime: null,
      buildHigh: 0, //楼层
      buildManNum: 0,
      long: null
    };
  },
  created() {
    this.initDadas();
  },

  methods: {
    PopButton() {
      this.submit();
    },
    initDadas(data) {
      this.buildHigh = this.datas.bulidCount;
      this.buildManNum = this.datas.userCount;
      this.time = this.nowTime(new Date(this.datas.endTime));
      this.nowStartTime = this.nowTime(new Date(this.datas.startTime));
      this.long = this.winnerData.data.length;
    },
    nowTime(nowTime) {
      var year = nowTime.getFullYear();
      var month;
      var day;
      if (nowTime.getMonth() + 1 < 10) {
        month = '0' + (nowTime.getMonth() + 1);
      } else {
        month = nowTime.getMonth() + 1;
      }
      if (nowTime.getDate() < 10) {
        day = '0' + nowTime.getDate();
      } else {
        day = nowTime.getDate();
      }
      var time = year + '年' + month + '月' + day + '日';
      return time;
    },
    //点击空白处关闭弹框
    clickEmpty(){
      this.submit();
    },
    //阻止冒泡
    stopClickEmpty(event){
      event.stopPropagation();
    },
  }
};
</script>
<style scoped>
.btnimgbox {

}
</style>
