"use strict";const e=require("./main-BB7fFseo.cjs"),n=i=>(e.pushScopeId("data-v-2f5c18e8"),i=i(),e.popScopeId(),i),V={class:"content-box"},B={class:"flex flex-col",style:{gap:"8px"}},b=n(()=>e.createBaseVNode("div",{class:"title"},"无需支付，仅做展示",-1)),N=n(()=>e.createBaseVNode("div",{class:"tip"},"无需支付，商品仅做展示",-1)),k={key:0,class:"title mt-2"},w=n(()=>e.createBaseVNode("span",{style:{"margin-left":"3px"},class:"tip2"},"目前支付功能仅支持人民币",-1)),C={class:"flex items-center",style:{gap:"18px"}},S=["src"],M=n(()=>e.createBaseVNode("div",{style:{"font-size":"14px","margin-top":"24px"}},"自有支付商户号收款",-1)),I={class:"flex flex-col",style:{gap:"8px","margin-top":"8px","margin-bottom":"8px"}},E={class:"flex flex-col gap-1"},T={style:{display:"flex","align-items":"center",gap:"8px"}},z=n(()=>e.createBaseVNode("i",{style:{color:"#1aad19","font-size":"18px"},class:"iconfont icon-form-weixinzhifu"},null,-1)),L={class:"title"},O=n(()=>e.createBaseVNode("div",{class:"tip"},"使用该账户收款，资金将直接进入已绑定的微信支付商户账户",-1)),P=n(()=>e.createBaseVNode("i",{style:{"font-size":"18px",color:"#999999"},class:"iconfont icon-form-weixinzhifu"},null,-1)),F=e.defineComponent({__name:"SetpayModal",props:{visible:!1},emits:["close","setPay"],setup(i,{emit:g}){const a=e.ref(),r=e.ref(),p=e.ref("0"),v=[{value:"0",label:"人民币(CNY)"}],l=e.ref([]),f=i,u=()=>{e.FormSetting.value.pay_setting.is_pay==0?a.value=0:a.value=l.value.findIndex(t=>t.id==e.FormSetting.value.pay_setting.mch_config_id)+1};e.onMounted(()=>{h(),u()});const c=g,h=async()=>{const t=e.globalInject.getToken(),s=await e.globalInject.$axios.get(`/v1/WxMchOrder/getMchList?eacb=${t}`);console.debug(s.data.result,"list"),l.value=s.data.result},_=e.computed({get:()=>f.visible,set:()=>{}});e.watch(_,t=>{t&&(console.debug(e.FormSetting.value.pay_setting.is_pay),u())});const y=()=>{console.debug("open",r.value),c("close"),console.debug(l.value.length,"length"),e.globalInject.showBindWxPayModal({tab:0,length:l.value.length})},x=()=>{const t={is_pay:0,mch_config_id:null,mch_config_name:"",pay_appid:"",pappid:""};if(a.value==0){d(),c("setPay",t);return}t.is_pay=1,t.pappid=l.value[a.value-1].pappid,t.mch_config_id=l.value[a.value-1].id,t.mch_config_name=l.value[a.value-1].mchname,t.pay_appid=l.value[a.value-1].appid,c("setPay",t),console.debug(t,"settingData"),d()},d=()=>{c("close")};return(t,s)=>(e.openBlock(),e.createBlock(e._sfc_main$4,{title:"设置支付方式",tips:"你可以设置当前表单的支付方式，绑定微信商户号后，款项会直接进入商户号。",dialogVisible:_.value,onOnClose:d,onOnCancel:d,onOnOk:x,ref_key:"modalRef",ref:r,width:"620px"},{content:e.withCtx(()=>[e.createBaseVNode("div",V,[e.createVNode(e.unref(e.ElRadioGroup),{class:"radio-group",modelValue:a.value,"onUpdate:modelValue":s[1]||(s[1]=o=>a.value=o)},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElRadio),{style:e.normalizeStyle(a.value==0?"height:160px":"height:88px"),class:"choose-radio",value:0},{default:e.withCtx(()=>[e.createBaseVNode("div",B,[b,N,a.value==0?(e.openBlock(),e.createElementBlock("div",k,[e.createTextVNode(" 选择展示货币"),w])):e.createCommentVNode("",!0),a.value==0?(e.openBlock(),e.createBlock(e.unref(e.ElSelect),{key:1,style:{width:"320px"},modelValue:p.value,"onUpdate:modelValue":s[0]||(s[0]=o=>p.value=o),disabled:""},{label:e.withCtx(({label:o,value:m})=>[e.createBaseVNode("div",C,[e.createBaseVNode("img",{style:{width:"20px",height:"14px"},src:e.unref(e.getImageUrl)("images/widget/rmb-img.png")},null,8,S),e.createBaseVNode("span",null,e.toDisplayString(o),1)])]),default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,o=>e.createVNode(e.unref(e.ElOption),{key:o.value,label:o.label,value:o.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])):e.createCommentVNode("",!0)])]),_:1},8,["style"]),M,e.createBaseVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(o,m)=>(e.openBlock(),e.createBlock(e.unref(e.ElRadio),{class:"mer-radio",key:o.id,value:m+1},{default:e.withCtx(()=>[e.createBaseVNode("div",E,[e.createBaseVNode("div",T,[z,e.createBaseVNode("div",L,e.toDisplayString(o.mchname),1)]),O])]),_:2},1032,["value"]))),128))])]),_:1},8,["modelValue"]),e.createBaseVNode("div",{onClick:y,class:"add-wxpay"},[P,e.createTextVNode(" 添加微信支付 ")])])]),_:1},8,["dialogVisible"]))}}),R=e._export_sfc(F,[["__scopeId","data-v-2f5c18e8"]]);exports.SetpayModal=R;
