import{_ as e}from"./page-meta.a54da57d.js";import{d as a,z as t,aT as s,G as r,c as l,I as u,o,g as i,e as m,f as n,w as c,x as p,l as d,t as _,b as f,F as g,v as y,r as x,a as h,a3 as v,p as w}from"./index-cca0a918.js";import{_ as j}from"./u-empty.2cdc857e.js";import{_ as b}from"./u-image.777f39e2.js";import{_ as k}from"./u-button.286a5b6f.js";import{g as R,_ as O}from"./pay.6f04d8df.js";import{_ as I}from"./_plugin-vue_export-helper.1b428a4d.js";import"./u-icon.8199a0c5.js";import"./u-loading.df09980e.js";const L=I(a({__name:"payment_result",setup(a){const I=y(),L={succeed:{text:"支付成功",image:"/static/images/payment/icon_succeed.png"},waiting:{text:"等待支付",image:"/static/images/payment/icon_waiting.png"}},A=t(s.LOADING),C=t({id:"",from:""}),D=r({order:{}}),E=l((()=>{const e=!!D.pay_status;return L[e?"succeed":"waiting"]})),G=()=>{I.reLaunch("/pages/index/index")},N=()=>{if("recharge"===C.value.from)I.navigateBack()};return u((async e=>{try{if(!e.id)throw new Error("订单不存在");C.value=e,await new Promise(((e,a)=>{R({order_id:C.value.id,from:C.value.from}).then((a=>{Object.assign(D,a),e(a)})).catch((e=>{a(e)}))})),A.value=s.NORMAL}catch(a){console.log(a),A.value=s.ERROR}})),(a,t)=>{const s=x(h("page-meta"),e),r=x(h("u-empty"),j),l=x(h("u-image"),b),u=v,y=w,R=x(h("u-button"),k),I=x(h("page-status"),O);return o(),i(g,null,[m(s,{"page-style":a.$theme.pageStyle},null,8,["page-style"]),n(" 页面状态 "),m(I,{status:A.value},{error:c((()=>[m(r,{text:"订单不存在",mode:"order"})])),default:c((()=>[m(y,{class:"payment-result p-[20rpx]"},{default:c((()=>[m(y,{class:"result bg-white p-[20rpx] rounded-md"},{default:c((()=>[m(y,{class:"flex flex-col items-center my-[40rpx]"},{default:c((()=>[n(" 支付状态图片 "),m(l,{class:"status-image",src:p(E).image,width:"100",height:"100",shape:"circle"},null,8,["src"]),n(" 支付状态文字 "),m(u,{class:"text-2xl font-medium mt-[20rpx]"},{default:c((()=>[d(_(p(E).text),1)])),_:1}),m(y,{class:"text-3xl font-medium mt-[20rpx]"},{default:c((()=>[d(" ¥ "+_(D.order.order_amount),1)])),_:1})])),_:1}),n(" 支付信息 "),m(y,{class:"result-info"},{default:c((()=>[m(y,{class:"result-info__item"},{default:c((()=>[m(u,null,{default:c((()=>[d("订单编号")])),_:1}),m(u,null,{default:c((()=>[d(_(D.order.order_sn),1)])),_:1})])),_:1}),m(y,{class:"result-info__item"},{default:c((()=>[m(u,null,{default:c((()=>[d("付款时间")])),_:1}),m(u,null,{default:c((()=>[d(_(D.order.pay_time),1)])),_:1})])),_:1}),m(y,{class:"result-info__item"},{default:c((()=>[m(u,null,{default:c((()=>[d("支付方式")])),_:1}),D.pay_status?(o(),f(u,{key:0},{default:c((()=>[d(_(D.order.pay_way||"-"),1)])),_:1})):(o(),f(u,{key:1},{default:c((()=>[d("未支付")])),_:1}))])),_:1})])),_:1})])),_:1}),m(y,{class:"mt-[40rpx]"},{default:c((()=>[m(y,{class:"mb-[20rpx]"},{default:c((()=>["recharge"==C.value.from?(o(),f(R,{key:0,type:"primary",shape:"circle","hover-class":"none",onClick:N},{default:c((()=>[d(" 继续充值 ")])),_:1})):n("v-if",!0)])),_:1}),m(y,{class:"mb-[20rpx]"},{default:c((()=>[m(R,{type:"primary",plain:"",shape:"circle","hover-class":"none",onClick:G},{default:c((()=>[d(" 返回首页 ")])),_:1})])),_:1})])),_:1})])),_:1})])),_:1},8,["status"])],64)}}}),[["__scopeId","data-v-bba82a10"]]);export{L as default};
