import{o as s,g as n,a as o,b as _,w as d,u as t,h as l,c as g,i as c,f as u,t as i,n as y}from"./app-BYcXwl4U.js";import{i as m,c as p}from"./app-a6cKceqE.js";import{T as f}from"./app-CrjU8lgK.js";import{D as k}from"./app-7GBSHA5C.js";function x(){const{utils:h}=m(this);this.isPaying=!1,this.returnURL.length==0&&(this.returnURL="/finance"),this.$delay(function(){this.isPaying||h.reload()},600*1e3),this.goPay=function(){this.isPaying=!0},this.cancel=function(){this.isPaying=!1},this.goReturn=function(e){window.location=e}}const C={class:"pay-box"},R=o("td",{class:"title"},"订单号",-1),v=o("td",null,"订单金额",-1),P=o("td",null,"订单类型",-1),b=o("td",null,"支付方式",-1),q=o("td",null,"订单状态",-1),w={key:0,class:"red"},L=["href"],N={key:2,class:"red"},T=["href"],U={key:0,class:"pay-mask"},B={key:0,class:"qrcode-box"},K={class:"qrcode-title-box"},Q={key:0},V={key:1},D=["src"],E={class:"cancel"},A={__name:"index",setup(h){const e=p(new x);return(z,r)=>(s(),n("div",C,[o("form",null,[_(k,null,{default:d(()=>[o("tbody",null,[o("tr",null,[R,o("td",null,i(t(e).order.code),1)]),o("tr",null,[v,o("td",null," ￥"+i(t(e).order.amount),1)]),o("tr",null,[P,o("td",null,i(t(e).order.typeName),1)]),o("tr",null,[b,o("td",null,i(t(e).order.method.name),1)]),o("tr",null,[q,o("td",null,[t(e).order.isExpired?(s(),n("span",w,"已过期")):(s(),n("span",{key:1,class:y({green:t(e).order.status=="finished"})},i(t(e).order.statusName),3))])])])]),_:1}),t(e).order.canPay&&t(e).order.urlQRCodeKey.length==0?(s(),n("a",{key:0,href:t(e).order.payURL,target:"_blank",onClick:r[0]||(r[0]=(...a)=>t(e).goPay&&t(e).goPay(...a))},"去支付 »",8,L)):l("",!0),t(e).order.canPay&&t(e).order.urlQRCodeKey.length>0?(s(),g(f,{key:1,onClick:c(t(e).goPay,["prevent"])},{default:d(()=>[u("去支付 »")]),_:1},8,["onClick"])):l("",!0),t(e).order.isExpired?(s(),n("span",N,"订单已过期，无需支付")):l("",!0),u("         "),t(e).fromURL.length>0?(s(),n("a",{key:3,href:t(e).fromURL,class:"grey"},"[上一步]",8,T)):l("",!0)]),t(e).isPaying?(s(),n("div",U,[o("div",{class:y(["inner-box",{qrcode:t(e).order.urlQRCodeKey.length>0}])},[t(e).order.urlQRCodeKey.length>0?(s(),n("div",B,[o("div",K,[t(e).order.qrcodeTitle.length>0?(s(),n("span",Q,i(t(e).order.qrcodeTitle),1)):(s(),n("span",V,"请扫描以下二维码完成支付："))]),o("img",{src:"/qrcode?key="+t(e).order.urlQRCodeKey},null,8,D)])):l("",!0),o("div",null,[_(f,{size:"large",onClick:r[1]||(r[1]=c(a=>t(e).goReturn(t(e).returnURL),["prevent"]))},{default:d(()=>[u("我已完成支付")]),_:1})]),o("div",E,[o("a",{href:"",onClick:r[2]||(r[2]=c((...a)=>t(e).cancel&&t(e).cancel(...a),["prevent"])),class:"link"},"暂不支付")])],2)])):l("",!0)]))}};export{A as default};
