import{Z as O,R as p,b8 as X,d as q,ah as J,ag as K,r as j,$ as w,c as e,f as C,aj as k,F as M,q as s,b6 as h,B as y,P as S,m as v,b9 as U,o as x}from"./index.d1dca38b.js";import{i as Z,n as L,t as V,a as G}from"./index.c88930a5.js";import{I as F}from"./index.6c52b1a0.js";import{C as N}from"./index.1383acec.js";import{C as A}from"./index.2f930c00.js";import{T as Y}from"./index.3d816bd4.js";import{R as W,a as Q}from"./index.db6e33f6.js";import{F as _}from"./index.a5f38096.js";import"./Checker.d2072e67.js";function $(o){var t;const n=X(o);return(t=n==null?void 0:n.$el)!=null?t:n}const B=G?window:void 0;function R(...o){let t,n,r,l;if(Z(o[0])?([n,r,l]=o,t=B):[t,n,r,l]=o,!t)return L;let c=L;const g=O(()=>$(t),f=>{c(),f&&(f.addEventListener(n,r,l),c=()=>{f.removeEventListener(n,r,l),c=L})},{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:{},z="__vueuse_ssr_handlers__";P[z]=P[z]||{};P[z];var E;(function(o){o.UP="UP",o.RIGHT="RIGHT",o.DOWN="DOWN",o.LEFT="LEFT",o.NONE="NONE"})(E||(E={}));function ee({window:o=B}={}){if(!o)return{x:p(0),y:p(0)};const t=p(o.pageXOffset),n=p(o.pageYOffset);return R("scroll",()=>{t.value=o.pageXOffset,n.value=o.pageYOffset},{capture:!1,passive:!0}),{x:t,y:n}}const te="_paymentTitle_1fyjz_1",ne="_orderType_1fyjz_6",ae="_img_1fyjz_14",oe="_orderPrice_1fyjz_24",ue="_mTop_1fyjz_30",se="_cellGroup_1fyjz_33",re="_brandName_1fyjz_36",le="_buyDetail_1fyjz_50",de="_buyDetailTitle_1fyjz_68",ie="_refundBtn_1fyjz_72",ce="_buyImg_1fyjz_77",fe="_container_1fyjz_84",me="_dialogTitle_1fyjz_88",pe="_refundContent_1fyjz_104",ve="_tips_1fyjz_107",Ae="_refundTitle_1fyjz_112",ge="_phoneName_1fyjz_122";var u={paymentTitle:te,orderType:ne,img:ae,orderPrice:oe,mTop:ue,cellGroup:se,brandName: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]",H="data:image/png;base64,[encoded data, 4248 characters]",xe=q({name:"payment-result",setup(){const o=J();K();const t=j({refund:o.query.refund,orders:{},goodsInfos:[],background:"transparent",color:"#fff",backIconColor:"white",timer:null,timerCount:0}),n=j({resionList:[],refundStatus:!1,resion:null,refundSelect:{},checked:null}),r=async()=>{try{if(!o.query.orderNo)return;const{data:a}=await v.post("/api-student/open/userOrder/paymentStatus/"+o.query.orderNo);t.orders=a||{};const d=a.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/"+o.query.orderNo,{hideLoading:!1}),r()}catch{}})},g=a=>({WAIT_PAY:H,PAYING:H,PAID:b,TIMEOUT:D,FAIL:D,CLOSED:D,REFUNDING:Te,REFUNDED:b})[a]||b,m=a=>({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"})[a],f=async()=>{try{const{data:a}=await v.get("/api-student/sysParamConfig/queryByParamName",{params:{paramName:"refund_reason"}});(a.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{}},I=async()=>{try{const a=n.checked===999&&!n.resion;if(console.log(n.checked),n.checked){if(a){x("\u8BF7\u8F93\u5165\u539F\u56E0");return}}else{x("\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:o.query.orderNo,refundReason:n.checked===999?n.resion:d.text}}),n.refundStatus=!1,r()}catch{}};return w(async()=>{await r(),f(),await l(),R(document,"scroll",()=>{const{y:a}=ee();a.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(F,{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 "),h(t.orders.paymentCashAmount)]):"",t.orders.status==="REFUNDED"&&e("div",{class:u.orderPrice},[s("\u9000\u6B3E\u91D1\u989D\uFF1A\uFFE5 "),h(t.orders.paymentCashAmount)])])])])]),e(N,{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(N,{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(a=>e(A,null,{icon:()=>e(F,{class:u.buyImg,src:a.goodsUrl},null),title:()=>e("div",{class:u.buyContent},[e("p",{class:u.goodsTitle},[a.goodsName]),e(Y,{color:"linear-gradient(135deg, #FF8C4A 0%, #FF531C 100%)",textColor:"#fff",class:u.brandName},{default:()=>[a.brandName]})]),value:()=>e("span",null,[a.goodsType==="VIP"?"6\u4E2A\u6708":"x 1"])}))]}),t.orders.status==="REFUNDING"&&C().isApp&&e("div",{class:"btnGroup"},[e(y,{type:"primary",round:!0,block:!0,onClick:c},{default:()=>[s("\u64A4\u9500\u9000\u8D39")]})]),e(S,{show:n.refundStatus,"onUpdate:show":a=>n.refundStatus=a,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(W,{modelValue:n.checked,"onUpdate:modelValue":a=>n.checked=a},{default:()=>[n.resionList&&n.resionList.map(a=>e(A,{style:"padding: 16px 0;",onClick:()=>n.checked=a.value},{icon:()=>e(Q,{name:a.value},null),title:()=>e("span",{style:"padding-left: 6px"},[a.text])}))]}),n.checked===999&&e(_,{class:u.phoneName,modelValue:n.resion,"onUpdate:modelValue":a=>n.resion=a,placeholder:"\u8BF7\u8F93\u5165\u539F\u56E0",maxlength:50,type:"textarea",rows:2},null)]),e("div",{class:["van-hairline--top van-dialog__footer"]},[e(y,{onClick:I,class:["van-button van-button--default van-button--large van-dialog__cancel"]},{default:()=>[s("\u786E\u8BA4\u9000\u6B3E")]}),e(y,{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};
