import{d as p,U as b,q as y,x as i,y as z,a as n,R as j,S as x,F as C,A as s,P as m,D as H}from"./index-14ddd5b6.js";import{u as N,a as I}from"./index-c3e3ac01.js";import{I as f}from"./index-2684893d.js";import{C as L}from"./index-792cb44c.js";import{C as l}from"./index-db2455fb.js";import{T as X}from"./index-58ef3223.js";const J="_paymentTitle_1enln_1",F="_orderType_1enln_6",R="_img_1enln_14",q="_orderPrice_1enln_24",K="_mTop_1enln_30",h="_cellGroup_1enln_33",M="_brandName_1enln_36",B="_buyDetail_1enln_53",O="_buyDetailTitle_1enln_71",w="_refundBtn_1enln_75",S="_buyImg_1enln_80",U="_container_1enln_87",Z="_dialogTitle_1enln_91",E="_refundContent_1enln_107",k="_tips_1enln_110",V="_refundTitle_1enln_115",Y="_phoneName_1enln_125",t={paymentTitle:J,orderType:F,img:R,orderPrice:q,mTop:K,cellGroup:h,brandName:M,buyDetail:B,buyDetailTitle:O,refundBtn:w,buyImg:S,container:U,dialogTitle:Z,refundContent:E,tips:k,refundTitle:V,phoneName:Y},G=""+new URL("icon_refunding-0e95d32d.png",import.meta.url).href,d="data:image/png;base64,[encoded data, 5068 characters]",c="data:image/png;base64,[encoded data, 4876 characters]",g="data:image/png;base64,[encoded data, 4248 characters]",te=p({name:"payment-result",setup(){const a=b();y();const e=i({refund:a.query.refund,orders:{},goodsInfos:[],background:"transparent",color:"#fff",backIconColor:"white",timer:null,timerCount:0});i({resionList:[],refundStatus:!1,resion:null,refundSelect:{},checked:null});const A=async()=>{try{if(!a.query.orderNo)return;const{data:o}=await H.post("/edu-app/open/userOrder/paymentStatus/"+a.query.orderNo);e.orders=o||{};const r=o.goodsInfos||[];r.forEach(u=>{const D=u.goodsUrl?u.goodsUrl.split(",")[0]:"";u.goodsUrl=D}),e.goodsInfos=r}catch(o){}},T=async()=>{["WAIT_PAY","PAYING"].includes(e.orders.status)&&e.timerCount<=10?e.timer=setTimeout(async()=>{e.timerCount+=1,await A(),T()},3e3):clearTimeout(e.timer)},v=o=>({WAIT_PAY:g,PAYING:g,PAID:d,TIMEOUT:c,FAIL:c,CLOSED:c,REFUNDING:G,REFUNDED:d})[o]||d,P=o=>({WAIT_PAY:"支付中",PAYING:"支付中",PAID:"支付成功",TIMEOUT:"订单超时",FAIL:"支付失败",CLOSED:"订单关闭",REFUNDING:"退款中",REFUNDED:"已退款"})[o];return z(async()=>{await A(),await T(),N(document,"scroll",()=>{const{y:o}=I();o.value>52?(e.background="#fff",e.color="#323333",e.backIconColor="black"):(e.background="transparent",e.color="#fff",e.backIconColor="white")})}),()=>n("div",{class:t.paymentResult},[n("div",{class:[t.paymentTitle]},[j().isApp&&n(x,{border:!1,background:e.background,color:e.color},null),e.orders.id&&n(C,null,[n("div",{class:t.orderType},[n(f,{class:t.img,src:v(e.orders.status)},null),n("div",{class:t.orderInfo},[n("span",null,[P(e.orders.status)]),e.orders.status==="PAID"||e.orders.status==="REFUNDING"?n("div",{class:t.orderPrice},[s("实付金额：￥ "),m(e.orders.paymentCashAmount)]):"",e.orders.status==="REFUNDED"&&n("div",{class:t.orderPrice},[s("退款金额：￥ "),m(e.orders.paymentCashAmount)])])])])]),n(L,{inset:!0,class:[t.cellGroup,t.mTop]},{default:()=>[n(l,null,{title:()=>"付款时间",value:()=>n("span",null,[e.orders.payTime||"--"])}),n(l,null,{title:()=>"订单编号",value:()=>n("span",null,[e.orders.orderNo])})]}),n(L,{inset:!0,class:t.cellGroup},{default:()=>[n("div",{class:t.buyDetail},[n("div",{class:t.buyDetailTitle},[n("i",null,null),s(" 购买详情")])]),e.goodsInfos.map(o=>n(l,null,{icon:()=>n(f,{class:t.buyImg,src:o.goodsUrl},null),title:()=>n("div",{class:t.buyContent},[n("p",{class:t.goodsTitle},[o.goodsName]),n(X,{class:t.brandName},{default:()=>[e.orders.orderType==="VIP"?"12个月":o.brandName]})]),value:()=>n("span",null,[s("x "),o.goodsNum])}))]})])}});export{te as default};
