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