var e=Object.defineProperty,a=Object.defineProperties,t=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,u=(a,t,s)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[t]=s,c=(e,a)=>{for(var t in a||(a={}))r.call(a,t)&&u(e,t,a[t]);if(s)for(var t of s(a))l.call(a,t)&&u(e,t,a[t]);return e},n=(e,s)=>a(e,t(s));import{E as o,b5 as i,e as v,_ as p,a6 as d}from"./vendor-element-CbJWrKZ5.js";import{q as f,bD as y,bz as w,by as m,r as b,c as h,R as x,U as g,t as O,v as _,M as j,E as k,F as P,D,H as I,A as q,K as E,J as F,u as S}from"./vendor-core-DQkwEQyE.js";import{c as T}from"./wallet-on_4kG9q.js";import"./index-DITu3gCO.js";const W={class:"p-4"},B={class:"py-10"},C={class:"flex flex-col items-center gap-4"},R={key:0,class:"text-gray-500 text-sm"},U={class:"flex gap-4"},z=f(n(c({},{name:"UserWalletDepositResult"}),{__name:"result",setup(e){const{t:a}=y(),t=w(),s=m(),r=b(!0),l=b("pending"),u=b("");let f=0,z=null;const A=h(()=>u.value.startsWith("OP")),H=h(()=>{switch(l.value){case"success":return"success";case"fail":return"error";default:return"info"}}),J=h(()=>{switch(l.value){case"success":return a("user.wallet.depositSuccess");case"fail":return a("user.wallet.depositFail");default:return a("user.wallet.checkingDeposit")}}),K=h(()=>{const e=A.value?a("user.wallet.operatingBalance"):a("user.wallet.depositBalance");switch(l.value){case"success":return`您的${e}已成功充值到账户`;case"fail":return a("user.wallet.depositFailTip");default:return a("user.wallet.checkingDepositTip")}}),M=()=>{s.push("/user/wallet/balance")},N=()=>{return e=null,a=null,s=function*(){if(u.value){try{const e=n(c({},t.query),{order_no:u.value}),a=yield T(e);if(a&&"paid"===a.status)return l.value="success",r.value=!1,void(z&&clearInterval(z))}catch(e){}f>=20?(r.value=!1,l.value="fail",z&&clearInterval(z)):f++}},new Promise((t,r)=>{var l=e=>{try{c(s.next(e))}catch(a){r(a)}},u=e=>{try{c(s.throw(e))}catch(a){r(a)}},c=e=>e.done?t(e.value):Promise.resolve(e.value).then(l,u);c((s=s.apply(e,a)).next())});var e,a,s};return x(()=>{const e=t.query.out_trade_no||t.query.order_no;e?(u.value=e,N(),z=setInterval(N,2e3)):(r.value=!1,l.value="fail",o.error(a("user.wallet.missingOrderNo")))}),g(()=>{z&&clearInterval(z)}),(e,t)=>{const s=v,c=i,n=d,o=p;return _(),O("div",W,[j(n,{class:"max-w-3xl mx-auto mt-10",shadow:"hover"},{default:k(()=>[P((_(),O("div",B,[r.value?I("",!0):(_(),D(c,{key:0,icon:H.value,title:J.value,"sub-title":K.value},{extra:k(()=>[q("div",C,[u.value?(_(),O("div",R," 订单号: "+E(u.value),1)):I("",!0),q("div",U,[j(s,{type:"primary",onClick:M},{default:k(()=>[F(E(S(a)("user.wallet.backToWallet")),1)]),_:1}),"pending"===l.value?(_(),D(s,{key:0,onClick:N},{default:k(()=>[F(E(S(a)("user.wallet.refreshStatus")),1)]),_:1})):I("",!0)])])]),_:1},8,["icon","title","sub-title"]))])),[[o,r.value]])]),_:1})])}}}));export{z as default};
