From 0d221d0a35beeb17dbe39ebd2bbf7483ccfd9ec0 Mon Sep 17 00:00:00 2001 From: lanxi <1220lanxi@gmail.com> Date: Sun, 15 Mar 2026 15:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=85=85=E5=80=BC?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request.ts | 2 +- src/api/wallet.ts | 13 +- src/components/DepositDialog.vue | 230 +++++++++++++++++++++++++++++-- src/locales/en.json | 10 +- src/locales/zh-CN.json | 10 +- src/stores/user.ts | 12 +- 6 files changed, 261 insertions(+), 16 deletions(-) diff --git a/src/api/request.ts b/src/api/request.ts index 3b5d718..bc9d1bf 100644 --- a/src/api/request.ts +++ b/src/api/request.ts @@ -1,7 +1,7 @@ import { i18n } from '@/plugins/i18n' /** 请求基础 URL,默认 https://api.xtrader.vip,可通过环境变量 VITE_API_BASE_URL 覆盖 */ -const BASE_URL = +export const BASE_URL = (import.meta as { env?: { VITE_API_BASE_URL?: string } }).env?.VITE_API_BASE_URL ?? 'https://api.xtrader.vip' diff --git a/src/api/wallet.ts b/src/api/wallet.ts index 4053b25..d3a6a28 100644 --- a/src/api/wallet.ts +++ b/src/api/wallet.ts @@ -1,4 +1,4 @@ -import { get } from './request' +import { get, post } from './request' export interface DepositAddressData { address?: string @@ -30,6 +30,17 @@ function pickAddress(d: DepositAddressData | undefined): string | undefined { ) } +export interface CollectDepositParams { + userId: number +} + +export async function collectDeposit( + data: CollectDepositParams, + config?: { headers?: Record }, +): Promise<{ code: number; msg?: string }> { + return post<{ code: number; msg?: string }>('/wallet/collect', data, config) +} + export async function getDepositAddress( params: GetDepositAddressParams, config?: { headers?: Record }, diff --git a/src/components/DepositDialog.vue b/src/components/DepositDialog.vue index 582860d..6170bef 100644 --- a/src/components/DepositDialog.vue +++ b/src/components/DepositDialog.vue @@ -75,15 +75,36 @@
- {{ depositAddressShort }} - - {{ copied ? t('deposit.copied') : t('deposit.copy') }} + {{ depositAddress }} + + {{ copied ? t('deposit.copied') : t('deposit.copy') }}
QR Code
+
+ + {{ isPolling ? t('deposit.checking') : t('deposit.checkStatus') }} + +
+ + {{ t('deposit.checkSuccess') }} + {{ t('deposit.checkTimeout') }} + {{ checkMessage }} +
+
@@ -128,7 +149,7 @@
- {{ depositAddressShort }} + {{ depositAddress }} {{ copied ? t('deposit.copied') : t('deposit.copy') }} @@ -145,10 +166,12 @@