index-2fadcb5e.js 8.6 KB

1
  1. import{d as he,N as xe,u as Ce,r as p,z as ge,o as h,c as P,D as $,a,j as ee,w as s,i as t,m as u,t as d,k as r,F as k,C as U,X as we,I as Ae,E as Pe,s as ke,J as Ee,q as Se,M as Ue,__tla as Ie}from"./index-1e808f2e.js";import{E as Re,__tla as Ve}from"./el-link-1faa17b5.js";import{_ as Le,__tla as qe}from"./Dialog-f44f9d78.js";import{E as Oe,__tla as We}from"./el-card-03b3588b.js";import{E as Xe,a as Be,__tla as De}from"./el-descriptions-item-8d4be2e8.js";import{Q as Me,__tla as Ye}from"./Qrcode-ef77d611.js";import{g as ae,s as Te,__tla as je}from"./index-c506407b.js";import{P as C,a as _,b as I}from"./constants-e43f22dd.js";import{f as le,__tla as Fe}from"./formatTime-a348c3be.js";import{u as Qe,__tla as ze}from"./tagsView-1954bd1b.js";import{s as Je,a as Ne}from"./wx_app-08e07efc.js";import{u as Ge,__tla as He}from"./useMessage-5f9e8917.js";import{_ as Ke}from"./_plugin-vue_export-helper-1b428a4d.js";let te,Ze=Promise.all([(()=>{try{return Ie}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return qe}catch{}})(),(()=>{try{return We}catch{}})(),(()=>{try{return De}catch{}})(),(()=>{try{return Ye}catch{}})(),(()=>{try{return je}catch{}})(),(()=>{try{return Fe}catch{}})(),(()=>{try{return ze}catch{}})(),(()=>{try{return He}catch{}})()]).then(async()=>{let R,V,L,q,O,W,X,B,D,M,Y,T,j;R={class:"pay-channel-container"},V=["onClick"],L=["src"],q={class:"title"},O={class:"pay-channel-container"},W=["onClick"],X=["src"],B={class:"title"},D={class:"pay-channel-container"},M=["onClick"],Y=["src"],T={class:"title"},j={style:{"text-align":"right"}},te=Ke(he({name:"PayCashier",__name:"index",setup($e){const n=Ge(),E=xe(),{push:se,currentRoute:F}=Ce(),{delView:Q}=Qe(),x=p(void 0),y=p(void 0),oe=p(!1),v=p({}),ie=[{name:"\u652F\u4ED8\u5B9D PC \u7F51\u7AD9\u652F\u4ED8",icon:"/assets/alipay_pc-61b7a901.svg",code:"alipay_pc"},{name:"\u652F\u4ED8\u5B9D Wap \u7F51\u7AD9\u652F\u4ED8",icon:"/assets/alipay_wap-c6a2e6a2.svg",code:"alipay_wap"},{name:"\u652F\u4ED8\u5B9D App \u7F51\u7AD9\u652F\u4ED8",icon:Je,code:"alipay_app"},{name:"\u652F\u4ED8\u5B9D\u626B\u7801\u652F\u4ED8",icon:"/assets/alipay_qr-2be55889.svg",code:"alipay_qr"},{name:"\u652F\u4ED8\u5B9D\u6761\u7801\u652F\u4ED8",icon:"/assets/alipay_bar-0dba2b09.svg",code:"alipay_bar"}],re=[{name:"\u5FAE\u4FE1\u516C\u4F17\u53F7\u652F\u4ED8",icon:"/assets/wx_pub-ae17ce78.svg",code:"wx_pub"},{name:"\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u652F\u4ED8",icon:"/assets/wx_lite-1f244e1b.svg",code:"wx_lite"},{name:"\u5FAE\u4FE1 App \u652F\u4ED8",icon:Ne,code:"wx_app"},{name:"\u5FAE\u4FE1\u626B\u7801\u652F\u4ED8",icon:"/assets/wx_native-aab2e7e4.svg",code:"wx_native"},{name:"\u5FAE\u4FE1\u6761\u7801\u652F\u4ED8",icon:"/assets/wx_bar-78569907.svg",code:"wx_bar"}],ce=[{name:"\u6A21\u62DF\u652F\u4ED8",icon:"/assets/mock-e9f0a039.svg",code:"mock"}],f=p(!1),g=p(void 0),b=p({url:"",title:"",visible:!1}),c=p({channelCode:"",value:"",title:"",visible:!1}),S=e=>{e!==_.ALIPAY_BAR.code?e!==_.WX_BAR.code?e!==_.WX_PUB.code?e!==_.WX_LITE.code?z(e):n.error("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\uFF1A\u4E0D\u652F\u6301 PC \u7F51\u7AD9"):n.error("\u5FAE\u4FE1\u516C\u4F17\u53F7\u652F\u4ED8\uFF1A\u4E0D\u652F\u6301 PC \u7F51\u7AD9"):c.value={channelCode:e,value:"",title:"\u201C\u5FAE\u4FE1\u201D\u6761\u7801\u652F\u4ED8",visible:!0}:c.value={channelCode:e,value:"",title:"\u201C\u652F\u4ED8\u5B9D\u201D\u6761\u7801\u652F\u4ED8",visible:!0}},z=async e=>{f.value=!0;try{const o={id:x.value,channelCode:e,returnUrl:location.href,...ne(e)},i=await Te(o);if(i.status===C.SUCCESS.status)return w(),n.success("\u652F\u4ED8\u6210\u529F\uFF01"),void m("success");i.displayMode===I.URL.mode?ue(e,i):i.displayMode===I.QR_CODE.mode?de(e,i):i.displayMode===I.APP.mode&&_e(e),pe()}finally{f.value=!1}},ne=e=>e===_.ALIPAY_BAR.code?{channelExtras:{auth_code:c.value.value}}:e===_.WX_BAR.code?{channelExtras:{authCode:c.value.value}}:{},ue=(e,o)=>{location.href=o.displayContent,f.value=!1},de=(e,o)=>{let i="\u8BF7\u4F7F\u7528\u624B\u673A\u6D4F\u89C8\u5668\u201C\u626B\u4E00\u626B\u201D";e===_.ALIPAY_WAP.code||(e.indexOf("alipay_")===0?i="\u8BF7\u4F7F\u7528\u652F\u4ED8\u5B9D\u201C\u626B\u4E00\u626B\u201D\u626B\u7801\u652F\u4ED8":e.indexOf("wx_")===0&&(i="\u8BF7\u4F7F\u7528\u5FAE\u4FE1\u201C\u626B\u4E00\u626B\u201D\u626B\u7801\u652F\u4ED8")),b.value={title:i,url:o.displayContent,visible:!0},f.value=!1},_e=e=>{e===_.ALIPAY_APP.code&&n.error("\u652F\u4ED8\u5B9D App \u652F\u4ED8\uFF1A\u65E0\u6CD5\u5728\u7F51\u9875\u652F\u4ED8\uFF01"),e===_.WX_APP.code&&n.error("\u5FAE\u4FE1 App \u652F\u4ED8\uFF1A\u65E0\u6CD5\u5728\u7F51\u9875\u652F\u4ED8\uFF01"),f.value=!1},pe=()=>{g.value||(g.value=setInterval(async()=>{const e=await ae(x.value);e.status===C.SUCCESS.status&&(w(),n.success("\u652F\u4ED8\u6210\u529F\uFF01"),m("success")),e.status===C.CLOSED.status&&(w(),n.error("\u652F\u4ED8\u5DF2\u5173\u95ED\uFF01"),m("close"))},2e3))},w=()=>{b.value={title:"",url:"",visible:!1},clearInterval(g.value),g.value=void 0},m=e=>{if(w(),!y.value)return void Q(a(F));const o=y.value.indexOf("?")>=0?y.value+"&payResult="+e:y.value+"?payResult="+e;y.value.indexOf("http")===0?location.href=o:(Q(a(F)),se({path:o}))};return ge(()=>{x.value=E.query.id,E.query.returnUrl&&(y.value=decodeURIComponent(E.query.returnUrl)),(async()=>{if(!x.value)return n.error("\u672A\u4F20\u9012\u652F\u4ED8\u5355\u53F7\uFF0C\u65E0\u6CD5\u67E5\u770B\u5BF9\u5E94\u7684\u652F\u4ED8\u4FE1\u606F"),void m("cancel");const e=await ae(x.value);v.value=e,e?e.status===C.SUCCESS.status?(n.success("\u652F\u4ED8\u6210\u529F"),m("success")):e.status===C.CLOSED.status&&(n.error("\u65E0\u6CD5\u652F\u4ED8\uFF0C\u539F\u56E0\uFF1A\u8BA2\u5355\u5DF2\u5173\u95ED"),m("close")):(n.error("\u652F\u4ED8\u8BA2\u5355\u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5\uFF01"),m("cancel"))})()}),(e,o)=>{const i=Xe,A=Be,J=Oe,N=Le,ve=we,me=Ae,G=Pe,ye=Re,fe=ke,be=Ee,H=Se,K=Ue;return h(),P(k,null,[$((h(),ee(J,null,{default:s(()=>[t(A,{title:"\u652F\u4ED8\u4FE1\u606F",column:3,border:""},{default:s(()=>[t(i,{label:"\u652F\u4ED8\u5355\u53F7"},{default:s(()=>[u(d(a(v).id),1)]),_:1}),t(i,{label:"\u5546\u54C1\u6807\u9898"},{default:s(()=>[u(d(a(v).subject),1)]),_:1}),t(i,{label:"\u5546\u54C1\u5185\u5BB9"},{default:s(()=>[u(d(a(v).body),1)]),_:1}),t(i,{label:"\u652F\u4ED8\u91D1\u989D"},{default:s(()=>[u(" \uFFE5"+d((a(v).price/100).toFixed(2)),1)]),_:1}),t(i,{label:"\u521B\u5EFA\u65F6\u95F4"},{default:s(()=>[u(d(a(le)(a(v).createTime)),1)]),_:1}),t(i,{label:"\u8FC7\u671F\u65F6\u95F4"},{default:s(()=>[u(d(a(le)(a(v).expireTime)),1)]),_:1})]),_:1})]),_:1})),[[K,a(oe)]]),$((h(),ee(J,{style:{"margin-top":"10px"},"element-loading-text":"\u63D0\u4EA4\u652F\u4ED8\u4E2D..."},{default:s(()=>[t(A,{title:"\u9009\u62E9\u652F\u4ED8\u5B9D\u652F\u4ED8"}),r("div",R,[(h(),P(k,null,U(ie,l=>r("div",{class:"box",key:l.code,onClick:Z=>S(l.code)},[r("img",{src:l.icon},null,8,L),r("div",q,d(l.name),1)],8,V)),64))]),t(A,{title:"\u9009\u62E9\u5FAE\u4FE1\u652F\u4ED8",style:{"margin-top":"20px"}}),r("div",O,[(h(),P(k,null,U(re,l=>r("div",{class:"box",key:l.code,onClick:Z=>S(l.code)},[r("img",{src:l.icon},null,8,X),r("div",B,d(l.name),1)],8,W)),64))]),t(A,{title:"\u9009\u62E9\u5176\u5B83\u652F\u4ED8",style:{"margin-top":"20px"}}),r("div",D,[(h(),P(k,null,U(ce,l=>r("div",{class:"box",key:l.code,onClick:Z=>S(l.code)},[r("img",{src:l.icon},null,8,Y),r("div",T,d(l.name),1)],8,M)),64))])]),_:1})),[[K,a(f)]]),t(N,{title:a(b).title,modelValue:a(b).visible,"onUpdate:modelValue":o[0]||(o[0]=l=>a(b).visible=l),width:"350px","append-to-body":"","close-on-press-escape":!1},{default:s(()=>[t(a(Me),{text:a(b).url,width:310},null,8,["text"])]),_:1},8,["title","modelValue"]),t(N,{title:a(c).title,modelValue:a(c).visible,"onUpdate:modelValue":o[4]||(o[4]=l=>a(c).visible=l),width:"500px","append-to-body":"","close-on-press-escape":!1},{footer:s(()=>[t(H,{type:"primary",onClick:o[2]||(o[2]=l=>z(a(c).channelCode)),disabled:a(c).value.length===0},{default:s(()=>[u(" \u786E\u8BA4\u652F\u4ED8 ")]),_:1},8,["disabled"]),t(H,{onClick:o[3]||(o[3]=l=>a(c).visible=!1)},{default:s(()=>[u("\u53D6 \u6D88")]),_:1})]),default:s(()=>[t(be,{ref:"form","label-width":"80px"},{default:s(()=>[t(fe,null,{default:s(()=>[t(G,{span:24},{default:s(()=>[t(me,{label:"\u6761\u5F62\u7801",prop:"name"},{default:s(()=>[t(ve,{modelValue:a(c).value,"onUpdate:modelValue":o[1]||(o[1]=l=>a(c).value=l),placeholder:"\u8BF7\u8F93\u5165\u6761\u5F62\u7801",required:""},null,8,["modelValue"])]),_:1})]),_:1}),t(G,{span:24},{default:s(()=>[r("div",j,[u(" \u6216\u4F7F\u7528 "),t(ye,{type:"danger",target:"_blank",href:"https://baike.baidu.com/item/\u6761\u7801\u652F\u4ED8/10711903"},{default:s(()=>[u(" (\u626B\u7801\u67AA/\u626B\u7801\u76D2) ")]),_:1}),u(" \u626B\u7801 ")])]),_:1})]),_:1})]),_:1},512)]),_:1},8,["title","modelValue"])],64)}}}),[["__scopeId","data-v-4d8e6a42"]])});export{Ze as __tla,te as default};