import{d as q,ah as F,ag as B,r as T,$ as H,c as e,f as g,aj as N,F as E,q as u,bf as L,B as m,P as R,m as c,bh as I,o as D}from"./index.27735e87.js";import{a as X,b as w}from"./index.18f2dec1.js";import{I as b}from"./index.06a07328.js";import{C as y}from"./index.5a2d3ded.js";import{C as i}from"./index.997909e4.js";import{R as J,a as K}from"./index.afd7848d.js";import{F as O}from"./index.c2431b87.js";import"./index.d02ae1ba.js";import"./Checker.7ec89993.js";const k="_paymentTitle_1h4fq_1",S="_orderType_1h4fq_6",M="_img_1h4fq_14",U="_orderPrice_1h4fq_24",Z="_mTop_1h4fq_30",V="_cellGroup_1h4fq_33",G="_brandName_1h4fq_36",Y="_model_1h4fq_50",W="_buyDetail_1h4fq_57",Q="_buyDetailTitle_1h4fq_76",_="_refundBtn_1h4fq_80",$="_buyImg_1h4fq_85",ee="_container_1h4fq_92",te="_dialogTitle_1h4fq_96",oe="_refundContent_1h4fq_112",ae="_tips_1h4fq_115",ne="_refundTitle_1h4fq_120",ue="_phoneName_1h4fq_130";var n={paymentTitle:k,orderType:S,img:M,orderPrice:U,mTop:Z,cellGroup:V,brandName:G,model:Y,buyDetail:W,buyDetailTitle:Q,refundBtn:_,buyImg:$,container:ee,dialogTitle:te,refundContent:oe,tips:ae,refundTitle:ne,phoneName:ue},re="./assets/icon_refunding.0e95d32d.png",A="data:image/png;base64,[encoded data, 5068 characters]",p="data:image/png;base64,[encoded data, 4876 characters]",P="data:image/png;base64,[encoded data, 4248 characters]",ve=q({name:"payment-result",setup(){const l=F();B();const t=T({refund:l.query.refund,orders:{},goodsInfos:[],background:"transparent",color:"#fff",backIconColor:"white",timer:null,timerCount:0}),a=T({resionList:[],refundStatus:!1,resion:null,refundSelect:{},checked:null}),d=async()=>{try{if(!l.query.orderNo)return;const{data:o}=await c.post("/api-student/open/userOrder/paymentStatus/"+l.query.orderNo);t.orders=o||{};const r=o.goodsInfos||[];r.forEach(s=>{const f=s.goodsUrl?s.goodsUrl.split(",")[0]:"";s.goodsUrl=f}),t.goodsInfos=r}catch{}},v=async()=>{["WAIT_PAY","PAYING"].includes(t.orders.status)&&t.timerCount<=10?t.timer=setTimeout(async()=>{t.timerCount+=1,await d(),v()},3e3):clearTimeout(t.timer)},h=async()=>{I({message:"\u60A8\u662F\u5426\u786E\u5B9A\u64A4\u9500\u9000\u8D39?"}).then(async()=>{try{await c.post("/api-student/userPaymentOrder/cancelRefund/"+l.query.orderNo,{hideLoading:!1}),d()}catch{}})},z=o=>({WAIT_PAY:P,PAYING:P,PAID:A,TIMEOUT:p,FAIL:p,CLOSED:p,REFUNDING:re,REFUNDED:A})[o]||A,C=o=>({WAIT_PAY:"\u652F\u4ED8\u4E2D",PAYING:"\u652F\u4ED8\u4E2D",PAID:"\u652F\u4ED8\u6210\u529F",TIMEOUT:"\u8BA2\u5355\u8D85\u65F6",FAIL:"\u652F\u4ED8\u5931\u8D25",CLOSED:"\u8BA2\u5355\u5173\u95ED",REFUNDING:"\u9000\u6B3E\u4E2D",REFUNDED:"\u5DF2\u9000\u6B3E"})[o],x=async()=>{try{const{data:o}=await c.get("/api-student/sysParamConfig/queryByParamName",{params:{paramName:"refund_reason"}});(o.paramValue.split(`
`)||[]).forEach((s,f)=>{a.resionList.push({text:s,value:f+1})}),a.resionList.push({text:"\u5176\u5B83\u539F\u56E0",value:999}),console.log(a.resionList,"resionList")}catch{}},j=async()=>{try{const o=a.checked===999&&!a.resion;if(console.log(a.checked),a.checked){if(o){D("\u8BF7\u8F93\u5165\u539F\u56E0");return}}else{D("\u8BF7\u9009\u62E9\u539F\u56E0");return}const r=a.resionList.find(s=>s.value===a.checked);await c.post("/api-student/userPaymentOrder/refundPayment",{hideLoading:!1,data:{merOrderNo:l.query.orderNo,refundReason:a.checked===999?a.resion:r.text}}),a.refundStatus=!1,d()}catch{}};return H(async()=>{await d(),x(),await v(),X(document,"scroll",()=>{const{y:o}=w();o.value>52?(t.background="#fff",t.color="#323333",t.backIconColor="black"):(t.background="transparent",t.color="#fff",t.backIconColor="white")})}),()=>e("div",{class:n.paymentResult},[e("div",{class:n.paymentTitle},[g().isApp&&e(N,{border:!1,background:t.background,color:t.color,backIconColor:t.backIconColor},null),t.orders.id&&e(E,null,[e("div",{class:n.orderType},[e(b,{class:n.img,src:z(t.orders.status)},null),e("div",{class:n.orderInfo},[e("span",null,[C(t.orders.status)]),t.orders.status==="PAID"||t.orders.status==="REFUNDING"?e("div",{class:n.orderPrice},[u("\u5B9E\u4ED8\u91D1\u989D\uFF1A\uFFE5 "),L(t.orders.paymentCashAmount)]):"",t.orders.status==="REFUNDED"&&e("div",{class:n.orderPrice},[u("\u9000\u6B3E\u91D1\u989D\uFF1A\uFFE5 "),L(t.orders.paymentCashAmount)])])])])]),e(y,{inset:!0,class:[n.cellGroup,n.mTop]},{default:()=>[e(i,null,{title:()=>"\u4ED8\u6B3E\u65F6\u95F4",value:()=>e("span",null,[t.orders.payTime||"--"])}),e(i,null,{title:()=>"\u8BA2\u5355\u7F16\u53F7",value:()=>e("span",null,[t.orders.orderNo])})]}),e(y,{inset:!0,class:n.cellGroup},{default:()=>[e("div",{class:n.buyDetail},[e("div",{class:n.buyDetailTitle},[e("i",null,null),u(" \u8D2D\u4E70\u8BE6\u60C5")])]),t.goodsInfos.map(o=>e(i,null,{icon:()=>e(b,{class:n.buyImg,src:o.goodsUrl},null),title:()=>e("div",{class:n.buyContent},[e("p",{class:n.goodsTitle},[o.goodsName]),e("span",{class:[n.model,"van-multi-ellipsis--l2"]},[o.description])]),value:()=>e("span",null,[o.goodsType==="VIP"?"6\u4E2A\u6708":"x 1"])}))]}),t.orders.status==="REFUNDING"&&g().isApp&&e("div",{class:"btnGroup"},[e(m,{type:"primary",round:!0,block:!0,onClick:h},{default:()=>[u("\u64A4\u9500\u9000\u8D39")]})]),e(R,{show:a.refundStatus,"onUpdate:show":o=>a.refundStatus=o,round:!0,style:{width:"90%"}},{default:()=>[e("div",{class:n.container},[e("div",{class:n.dialogTitle},[e("i",null,null),u("\u7533\u8BF7\u9000\u6B3E")]),e("div",{class:n.refundContent},[e("div",{class:n.tips},[u("\u60A8\u5C06\u8981\u53D1\u8D77\u9000\u6B3E\uFF0C\u9000\u6B3E\u9700\u627F\u62C5\u5343\u5206\u4E4B\u516D\u7684\u624B\u7EED\u8D39\uFF0C\u786E\u8BA4\u9000\u6B3E\u540E\u6B3E\u9879\u5C06\u539F\u8DEF\u8FD4\u8FD8\u5230\u60A8\u7684\u4ED8\u6B3E\u8D26\u6237\u4E2D\u3002")]),e("div",{class:n.refundTitle},[e("span",null,[u("*")]),u("\u8BF7\u9009\u62E9\u60A8\u7684\u9000\u6B3E\u539F\u56E0")]),e(J,{modelValue:a.checked,"onUpdate:modelValue":o=>a.checked=o},{default:()=>[a.resionList&&a.resionList.map(o=>e(i,{style:"padding: 16px 0;",onClick:()=>a.checked=o.value},{icon:()=>e(K,{name:o.value},null),title:()=>e("span",{style:"padding-left: 6px"},[o.text])}))]}),a.checked===999&&e(O,{class:n.phoneName,modelValue:a.resion,"onUpdate:modelValue":o=>a.resion=o,placeholder:"\u8BF7\u8F93\u5165\u539F\u56E0",maxlength:50,type:"textarea",rows:2},null)]),e("div",{class:["van-hairline--top van-dialog__footer"]},[e(m,{onClick:j,class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:()=>[u("\u786E\u8BA4\u9000\u6B3E")]}),e(m,{onClick:()=>a.refundStatus=!1,class:["van-button van-button--default van-button--large van-dialog__confirm van-hairline--left"]},{default:()=>[u("\u53D6\u6D88")]})])])]})])}});export{ve as default};
