mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-06 04:58:10 +00:00
2 lines
6.5 KiB
JavaScript
2 lines
6.5 KiB
JavaScript
import{d as G,r as u,l as H,X as J,k as t,ax as L,al as W,Y as T,h as x,m as E,w as s,a as r,e as i,i as U,t as n,u as a,J as v,ae as D,O as X,D as Y,G as z,H as A,E as Q,S as Z,M as ee}from"./index-9f163f98.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as te}from"./index.vue_vue_type_style_index_0_lang-5eb33607.js";import"./el-form-item-4ed993c7.js";/* empty css */import{T as g}from"./test-71dfb9c1.js";import{r as le}from"./sys-135535fa.js";/* empty css *//* empty css */const ae={class:"form-tip"},oe={class:"form-tip"},ie={class:"input-width"},ce={class:"form-tip"},se={class:"input-width"},re={class:"form-tip"},ne={class:"input-width"},de={class:"input-width"},pe={class:"form-tip !leading-normal"},ue={class:"form-tip !leading-normal"},me={class:"form-tip !leading-normal"},_e={class:"dialog-footer"},xe=G({__name:"pay-wechatpay",emits:["complete"],setup(he,{expose:I,emit:C}){const m=u(!1),_=u(!0),h=u(""),b=u(""),f=u(null);le().then(o=>{h.value=o.data.wap_domain,b.value=o.data.service_domain});const w={type:"wechatpay",config:{mch_id:"",mch_secret_key:"",mch_secret_cert:"",mch_public_cert_path:"",wechat_public_cert_path:"",wechat_public_cert_id:""},channel:"",status:0,is_default:0},e=H({...w}),P=u(),j=J(()=>({"config.mch_id":[{required:!0,message:t("mchIdPlaceholder"),trigger:"blur"}],"config.mch_secret_key":[{required:!0,message:t("mchSecretKeyPlaceholder"),trigger:"blur"}],"config.mch_secret_cert":[{required:!0,message:t("mchSecretCertPlaceholder"),trigger:"blur"}],"config.mch_public_cert_path":[{required:!0,message:t("mchPublicCertPathPlaceholder"),trigger:"blur"}]})),M=async o=>{_.value||!o||await o.validate(async l=>{l&&(C("complete",e),m.value=!1)})},N=()=>{Object.assign(e,w),f.value&&(Object.keys(e).forEach(o=>{f.value[o]!=null&&(e[o]=f.value[o])}),e.channel=f.value.redio_key.split("_")[0],e.status=Number(e.status)),C("complete",e),m.value=!1},O=async(o=null)=>{f.value=X(o),_.value=!0,Object.assign(e,w),o&&(Object.keys(e).forEach(l=>{o[l]!=null&&(e[l]=o[l])}),e.channel=o.redio_key.split("_")[0],e.status=Number(e.status)),_.value=!1},$=()=>{let o=!0;return(g.empty(e.config.mch_id)||g.empty(e.config.mch_secret_key)||g.empty(e.config.mch_secret_cert)||g.empty(e.config.mch_public_cert_path))&&(o=!1),o},{copy:q,isSupported:B,copied:k}=L(),y=o=>{if(!B.value){T({message:t("notSupportCopy"),type:"warning"});return}q(o)};return W(k,()=>{k.value&&T({message:t("copySuccess"),type:"success"})}),I({showDialog:m,setFormData:O,enableVerify:$}),(o,l)=>{const p=Y,d=z,V=te,F=A,S=Q,K=Z,R=ee;return x(),E(K,{modelValue:m.value,"onUpdate:modelValue":l[10]||(l[10]=c=>m.value=c),title:a(t)("updateWechat"),width:"500px","destroy-on-close":!0},{footer:s(()=>[r("span",_e,[i(S,{onClick:N},{default:s(()=>[U(n(a(t)("cancel")),1)]),_:1}),i(S,{type:"primary",loading:_.value,onClick:l[9]||(l[9]=c=>M(P.value))},{default:s(()=>[U(n(a(t)("confirm")),1)]),_:1},8,["loading"])])]),default:s(()=>[v((x(),E(F,{model:e,"label-width":"140px",ref_key:"formRef",ref:P,rules:a(j),class:"page-form"},{default:s(()=>[i(d,{label:a(t)("mchId"),prop:"config.mch_id"},{default:s(()=>[i(p,{modelValue:e.config.mch_id,"onUpdate:modelValue":l[0]||(l[0]=c=>e.config.mch_id=c),modelModifiers:{trim:!0},placeholder:a(t)("mchIdPlaceholder"),class:"input-width",maxlength:"32","show-word-limit":"",clearable:""},null,8,["modelValue","placeholder"]),r("div",ae,n(a(t)("mchIdTips")),1)]),_:1},8,["label"]),i(d,{label:a(t)("mchSecretKey"),prop:"config.mch_secret_key"},{default:s(()=>[i(p,{modelValue:e.config.mch_secret_key,"onUpdate:modelValue":l[1]||(l[1]=c=>e.config.mch_secret_key=c),modelModifiers:{trim:!0},placeholder:a(t)("mchSecretKeyPlaceholder"),class:"input-width",maxlength:"32","show-word-limit":"",clearable:""},null,8,["modelValue","placeholder"]),r("div",oe,n(a(t)("mchSecretKeyTips")),1)]),_:1},8,["label"]),i(d,{label:a(t)("mchSecretCert"),prop:"config.mch_secret_cert"},{default:s(()=>[r("div",ie,[i(V,{modelValue:e.config.mch_secret_cert,"onUpdate:modelValue":l[2]||(l[2]=c=>e.config.mch_secret_cert=c),api:"sys/document/wechat"},null,8,["modelValue"])]),r("div",ce,n(a(t)("mchSecretCertTips")),1)]),_:1},8,["label"]),i(d,{label:a(t)("mchPublicCertPath"),prop:"config.mch_public_cert_path"},{default:s(()=>[r("div",se,[i(V,{modelValue:e.config.mch_public_cert_path,"onUpdate:modelValue":l[3]||(l[3]=c=>e.config.mch_public_cert_path=c),api:"sys/document/wechat"},null,8,["modelValue"])]),r("div",re,n(a(t)("mchPublicCertPathTips")),1)]),_:1},8,["label"]),i(d,{label:a(t)("wechatpayPublicCert"),prop:"config.wechat_public_cert_path"},{default:s(()=>[r("div",ne,[i(V,{modelValue:e.config.wechat_public_cert_path,"onUpdate:modelValue":l[4]||(l[4]=c=>e.config.wechat_public_cert_path=c),api:"sys/document/wechat"},null,8,["modelValue"])])]),_:1},8,["label"]),i(d,{label:a(t)("wechatpayPublicCertId"),prop:"config.wechat_public_cert_id"},{default:s(()=>[r("div",de,[i(p,{modelValue:e.config.wechat_public_cert_id,"onUpdate:modelValue":l[5]||(l[5]=c=>e.config.wechat_public_cert_id=c),modelModifiers:{trim:!0},placeholder:"",class:"input-width","show-word-limit":"",clearable:""},null,8,["modelValue"])])]),_:1},8,["label"]),v(i(d,{label:a(t)("jsapiDir")},{default:s(()=>[i(p,{"model-value":h.value+"/",placeholder:"Please input",class:"input-width",readonly:!0,disabled:!0},{append:s(()=>[r("div",{class:"cursor-pointer",onClick:l[6]||(l[6]=c=>y(h.value+"/"))},n(a(t)("copy")),1)]),_:1},8,["model-value"]),r("div",pe,n(a(t)("jsapiDirTips")),1)]),_:1},8,["label"]),[[D,e.channel=="wechat"||e.channel=="weapp"]]),v(i(d,{label:a(t)("h5Domain")},{default:s(()=>[i(p,{"model-value":h.value.replace("http://","").replace("https://",""),placeholder:"Please input",class:"input-width",readonly:!0,disabled:!0},{append:s(()=>[r("div",{class:"cursor-pointer",onClick:l[7]||(l[7]=c=>y(h.value.replace("http://","").replace("https://","")))},n(a(t)("copy")),1)]),_:1},8,["model-value"]),r("div",ue,n(a(t)("h5DomainTips")),1)]),_:1},8,["label"]),[[D,e.channel=="h5"]]),v(i(d,{label:a(t)("nativeDomain")},{default:s(()=>[i(p,{"model-value":b.value,placeholder:"Please input",class:"input-width",readonly:!0,disabled:!0},{append:s(()=>[r("div",{class:"cursor-pointer",onClick:l[8]||(l[8]=c=>y(b.value))},n(a(t)("copy")),1)]),_:1},8,["model-value"]),r("div",me,n(a(t)("nativeDomainTips")),1)]),_:1},8,["label"]),[[D,e.channel=="pc"]])]),_:1},8,["model","rules"])),[[R,_.value]])]),_:1},8,["modelValue","title"])}}});export{xe as default};
|