<template>
  <div :style="styleDataNew.strategyAll ? styleDataNew.strategyAll : null" ref="strategyNew"
      @click.stop="styleClick('click', 'strategyNew')"
      @mousemove.stop="styleClick('mousemove', 'strategyNew')"
      @mouseout.stop="styleClick('mouseout')">
      <div  class="strategyDiv"
      :style="styleDataNew.strategy" v-if="activityType != 10070"></div>
      <div v-else>
       <div
        class="strategyDiv"
        :style="styleDataNew.strategy" v-if="isOpen == '0'"></div>
      <div
        class="strategyDiv"
        :style="styleDataNew.strategy1" v-if="isOpen == '1'"></div>
      </div>
    
  </div>
</template>

<script>
export default {
  props: ['styleData', 'keyData', 'datas', 'templateData', 'isWebClick', 'modifyContent'],
  data() {
    return {
      styleDataOld: {},
      isOpen:'',
      activityType:sessionStorage.getItem('activityType')
    };
  },
  created() {
    //深拷贝重置需要
    this.styleDataOld = JSON.parse(JSON.stringify(this.styleData));
    this.styleDataNew = this.styleData;
    // 10070活动是否开启排行榜
    this.publicData.$on('isOpen',(val) => {
     this.isOpen = val
     console.log(this.isOpen == '0',this.styleDataNew.strategy,'valvalvalvalval')
    })
  },
  mounted() {},

  methods: {
    //点击可修改位置的方法
    styleClick(type, refName) {
      if (this.isWebClick) {
        //传值给B端
        let byValue = {
          modifyContent: this.modifyContent,
          refName: refName,
          styleData: this.styleDataNew,
          c_this: this,
          styleDataOld: this.styleDataOld
        };
        this.$emit('opertaionCom', type, byValue);
      }
    },
    initData() {}
  }
};
</script>

<style lang="scss">
.strategyDiv {
  // position: absolute;
  // position: absolute;
  // overflow: hidden;
}
</style>
