import{d as A,U as C,q as P,x as R,y as F,a as t,S as v,F as O,A as s,P as c,C as h,E as U}from"./index-5a763f46.js";import{u as G,a as w}from"./index-689e945e.js";import{g as B,a as S,h as k}from"./api-c5f52f27.js";import{I as p}from"./index-ee50f8d6.js";import{C as T}from"./index-f9bc0cc5.js";import{C as i}from"./index-18ed1ff2.js";import{T as L}from"./index-2a3fa569.js";const Y="_paymentTitle_1eftd_1",x="_orderType_1eftd_10",M="_img_1eftd_18",q="_orderPrice_1eftd_28",V="_mTop_1eftd_34",W="_cellGroup_1eftd_37",J="_brandName_1eftd_40",H="_buyDetail_1eftd_57",K="_buyDetailTitle_1eftd_75",X="_refundBtn_1eftd_79",j="_buyImg_1eftd_84",z="_container_1eftd_91",Q="_dialogTitle_1eftd_95",Z="_refundContent_1eftd_111",$="_tips_1eftd_114",ee="_refundTitle_1eftd_119",te="_phoneName_1eftd_129",re="_cancelBtn_1eftd_133",oe="_orderNo_1eftd_142",o={paymentTitle:Y,orderType:x,img:M,orderPrice:q,mTop:V,cellGroup:W,brandName:J,buyDetail:H,buyDetailTitle:K,refundBtn:X,buyImg:j,container:z,dialogTitle:Q,refundContent:Z,tips:$,refundTitle:ee,phoneName:te,cancelBtn:re,orderNo:oe},y=""+new URL("icon_refunding-47b787dd.svg",import.meta.url).href,f=""+new URL("icon_success-418d3aaa.svg",import.meta.url).href,m=""+new URL("icon_close-c5194700.svg",import.meta.url).href,I=""+new URL("icon_tradeing-f6dadddb.svg",import.meta.url).href,ie=A({name:"collection-record-detail",setup(){const u=C();P();const a=!!u.query.userRefundOrderId,e=R({refundAudit:"",refundOrderId:"",orders:{},goodsInfos:[],background:"transparent",color:"#fff",backIconColor:"white",timer:null,timerCount:0}),l=async()=>{let r=null;try{a?r=await B(u.query.userRefundOrderId):r=await S(u.query.orderNo)}catch(n){}if((r==null?void 0:r.code)!==200)return;e.orders=r.data||{};const d=(a?r.data.studentRefundOrderDetails:r.data.goodsInfos)||[];d.forEach(n=>{const b=n.goodsUrl?n.goodsUrl.split(",")[0]:"";n.goodsUrl=b,n.brandName=n.brandName?n.brandName:N[n.goodsType]}),e.goodsInfos=d,a&&(e.refundAudit=r.data.refundAudit||"",e.refundOrderId=r.data.userRefundOrderId||"",e.orders.status=e.refundAudit)},_=async()=>{["WAIT_PAY","PAYING"].includes(e.orders.status)&&e.timerCount<=10?e.timer=setTimeout(async()=>{e.timerCount+=1,await l(),_()},3e3):clearTimeout(e.timer)},g=r=>({WAIT_PAY:I,PAYING:I,PAID:f,TIMEOUT:m,FAIL:m,CLOSED:m,ING:y,REFUNDING:y,REFUNDED:f})[r]||f,D=r=>({WAIT_PAY:"领取中",PAYING:"领取中",PAID:"领取成功",TIMEOUT:"订单超时",FAIL:"领取失败",CLOSED:"已关闭",ING:"退回申请中",PASS:"已退回",REJECT:"退回失败",REFUNDING:"退款中",REFUNDED:"已退款"})[r],N={VIP:"数字化乐器学练工具",INSTRUMENTS:"乐器购买",TEXTBOOK:"教材"};F(async()=>{await l(),await _(),G(document,"scroll",()=>{const{y:r}=w();r.value>52?(e.background="#fff",e.color="#323333",e.backIconColor="black"):(e.background="transparent",e.color="#fff",e.backIconColor="white")})});const E=async()=>{await k(e.refundOrderId),U("撤销退回成功"),await l()};return()=>t("div",{class:o.paymentResult},[t("div",{class:[o.paymentTitle]},[t(v,{title:a?"申请退回":"领取详情",background:"transparent"},null),e.orders.id&&t(O,null,[t("div",{class:o.orderType},[t(p,{class:o.img,src:g(e.orders.status)},null),t("div",{class:o.orderInfo},[t("span",null,[D(e.orders.status)]),e.orders.status==="PAID"?t("div",{class:o.orderPrice},[s("实付金额：￥ "),c(e.orders.paymentCashAmount)]):null,["ING","PASS","REJECT","REFUNDED"].includes(e.orders.status)&&t("div",{class:o.orderPrice},[s("退回金额：￥ "),c(e.orders.paymentCashAmount)]),["CLOSED"].includes(e.orders.status)&&t("div",{class:o.orderPrice},[s("实付金额：￥ "),c(e.orders.paymentCashAmount)])])])])]),t(T,{inset:!0,class:[o.cellGroup,o.mTop]},{default:()=>[t(i,null,{title:()=>"付款时间",value:()=>t("span",null,[e.orders.payTime||e.orders.refundTime||"--"])}),t(i,null,{title:()=>"订单编号",value:()=>t("span",null,[e.orders.orderNo])})]}),t(T,{inset:!0,class:o.cellGroup},{default:()=>[t("div",{class:o.buyDetail},[t("div",{class:o.buyDetailTitle},[t("i",null,null),s(" 购买详情")])]),e.goodsInfos.map(r=>t(i,null,{icon:()=>t(p,{class:o.buyImg,src:r.goodsUrl},null),title:()=>t("div",{class:o.buyContent},[t("p",{class:o.goodsTitle},[r.goodsName]),t(L,{class:o.brandName},{default:()=>[e.orders.orderType==="VIP"?"12个月":r.brandName]})]),value:()=>t("span",null,[s("x "),r.goodsNum])}))]}),e.refundAudit==="ING"&&t(h,{class:o.cancelBtn,block:!0,round:!0,type:"primary",onClick:()=>E()},{default:()=>[s("撤销退回")]})])}});export{ie as default};
