index-2577dca0.js 4.4 KB

1
  1. import{d as A,P as C,q as P,x as R,y as F,a as t,V as v,F as O,A as s,W as c,C as h,N as G}from"./index-869d77fb.js";import{u as U,a as w}from"./index-155c29c2.js";import{g as B,a as k,h as S}from"./api-6e0b0638.js";import{I as p}from"./index-e76f2a88.js";import{C as T}from"./index-cff93552.js";import{C as i}from"./index-1c6c2ec0.js";import{T as L}from"./index-70d6770d.js";const Y="_paymentTitle_1eftd_1",x="_orderType_1eftd_10",M="_img_1eftd_18",V="_orderPrice_1eftd_28",W="_mTop_1eftd_34",q="_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:V,mTop:W,cellGroup:q,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 k(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 E=n.goodsUrl?n.goodsUrl.split(",")[0]:"";n.goodsUrl=E,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 _(),U(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 b=async()=>{await S(e.refundOrderId),G("撤销退回成功"),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:()=>b()},{default:()=>[s("撤销退回")]})])}});export{ie as default};