import{d as i,q as l,P as u,x as y,y as x,a as n,I as _,R as s,bS as f,bT as I}from"./index-521a9826.js";const q="_payCenter_19c4e_1",a={payCenter:q,"error-icon":"_error-icon_19c4e_5","error-text":"_error-text_19c4e_12"},b=i({name:"pay-center",setup(){const p=l(),r=u(),e=y({errorText:"",code:null,pay_channel:r.query.pay_channel,wxAppId:r.query.wxAppId,body:r.query.body,price:r.query.price,orderNo:r.query.orderNo,userId:r.query.userId}),d=()=>{const o=e.pay_channel;if(s().weixin)if(o==="wx_pub"){const t=f();console.log(t),t?(e.code=t,c()):I(e.wxAppId),document.title="微信支付"}else o=="alipay_qr"&&(e.errorText="请使用支付宝扫码");else s().alipay?o==="wx_pub"?e.errorText="请使用微信扫码":o=="alipay_qr"&&(document.title="支付宝支付",c()):e.errorText="请在微信或支付宝客户端打开";e.errorText&&(document.title="ERROR")},c=()=>{p.replace({path:"/payDefine",query:{pay_channel:e.pay_channel,wxAppId:e.wxAppId,body:e.body,price:e.price,code:e.code,orderNo:e.orderNo,userId:e.userId}})};return x(()=>{d()}),()=>n("div",{class:a.payCenter},[n("div",{class:a["error-text"]},[e.errorText&&n(_,{class:a["error-icon"],name:"warning-o"},null),e.errorText])])}});export{b as default};