<template>
<div ref="cartMyFriend"
    @click="styleClick('click', 'cartMyFriend')"
    @mousemove="styleClick('mousemove', 'cartMyFriend')"
    @mouseout="styleClick('mouseout')"
    :style="styleData.myFriendAll">
     <img :style="styleData[keyData.myFriendBtn]" :src="styleData.myFriendBtn.imageUrl" @click="addSkuHelpFriend" alt="">    
</div>
 
     
</template>
<script>
import {addSkuHelpFriendComService } from '../../../util/comCreate.js';
import store from "../../../store/store";
export default {
    components: {
        store,
    },
    props:['datas','keyData','styleData','isTemplate', "templateData","isWebClick",
    "modifyContent",],
    data() {
        return {
            shoppingCard:[],
            shareFlag: false,
            shopLogoUrl:'',
            shopName:'',
            userCount:0,
            priceDate1:'',
            activityStart:'',
            activityEnd:'',
            shareUserId:'',//用户id取得
            shareNum: 0,
            shareNumName:'',
            shopId:'',
            followStoreFlag: true,
            addSkuStartTime: "",
            addSkuEndTime: "",
              styleDataOld: {},
      isCustomSwitching: "", //有tab切换时
        };
    },
    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,
          isCustomSwitching: this.isCustomSwitching, //有tab切换时
          c_this: this,
          styleDataOld: this.styleDataOld,
        };
        this.$emit("opertaionCom", type, byValue);
      }
    },
     addSkuHelpFriend(){
        if (this.isTemplate == true) {
            this.$toast("活动预览，仅供查看");
            return;
        }
        if(new Date().getTime()<new Date(this.addSkuStartTime).getTime() || new Date().getTime()>new Date(this.addSkuEndTime).getTime()){
            this.$toast('活动未开始');
            return;
        }
        addSkuHelpFriendComService.create(
            (submit) => {
            addSkuHelpFriendComService.close();
            }
        );
    }
    }
};
</script>