tg_h5_dist/assets/Pay-M_yWRjjx.js
2025-07-11 18:38:12 +08:00

1 line
3.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{__plugin_vue_export_helper_default as e,getUsdtInfo as t,showSuccessToast as n}from"./_plugin-vue_export-helper-BZSVNCRS.js";import{createBaseVNode as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createTextVNode as s,createVNode as c,openBlock as l,reactive as u,ref as d,toDisplayString as f,watch as p,withCtx as m}from"./index-BDung3EM.js";import{Dialog as h}from"./style-B37PGvbn.js";import{Button as g}from"./style-DGwcFI5d.js";import{esm_default as _}from"./esm-BufrrNSN.js";var v=`/assets/pay-code-DPIhp-36.jpeg`;const y={class:`pay-code`},b={style:{margin:`10px 0`}},x={type:`danger`,style:{"font-size":`16px`,"font-weight":`600`}},S=[`src`],C={key:1,type:`warning`},w={key:0,style:{margin:`10px 0`}},T={type:`primary`,style:{"font-size":`16px`,"font-weight":`600`}},E={style:{margin:`0 10px`,color:`aqua`}},D={class:`dialog-footer`},O={__name:`Pay`,props:{showDialog:{type:Boolean,default:!1},current_order:{type:Object,default:{}}},emits:[`update:showDialog`,`handleConfrimPay`,`closePay`],setup(e,{emit:O}){let k=e;console.log(`props`,k);let A=d(!1),j=O,M=u({payCode:v,payHash:``}),N=async e=>{let{toClipboard:t}=_();try{console.log(`复制`,e),await t(e),n(`复制成功`)}catch(e){console.log(e)}};p(()=>k.showDialog,e=>{console.log(`showDialog`,k.showDialog),A.value=k.showDialog,k.showDialog&&(R(),V())});let P=d(``),F=d(!1),I=(e,t)=>{let n=new Date(t).getTime(),r=new Date().getTime(),i=n-r;i<=0&&(clearInterval(L),F.value=!1,P.value=``);let a=Math.floor(i%(1e3*60*60)/(1e3*60)),o=Math.floor(i%(1e3*60)/1e3);P.value=` ${a}分钟 ${o}`};var L=null;let R=()=>{clearInterval(L);let e=k.current_order.order_created_at,t=k.current_order.expired_at;new Date(e).getTime()<new Date(t).getTime()?(F.value=!0,L=setInterval(()=>I(e,t),1e3)):(F.value=!1,clearInterval(L))},z=()=>{M.hash=``,j(`update:showDialog`,!1),j(`closePay`)},B=()=>{j(`handleConfrimPay`),j(`update:showDialog`,!1)},V=()=>{t().then(e=>{M.payHash=e.USDT_ACCOUNT})};return(t,n)=>{let u=g,d=h;return l(),i(d,{show:A.value,"onUpdate:show":n[1]||=e=>A.value=e,title:`标题`,"show-cancel-button":``},{title:m(()=>n[2]||=[r(`div`,{class:`my-header`},[r(`div`,null,`充值网络USDT-TRC20`),r(`div`,{style:{"font-size":`12px`,color:`#999`}},`请选择TRC20网络充值否则可能造成资产丢失`)],-1)]),footer:m(()=>[r(`div`,D,[c(u,{onClick:z,size:`small`,style:{"margin-right":`8px`}},{default:m(()=>n[7]||=[s(`关闭`)]),_:1,__:[7]}),F.value?(l(),i(u,{key:0,type:`primary`,size:`small`,onClick:B},{default:m(()=>n[8]||=[s(` 支付完成 `)]),_:1,__:[8]})):a(``,!0)])]),default:m(()=>[r(`div`,y,[r(`div`,b,[n[3]||=s(`支付金额:`),r(`span`,x,` $`+f(e.current_order.pay_usdt_amount),1)]),r(`div`,null,[F.value?(l(),o(`img`,{key:0,src:M.payCode,class:`pay-code-img`},null,8,S)):a(``,!0),F.value?a(``,!0):(l(),o(`span`,C,`订单已过期`))]),F.value?(l(),o(`div`,w,[n[4]||=r(`span`,null,`订单有效期:`,-1),r(`span`,T,f(P.value),1),n[5]||=r(`div`,null,[r(`span`,{type:`danger`},`超过有效期订单自动取消,请尽快完成支付`)],-1)])):a(``,!0),F.value?(l(),o(`div`,{key:1,onClick:n[0]||=e=>N(M.payHash)},[n[6]||=r(`div`,{style:{color:`#999`,"font-size":`12px`}},`钱包地址(点击复制): `,-1),r(`span`,E,f(M.payHash),1)])):a(``,!0)])]),_:1},8,[`show`])}}};var k=e(O,[[`__scopeId`,`data-v-f7a8890b`]]);export{k as Pay_default};