import Vue from 'vue'



import acRulePopCom from '../components/basisComponent/popCom/hdzxtrulePop.vue'
import myPrizePopCom from "../components/basisComponent/popCom/hdzxtmyPrizePop.vue"
import taskPopComNew from "../components/basisComponent/button/hdzxtdialogMore.vue"
import taskPopComNew1 from "../components/basisComponent/popCom/hdzxtTaskDialogMore.vue"
import followSkuPopNew from "../components/basisComponent/popCom/hdzxtfollowSkuPop.vue"
import hdzxtFollowSkuPopNew from "../components/basisComponent/popCom/hdzxtFollowSkuPopNew.vue"
import prizeResultPopCom from '../components/basisComponent/drawPrizeResult/hdzxtacquirething.vue'
import noPrizeResultPopCom from '../components/basisComponent/drawPrizeResult/hdzxtthanksjion.vue'
import joinVip from "../components/basisComponent/joinMemeber/AmnthresholdJoin/hdzxtJoinVip.vue"
import commonjoinVip from "../components/basisComponent/joinMemeber/hdzxtJoinVip.vue"
import sureFollowShopPop from "../components/basisComponent/joinMemeber/AmnthresholdJoin/hdzxtfollowShop.vue"
import commonsureFollowShopPop from "../components/basisComponent/joinMemeber/hdzxtfollowShop.vue"
import shopPopComNew from "../components/basisComponent/popCom/hdzxtShopPop.vue"
import drawCardPopCom from '../components/basisComponent/popCom/hdzxtdrawCardPop.vue'
import drawCardPopCom1 from '../components/basisComponent/popCom/hdzxtdrawCardPop1.vue'
import hdzxtAddress from '../components/basisComponent/popCom/hdzxtAddressPop.vue'
import hdzxtShareTaskPop from '../components/basisComponent/popCom/hdzxtShareTask.vue'
import hdzxtMyFriendPop from '../components/basisComponent/popCom/hdzxtMyFriend.vue'
import taskPopComNew2 from "../components/basisComponent/popCom/hdzxtTaskDialogMoreNew.vue"
import newBuyUserSheetConstructor from '../components/basisComponent/popCom/newBuyUserPop.vue'
import newBuyshareConstructor from '../components/basisComponent/popCom/newBuySharePop.vue'
const HdzxtAddressConstructor = Vue.extend(hdzxtAddress);
const AcRulePopComConstructor = Vue.extend(acRulePopCom);
const MyPrizePopComConstructor = Vue.extend(myPrizePopCom);
const TaskPopComConstructorNew = Vue.extend(taskPopComNew);
const TaskPopComConstructorNew1 = Vue.extend(taskPopComNew1);
const followSkuPopNewComConstructor = Vue.extend(followSkuPopNew);
const hdzxtFollowSkuPopNewComConstructor = Vue.extend(hdzxtFollowSkuPopNew);

const PrizeResultPopComConstructor = Vue.extend(prizeResultPopCom);
const ShopPopComNewConstructor = Vue.extend(shopPopComNew);
const NoPrizeResultPopComConstructor = Vue.extend(noPrizeResultPopCom);
const joinVipConstructor = Vue.extend(joinVip);
const CommonjoinVipConstructor = Vue.extend(commonjoinVip);
const DrawCardPopComConstructor = Vue.extend(drawCardPopCom);
const DrawCardPopComConstructor1 = Vue.extend(drawCardPopCom1);
const sureFollowShopPopComConstructor = Vue.extend(sureFollowShopPop);
const commonsureFollowShopPopComConstructor = Vue.extend(commonsureFollowShopPop);
const hdzxtShareTaskPopConstructor = Vue.extend(hdzxtShareTaskPop);
const HdzxtMyFriendPopConstructor = Vue.extend(hdzxtMyFriendPop);
const TaskPopComConstructorNew2 = Vue.extend(taskPopComNew2);
const newBuyUserSheetConstructorPop = Vue.extend(newBuyUserSheetConstructor);
const newBuyshareConstructorPop = Vue.extend(newBuyshareConstructor);
//活动规则
let acRulePopComInstance;
export const AcRulePopComService = {
    create(datas, isTemplate, templateData, styleDataNew, submit) {
        // console.log('333333333333333')
        let option = {
            datas: datas.datas,
            templateData: templateData,
            keyData: datas.keyData,
            styleData: datas.styleData,
            isTemplate: isTemplate,
            styleDataNew: styleDataNew,
            show: true
        }
        acRulePopComInstance = new AcRulePopComConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        acRulePopComInstance.$mount();
        document.body.appendChild(acRulePopComInstance.$el);
    },

    close() {
        if (acRulePopComInstance) {
            acRulePopComInstance.show = false;
        }
    },

};


