CreatePayTransfer-1daad1ce.js 3.3 KB

1
  1. import{_ as A}from"./Dialog-e0707d40.js";import{d as F,z as R,r as g,f as U,e as h,o as y,j as _,w as s,i as d,m as r,t as u,a as e,l as x,k as p,P as Y,ag as q,ah as z,bf as D,q as S}from"./index-34852970.js";import{E as M}from"./el-card-73839c3c.js";import{E as B,a as G}from"./el-descriptions-item-f0646587.js";import{c as H}from"./index-0172a2ea.js";import{e as J,D as K}from"./dict-5c28424e.js";import{s as O,a as Q}from"./wx_app-b452d323.js";import{u as W}from"./useMessage-f6294882.js";import{_ as X}from"./_plugin-vue_export-helper-1b428a4d.js";const Z=["src"],$=["src"],aa={style:{"text-align":"right"}},ea=X(F({name:"CreatePayTransfer",__name:"CreatePayTransfer",emits:["success"],setup(sa,{expose:T,emit:w}){R();const V=W(),m=g(!1),k=w;let c;const a=U({appId:void 0,channelCode:void 0,merchantTransferId:void 0,type:void 0,price:void 0,subject:void 0,userName:void 0,alipayLogonId:void 0,openid:void 0}),o=g(!1),C=h(()=>J(K.PAY_TRANSFER_TYPE,a.type)),f=h(()=>{let l="alipay_pc";return a.type===2&&(l="wx_app"),l});T({showPayTransfer:async l=>{o.value=!0,c=l,a.merchantTransferId=l.merchantTransferId,a.price=l.price,a.userName=l.userName,a.type=l.type,a.appId=l.appId,a.subject=l.subject,a.alipayLogonId=l.alipayLogonId,a.openid=l.openid},close:async()=>{o.value=!1}});const P=async()=>{m.value=!0;try{c.channelCode=f.value,await H(c),V.success("\u53D1\u8D77\u8F6C\u8D26\u6210\u529F. \u662F\u5426\u8F6C\u8D26\u6210\u529F,\u4EE5\u8F6C\u8D26\u8BA2\u5355\u72B6\u6001\u4E3A\u51C6"),k("success"),o.value=!1}finally{m.value=!1}};return(l,t)=>{const i=B,N=G,v=M,b=q,j=z,E=D,I=S,L=A;return y(),_(L,{title:"\u53D1\u8D77\u8F6C\u8D26",modelValue:e(o),"onUpdate:modelValue":t[2]||(t[2]=n=>Y(o)?o.value=n:null),width:"800px"},{default:s(()=>[d(v,{style:{"margin-top":"10px"}},{default:s(()=>[d(N,{title:"\u8F6C\u8D26\u4FE1\u606F",column:2,border:""},{default:s(()=>[d(i,{label:"\u8F6C\u8D26\u7C7B\u578B"},{default:s(()=>[r(u(C.value),1)]),_:1}),d(i,{label:"\u8F6C\u8D26\u91D1\u989D(\u5143)"},{default:s(()=>[r(" \uFFE5"+u((e(a).price/100).toFixed(2)),1)]),_:1}),d(i,{label:"\u6536\u6B3E\u4EBA\u59D3\u540D"},{default:s(()=>[r(u(e(a).userName),1)]),_:1}),e(a).type===1?(y(),_(i,{key:0,label:"\u652F\u4ED8\u5B9D\u767B\u5F55\u8D26\u53F7"},{default:s(()=>[r(u(e(a).alipayLogonId),1)]),_:1})):x("",!0),e(a).type===2?(y(),_(i,{key:1,label:"\u5FAE\u4FE1 openid"},{default:s(()=>[r(u(e(a).openid),1)]),_:1})):x("",!0)]),_:1})]),_:1}),d(v,{style:{"margin-top":"20px"}},{header:s(()=>t[3]||(t[3]=[p("div",{class:"card-header"},[p("span",null,"\u9009\u62E9\u8F6C\u8D26\u6E20\u9053")],-1)])),default:s(()=>[p("div",null,[d(j,{modelValue:f.value,"onUpdate:modelValue":t[0]||(t[0]=n=>f.value=n)},{default:s(()=>[d(b,{label:"alipay_pc",disabled:e(a).type===2||e(a).type===3||e(a).type===4},{default:s(()=>[p("img",{src:e(O)},null,8,Z)]),_:1},8,["disabled"]),d(b,{label:"wx_app",disabled:e(a).type===1||e(a).type===3||e(a).type===4},{default:s(()=>[p("img",{src:e(Q)},null,8,$)]),_:1},8,["disabled"])]),_:1},8,["modelValue"])])]),_:1}),d(E),p("div",aa,[d(I,{onClick:P,type:"primary",disabled:e(m)},{default:s(()=>t[4]||(t[4]=[r("\u786E \u5B9A")])),_:1},8,["disabled"]),d(I,{onClick:t[1]||(t[1]=n=>o.value=!1)},{default:s(()=>t[5]||(t[5]=[r("\u53D6 \u6D88")])),_:1})])]),_:1},8,["modelValue"])}}}),[["__scopeId","data-v-5cfa0b5d"]]);export{ea as default};