"use strict";(self["webpackChunkautoshopee_kit"]=self["webpackChunkautoshopee_kit"]||[]).push([[1813],{41813:function(e,t,s){s.r(t),s.d(t,{default:function(){return E}});var a=function(){var e=this,t=e._self._c;return t("layout-single",{attrs:{"require-authed":""}},[t("template",{slot:"header"},[t("h1",{staticClass:"text-warning"},[t("i",{staticClass:"fa fa-home mr-5",attrs:{"aria-hidden":"true"}}),t("span",[e._v(e._s(e.$t("SHOPEE_MY_SHOP")))])])]),t("div",[t("Row",[t("Col",{attrs:{span:8,offset:8}},[t("div",{staticClass:"mb-20"},[t("shop-connect")],1),t("div",[t("shop-info")],1)])],1)],1)],2)},n=[],i=function(){var e=this,t=e._self._c;return t("div",[e.isConnected?t("div",[t("div",{staticClass:"text-right mb-10"},[t("Button",{attrs:{type:"error",loading:e.loading,size:"small"},on:{click:e.disconnectShop}},[e._v(" "+e._s(e.$t("SHOP_DISCONNECT_BTN"))+" ")])],1),t("Alert",{attrs:{"show-icon":"",type:"success"}},[t("div",[e._v(" "+e._s(e.$t("SHOP_WAS_CONNECTED",{shop:e.shopName}))+" ")]),e._e()])],1):t("div",[t("div",{staticClass:"text-right mb-10"},[t("Button",{attrs:{type:"success",loading:e.loading,size:"small"},on:{click:e.connectShop}},[e._v(" "+e._s(e.$t("SHOP_CONNECT_BTN"))+" ")])],1),t("Alert",{attrs:{"show-icon":"",type:"warning"}},[t("span",[e._v(e._s(e.$t("SHOP_NOT_CONNECTED",{shop:e.shopName})))])])],1)])},o=[],l=s(90408),h=s(57389),r={data(){return{shopName:"",shopId:"",loading:!1,username:"",phone:"",email:""}},methods:{...(0,l.nv)(["ShopeeSellerUnSync","ShopeeSellerConnect"]),async disconnectShop(){this.loading=!0,await this.ShopeeSellerUnSync(),this.loading=!1},async connectShop(){this.loading=!0;try{const e=await this.ShopeeSellerConnect();e.success?this.$Message.success(e.msg):this.$Message.error(e.msg)}catch(e){this.$Message.error(this.$t("SHOP_CONNECT_ERROR")),console.error({msg:"ERROR_CONNECT_SHOP",error:e})}this.loading=!1},async init(){const e=await(0,h.m4)();this.shopName=e.username,this.shopId=e.shopid,this.username=e.username,this.phone=e.phone,this.email=e.email}},created(){this.shopName=this.getShopeeShopName,this.username=this.getShopeeShopName,this.shopId=this.getShopeeShopId,this.ShopeeSellerInit(),this.init()},computed:{isConnected(){return!!this.getShopeeShopRef}}},p=r,c=s(1001),m=(0,c.Z)(p,i,o,!1,null,null,null),u=m.exports,d=function(){var e=this,t=e._self._c;return t("div",[t("Form",{attrs:{"label-position":"left","label-width":100}},[e.name?t("FormItem",{attrs:{label:e.$t("SHOP_USERNAME")}},[t("Input",{attrs:{readonly:""},model:{value:e.username,callback:function(t){e.username=t},expression:"username"}})],1):e._e(),t("FormItem",{attrs:{label:e.$t("SHOP_SPCF")}},[t("Input",{attrs:{readonly:""},model:{value:e.spcf,callback:function(t){e.spcf=t},expression:"spcf"}})],1),e.isShopAuthed?t("FormItem",{attrs:{label:e.$t("SHOP_PHONE_NUMBER")}},[t("Input",{attrs:{readonly:""},model:{value:e.phone,callback:function(t){e.phone=t},expression:"phone"}})],1):e._e(),e.isShopAuthed?t("FormItem",{attrs:{label:e.$t("SHOP_EMAIL")}},[t("Input",{attrs:{readonly:""},model:{value:e.email,callback:function(t){e.email=t},expression:"email"}})],1):e._e(),e.isShopAuthed?t("FormItem",{attrs:{label:e.$t("SHOP_ID")}},[t("Input",{attrs:{readonly:""},model:{value:e.id,callback:function(t){e.id=t},expression:"id"}})],1):e._e()],1),e.isShopAuthed?t("div",{staticClass:"text-right mt-10"},[t("span",{staticStyle:{float:"left"}},[e._v(e._s(e.msg))])]):e._e()],1)},S=[],_=s(19387),f={name:"ShopInfo",data(){return{msg:"",name:"",username:"",id:"",image:"",phone:"",email:"",spcf:"",data:{},loading:!1}},methods:{init(){(0,h.Z7)().then((e=>{this.spcf=e})).catch((()=>{})),(0,h.m4)().then((e=>{this.name=e.display_name,this.username=e.username,this.phone=e.phone,this.email=e.email,this.id=e.shopid,this.image=(0,_.sQ)(e.portrait),this.data=e})).catch((()=>{}))}},created(){this.init()},computed:{isShopAuthed(){return!!this.id}}},g=f,v=(0,c.Z)(g,d,S,!1,null,null,null),C=v.exports,N={name:"ShopeeShop",metaInfo(){return{title:this.$t("SHOPEE_MY_SHOP")}},components:{"shop-connect":u,"shop-info":C},created(){this.ShopeeSellerInit()}},O=N,I=(0,c.Z)(O,a,n,!1,null,null,null),E=I.exports}}]);
//# sourceMappingURL=1813.34073de7.js.map