"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BB7fFseo.cjs"),u=require("./index-YwS-u3iG.cjs"),_=require("./Input-nzZ6ZRQk.cjs"),g=require("./ImportantOption.vue_vue_type_script_setup_true_lang-19mUJE6D.cjs"),r=n=>(e.pushScopeId("data-v-392d851e"),n=n(),e.popScopeId(),n),f={class:"qrcode-item"},v={key:0,class:"view-1"},m=["src"],h=r(()=>e.createBaseVNode("div",{class:"abs-view"},[e.createBaseVNode("i",{class:"iconfont icon-form-upload1"}),e.createBaseVNode("div",null,"重新上传")],-1)),w={key:1,class:"view-2"},V=r(()=>e.createBaseVNode("i",{class:"iconfont icon-form-upload1"},null,-1)),B=r(()=>e.createBaseVNode("div",null,"上传",-1)),U=[V,B],x=e.defineComponent({__name:"ContactUsSetting",setup(n){const i=e.computed({get:()=>e.contactUsWidget.value.attrs.tel,set:c=>{e.contactUsWidget.value.attrs.tel=c||""}}),o=e.ref(!1),l=["jpg","jpeg","png"],p=async c=>{if(o.value)return;const a=e.getFileExtension(c.name);if(!a||!l.includes(a)){e.ElMessage.error(`请上传${l.join("、")}格式的图片！`);return}o.value=!0;try{(await e.globalInject.uploadFile(c.raw,{name:`${e.generateUUID()}.${a}`})).subscribe({complete:t=>{e.contactUsWidget.value.attrs.qrcode=e.globalInject.imagePrefix+t.key,o.value=!1},error:t=>{console.error(t),e.ElMessage.error("图片上传失败，请稍后再试!"),o.value=!1}})}catch(s){o.value=!1,console.error("handleUploadChange",s),e.ElMessage.error("图片上传失败，请稍后再试!")}};return(c,a)=>{const s=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(u.TitleRow),null,{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString((t=e.unref(e.activeWidgetInfo))==null?void 0:t.name)+"设置",1)]}),_:1}),e.createVNode(e.unref(_.InputRow),{wrap:"",label:"电话",placeholder:"请输入联系电话",tips:"可以输入手机号或固话，不要添加空格或其他符号","max-length":13,modelValue:i.value,"onUpdate:modelValue":a[0]||(a[0]=t=>i.value=t)},null,8,["modelValue"]),e.createVNode(e.unref(u.Row),{label:"微信二维码",wrap:"",tips:"温馨提示：出于微信风控影响，个人微信号可能无法在短时间内被多次添加。"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElUpload),{"show-file-list":!1,"auto-upload":!1,accept:l.map(t=>`.${t}`).join(","),onChange:p},{default:e.withCtx(()=>{var t,d;return[e.withDirectives((e.openBlock(),e.createElementBlock("div",f,[(t=e.unref(e.contactUsWidget))!=null&&t.attrs.qrcode?(e.openBlock(),e.createElementBlock("div",v,[e.createBaseVNode("img",{src:(d=e.unref(e.contactUsWidget))==null?void 0:d.attrs.qrcode,alt:""},null,8,m),h])):(e.openBlock(),e.createElementBlock("div",w,U))])),[[s,o.value]])]}),_:1},8,["accept"])]),_:1}),e.createVNode(g._sfc_main)],64)}}}),N=e._export_sfc(x,[["__scopeId","data-v-392d851e"]]);exports.default=N;