//我的奖品
let myPrizePopComInstance;
export const MyPrizePopComService = {
    create(datas, isTemplate, styleDataNew, submit) {
        // console.log('333333333333333')
        let option = {
            datas: datas.datas,
            keyData: datas.keyData,
            styleData: datas.styleData,
            isTemplate: isTemplate,
            styleDataNew: styleDataNew,
            show: true
        }
        myPrizePopComInstance = new MyPrizePopComConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        myPrizePopComInstance.$mount();
        document.body.appendChild(myPrizePopComInstance.$el);
    },

    close() {
        console.log(myPrizePopComInstance + "myPrizePopComInstance")
        if (myPrizePopComInstance) {
            myPrizePopComInstance.show = false;
        }
    },

};

//dialogMoreNew
let taskPopComInstanceNew;
export const TaskPopComServiceNew = {
    create(pcontent, isTemplate, showShare, showFoll, showBuy, restDrawCount, pointFoll, pointShare, pointBuy, task, styleData, datas, submit) {
        let option = {
            pcontent: pcontent,
            isTemplate: isTemplate,
            showShare: showShare,
            showFoll: showFoll,
            showBuy: showBuy,
            restDrawCount: restDrawCount,
            pointFoll: pointFoll,
            pointShare: pointShare,
            pointBuy: pointBuy,
            task: task,
            styleData: styleData,
            datas: datas,
            show: true
        }
        taskPopComInstanceNew = new TaskPopComConstructorNew({
            data: option,
            methods: {
                submit: submit
            }
        });
        taskPopComInstanceNew.$mount();
        document.body.appendChild(taskPopComInstanceNew.$el);
    },

    close() {
        if (taskPopComInstanceNew) {
            taskPopComInstanceNew.show = false;
        }
    },

};

let taskPopComInstanceNew1;
export const TaskPopComServiceNew1 = {
    create(isTemplate, showShare, showFoll, showBuy, restDrawCount, pointFoll, pointShare, pointBuy, task, styleData, datas, submit) {
        let option = {
            isTemplate: isTemplate,
            showShare: showShare,
            showFoll: showFoll,
            showBuy: showBuy,
            restDrawCount: restDrawCount,
            pointFoll: pointFoll,
            pointShare: pointShare,
            pointBuy: pointBuy,
            task: task,
            styleData: styleData,
            datas: datas,
            show: true
        }
        taskPopComInstanceNew1 = new TaskPopComConstructorNew1({
            data: option,
            methods: {
                submit: submit
            }
        });
        taskPopComInstanceNew1.$mount();
        document.body.appendChild(taskPopComInstanceNew1.$el);
    },

    close() {
        if (taskPopComInstanceNew1) {
            taskPopComInstanceNew1.show = false;
        }
    },

};



let followSkuPopNewComInstance;
export const FollowSkuPopNewComService = {
    create(data, restDrawCount, styleData, submit) {
        let option = {
            data: data,
            restDrawCount: restDrawCount,
            styleData: styleData,
            show: true
        }
        followSkuPopNewComInstance = new followSkuPopNewComConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        followSkuPopNewComInstance.$mount();
        document.body.appendChild(followSkuPopNewComInstance.$el);
    },

    close() {
        if (followSkuPopNewComInstance) {
            followSkuPopNewComInstance.show = false;
        }
    },

};

//中奖弹框
let prizeResultPopComInstance;
export const PrizeResultPopComService = {
    create(prizeResultData, initDatas, styleData, submit) {
        let option = {
            prizeResultData: prizeResultData,
            initDatas: initDatas,
            styleData: styleData,
            show: true
        }
        prizeResultPopComInstance = new PrizeResultPopComConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });

        prizeResultPopComInstance.$mount();
        document.body.appendChild(prizeResultPopComInstance.$el);
    },

    close() {
        if (prizeResultPopComInstance) {
            prizeResultPopComInstance.show = false;
        }
    },

};

