import{b8 as w,b9 as I,ba as X,x as h,q as m,d as N,u as J,a2 as F,$ as b,E as R,g as t,p as q,b5 as K,F as M,h as p,ap as D,a as O}from"./index-bc617d61.js";import{I as y}from"./index-e80a7d08.js";import{C as P}from"./index-344192ea.js";import{C as v}from"./index-917ed250.js";import{T as S}from"./index-154c7237.js";const B="_paymentTitle_1gzfw_1",E="_orderType_1gzfw_6",Z="_img_1gzfw_14",U="_orderPrice_1gzfw_24",k="_mTop_1gzfw_30",V="_cellGroup_1gzfw_33",Y="_brandName_1gzfw_36",G="_buyDetail_1gzfw_52",W="_buyDetailTitle_1gzfw_70",Q="_refundBtn_1gzfw_74",_="_buyImg_1gzfw_79",$="_container_1gzfw_86",ee="_dialogTitle_1gzfw_90",te="_refundContent_1gzfw_106",re="_tips_1gzfw_109",ne="_refundTitle_1gzfw_114",oe="_phoneName_1gzfw_124",s={paymentTitle:B,orderType:E,img:Z,orderPrice:U,mTop:k,cellGroup:V,brandName:Y,buyDetail:G,buyDetailTitle:W,refundBtn:Q,buyImg:_,container:$,dialogTitle:ee,refundContent:te,tips:re,refundTitle:ne,phoneName:oe},se=""+new URL("icon_refunding-0e95d32d.png",import.meta.url).href,L="data:image/png;base64,[encoded data, 5068 characters]",z="data:image/png;base64,[encoded data, 4876 characters]",j="data:image/png;base64,[encoded data, 4248 characters]";function ue(r){return w()?(I(r),!0):!1}function x(r){return typeof r=="function"?r():X(r)}const ae=typeof window<"u",le=()=>{};function ce(r){var e;const o=x(r);return(e=o==null?void 0:o.$el)!=null?e:o}const C=ae?window:void 0;function H(...r){let e,o,u,c;if(typeof r[0]=="string"||Array.isArray(r[0])?([o,u,c]=r,e=C):[e,o,u,c]=r,!e)return le;Array.isArray(o)||(o=[o]),Array.isArray(u)||(u=[u]);const d=[],n=()=>{d.forEach(a=>a()),d.length=0},l=(a,A,g,T)=>(a.addEventListener(A,g,T),()=>a.removeEventListener(A,g,T)),f=h(()=>[ce(e),x(c)],([a,A])=>{n(),a&&d.push(...o.flatMap(g=>u.map(T=>l(a,g,T,A))))},{immediate:!0,flush:"post"}),i=()=>{f(),n()};return ue(i),i}function de({window:r=C}={}){if(!r)return{x:m(0),y:m(0)};const e=m(r.scrollX),o=m(r.scrollY);return H(r,"scroll",()=>{e.value=r.scrollX,o.value=r.scrollY},{capture:!1,passive:!0}),{x:e,y:o}}const me=N({name:"payment-result",setup(){const r=J();F();const e=b({refund:r.query.refund,orders:{},goodsInfos:[],background:"transparent",color:"#fff",backIconColor:"white",timer:null,timerCount:0});b({resionList:[],refundStatus:!1,resion:null,refundSelect:{},checked:null});const o=async()=>{try{if(!r.query.orderNo)return;const{data:n}=await O.post("/edu-app/open/userOrder/paymentStatus/"+r.query.orderNo);e.orders=n||{};const l=n.goodsInfos||[];l.forEach(f=>{const i=f.goodsUrl?f.goodsUrl.split(",")[0]:"";f.goodsUrl=i}),e.goodsInfos=l}catch(n){}},u=async()=>{["WAIT_PAY","PAYING"].includes(e.orders.status)&&e.timerCount<=10?e.timer=setTimeout(async()=>{e.timerCount+=1,await o(),u()},3e3):clearTimeout(e.timer)},c=n=>({WAIT_PAY:j,PAYING:j,PAID:L,TIMEOUT:z,FAIL:z,CLOSED:z,REFUNDING:se,REFUNDED:L})[n]||L,d=n=>({WAIT_PAY:"支付中",PAYING:"支付中",PAID:"支付成功",TIMEOUT:"订单超时",FAIL:"支付失败",CLOSED:"订单关闭",REFUNDING:"退款中",REFUNDED:"已退款"})[n];return R(async()=>{await o(),await u(),H(document,"scroll",()=>{const{y:n}=de();n.value>52?(e.background="#fff",e.color="#323333",e.backIconColor="black"):(e.background="transparent",e.color="#fff",e.backIconColor="white")})}),()=>t("div",{class:s.paymentResult},[t("div",{class:s.paymentTitle},[q().isApp&&t(K,{border:!1,background:e.background,color:e.color},null),e.orders.id&&t(M,null,[t("div",{class:s.orderType},[t(y,{class:s.img,src:c(e.orders.status)},null),t("div",{class:s.orderInfo},[t("span",null,[d(e.orders.status)]),e.orders.status==="PAID"||e.orders.status==="REFUNDING"?t("div",{class:s.orderPrice},[p("实付金额：￥ "),D(e.orders.paymentCashAmount)]):"",e.orders.status==="REFUNDED"&&t("div",{class:s.orderPrice},[p("退款金额：￥ "),D(e.orders.paymentCashAmount)])])])])]),t(P,{inset:!0,class:[s.cellGroup,s.mTop]},{default:()=>[t(v,null,{title:()=>"付款时间",value:()=>t("span",null,[e.orders.payTime||"--"])}),t(v,null,{title:()=>"订单编号",value:()=>t("span",null,[e.orders.orderNo])})]}),t(P,{inset:!0,class:s.cellGroup},{default:()=>[t("div",{class:s.buyDetail},[t("div",{class:s.buyDetailTitle},[t("i",null,null),p(" 购买详情")])]),e.goodsInfos.map(n=>t(v,null,{icon:()=>t(y,{class:s.buyImg,src:n.goodsUrl},null),title:()=>t("div",{class:s.buyContent},[t("p",{class:s.goodsTitle},[n.goodsName]),t(S,{class:s.brandName},{default:()=>[n.brandName]})]),value:()=>t("span",null,[n.goodsType==="VIP"||n.goodsType==="DEPOSIT"?"6个月":"x 1"])}))]})])}});export{me as default};
