import{d as i,P as l,O as u,Q as y,U as x,j as a,M as _,f as s,bH as f,bI as I}from"./index.e6d6174e.js";const w="_payCenter_19c4e_1";var n={payCenter:w,"error-icon":"_error-icon_19c4e_5","error-text":"_error-text_19c4e_12"},h=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="\u5FAE\u4FE1\u652F\u4ED8"}else o=="alipay_qr"&&(e.errorText="\u8BF7\u4F7F\u7528\u652F\u4ED8\u5B9D\u626B\u7801");else s().alipay?o==="wx_pub"?e.errorText="\u8BF7\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801":o=="alipay_qr"&&(document.title="\u652F\u4ED8\u5B9D\u652F\u4ED8",c()):e.errorText="\u8BF7\u5728\u5FAE\u4FE1\u6216\u652F\u4ED8\u5B9D\u5BA2\u6237\u7AEF\u6253\u5F00";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()}),()=>a("div",{class:n.payCenter},[a("div",{class:n["error-text"]},[e.errorText&&a(_,{class:n["error-icon"],name:"warning-o"},null),e.errorText])])}});export{h as default};