//未中奖弹框
let noPrizeResultPopComInstance;
export const NoPrizeResultPopComService = {
    create(styleData, submit) {
        let option = {
            styleData: styleData,
            show: true
        }
        noPrizeResultPopComInstance = new NoPrizeResultPopComConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        noPrizeResultPopComInstance.$mount();
        document.body.appendChild(noPrizeResultPopComInstance.$el);
    },

    close() {
        if (noPrizeResultPopComInstance) {
            noPrizeResultPopComInstance.show = false;
        }
    },

};
//去购买
let shopPopComNewInstance;
export const ShopPopComNewService = {
    create(data, restDrawCount,styleData, submit) {
        let option = {
            data: data,
            restDrawCount: restDrawCount,
            styleData:styleData,
            show: true
        }
        shopPopComNewInstance = new ShopPopComNewConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        shopPopComNewInstance.$mount();
        document.body.appendChild(shopPopComNewInstance.$el);
    },

    close() {
        if (shopPopComNewInstance) {
            shopPopComNewInstance.show = false;
        }
    },

};
//门槛弹窗
let joinVipInstance
export const AmnjoinVipService = {
    create(datas, submit) {
        // console.log('333333333333333')
        let option = {
            datas: datas
        }
        joinVipInstance = new joinVipConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        joinVipInstance.$mount();
        document.body.appendChild(joinVipInstance.$el);
    },

    close() {
        if (joinVipInstance) {
            joinVipInstance.show = false;
        }
    },
}

let commonjoinVipInstance
export const CommonjoinVipService = {
    create(datas, join, submit) {
        // console.log('333333333333333')
        let option = {
            datas: datas,
            join: join
        }
        commonjoinVipInstance = new CommonjoinVipConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        commonjoinVipInstance.$mount();
        document.body.appendChild(commonjoinVipInstance.$el);
    },

    close() {
        if (commonjoinVipInstance) {
            commonjoinVipInstance.show = false;
        }
    },
}



let sureFollowShopPopCom;
export const AmnsureFollowShopPopComService = {

    create(datas, submit) {
        let option = {
            datas: datas,
            show: true
        }
        sureFollowShopPopCom = new sureFollowShopPopComConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        sureFollowShopPopCom.$mount();
        document.body.appendChild(sureFollowShopPopCom.$el);
    },

    close() {
        if (sureFollowShopPopCom) {
            sureFollowShopPopCom.show = false;
        }
    },

};

let commonFollowShopPopCom;
export const CommonsureFollowShopPopComService = {

    create(datas, follow, submit) {
        let option = {
            datas: datas,
            follow: follow,
            show: true
        }
        commonFollowShopPopCom = new commonsureFollowShopPopComConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        commonFollowShopPopCom.$mount();
        document.body.appendChild(commonFollowShopPopCom.$el);
    },

    close() {
        if (commonFollowShopPopCom) {
            commonFollowShopPopCom.show = false;
        }
    },

};
//集卡有礼卡片弹窗
let drawCardPopComInstance;
export const DrawCardPopComService = {
    create(cardName, cardUrl, drawCardCount, styleData, submit) {
        let option = {
            cardName: cardName,
            cardUrl: cardUrl,
            drawCardCount: drawCardCount,
            styleData: styleData,
            show: true
        }
        drawCardPopComInstance = new DrawCardPopComConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        drawCardPopComInstance.$mount();
        document.body.appendChild(drawCardPopComInstance.$el);
    },

    close() {
        if (drawCardPopComInstance) {
            drawCardPopComInstance.show = false;
        }
    },

};

//集卡有礼卡片弹窗
let drawCardPopComInstance1;
export const DrawCardPopComService1 = {
    create(drawCardCount, styleData, submit) {
        let option = {
            drawCardCount: drawCardCount,
            styleData: styleData,
            show: true
        }
        drawCardPopComInstance1 = new DrawCardPopComConstructor1({
            data: option,
            methods: {
                submit: submit
            }
        });
        drawCardPopComInstance1.$mount();
        document.body.appendChild(drawCardPopComInstance1.$el);
    },

    close() {
        if (drawCardPopComInstance1) {
            drawCardPopComInstance1.show = false;
        }
    },

};
let hdzxtFollowSkuPopNewComInstance;
export const HdzxtFollowSkuPopNewComService = {
  create(data, restDrawCount, styleData, datas, submit) {
    let option = {
      data: data,
      restDrawCount: restDrawCount,
      styleData: styleData,
      datas: datas,
      show: true
    }
    hdzxtFollowSkuPopNewComInstance = new hdzxtFollowSkuPopNewComConstructor({
      data: option,
      methods: {
        submit: submit
      }
    });
    hdzxtFollowSkuPopNewComInstance.$mount();
    document.body.appendChild(hdzxtFollowSkuPopNewComInstance.$el);
  },

  close() {
    if (hdzxtFollowSkuPopNewComInstance) {
      hdzxtFollowSkuPopNewComInstance.show = false;
    }
  },

};


