import{bf as e,bw as a,ae as t,D as l,r as s,o,aB as r,c as i,e as n,O as d,w as p,l as u,ah as c,P as y,t as _,m as f,g as m,bA as h,E as v,bB as g,al as w,bb as D,by as C}from"./index.zhHwzoL8.js";import{E as x}from"./el-text.DDZunB83.js";import{p as b}from"./custom.C-rQBt0f.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"},P=e({__name:"pay",props:{showDialog:{type:Boolean,default:!1},current_order:{type:Object,default:{}}},emits:["update:showDialog","handleConfrimPay"],setup(e,{emit:P}){const{copy:z}=a({legacy:!0}),B=e,E=P,N=t({payCode:"/img/pay-code.DPIhp-36.jpeg",payHash:"",activeName:"first"}),O=g((e=>{z(e).then((()=>{C.success("复制成功")}))}),300);l((()=>B.showDialog),(e=>{B.showDialog&&(M(),F())}));const U=s(""),$=s(!1);var A=null;const M=()=>{clearInterval(A);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(A),$.value=!1,U.value="");const l=Math.floor(t%36e5/6e4),s=Math.floor(t%6e4/1e3);U.value=` ${l}分钟 ${s}秒`})(0,a)),1e3)):($.value=!1,clearInterval(A))},R=()=>{N.hash="",E("update:showDialog",!1)},S=()=>{E("handleConfrimPay"),E("update:showDialog",!1)};o((()=>{N.activeName="first"}));const F=()=>{b().then((e=>{N.payHash=e.USDT_ACCOUNT}))};return(a,t)=>{const l=x,s=h,o=r("DocumentCopy"),g=v,C=w,b=D;return n(),i("div",null,[d(b,{"model-value":e.showDialog,title:"支付",width:"600",onClose:R},{header:p((({close:e,titleId:a,titleClass:l})=>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,[d(C,{onClick:R},{default:p((()=>t[7]||(t[7]=[y("关闭")]))),_:1,__:[7]}),d(C,{type:"primary",onClick:S},{default:p((()=>t[8]||(t[8]=[y(" 支付完成 ")]))),_:1,__:[8]})])])),default:p((()=>[u("div",T,[u("div",k,[t[2]||(t[2]=y("支付金额:")),d(l,{type:"danger",style:{"font-size":"16px","font-weight":"600"}},{default:p((()=>[y(" $"+_(e.current_order.pay_usdt_amount),1)])),_:1})]),u("div",null,[m($)?(n(),f(s,{key:0,src:m(N).payCode,class:"pay-code-img"},null,8,["src"])):c("",!0),m($)?c("",!0):(n(),f(l,{key:1,type:"warning"},{default:p((()=>t[3]||(t[3]=[y("订单已过期")]))),_:1,__:[3]}))]),m($)?(n(),i("div",I,[d(l,null,{default:p((()=>t[4]||(t[4]=[y("订单有效期:")]))),_:1,__:[4]}),d(l,{type:"primary",style:{"font-size":"16px","font-weight":"600"}},{default:p((()=>[y(_(m(U)),1)])),_:1}),u("div",null,[d(l,{type:"danger"},{default:p((()=>t[5]||(t[5]=[y("超过有效期订单自动取消,请尽快完成支付")]))),_:1,__:[5]})])])):c("",!0),m($)?(n(),i("div",j,[d(l,null,{default:p((()=>[t[6]||(t[6]=y("钱包地址:")),d(l,{type:"primary",style:{margin:"0 10px"}},{default:p((()=>[y(_(m(N).payHash),1)])),_:1}),d(g,{onClick:t[0]||(t[0]=e=>m(O)(m(N).payHash))},{default:p((()=>[d(o)])),_:1})])),_:1,__:[6]})])):c("",!0)])])),_:1},8,["model-value"])])}}},[["__scopeId","data-v-df611be5"]]);export{P as default};