import{a,x as e,a9 as s,i as t,O as o,a2 as n,o as u,j as l,w as r,B as i,h as c,I as m,l as p,z as d,e as f,F as _,g as v,bs as y,p as x,u as j}from"./index-90c12cc1.js";import{u as b,f as k}from"./order.190c4706.js";import{C as g}from"./config.6730da78.js";import{H as h}from"./index.0e2fd26a.js";import{R as N}from"./index.cf172dbd.js";import{u as w}from"./useInterface.bd4f041a.js";import{u as I}from"./useScroll.50272fa4.js";import{M as C}from"./index.4bde3b32.js";import{L}from"./index.867e23f4.js";import{u as O,a6 as P,a7 as R}from"./images.cf3befb9.js";import{_ as B}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-icon.c815b875.js";import"./uv-icon.vue_vue_type_style_index_0_scoped_23936b10_lang.7145f5b2.js";import"./utils.80a0ac72.js";import"./usePage.8865205f.js";import"./product.4783a646.js";import"./index.ed915e92.js";import"./Goods.94b8dae8.js";import"./index.d156dd8a.js";import"./index.188c29d6.js";const F=B({__name:"index",setup(B){const{getParams:F,goBack:T,push:A,pushToTab:D}=j(),{loading:G,hideLoading:Y}=w(),S=a(0),z=a(0),{scrollTop:H}=I(),J=e((()=>0===z.value?"查询中...":1===z.value?"支付成功":2===z.value?"支付失败":void 0)),M=a();const W=a(3);async function $(){G({title:"查询中..."}),setTimeout((async()=>{try{const a=v(g.PAY_INFO);if(!a)return 2===U.value?E():q(0);const e=JSON.parse(a);e.options&&e.options.isGroup&&(S.value=1);if(!(await b({...e.payData,uni:e.payData.orderId||""})))return void(W.value>0?(W.value--,await $()):(z.value=2,y(g.PAY_INFO)));if(e.options&&e.options.isGroup){const a=await k({key:e.payData.orderId});a&&"8"===a._status._type&&(S.value=4),console.log(S.value)}z.value=1,y(g.PAY_INFO)}finally{Y()}}),500)}function q(a){1===z.value&&(1===S.value&&(a=5),4===S.value&&(a=1)),A({url:"/pages/orderList/orderList"},{data:{type:a},type:"reLaunch"})}function E(){A({url:"/views/account/balance/index"},{data:{},type:"reLaunch"})}function K(){D({url:"/root/index/index"})}const Q=a(null);s((()=>{t(Q).onReachBottom&&t(Q).onReachBottom()}));const U=a(1);return o((async a=>{U.value=a.type,await n((()=>{t(M).show()}))})),(a,e)=>{const s=x,o=i;return u(),l(o,{class:"pay-status"},{default:r((()=>[c(h,{"scroll-top":t(H)},{default:r((()=>[m(p(t(J)),1)])),_:1},8,["scroll-top"]),c(o,{class:"status-main flex flex-column flex-ai__center"},{default:r((()=>[0===Number(z.value)?(u(),l(s,{key:0,class:"icon",src:t(O)},null,8,["src"])):d("",!0),1===Number(z.value)?(u(),l(s,{key:1,class:"icon",src:t(P)},null,8,["src"])):d("",!0),2===Number(z.value)?(u(),l(s,{key:2,class:"icon",src:t(R)},null,8,["src"])):d("",!0),[1,2].includes(Number(z.value))?(u(),l(o,{key:3,class:"text"},{default:r((()=>[m(p(t(J)),1)])),_:1})):(u(),l(L,{key:4,"show-line":!1,text:"查询中..."}))])),_:1}),c(o,{class:"button-group flex flex-ai__center flex-jc__center"},{default:r((()=>[1===Number(z.value)?(u(),l(o,{key:0,class:"animation-button button white-button",onClick:K},{default:r((()=>[m(" 继续逛逛 ")])),_:1})):d("",!0),1!==U.value?(u(),f(_,{key:1},[1===Number(z.value)?(u(),l(o,{key:0,class:"animation-button button",onClick:e[0]||(e[0]=a=>q(1))},{default:r((()=>[m(" 查看订单 ")])),_:1})):d("",!0),2===Number(z.value)?(u(),l(o,{key:1,class:"animation-button button",onClick:e[1]||(e[1]=a=>q(0))},{default:r((()=>[m(" 重新支付 ")])),_:1})):d("",!0)],64)):(u(),f(_,{key:2},[1===Number(z.value)?(u(),l(o,{key:0,class:"animation-button button",onClick:E},{default:r((()=>[m(" 我的余额 ")])),_:1})):d("",!0)],64))])),_:1}),c(N,{ref_key:"recommendRef",ref:Q},null,512),c(C,{ref_key:"modalRef",ref:M,content:"请确认支付是否完成？",onConfirm:$,onCancel:$},null,512)])),_:1})}}},[["__scopeId","data-v-86c2a9ce"]]);export{F as default};
