(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b62a3134"],{"09a5":function(t,o,e){"use strict";e("29f9")},"29f9":function(t,o,e){},"368b":function(t,o,e){"use strict";var i=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{ref:"main"},[e("el-upload",{ref:"uploader",staticClass:"avatar-uploader",attrs:{"show-file-list":!1,"http-request":t.ossRequest,"before-upload":t.onBeforeUpload,accept:t.accept,disabled:!t.uploadable,action:""}},[e("el-row",{directives:[{name:"loading",rawName:"v-loading",value:t.form.loading,expression:"form.loading"}],staticClass:"avatar-uploader-img-box"},[t.value?e("img",{staticClass:"avatar",attrs:{width:230,height:230,src:t.value}}):e("span",{staticClass:"el-icon-plus avatar-uploader-icon"},[t._v(" Upload ")])]),t._t("trigger")],2),t._t("extend")],2)},s=[],a=e("88e7"),l=e("2f62"),n={props:{value:{type:String,default:""},accept:{type:String,default:"image/*"},fileType:{type:Number,required:!0},uploadable:{type:Boolean,default:!0}},data(){return{form:{loading:!1}}},computed:{...Object(l["b"])("app",{submitOssFileApi:"submitOssFileApi",stsApi:"stsApi"})},mounted(){},methods:{removeFile(){this.$emit("update:fileUrl",null),this.$emit("input",null)},beforeUpload(){this.form.loading=!0},toUpload(){this.$refs.uploader.dispatchEvent(new MouseEvent("click"))},isLogin(){return new Promise((t,o)=>{const{login:e}=this.$store.getters["user/getUserBaseInfo"];e?t():this.$loginDialog({loginType:"login"})})},async onBeforeUpload(){await this.isLogin()},async ossRequest(t){this.form.loading=!0;const o=t.file;var e=await a["a"].oss(this.stsApi),i=a["a"].getRandomObjectName(e.ossObjectNamePrefix,e.domain,o.name);try{const t=await e.client.multipartUpload(i.objectName,o,{progress:async t=>{},headers:{"Cache-Control":"max-age=360000"}}),s=new Image;s.src=i.objectUrl,s.onload=async()=>{await this.submitOssFileApi({fileName:o.name,fileType:this.fileType,width:s.width,height:s.height,fileUrl:i.objectUrl,bucketName:t.bucket,objectName:t.name,fileSize:o.size}),this.$emit("update:value",i.objectUrl),this.$emit("input",i.objectUrl),this.form.loading=!1}}catch(s){console.log(s),this.form.loading=!1}}}},r=n,g=(e("7d4e"),e("2877")),c=Object(g["a"])(r,i,s,!1,null,"51c3eb4a",null);o["a"]=c.exports},"4fa4":function(t,o,e){"use strict";e.r(o);var i=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"set-shop-logo-page"},[e("div",{staticClass:"title"},[t._v("Jewerly Box Packaging Customization")]),t._m(0),e("div",{staticClass:"customizer"},[e("div",{staticClass:"upload-logo-box"},[e("ImageUploader",{ref:"imageUpload",attrs:{"file-type":6},model:{value:t.logoUrl,callback:function(o){t.logoUrl=o},expression:"logoUrl"}},[t.logoUrl?e("el-row",{staticClass:"btn-row",attrs:{slot:"extend"},slot:"extend"},[t.logoUrl!==t.oldLogoUrl?e("el-row",{attrs:{gutter:5}},[e("el-col",{attrs:{span:4}},[e("el-button",{staticClass:"btn",on:{click:t.removeUploadedLogo}},[t._v("X")])],1),e("el-col",{attrs:{span:20}},[e("el-button",{staticClass:"btn",attrs:{type:"primary"},on:{click:t.saveFittingsLogo}},[t._v("Save")])],1)],1):e("el-row",{attrs:{gutter:5}},[e("el-col",{attrs:{span:4}},[e("el-button",{staticClass:"btn",on:{click:t.removeUploadedLogo}},[t._v("X")])],1),e("el-col",{attrs:{span:20}},[e("el-button",{staticClass:"btn"},[t._v("The logo has been uploaded!")])],1)],1)],1):e("el-button",{staticClass:"btn upload-btn",attrs:{slot:"trigger",type:"primary"},slot:"trigger"},[t._v("Upload logo")])],1)],1),e("div",{staticClass:"fittings-container"},t._l(t.fittingsInfos,(function(o,i){return e("div",{key:o.name+i,staticClass:"fittings-box"},[e("el-card",[e("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[e("div",{staticClass:"fittings-name"},[t._v(t._s(o.name))])]),e("div",{staticClass:"fittings-imgs"},t._l(o.customizeInfos.slice(0,10),(function(o){return e("fittings-img",{key:o.bottomImageUrl,staticClass:"fittings-img",attrs:{"bottom-image-url":o.bottomImageUrl,"logo-x":o.logoX,"logo-y":o.logoY,"logo-w":o.logoW,"logo-h":o.logoH,"logo-url":t.logoUrl}})})),1),e("div",[t.logoUrl?e("el-button",{staticClass:"fittings-check-btn",on:{click:function(e){return t.showFittingsImgDialog(o)}}},[t._v("Check")]):t._e()],1)])],1)})),0)]),e("fittings-img-dialog",{attrs:{show:t.fittingsImgDialog.show,"logo-url":t.fittingsImgDialog.logoUrl,fittings:t.fittingsImgDialog.fittings},on:{"update:show":function(o){return t.$set(t.fittingsImgDialog,"show",o)}}}),e("subscription-action",{ref:"SubscriptionAction"})],1)},s=[function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"warn"},[e("div",{staticClass:"warn-title"},[t._v("According to the market big data research,the jewerly box with your exclusive logo wil help you to promote your own brand, ad at the same time provide repurchase in your store,")]),e("div",{staticClass:"warn-content"},[t._v("After uploading your exclusive logo, we will make a small batch of jewerly boxes with your logo printed on it for you. When you have an order to ship,the jewerlry will be put into the jewerly box with your logo")])])}],a=e("35f2"),l=e("b0dc"),n=e("368b"),r=e("2f62"),g=e("e112"),c=e("1cf3"),u=e("7f5a"),d={name:"SetShopLogo",components:{ImageUploader:n["a"],FittingsImgDialog:c["a"],FittingsImg:g["a"],SubscriptionAction:u["a"]},inject:["reload"],data(){return{fittingsInfos:[],shopInfo:{},oldLogoUrl:null,logoUrl:null,fittingsImgDialog:{show:!1,logoUrl:null,fittings:null}}},computed:{...Object(r["b"])("user",{currentShop:"getCurrentShop",fittingsLevel:"getFittingsLevel"}),...Object(r["b"])("shopify",{app:"getApp",shop:"getShop"})},mounted(){this.getCurrentShopInfo(),this.getFittingsInfos()},methods:{getFittingsInfos(){Object(l["a"])({level:2}).then(t=>{if(200===t.code){var o=t.data.records||[];for(const t of o)t.customizeInfos&&t.customizeInfos.length&&this.fittingsInfos.push(t)}})},getCurrentShopInfo(){Object(a["c"])().then(t=>{200===t.code&&(this.shopInfo=t.data||{},this.logoUrl=this.shopInfo.fittingsLogoUrl||null,this.oldLogoUrl=this.shopInfo.fittingsLogoUrl||null)})},saveFittingsLogo(){this.logoUrl?this.fittingsLevel<2?this.$confirm("Dear customer, custom logo for jewelry box needs to be subscribed first","",{confirmButtonText:"Subscribe",cancelButtonText:"Details",type:"warning"}).then(async()=>{this.$refs.SubscriptionAction.SelectSubscription(2)}).catch(()=>{this.callNewPage("/Subscription")}):Object(a["i"])({fittingsLogoUrl:this.logoUrl}).then(t=>{200===t.code&&(this.$message.success("Update logo success"),this.reload())}):this.$message.error("Please upload your logo")},removeUploadedLogo(){this.$refs.imageUpload.removeFile()},showFittingsImgDialog(t){this.fittingsImgDialog.fittings=t,this.fittingsImgDialog.logoUrl=this.logoUrl,this.fittingsImgDialog.show=!0}}},p=d,f=(e("09a5"),e("2877")),h=Object(f["a"])(p,i,s,!1,null,"1620c636",null);o["default"]=h.exports},"7d4e":function(t,o,e){"use strict";e("9777")},9777:function(t,o,e){},b0dc:function(t,o,e){"use strict";e.d(o,"a",(function(){return s}));var i=e("66a5");const s=t=>Object(i["a"])({url:"/shopapi/blankFittings/list",method:"post",data:t})}}]);