import{Z as I,bd as O,R as p,d as X,ah as J,ag as K,r as z,$ as w,c as e,f as C,aj as k,F as M,q as s,bb as x,B as L,P as S,m as v,be as U,o as j}from"./index.8f93de0e.js";import{i as Z,n as y,t as V,a as G}from"./index.65daca85.js";import{I as q}from"./index.a2e558d4.js";import{C as F}from"./index.b1095de8.js";import{C as A}from"./index.f729b332.js";import{R as Y,a as W}from"./index.b386e60d.js";import{F as Q}from"./index.9b99667f.js";import"./Checker.8e97a30c.js";function _(a){var t;const n=O(a);return(t=n==null?void 0:n.$el)!=null?t:n}const H=G?window:void 0;function B(...a){let t,n,r,l;if(Z(a[0])?([n,r,l]=a,t=H):[t,n,r,l]=a,!t)return y;let c=y;const g=I(()=>_(t),f=>{c(),f&&(f.addEventListener(n,r,l),c=()=>{f.removeEventListener(n,r,l),c=y})},{immediate:!0,flush:"post"}),m=()=>{g(),c()};return V(m),m}const P=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},h="__vueuse_ssr_handlers__";P[h]=P[h]||{};P[h];var N;(function(a){a.UP="UP",a.RIGHT="RIGHT",a.DOWN="DOWN",a.LEFT="LEFT",a.NONE="NONE"})(N||(N={}));function $({window:a=H}={}){if(!a)return{x:p(0),y:p(0)};const t=p(a.pageXOffset),n=p(a.pageYOffset);return B("scroll",()=>{t.value=a.pageXOffset,n.value=a.pageYOffset},{capture:!1,passive:!0}),{x:t,y:n}}const ee="_paymentTitle_1h4fq_1",te="_orderType_1h4fq_6",ne="_img_1h4fq_14",oe="_orderPrice_1h4fq_24",ae="_mTop_1h4fq_30",ue="_cellGroup_1h4fq_33",se="_brandName_1h4fq_36",re="_model_1h4fq_50",le="_buyDetail_1h4fq_57",de="_buyDetailTitle_1h4fq_76",ie="_refundBtn_1h4fq_80",ce="_buyImg_1h4fq_85",fe="_container_1h4fq_92",me="_dialogTitle_1h4fq_96",pe="_refundContent_1h4fq_112",ve="_tips_1h4fq_115",Ae="_refundTitle_1h4fq_120",ge="_phoneName_1h4fq_130";var u={paymentTitle:ee,orderType:te,img:ne,orderPrice:oe,mTop:ae,cellGroup:ue,brandName:se,model:re,buyDetail:le,buyDetailTitle:de,refundBtn:ie,buyImg:ce,container:fe,dialogTitle:me,refundContent:pe,tips:ve,refundTitle:Ae,phoneName:ge},Te="./assets/icon_refunding.0e95d32d.png",b="data:image/png;base64,[encoded data, 5068 characters]",D="data:image/png;base64,[encoded data, 4876 characters]",E="data:image/png;base64,[encoded data, 4248 characters]",xe=X({name:"payment-result",setup(){const a=J();K();const t=z({refund:a.query.refund,orders:{},goodsInfos:[],background:"transparent",color:"#fff",backIconColor:"white",timer:null,timerCount:0}),n=z({resionList:[],refundStatus:!1,resion:null,refundSelect:{},checked:null}),r=async()=>{try{if(!a.query.orderNo)return;const{data:o}=await v.post("/api-student/open/userOrder/paymentStatus/"+a.query.orderNo);t.orders=o||{};const d=o.goodsInfos||[];d.forEach(i=>{const T=i.goodsUrl?i.goodsUrl.split(",")[0]:"";i.goodsUrl=T}),t.goodsInfos=d}catch{}},l=async()=>{["WAIT_PAY","PAYING"].includes(t.orders.status)&&t.timerCount<=10?t.timer=setTimeout(async()=>{t.timerCount+=1,await r(),l()},3e3):clearTimeout(t.timer)},c=async()=>{U({message:"\u60A8\u662F\u5426\u786E\u5B9A\u64A4\u9500\u9000\u8D39?"}).then(async()=>{try{await v.post("/api-student/userPaymentOrder/cancelRefund/"+a.query.orderNo,{hideLoading:!1}),r()}catch{}})},g=o=>({WAIT_PAY:E,PAYING:E,PAID:b,TIMEOUT:D,FAIL:D,CLOSED:D,REFUNDING:Te,REFUNDED:b})[o]||b,m=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],f=async()=>{try{const{data:o}=await v.get("/api-student/sysParamConfig/queryByParamName",{params:{paramName:"refund_reason"}});(o.paramValue.split(`
`)||[]).forEach((i,T)=>{n.resionList.push({text:i,value:T+1})}),n.resionList.push({text:"\u5176\u5B83\u539F\u56E0",value:999}),console.log(n.resionList,"resionList")}catch{}},R=async()=>{try{const o=n.checked===999&&!n.resion;if(console.log(n.checked),n.checked){if(o){j("\u8BF7\u8F93\u5165\u539F\u56E0");return}}else{j("\u8BF7\u9009\u62E9\u539F\u56E0");return}const d=n.resionList.find(i=>i.value===n.checked);await v.post("/api-student/userPaymentOrder/refundPayment",{hideLoading:!1,data:{merOrderNo:a.query.orderNo,refundReason:n.checked===999?n.resion:d.text}}),n.refundStatus=!1,r()}catch{}};return w(async()=>{await r(),f(),await l(),B(document,"scroll",()=>{const{y:o}=$();o.value>52?(t.background="#fff",t.color="#323333",t.backIconColor="black"):(t.background="transparent",t.color="#fff",t.backIconColor="white")})}),()=>e("div",{class:u.paymentResult},[e("div",{class:u.paymentTitle},[C().isApp&&e(k,{border:!1,background:t.background,color:t.color,backIconColor:t.backIconColor},null),t.orders.id&&e(M,null,[e("div",{class:u.orderType},[e(q,{class:u.img,src:g(t.orders.status)},null),e("div",{class:u.orderInfo},[e("span",null,[m(t.orders.status)]),t.orders.status==="PAID"||t.orders.status==="REFUNDING"?e("div",{class:u.orderPrice},[s("\u5B9E\u4ED8\u91D1\u989D\uFF1A\uFFE5 "),x(t.orders.paymentCashAmount)]):"",t.orders.status==="REFUNDED"&&e("div",{class:u.orderPrice},[s("\u9000\u6B3E\u91D1\u989D\uFF1A\uFFE5 "),x(t.orders.paymentCashAmount)])])])])]),e(F,{inset:!0,class:[u.cellGroup,u.mTop]},{default:()=>[e(A,null,{title:()=>"\u4ED8\u6B3E\u65F6\u95F4",value:()=>e("span",null,[t.orders.payTime||"--"])}),e(A,null,{title:()=>"\u8BA2\u5355\u7F16\u53F7",value:()=>e("span",null,[t.orders.orderNo])})]}),e(F,{inset:!0,class:u.cellGroup},{default:()=>[e("div",{class:u.buyDetail},[e("div",{class:u.buyDetailTitle},[e("i",null,null),s(" \u8D2D\u4E70\u8BE6\u60C5")])]),t.goodsInfos.map(o=>e(A,null,{icon:()=>e(q,{class:u.buyImg,src:o.goodsUrl},null),title:()=>e("div",{class:u.buyContent},[e("p",{class:u.goodsTitle},[o.goodsName]),e("span",{class:[u.model,"van-multi-ellipsis--l2"]},[o.description])]),value:()=>e("span",null,[o.goodsType==="VIP"?"6\u4E2A\u6708":"x 1"])}))]}),t.orders.status==="REFUNDING"&&C().isApp&&e("div",{class:"btnGroup"},[e(L,{type:"primary",round:!0,block:!0,onClick:c},{default:()=>[s("\u64A4\u9500\u9000\u8D39")]})]),e(S,{show:n.refundStatus,"onUpdate:show":o=>n.refundStatus=o,round:!0,style:{width:"90%"}},{default:()=>[e("div",{class:u.container},[e("div",{class:u.dialogTitle},[e("i",null,null),s("\u7533\u8BF7\u9000\u6B3E")]),e("div",{class:u.refundContent},[e("div",{class:u.tips},[s("\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:u.refundTitle},[e("span",null,[s("*")]),s("\u8BF7\u9009\u62E9\u60A8\u7684\u9000\u6B3E\u539F\u56E0")]),e(Y,{modelValue:n.checked,"onUpdate:modelValue":o=>n.checked=o},{default:()=>[n.resionList&&n.resionList.map(o=>e(A,{style:"padding: 16px 0;",onClick:()=>n.checked=o.value},{icon:()=>e(W,{name:o.value},null),title:()=>e("span",{style:"padding-left: 6px"},[o.text])}))]}),n.checked===999&&e(Q,{class:u.phoneName,modelValue:n.resion,"onUpdate:modelValue":o=>n.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(L,{onClick:R,class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:()=>[s("\u786E\u8BA4\u9000\u6B3E")]}),e(L,{onClick:()=>n.refundStatus=!1,class:["van-button van-button--default van-button--large van-dialog__confirm van-hairline--left"]},{default:()=>[s("\u53D6\u6D88")]})])])]})])}});export{xe as default};
