<template>
  <div
    class="bargainingDiv"
    ref="goToShop"
    @click="styleClick('click', 'goToShop')"
    @mousemove="styleClick('mousemove', 'goToShop')"
    @mouseout="styleClick('mouseout')"
  >
  <div
      v-if="isWebClick"
      :style="styleData.shop"
    ></div>
    <div
    v-else
      :style="styleData.shop"
      v-lz-click="'4'"
      @click="goToShop()"
    ></div>
  </div>
</template>

<script>
import apis1 from '../../../util/apis1.js';
let {storeGoodsPoint} = apis1
import { goToShopPage } from "../../../util/tools.js";
import store from '../../../store/store.js'
export default {
  props: ["datas", "styleData", "keyData", "isTemplate", "templateData", "isWebClick", "modifyContent"],
  data() {
    return {
      styleDataOld:{}
    };
  },
   created() {
     //深拷贝重置需要
    this.styleDataOld = JSON.parse(JSON.stringify(this.styleData));
  },
  methods: {
      styleClick(type, refName) {
      if (this.isWebClick) {
        //传值给B端
        let byValue = {
          modifyContent: this.modifyContent,
          refName: refName,
          styleData: this.styleData,
          c_this: this,
          styleDataOld: this.styleDataOld,
        };
        this.$emit("opertaionCom", type, byValue);
      }
    },
    goToShop() {
      if (this.isTemplate == true) {
        this.$toast("活动预览，仅供查看");
      } else {
        storeGoodsPoint(4)
        goToShopPage(store.state.shopId);
      }
    },
  },
};
</script>

<style>
.bargainingDiv{
  width: .5rem;
  height: 1.29rem;
  position: absolute;
    right: 0px;
    top: 3.14rem;
}
</style>