//活动规则
let hdzxtShareTaskPopInstance;
export const HdzxtShareTaskService = {
    create(isTemplate, title, data, restDrawCount,styleData, submit) {
        // console.log('333333333333333')
        let option = {
           isTemplate: isTemplate,
           title: title,
           data: data,
           restDrawCount: restDrawCount,
           styleData:styleData,
           show: true
        }
        hdzxtShareTaskPopInstance = new hdzxtShareTaskPopConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        hdzxtShareTaskPopInstance.$mount();
        document.body.appendChild(hdzxtShareTaskPopInstance.$el);
    },

    close() {
        if (hdzxtShareTaskPopInstance) {
            hdzxtShareTaskPopInstance.show = false;
        }
    },

};

//地址
let addressPopComInstance;
export const AddressPopComService = {
  // styleData zhumingyang 传参多了一个 以前得度用不了了 ，暂时恢复为原来传参方式，需要修改新建页面
    create(datas,styleData, submit) {
        let option = {
            datas: datas,
            styleData:styleData,
            show: true,
        }
        addressPopComInstance = new HdzxtAddressConstructor({
            data: option,
            methods: {
                submit: submit
            }
        });
        addressPopComInstance.$mount();
        document.body.appendChild(addressPopComInstance.$el);
    },

    close() {
        if (addressPopComInstance) {
            addressPopComInstance.show = false;
        }
    },

};

let taskPopComInstanceNew2;
export const TaskPopComServiceNew2 = {
  create(isTemplate, showShare, showFoll, showBuy, restDrawCount, pointFoll, pointShare, pointBuy, task, styleData,
    datas, submit) {
    let option = {
      isTemplate: isTemplate,
      showShare: showShare,
      showFoll: showFoll,
      showBuy: showBuy,
      restDrawCount: restDrawCount,
      pointFoll: pointFoll,
      pointShare: pointShare,
      pointBuy: pointBuy,
      task: task,
      styleData: styleData,
      datas: datas,
      show: true
    }
    taskPopComInstanceNew2 = new TaskPopComConstructorNew2({
      data: option,
      methods: {
        submit: submit
      }
    });
    taskPopComInstanceNew2.$mount();
    document.body.appendChild(taskPopComInstanceNew2.$el);
  },

  close() {
    if (taskPopComInstanceNew2) {
      taskPopComInstanceNew2.show = false;
    }
  },

};

let hdzxtMyFriendPopComInstanceNew2;
export const HdzxtMyFriendPopComServiceNew2 = {
  create(styleData, defaultDatas, submit) {
    let option = {
      styleData: styleData,
      defaultDatas: defaultDatas,
      show: true
    }
    hdzxtMyFriendPopComInstanceNew2 = new HdzxtMyFriendPopConstructor({
      data: option,
      methods: {
        submit: submit
      }
    });
    hdzxtMyFriendPopComInstanceNew2.$mount();
    document.body.appendChild(hdzxtMyFriendPopComInstanceNew2.$el);
  },

  close() {
    if (hdzxtMyFriendPopComInstanceNew2) {
      hdzxtMyFriendPopComInstanceNew2.show = false;
    }
  },

};

//买家秀用户分享
let buyUsersharePopComService;
export const buysharePopComService = {
    create(item, data, id, submit) {
        // console.log('4444')
        let option = {
            item: item,
            id: id,
            data: data,
            show: true
        }
        buyUsersharePopComService = new newBuyshareConstructorPop({
            data: option,
            methods: {
                submit: submit
            }
        });
        buyUsersharePopComService.$mount();
        document.body.appendChild(buyUsersharePopComService.$el);
    },
    close() {
        if (buyUsersharePopComService) {
            buyUsersharePopComService.show = false;
        }
    },
};

//买家秀用户晒单
let buyUserSheetNewPopComService;
export const buyUserSheetPopComService = {
    create(item, data, alldata, submit) {
        // console.log('4444')
        let option = {
            item: item,
            data: data,
            alldata: alldata,
            show: true
        }
        buyUserSheetNewPopComService = new newBuyUserSheetConstructorPop({
            data: option,
            methods: {
                submit: submit
            }
        });
        buyUserSheetNewPopComService.$mount();
        document.body.appendChild(buyUserSheetNewPopComService.$el);
    },
    close() {
        if (buyUserSheetNewPopComService) {
            buyUserSheetNewPopComService.show = false;
        }
    },
};
