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,be as i,e as v,a7 as p,ae as d}from"./vendor-element-C6D3GHVC.js";import{t as f,bG as w,bB as y,bA as m,r as b,c as h,S as x,V as g,v as O,x as j,O as _,F as k,G as P,E as I,I as B,B as D,L as S,K as q,u as E}from"./vendor-core-B-NFAs71.js";import{c as F}from"./wallet-HPvPXhNt.js";import"./index-DYPGJs8A.js";const T={class:"p-4"},W={class:"py-10"},C={class:"flex flex-col items-center gap-4"},G={key:0,class:"text-gray-500 text-sm"},L={class:"flex gap-4"},A=f(n(c({},{name:"UserWalletDepositResult"}),{__name:"result",setup(e){const{t:a}=w(),t=y(),s=m(),r=b(!0),l=b("pending"),u=b("");let f=0,A=null;const K=h(()=>u.value.startsWith("OP")),N=h(()=>{switch(l.value){case"success":return"success";case"fail":return"error";default:return"info"}}),R=h(()=>{switch(l.value){case"success":return a("user.wallet.depositSuccess");case"fail":return a("user.wallet.depositFail");default:return a("user.wallet.checkingDeposit")}}),U=h(()=>{const e=K.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")}}),V=()=>{s.push("/user/wallet/balance")},$=()=>{return e=null,a=null,s=function*(){if(u.value){try{const e=n(c({},t.query),{order_no:u.value}),a=yield F(e);if(a&&"paid"===a.status)return l.value="success",r.value=!1,void(A&&clearInterval(A))}catch(e){}f>=20?(r.value=!1,l.value="fail",A&&clearInterval(A)):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,$(),A=setInterval($,2e3)):(r.value=!1,l.value="fail",o.error(a("user.wallet.missingOrderNo")))}),g(()=>{A&&clearInterval(A)}),(e,t)=>{const s=v,c=i,n=d,o=p;return j(),O("div",T,[_(n,{class:"max-w-3xl mx-auto mt-10",shadow:"hover"},{default:k(()=>[P((j(),O("div",W,[r.value?B("",!0):(j(),I(c,{key:0,icon:N.value,title:R.value,"sub-title":U.value},{extra:k(()=>[D("div",C,[u.value?(j(),O("div",G," 订单号: "+S(u.value),1)):B("",!0),D("div",L,[_(s,{type:"primary",onClick:V},{default:k(()=>[q(S(E(a)("user.wallet.backToWallet")),1)]),_:1}),"pending"===l.value?(j(),I(s,{key:0,onClick:$},{default:k(()=>[q(S(E(a)("user.wallet.refreshStatus")),1)]),_:1})):B("",!0)])])]),_:1},8,["icon","title","sub-title"]))])),[[o,r.value]])]),_:1})])}}}));export{A as default};
