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