会员支付管理后台-用于提供会员管理小程序支付的api接口,与后台数据管理展示
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
6.8 KiB

import{d as U,O as N,r as y,n as x,q as E,N as a,h as C,c as F,a as d,t as m,u as r,e as _,w as i,i as f,I as B,B as H,a2 as M,W as R,X as A,E as D,Y as K,_ as S}from"./index-6010b07e.js";/* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import{g as O,r as j,e as Q}from"./config-8cc9fc39.js";import{u as $}from"./common-adf8ca96.js";const T={class:"main-container"},W={class:"detail-head"},X={class:"right"},Y=d("p",{style:{color:"red"}},'重新生成二维码后->点击"保存"将替换此二维码',-1),z=["src"],G=["href"],J={class:"fixed-footer-wrap"},L={class:"fixed-footer"},ie=U({__name:"config",setup(Z){const w=N();parseInt(w.query.id);const h=y(!1),q=w.meta.title,g={id:0,we_chat_pay_appid:"",we_chat_pay_app_id:"",we_chat_pay_miniapp_id:"",we_chat_pay_mch_id:"",we_chat_pay_key:"",we_chat_pay_miniapp_secret:"",we_chat_pay_notify_url:"",alipay_appId:"",alipay_rsa_private_key:"",alipay_public_key:"",alipay_notify_url:"",we_chat_pay_mch_secret_cert:"",we_chat_pay_mch_public_cert_path:"",h5_site_url:"",h5_qrcode_url:"",ol_h5_qrcode_url:""},l=x({...g}),b=async(c=0)=>{Object.assign(l,g);const e=await(await O(c)).data;Object.keys(l).forEach(o=>{e[o]!=null&&(l[o]=e[o])})};b();const P=y();y([]);const v=E(()=>({we_chat_pay_appid:[{required:!0,message:a("weChatPayAppidPlaceholder"),trigger:"blur"}],we_chat_pay_app_id:[{required:!0,message:a("weChatPayAppIdPlaceholder"),trigger:"blur"}],we_chat_pay_miniapp_id:[{required:!0,message:a("weChatPayMiniappIdPlaceholder"),trigger:"blur"}],we_chat_pay_mch_id:[{required:!0,message:a("weChatPayMchIdPlaceholder"),trigger:"blur"}],we_chat_pay_key:[{required:!0,message:a("weChatPayKeyPlaceholder"),trigger:"blur"}],we_chat_pay_miniapp_secret:[{required:!0,message:a("weChatPayMiniappSecretPlaceholder"),trigger:"blur"}],we_chat_pay_notify_url:[{required:!0,message:a("weChatPayNotifyUrlPlaceholder"),trigger:"blur"}],we_chat_pay_mch_secret_cert:[{required:!0,message:a("商户私钥必传"),trigger:"blur"}],we_chat_pay_mch_public_cert_path:[{required:!0,message:a("商户公钥必传"),trigger:"blur"}],alipay_appId:[{required:!0,message:a("alipayAppIdPlaceholder"),trigger:"blur"}],alipay_rsa_private_key:[{required:!0,message:a("alipayRsaPrivateKeyPlaceholder"),trigger:"blur"}],alipay_public_key:[{required:!0,message:a("alipayPublicKeyPlaceholder"),trigger:"blur"}],alipay_notify_url:[{required:!0,message:a("alipayNotifyUrlPlaceholder"),trigger:"blur"}]})),k=async c=>{h.value||!c||await c.validate(async e=>{e&&(h.value=!0,Q(l).then(s=>{h.value=!1,b()}).catch(s=>{h.value=!1}))})},I=async()=>{let c=l;if(!c.id){M({message:"请先填写必要信息并点击保存后再试",type:"warning"});return}j(c.id).then(e=>{e.code&&(l.h5_qrcode_url=e.data.url)}).catch(e=>{console.log(e)})},V=(c,e,o)=>{const p=c.target;if(!p.files||p.files.length===0)return;const s=p.files[0];let n=new FormData;n.append("file",s),n.append("path",o),$(n).then(u=>{console.log(222,u),u.code&&(l[e]=u.data.file_path)}).catch(u=>{})};return(c,e)=>{const o=R,p=A,s=D,n=K,u=S;return C(),F("div",T,[d("div",W,[d("span",X,m(r(q)),1)]),_(u,{class:"box-card !border-none",shadow:"never"},{default:i(()=>[_(n,{model:l,"label-width":"270px",ref_key:"formRef",ref:P,rules:r(v),class:"page-form"},{default:i(()=>[_(p,{label:r(a)("weChatPayAppId"),prop:"we_chat_pay_app_id"},{default:i(()=>[_(o,{modelValue:l.we_chat_pay_app_id,"onUpdate:modelValue":e[0]||(e[0]=t=>l.we_chat_pay_app_id=t),clearable:"",placeholder:r(a)("weChatPayAppIdPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),_(p,{label:r(a)("weChatPayMchId"),prop:"we_chat_pay_mch_id"},{default:i(()=>[_(o,{modelValue:l.we_chat_pay_mch_id,"onUpdate:modelValue":e[1]||(e[1]=t=>l.we_chat_pay_mch_id=t),clearable:"",placeholder:r(a)("weChatPayMchIdPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),_(p,{label:r(a)("weChatPayKey"),prop:"we_chat_pay_key"},{default:i(()=>[_(o,{modelValue:l.we_chat_pay_key,"onUpdate:modelValue":e[2]||(e[2]=t=>l.we_chat_pay_key=t),clearable:"",placeholder:r(a)("weChatPayKeyPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),_(p,{label:r(a)("weChatPayNotifyUrl"),prop:"we_chat_pay_notify_url"},{default:i(()=>[_(o,{disabled:"true",modelValue:l.we_chat_pay_notify_url,"onUpdate:modelValue":e[3]||(e[3]=t=>l.we_chat_pay_notify_url=t),clearable:"",placeholder:r(a)("weChatPayNotifyUrlPlaceholder"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),_(p,{label:r(a)("上传微信商户私钥(apiclient_key.pem)"),prop:"we_chat_pay_mch_secret_cert"},{default:i(()=>[_(o,{modelValue:l.we_chat_pay_mch_secret_cert,"onUpdate:modelValue":e[4]||(e[4]=t=>l.we_chat_pay_mch_secret_cert=t),clearable:"",placeholder:r(a)("请上传商户私钥"),class:"input-width"},null,8,["modelValue","placeholder"]),d("div",null,[d("input",{type:"file",onChange:e[5]||(e[5]=t=>V(t,"we_chat_pay_mch_secret_cert","config_we_chat_pay_mch_secret_cert"))},null,32)])]),_:1},8,["label"]),_(p,{label:r(a)("上传微信商户公钥(apiclient_cert.pem)"),prop:"we_chat_pay_mch_public_cert_path"},{default:i(()=>[_(o,{modelValue:l.we_chat_pay_mch_public_cert_path,"onUpdate:modelValue":e[6]||(e[6]=t=>l.we_chat_pay_mch_public_cert_path=t),clearable:"",placeholder:r(a)("请上传商户公钥"),class:"input-width"},null,8,["modelValue","placeholder"]),d("input",{type:"file",onChange:e[7]||(e[7]=t=>V(t,"we_chat_pay_mch_public_cert_path","config_we_chat_pay_mch_public_cert_path"))},null,32)]),_:1},8,["label"]),_(p,{label:r(a)("H5站点地址"),prop:"h5_site_url"},{default:i(()=>[_(o,{disabled:"true",modelValue:l.h5_site_url,"onUpdate:modelValue":e[8]||(e[8]=t=>l.h5_site_url=t),clearable:"",placeholder:r(a)("H5站点地址"),class:"input-width"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),_(p,{label:r(a)("H5站点二维码"),prop:"h5_qrcode_url"},{default:i(()=>[_(o,{disabled:"true",modelValue:l.h5_qrcode_url,"onUpdate:modelValue":e[9]||(e[9]=t=>l.h5_qrcode_url=t),clearable:"",placeholder:r(a)("H5站点二维码"),class:"input-width"},null,8,["modelValue","placeholder"]),_(s,{style:{"margin-left":"15px"},type:"primary",onClick:e[10]||(e[10]=t=>I())},{default:i(()=>[f(m(r(a)("重新生成二维码")),1)]),_:1})]),_:1},8,["label"]),l.ol_h5_qrcode_url?(C(),B(p,{key:0,label:r(a)("原始H5站点二维码"),prop:"h5_qrcode_url"},{default:i(()=>[d("div",null,[Y,d("img",{src:l.ol_h5_qrcode_url,alt:""},null,8,z),d("a",{href:l.ol_h5_qrcode_url,target:"downloadFile",download:"h5_qrcode.png"},[_(s,{type:"primary"},{default:i(()=>[f("打开二维码")]),_:1})],8,G)])]),_:1},8,["label"])):H("",!0)]),_:1},8,["model","rules"])]),_:1}),d("div",J,[d("div",L,[_(s,{type:"primary",onClick:e[11]||(e[11]=t=>k(P.value))},{default:i(()=>[f(m(r(a)("save")),1)]),_:1})])])])}}});export{ie as default};