import{bf as e,bw as a,ad as t,D as s,r as l,o,aB as r,c as d,e as i,N as n,w as p,l as u,ag as c,O as y,t as _,m as f,g as m,bB as g,E as v,bC as h,ak as w,bb as D,by as C}from"./index.1753082454051BqnET2ro.js";import{E as x}from"./el-text.1753082454051BFq5R2hZ.js";import{p as b}from"./custom.1753082454051BTN97j2O.js";const T={class:"pay-code"},k={style:{margin:"10px 0"}},I={key:0,style:{margin:"10px 0"}},j={key:1},H={class:"dialog-footer"},N=e({__name:"pay",props:{showDialog:{type:Boolean,default:!1},current_order:{type:Object,default:{}}},emits:["update:showDialog","handleConfrimPay"],setup(e,{emit:N}){const{copy:z}=a({legacy:!0}),B=e,E=N,O=t({payCode:"/img/pay-code.1753082454051DPIhp-36.jpeg",payHash:"",activeName:"first"}),P=h((e=>{z(e).then((()=>{C.success("复制成功")}))}),300);s((()=>B.showDialog),(e=>{B.showDialog&&(R(),F())}));const U=l(""),$=l(!1);var M=null;const R=()=>{clearInterval(M);let e=B.current_order.order_created_at,a=B.current_order.expired_at;new Date(e).getTime()((e,a)=>{const t=new Date(a).getTime()-(new Date).getTime();t<=0&&(clearInterval(M),$.value=!1,U.value="");const s=Math.floor(t%36e5/6e4),l=Math.floor(t%6e4/1e3);U.value=` ${s}分钟 ${l}秒`})(0,a)),1e3)):($.value=!1,clearInterval(M))},S=()=>{O.hash="",E("update:showDialog",!1)},A=()=>{E("handleConfrimPay"),E("update:showDialog",!1)};o((()=>{O.activeName="first"}));const F=()=>{b().then((e=>{O.payHash=e.USDT_ACCOUNT}))};return(a,t)=>{const s=x,l=g,o=r("DocumentCopy"),h=v,C=w,b=D;return i(),d("div",null,[n(b,{"model-value":e.showDialog,title:"支付",width:"600",onClose:S},{header:p((({close:e,titleId:a,titleClass:s})=>t[1]||(t[1]=[u("div",{class:"my-header"},[u("div",null,"充值网络USDT-TRC20"),u("div",{style:{"font-size":"12px",color:"#999"}},"请选择TRC20网络充值,否则可能造成资产丢失")],-1)]))),footer:p((()=>[u("div",H,[n(C,{onClick:S},{default:p((()=>t[7]||(t[7]=[y("关闭")]))),_:1,__:[7]}),n(C,{type:"primary",onClick:A},{default:p((()=>t[8]||(t[8]=[y(" 支付完成 ")]))),_:1,__:[8]})])])),default:p((()=>[u("div",T,[u("div",k,[t[2]||(t[2]=y("支付金额:")),n(s,{type:"danger",style:{"font-size":"16px","font-weight":"600"}},{default:p((()=>[y(" $"+_(e.current_order.pay_usdt_amount),1)])),_:1})]),u("div",null,[m($)?(i(),f(l,{key:0,src:m(O).payCode,class:"pay-code-img"},null,8,["src"])):c("",!0),m($)?c("",!0):(i(),f(s,{key:1,type:"warning"},{default:p((()=>t[3]||(t[3]=[y("订单已过期")]))),_:1,__:[3]}))]),m($)?(i(),d("div",I,[n(s,null,{default:p((()=>t[4]||(t[4]=[y("订单有效期:")]))),_:1,__:[4]}),n(s,{type:"primary",style:{"font-size":"16px","font-weight":"600"}},{default:p((()=>[y(_(m(U)),1)])),_:1}),u("div",null,[n(s,{type:"danger"},{default:p((()=>t[5]||(t[5]=[y("超过有效期订单自动取消,请尽快完成支付")]))),_:1,__:[5]})])])):c("",!0),m($)?(i(),d("div",j,[n(s,null,{default:p((()=>[t[6]||(t[6]=y("钱包地址:")),n(s,{type:"primary",style:{margin:"0 10px"}},{default:p((()=>[y(_(m(O).payHash),1)])),_:1}),n(h,{onClick:t[0]||(t[0]=e=>m(P)(m(O).payHash))},{default:p((()=>[n(o)])),_:1})])),_:1,__:[6]})])):c("",!0)])])),_:1},8,["model-value"])])}}},[["__scopeId","data-v-df611be5"]]);export{N as default};