(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a8be8830"],{"03d4":function(t,e,i){"use strict";i("fd5c")},"03f2":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAYxJREFUaEPtmTFOBSEURc9fgZa6EeMKTCx0BfYuQd2BW3Ablha2Jm5EWxsLG81LPgkhzMyDDw8w0M4M3HMvPAizY/C2G1w/E6B1gjOBnhO4Bp6Ak8YiP4Fb4DmmY20KfXQg3mkWiNNUgN/GzofDR81eS+DfAVhXrNDAgxOYAIlraiagciDR1ZTXVeOnVKFaa+AMuAdugG+PcAgAEf8CHAGvwJUH0T2AL94ZLxCXwA/QNUBMvEA8Ag97mm4BNOKFwQxADlly8NM0rXgzgLt95BfA+wZBingTABEvc1baF7AGkSq+OsA58BY4vgSRI746gAzgJ+BYQohc8SYAWxDy3G1Sflh+qVxbNmZVaCkJESc7bI54swScuBhE6K7WefedWQIaiFTx5gmsQeSIbwYQLuxc8U0BHMSxdzDb2KSjj83XQI7ILspoaeHNqlBpkDmFVA6Utt3rTzV+D7cSSx4UB6hotqrrg+9GVaNUfCkZYPgfHMP/Yqo4G8p1Xeu+s5zCjZ4mgJnVCwPNBFon8AcKqngxslfUYgAAAABJRU5ErkJggg=="},"0c6f":function(t,e,i){},"25a4":function(t,e,i){"use strict";i("8187")},"2f69":function(t,e,i){"use strict";i.d(e,"k",(function(){return o})),i.d(e,"c",(function(){return r})),i.d(e,"b",(function(){return n})),i.d(e,"h",(function(){return a})),i.d(e,"i",(function(){return l})),i.d(e,"n",(function(){return c})),i.d(e,"o",(function(){return u})),i.d(e,"l",(function(){return d})),i.d(e,"m",(function(){return p})),i.d(e,"q",(function(){return m})),i.d(e,"g",(function(){return g})),i.d(e,"r",(function(){return h})),i.d(e,"a",(function(){return f})),i.d(e,"j",(function(){return b})),i.d(e,"p",(function(){return v})),i.d(e,"e",(function(){return I})),i.d(e,"f",(function(){return k})),i.d(e,"d",(function(){return C}));var s=i("66a5");const o=t=>Object(s["a"])({url:"/shopapi/custom/product/page",method:"post",data:t}),r=(t,e={})=>Object(s["a"])({url:"/shopapi/custom/product/detail/"+t,method:"post",data:e}),n=()=>Object(s["a"])({url:"/shopapi/custom/product/customCollectionList",method:"post"}),a=t=>Object(s["a"])({url:"/shopapi/custom/product/modify",method:"post",data:t}),l=t=>Object(s["a"])({url:"/shopapi/custom/product/modifys",method:"post",data:t}),c=t=>Object(s["a"])({url:"/shopapi/custom/product/publishStatus",method:"post",data:t}),u=t=>Object(s["a"])({url:"/shopapi/custom/product/publishStatuses",method:"post",data:t}),d=t=>Object(s["a"])({url:"/shopapi/custom/product/publish",method:"post",data:t}),p=t=>Object(s["a"])({url:"/shopapi/custom/product/publishes",method:"post",data:t}),m=t=>Object(s["a"])({url:"/shopapi/custom/product/remove/"+t,method:"post"}),g=t=>Object(s["a"])({url:"/shopapi/custom/product/hideOnServer/"+t,method:"post"}),h=t=>Object(s["a"])({url:"/shopapi/custom/product/showOnServer/"+t,method:"post"}),f=t=>Object(s["a"])({url:"/shopapi/custom/product/cancel/"+t,method:"post"}),b=t=>Object(s["a"])({url:"/shopapi/custom/product/modifys",method:"post",data:t}),v=t=>Object(s["a"])({url:"/shopapi/custom/product/publishes",method:"post",data:t}),I=t=>Object(s["a"])({url:"/shopapi/custom/product/fittings/modifys",method:"post",data:t}),k=t=>Object(s["a"])({url:"/shopapi/custom/product/greeting_card/modifys",method:"post",data:t}),C=t=>Object(s["a"])({url:"/shopapi/custom/product/dropship",method:"post",data:t})},6313:function(t,e,i){},6722:function(t,e,i){"use strict";i("0c6f")},8187:function(t,e,i){},a790:function(t,e,i){"use strict";i("d582")},c17d:function(t,e,i){"use strict";i("e255")},d582:function(t,e,i){},dc52:function(t,e,i){"use strict";i("6313")},de5d:function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"dropshinpper-detail default-main"},[i("BackPage"),i("el-collapse",{attrs:{accordion:""},on:{change:t.handleChange},model:{value:t.activeNames,callback:function(e){t.activeNames=e},expression:"activeNames"}},t._l(t.productInfos,(function(e,s){return i("el-collapse-item",{key:s,attrs:{name:s}},[i("template",{slot:"title"},[i("div",{staticClass:"dropshinpper-title"},[t._v(t._s(e.customProductInfo.title))])]),i("el-form",{ref:"dropshinpperForm"+s,refInFor:!0,attrs:{model:e,rules:t.dropshinpperRules,"label-width":"100px","label-position":"top"}},[i("div",[i("div",{staticClass:"dropshinpper-card dropshinpper-card2"},[i("div",{staticClass:"dropshinpper-card-title"},[t._v("Mockups")]),i("Mockups",{attrs:{images:e.images,fittings:e.fittings,"show-fittings-image":e.syncFittingsImageFlag},model:{value:e.mainImageUrl,callback:function(i){t.$set(e,"mainImageUrl",i)},expression:"item.mainImageUrl"}})],1),i("div",{staticClass:"dropshinpper-card"},[i("div",{staticClass:"dropshinpper-card-title"},[t._v("Store details "),i("span",[i("el-checkbox",{model:{value:e.syncFittingsImageFlag,callback:function(i){t.$set(e,"syncFittingsImageFlag",i)},expression:"item.syncFittingsImageFlag"}},[t._v("Synchronize jewelry box pictures in Mockups")])],1)]),i("StoreDetails",{attrs:{"greeting-cards":t.greetingCards,"fittings-id":e.customProductInfo.fittingsId,"blank-fittings-level":e.customProductInfo.blankFittingsLevel,"collection-id":e.customProductInfo.collectionId,"hidden-in-store":e.customProductInfo.hiddenInStore,"blank-greeting-card-id":e.customProductInfo.blankGreetingCardId,"level-fittings":[].concat(e.level1Fittingses).concat(e.level2Fittingses)},on:{"update:fittingsId":function(i){return t.$set(e.customProductInfo,"fittingsId",i)},"update:fittings-id":function(i){return t.$set(e.customProductInfo,"fittingsId",i)},"update:blankFittingsLevel":function(i){return t.$set(e.customProductInfo,"blankFittingsLevel",i)},"update:blank-fittings-level":function(i){return t.$set(e.customProductInfo,"blankFittingsLevel",i)},"update:collectionId":function(i){return t.$set(e.customProductInfo,"collectionId",i)},"update:collection-id":function(i){return t.$set(e.customProductInfo,"collectionId",i)},"update:hiddenInStore":function(i){return t.$set(e.customProductInfo,"hiddenInStore",i)},"update:hidden-in-store":function(i){return t.$set(e.customProductInfo,"hiddenInStore",i)},"update:blankGreetingCardId":function(i){return t.$set(e.customProductInfo,"blankGreetingCardId",i)},"update:blank-greeting-card-id":function(i){return t.$set(e.customProductInfo,"blankGreetingCardId",i)}}})],1),i("div",{staticClass:"dropshinpper-card"},[i("div",{staticClass:"dropshinpper-card-title"},[t._v("Variants")]),i("Variants",{attrs:{"custom-product-info":e.customProductInfo},model:{value:e.variantList,callback:function(i){t.$set(e,"variantList",i)},expression:"item.variantList"}})],1),i("div",{staticClass:"dropshinpper-card"},[i("div",{staticClass:"dropshinpper-card-title"},[t._v("Description")]),i("Description",{attrs:{"custom-product-info":e.customProductInfo,"product-index":s},on:{change:t.changeDescription}})],1)])])],2)})),1),i("div",{staticClass:"dropshinpper-button"},[i("el-button",{attrs:{loading:t.saveLoading},on:{click:t.doSave}},[t._v("Save as draft")]),t.currentShop.shopType!==t.enums.shopTypeEnum.GENERAL.value&&t.currentShop.shopType!==t.enums.shopTypeEnum.NOT_BIND.value?i("el-button",{attrs:{loading:t.publishLoading,type:"primary"},on:{click:t.release}},[t._v("Publish")]):t._e()],1)],1)},o=[],r=(i("d9e2"),i("2f69")),n=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"mockups"},[s("my-img",{staticClass:"mockups-left",attrs:{src:t.value,alt:"product image"}}),s("div",{staticClass:"mockups-right"},[s("div",{staticClass:"mockups-title"},[t._v("Select title image view")]),s("div",{staticClass:"mockups-list"},t._l(t.validImages,(function(e,o){return s("div",{key:o,staticClass:"mockups-item"},[s("div",{class:["mockups-item-img-box","div-hover"],on:{click:function(i){return t.onSelectImg(e.url)}}},[e.url===t.value?s("img",{staticClass:"dagou",attrs:{src:i("03f2"),alt:""}}):t._e(),s("my-img",{staticClass:"mockups-item-img",attrs:{src:e.url}})],1)])})),0)])],1)},a=[],l={name:"Mockups",props:{images:{type:Array,default:()=>[]},value:{type:String,default:null},showFittingsImage:{type:Boolean,required:!0},fittings:{type:Object,default:()=>{}}},data(){return{}},computed:{validImages(){if(!this.images)return[];if(!this.images.length)return[];var t=[];for(const e of this.images)t.push(e);if(this.showFittingsImage&&this.fittings&&this.fittings.showImageUrls&&this.fittings.showImageUrls.length)for(const e of this.fittings.showImageUrls)t.push({url:e});return t}},watch:{},methods:{onSelectImg(t){this.$emit("input",t)}}},c=l,u=(i("25a4"),i("2877")),d=Object(u["a"])(c,n,a,!1,null,"971429a0",null),p=d.exports,m=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"upgrade-box"},[t.showStoreInfo?i("div",{staticClass:"store-info"},[i("div",{staticClass:"store-title"},[t._v("Shopify collections")]),i("div",{staticClass:"store-sub-title"},[t._v("Select one or multiple collections to publish your product")]),i("el-select",{staticClass:"customCollection-list",attrs:{value:t.collectionId,placeholder:"",clearable:""},on:{change:t.onCollectionIdChange}},t._l(t.customCollectionList,(function(t){return i("el-option",{key:t.id,attrs:{label:t.title,value:t.id}})})),1),i("div",{staticClass:"store-title"},[t._v("Product visibility in store")]),i("el-checkbox",{staticClass:"hidden-in-store",attrs:{value:t.hiddenInStore},on:{change:t.onHiddenInStoreChange}},[t._v("Hide in store")])],1):t._e()])},g=[],h=i("2f62"),f={name:"StoreDetails",props:{levelFittings:{type:Array,default:()=>[]},greetingCards:{type:Array,default:()=>[]},fittingsId:{type:Number,default:null},blankGreetingCardId:{type:Number,default:null},blankFittingsLevel:{type:Number,default:null},hiddenInStore:{type:Boolean,default:!1},collectionId:{type:String,default:""},showStoreInfo:{type:Boolean,default:!0},showBlankGreetingCard:{type:Boolean,default:!0},showPackage:{type:Boolean,default:!0}},data(){return{customCollectionList:[],fittingsImgDialog:{show:!1,logoUrl:null,fittings:null},showStoreDetailsDialog:!1,storeDetailsDialog:{show:!1,imageUrls:[],fittingsLevel:null}}},computed:{...Object(h["b"])("user",{currentShop:"getCurrentShop",fittingsLevel:"getFittingsLevel",fittingsLogoUrl:"getFittingsLogoUrl"})},created(){this.getCustomCollectionList()},methods:{async getCustomCollectionList(){const t=await Object(r["b"])();this.customCollectionList=t.data.items},showStoreDetailsDialogFn(t,e){this.storeDetailsDialog.imageUrls=t,this.storeDetailsDialog.fittingsLevel=e,this.storeDetailsDialog.show=!0},showFittingsImgWithLogo(t){this.fittingsImgDialog.logoUrl=this.fittingsLogoUrl,this.fittingsImgDialog.fittings=t,this.fittingsImgDialog.show=!0},async toSetLogo(){this.callNewPage("/SetShopLogo")},toPaySubscribe(){this.$refs.SubscriptionAction.SelectSubscription(2)},onBlankFittingsChange(t){if(this.$emit("update:fittingsId",t),t){var e=this.levelFittings.filter(e=>e.id===t)[0],i=e.level;if(i>this.fittingsLevel)return this.showStoreDetailsDialogFn(e.showImageUrls,e.level),this.$emit("update:blankFittingsLevel",this.levelFittings[0].level),void this.$emit("update:fittingsId",this.levelFittings[0].id);this.$emit("update:blankFittingsLevel",i)}else this.$emit("update:blankFittingsLevel",null)},onBlankGreetingCardChange(t){if(t)if(1===this.fittingsLevel){const e=this.greetingCards.filter(e=>e.id===t)[0];this.showStoreDetailsDialogFn(e.showImageUrls,2),this.$emit("update:blankGreetingCardId",null)}else this.$emit("update:blankGreetingCardId",t);else this.$emit("update:blankGreetingCardId",null)},onCollectionIdChange(t){this.$emit("update:collectionId",t)},onHiddenInStoreChange(t){this.$emit("update:hiddenInStore",t)}}},b=f,v=(i("c17d"),Object(u["a"])(b,m,g,!1,null,"1da23a1a",null)),I=v.exports,k=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"variants-box"},[i("div",{staticClass:"variants-title"},[t._v("Pricing")]),i("div",{staticClass:"variants-button-box"},[i("el-button",{attrs:{disabled:!t.skuIds.length},on:{click:function(e){return t.showEdit("retailPrice")}}},[t._v("Edit price")]),i("el-button",{attrs:{disabled:!t.skuIds.length},on:{click:function(e){return t.showEdit("profit")}}},[t._v("Edit profit")]),i("el-button",{attrs:{disabled:!t.skuIds.length},on:{click:function(e){return t.showEdit("compareAtPrice")}}},[t._v("Edit compare at price")]),i("el-button",{attrs:{disabled:!t.skuIds.length},on:{click:function(e){return t.showEdit("profitMargin")}}},[t._v("Edit profit margin")])],1),i("el-form-item",{attrs:{prop:"variantList"}},[i("el-table",{staticClass:"variants-table",attrs:{data:t.value,"row-style":t.tableRowStyle},on:{"selection-change":t.handleSelectionChange}},[i("el-table-column",{attrs:{type:"selection",width:"55"}}),t._l(t.value[0].skuList,(function(e,s){return[i("el-table-column",{key:s,attrs:{label:e.label},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.skuList&&e.row.skuList.length?i("div",[t._v(t._s(e.row.skuList[s].value))]):t._e()]}}],null,!0)})]})),i("el-table-column",{attrs:{prop:"costs",label:"Cost"}}),i("el-table-column",{attrs:{prop:"retailPrice",label:"Retail Price"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("div",{staticClass:"input-box"},[i("div",{staticClass:"input-tag"},[t._v("USD")]),i("el-input-number",{staticClass:"input-content",staticStyle:{width:"100%"},attrs:{precision:2,controls:!1},on:{input:function(i){return t.retailPriceComputed(e.row)}},model:{value:e.row.retailPrice,callback:function(i){t.$set(e.row,"retailPrice",i)},expression:"scope.row.retailPrice"}})],1)]}}])}),i("el-table-column",{attrs:{prop:"profit",label:"Profit"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("div",{staticClass:"input-box"},[i("div",{staticClass:"input-tag"},[t._v("USD")]),i("el-input-number",{staticClass:"input-content",staticStyle:{width:"100%"},attrs:{precision:2,controls:!1},on:{input:function(i){return t.profitComputed(e.row)}},model:{value:e.row.profit,callback:function(i){t.$set(e.row,"profit",i)},expression:"scope.row.profit"}})],1)]}}])}),i("el-table-column",{attrs:{prop:"compareAtPrice",label:"Compare at price"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("div",{staticClass:"input-box"},[i("div",{staticClass:"input-tag"},[t._v("USD")]),i("el-input-number",{staticClass:"input-content",staticStyle:{width:"100%"},attrs:{precision:2,min:e.row.retailPrice,controls:!1},model:{value:e.row.compareAtPrice,callback:function(i){t.$set(e.row,"compareAtPrice",i)},expression:"scope.row.compareAtPrice"}})],1)]}}])}),i("el-table-column",{attrs:{prop:"profitMargin",label:"Profit margin"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("div",{staticClass:"input-box"},[i("el-input-number",{staticClass:"input-content",staticStyle:{width:"100%"},attrs:{precision:2,max:9999,min:-9999,controls:!1},on:{input:function(i){return t.profitMarginComputed(e.row)}},model:{value:e.row.profitMargin,callback:function(i){t.$set(e.row,"profitMargin",i)},expression:"scope.row.profitMargin"}}),i("div",{staticClass:"input-tag"},[t._v("%")])],1)]}}])}),i("el-table-column",{attrs:{prop:"checked",label:"Synchronous SKU"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-radio",{attrs:{label:!0},model:{value:e.row.checked,callback:function(i){t.$set(e.row,"checked",i)},expression:"scope.row.checked"}},[t._v("YES")]),i("el-radio",{attrs:{label:!1},model:{value:e.row.checked,callback:function(i){t.$set(e.row,"checked",i)},expression:"scope.row.checked"}},[t._v("No")])]}}])})],2)],1),i("el-dialog",{attrs:{visible:t.dialogVisible,"close-on-click-modal":!1,"append-to-body":"",width:"30%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[i("div",{staticClass:"dialog-title",attrs:{slot:"title"},slot:"title"},[t._v("edit")]),i("el-form",{ref:"editForm",attrs:{model:t.editForm,rules:t.editRules,"label-width":"100px","label-position":"top"},nativeOn:{submit:function(e){return e.preventDefault(),t.editPrice("editForm")}}},["profitMargin"===t.currentKey?i("div",{staticClass:"input-box"},[i("el-form-item",{attrs:{prop:"num"}},[i("el-input-number",{staticClass:"input-content",staticStyle:{width:"100%"},attrs:{precision:2,max:9999,min:-9999,controls:!1},model:{value:t.editForm.num,callback:function(e){t.$set(t.editForm,"num",e)},expression:"editForm.num"}})],1),i("div",{staticClass:"input-tag"},[t._v("%")])],1):i("div",{staticClass:"input-box"},[i("div",{staticClass:"input-tag"},[t._v("USD")]),i("el-form-item",{attrs:{prop:"num"}},[i("el-input-number",{staticClass:"input-content",staticStyle:{width:"100%"},attrs:{precision:2,max:9999,min:-9999,controls:!1},model:{value:t.editForm.num,callback:function(e){t.$set(t.editForm,"num",e)},expression:"editForm.num"}})],1)],1)]),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:t.close}},[t._v("close")]),i("el-button",{attrs:{loading:t.editLoading,type:"primary"},on:{click:function(e){return t.editPrice("editForm")}}},[t._v("Edit")])],1)],1)],1)},C=[],y={name:"Variants",props:{value:{type:Array,default:()=>[]},customProductInfo:{type:Object,default:()=>({})}},data(){return{skuIds:[],dialogVisible:!1,currentKey:"",editLoading:!1,editForm:{num:0},editRules:{num:[{required:!0,message:"The Num field is required",trigger:"blur"}]}}},computed:{skuType(){return(t,e)=>this.customProductInfo.option1Name===t?e.option1Value:this.customProductInfo.option2Name===t?e.option2Value:this.customProductInfo.option3Name===t?e.option3Value:""},skuList(){return t=>{const e=[];return t.option1Value&&e.push({label:this.customProductInfo.option1Name,value:t.option1Value}),t.option2Value&&e.push({label:this.customProductInfo.option2Name,value:t.option2Value}),t.option3Value&&e.push({label:this.customProductInfo.option3Name,value:t.option3Value}),e}},profitComputed(){return t=>(t.retailPrice=Number(t.profit)+Number(t.costs),t.profitMargin=Number(t.profit)/Number(t.costs)*100,t.profit)},retailPriceComputed(){return t=>(t.profit=Number(t.retailPrice)-Number(t.costs),t.profitMargin=Number(t.profit)/Number(t.costs)*100,t.retailPrice)},profitMarginComputed(){return t=>(t.profit=Number(t.profitMargin)/100*Number(t.costs),t.retailPrice=Number(t.profit)+Number(t.costs),t.profitMargin)},haveDropshipped(){return this.customProductInfo&&this.customProductInfo.id}},watch:{},methods:{handleSelectionChange(t){this.skuIds=t.map(t=>t.skuId)},tableRowStyle({row:t,rowIndex:e}){return t.checked?{}:{background:"#faf9f9 !important",color:"gray","text-decoration":"line-through","font-weight":"lighter"}},close(){this.editLoading=!1,this.dialogVisible=!1,this.editForm.num=0},showEdit(t){this.dialogVisible=!0,this.currentKey=t},editPrice(t){this.$refs[t].validate(async t=>{t&&(this.editLoading=!0,this.value.forEach(t=>{this.skuIds.forEach(e=>{t.skuId===e&&(t[this.currentKey]=this.editForm.num)})}),this.close())})},changeForm(){const t=this.value.map(t=>{t.skuList=this.skuList(t);const e={skuId:t.skuId,retailPrice:t.retailPrice,compareAtPrice:t.compareAtPrice,costs:t.costs,checked:t.checked};return e});this.$emit("input",t)}}},w=y,P=(i("03d4"),Object(u["a"])(w,k,C,!1,null,"65185966",null)),S=P.exports,F=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"description-box"},[i("div",{staticClass:"description-title"},[t._v("Product description")]),i("el-form-item",{staticStyle:{"margin-top":"24px"},attrs:{label:"title",prop:"title"}},[i("el-input",{model:{value:t.customProductInfo.title,callback:function(e){t.$set(t.customProductInfo,"title",e)},expression:"customProductInfo.title"}})],1),i("el-form-item",{attrs:{label:"description",prop:"description"}},[t.currentShop.shopType===t.enums.shopTypeEnum.ETSY.value?i("el-input",{attrs:{autosize:{minRows:2,maxRows:8},type:"textarea"},model:{value:t.customProductInfo.description,callback:function(e){t.$set(t.customProductInfo,"description",e)},expression:"customProductInfo.description"}}):i("Wangeditor",{attrs:{id:t.customProductInfo.blankProductId},model:{value:t.customProductInfo.description,callback:function(e){t.$set(t.customProductInfo,"description",e)},expression:"customProductInfo.description"}})],1),i("div",{staticClass:"description-title"},[t._v("Tags")]),i("el-input",{staticClass:"tag-input",attrs:{placeholder:"Add tag"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.addTag.apply(null,arguments)}},model:{value:t.tempDescriptionForm.tag,callback:function(e){t.$set(t.tempDescriptionForm,"tag",e)},expression:"tempDescriptionForm.tag"}}),i("div",{staticClass:"tag-box"},t._l(t.customProductInfo.tags,(function(e,s){return i("div",{key:s,staticClass:"tag-item"},[i("div",[t._v(t._s(e))]),i("i",{staticClass:"el-icon-close del-tag div-hover",on:{click:function(e){return t.delTag(s)}}})])})),0)],1)},D=[],x=i("448e"),A=i("e661"),L={name:"Description",components:{Wangeditor:x["a"]},props:{customProductInfo:{type:Object,default:()=>({})},productIndex:{type:Number,default:null}},data(){return{tempDescriptionForm:{tag:""},enums:{shopTypeEnum:A["a"]}}},computed:{...Object(h["b"])("user",{currentShop:"getCurrentShop"})},watch:{customProductInfo:{handler(t){const e={productIndex:this.productIndex,productInfo:{title:t.title,description:t.description,tags:t.tags}};this.$emit("change",e)},immediate:!1,deep:!0}},methods:{addTag(){const t=this.tempDescriptionForm.tag;this.customProductInfo.tags.push(t),this.tempDescriptionForm.tag=""},delTag(t){this.customProductInfo.tags.splice(t,1)}}},_=L,N=(i("dc52"),Object(u["a"])(_,F,D,!1,null,"52114d25",null)),$=N.exports,O=i("623f"),E={name:"DropshinpperDetail",components:{Mockups:p,StoreDetails:I,Variants:S,Description:$},beforeRouteEnter(t,e,i){document.documentElement.scrollTop=0,i()},data(){return{id:"",activeNames:0,syncFittingsImageFlag:!0,customProductId:null,customFittingsDesignDataId:null,saveLoading:!1,productInfos:[],publishLoading:!1,enums:{shopTypeEnum:A["a"]},greetingCards:[],dropshinpperRules:{blankProductId:[{required:!0,message:"The BlankProductId field is required",trigger:"blur"}],mainImageUrl:[{required:!0,message:"The MainImageUrl field is required",trigger:"blur"}],title:[{required:!0,message:"The Title field is required",trigger:"blur"}],description:[{required:!0,message:"The Description field is required",trigger:"blur"}],hiddenInStore:[{required:!0,message:"The HiddenInStore field is required",trigger:"blur"}],blankFittingsLevel:[{required:!0,message:"The BlankFittingsLevel field is required",trigger:"blur"}],variantList:[{required:!0,message:"The VariantList field is required",trigger:"blur"}]},setIntervalTag:!1,productNum:0,boxId:""}},computed:{...Object(h["b"])("user",{currentShop:"getCurrentShop"})},async mounted(){this.customFittingsDesignDataId=this.$route.query.customFittingsDesignDataId,this.boxId=this.$route.query.boxId;const t=JSON.parse(this.$route.query.ids);this.productNum=t.length;for(let i=0;i{const e=Number(t.retailPrice)-Number(t.costs),i=Number(t.profit)/Number(t.costs)*100;this.$set(t,"profit",e),this.$set(t,"profitMargin",i)}),i.data},async loadGreetingCards(t){var e=await Object(O["m"])({blankProductId:t});this.greetingCards=e.data||[]},changeVariants(t){this.productInfos[t.productIndex].variantList=t.productInfo},changeDescription(t){Object.assign(this.productInfos[t.productIndex],t.productInfo)},validateForm(t){var e=this;return new Promise(i=>{var s="dropshinpperForm"+t;e.$refs[s][0].validate(async t=>{i(t)})})},async doSave(){this.save().then(t=>{200===t.code?(this.$message.success("Save success"),setTimeout(()=>{this.callNewPage("/DropshinpperList")},500)):this.$message.error(t.msg)})},async save(){for(let e=0;e{this.saveLoading=!0;const e={records:this.productInfos};Object(r["i"])(e).then(e=>{t(e)}).finally(()=>{this.saveLoading=!1})})},async release(){this.publishLoading=!0;try{const t=await this.save();if(!t)return;if(200!==t.code)return void this.$message.error(t.msg);await this.publish(t.data),this.callNewPage({name:"DropshinpperList",params:{id:t.data}})}finally{this.publishLoading=!1}},async publish(t){let e=null;return e=await Object(r["m"])({customProductIds:t}),e.data.customProductPublishId},async getPublishStatus(t){return new Promise((e,i)=>{const s=async()=>{const{data:{status:o}}=await Object(r["n"])({customProductPublishId:t});return 2===o?(clearInterval(this.setIntervalTag),e()):3===o&&(this.$message.error("publish failure"),clearInterval(this.setIntervalTag),i(new Error)),s};s(),this.setIntervalTag=setInterval(s,3e3)})}}},j=E,T=(i("6722"),i("a790"),Object(u["a"])(j,s,o,!1,null,"e103358e",null));e["default"]=T.exports},e255:function(t,e,i){},fd5c:function(t,e,i){}}]);