"use strict";(self.webpackChunkdami=self.webpackChunkdami||[]).push([[8203],{72824:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(66252);const o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"};var r=n(51349);function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),a.forEach((function(t){s(e,t,n[t])}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=function(e,t){var n=c({},e,t.attrs);return(0,a.Wm)(r.Z,c({},n,{icon:o}),null)};u.displayName="MinusCircleOutlined",u.inheritAttrs=!1;const l=u},69691:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var a=n(66252),o=n(2262),r=n(7043),c=n(8492),s=n(96486),u=n(61446),l=n(22201),i=n(93666),d=n(98280);const v={key:0,class:"edit-online-message"},p={__name:"EditOnlineSendProduct",setup(e){const{t}=(0,r.QT)(),n=(0,l.tv)(),p=(0,o.iH)(!1),h=(0,o.iH)({}),f=(0,o.iH)([1]),m=(0,o.iH)(""),b=(0,o.iH)(""),g=(t("dashboard.form.productId"),t("dashboard.form.productIdAndName"),{SELECT_METHOD:t("dashboard.errorTips.selectSendMethod"),NO_PRODUCT_ID:t("dashboard.errorTips.noProductId"),NO_CONTENT:t("dashboard.errorTips.noContent")}),S=(0,a.Fl)((()=>f.value.some((e=>2===e)))),O=(0,a.Fl)((()=>f.value.some((e=>1===e||2===e))));const y=(0,s.debounce)((()=>{!async function(){try{if(function(){let e=!0,t="";return f.value.length<=0&&(t=g.SELECT_METHOD,e=!1),S.value&&m.value.length<=0&&(t=g.NO_CONTENT,e=!1),O.value&&b.value.length<=0&&(t=g.NO_PRODUCT_ID,e=!1),!1===e&&u.ZP.warning({key:"validateErrorMessage",content:t}),e}()){const e=f.value[0],a={type:{1:6,2:7}[e],productId:b.value},o=(0,i.WI)();if(200===o.code&&o.data){const e={phone:"",areaCode:"",email:"",second:1,repeatDay:1,skipChat:1,isFixed:0,isPercent:0,freeSample:"",content:m.value},r=o.data,c={...a,...e,...r};1e5===(await d.sT.onSaveScriptSetting(c)).code&&(u.ZP.success(t("dashboard.successTips.scriptSettingSave")),n.push("/"))}}}catch(e){console.error(e)}}()}),300);async function T(){try{p.value=!1;const e=(0,i.WI)();if(200===e.code&&e.data){const t=e.data,n=await d.sT.onGetScriptSetting({shopId:t?.shopId});1e5===n.code&&(h.value=n.data),function(){const e=h.value;(0,s.isEmpty)(e)||(m.value=e.content,b.value=e.productId)}()}p.value=!0}catch(e){console.log(e),p.value=!0}}return(0,a.bv)((()=>{T()})),(e,t)=>p.value?((0,a.wg)(),(0,a.iD)("div",v,[(0,o.SU)(O)?((0,a.wg)(),(0,a.j4)((0,o.SU)(c.RK),{key:0,productId:b.value,"onUpdate:productId":t[0]||(t[0]=e=>b.value=e)},null,8,["productId"])):(0,a.kq)("",!0),(0,o.SU)(S)?((0,a.wg)(),(0,a.j4)((0,o.SU)(c.P4),{key:1,content:m.value,"onUpdate:content":t[1]||(t[1]=e=>m.value=e),options:{rows:6,maxlength:2e3}},null,8,["content"])):(0,a.kq)("",!0),(0,a.Wm)((0,o.SU)(c.e6),{onSave:(0,o.SU)(y)},null,8,["onSave"])])):(0,a.kq)("",!0)}}}}]);