diff --git a/src/views/trade/components/order-book.vue b/src/views/trade/components/order-book.vue new file mode 100644 index 0000000..2b078c1 --- /dev/null +++ b/src/views/trade/components/order-book.vue @@ -0,0 +1,158 @@ + + + + + + + + + + {{ ask.price }} + {{ ask.amount }} + {{ ask.total }} + + + + + + + + + 43250.50 + + + ≈ $43,250.50 + + + + + + + + + + {{ bid.price }} + {{ bid.amount }} + {{ bid.total }} + + + + + + + diff --git a/src/views/trade/components/orders-panel.vue b/src/views/trade/components/orders-panel.vue new file mode 100644 index 0000000..31eaec4 --- /dev/null +++ b/src/views/trade/components/orders-panel.vue @@ -0,0 +1,333 @@ + + + + + + + + 当前委托 ({{ currentOrders.length }}) + + + 历史记录 + + + + + + + + {{ activeTab === 'current' ? '暂无当前委托' : '暂无历史记录' }} + + + + + + + + + {{ order.side === 'buy' ? '买入' : '卖出' }} + + {{ order.symbol }} + + {{ getStatusText(order.status) }} + + + + 撤单 + + + + + + {{ order.type === 'limit' ? '价格' : '市价' }} + {{ order.type === 'limit' ? order.price : '-' }} + + + 数量 + {{ order.amount }} + + + 成交 + {{ order.filled }} + + + 总额 + {{ order.total }} USDT + + + + + + + + + + + diff --git a/src/views/trade/components/trade-form.vue b/src/views/trade/components/trade-form.vue new file mode 100644 index 0000000..93e9aae --- /dev/null +++ b/src/views/trade/components/trade-form.vue @@ -0,0 +1,292 @@ + + + + + + + + 限价 + + + 市价 + + + + + + 可用 + + {{ isBuy ? availableBalance.quote : availableBalance.base }} + {{ isBuy ? 'USDT' : 'BTC' }} + + + + + + 价格 + + + USDT + + + + + + 数量 + + + BTC + + + + + + + 25% + + + 50% + + + 75% + + + 100% + + + + + + 总额 + + + USDT + + + + + + {{ buttonText }} + + + + + diff --git a/src/views/trade/components/trading-pair-header.vue b/src/views/trade/components/trading-pair-header.vue new file mode 100644 index 0000000..690515b --- /dev/null +++ b/src/views/trade/components/trading-pair-header.vue @@ -0,0 +1,90 @@ + + + + + + + + + + {{ tradingPair.baseAsset }}/{{ tradingPair.quoteAsset }} + + + + 现货 + + + + + + + + + {{ tradingPair.lastPrice }} + + + {{ tradingPair.priceChangePercent24h }}% + + + + + + + + + 24h高 + {{ tradingPair.high24h }} + + + 24h低 + {{ tradingPair.low24h }} + + + 24h量({{ tradingPair.baseAsset }}) + {{ tradingPair.volume24h }} + + + + + + diff --git a/src/views/trade/index.vue b/src/views/trade/index.vue index 5c5e2ac..c62b50d 100644 --- a/src/views/trade/index.vue +++ b/src/views/trade/index.vue @@ -1,34 +1,127 @@ - {{ t('tabs.trade') }} + 交易 - + + + + + + + + + + + + + + + 买入 + + + 卖出 + + + + + + + + + + diff --git a/src/views/withdraw/rules.ts b/src/views/withdraw/rules.ts index 44abfaa..87d72a7 100644 --- a/src/views/withdraw/rules.ts +++ b/src/views/withdraw/rules.ts @@ -10,7 +10,7 @@ export function createWithdrawSchema(t: (key: string, params?: any) => string, m .string() .required(t("withdraw.validation.amountRequired")) .test("is-number", t("withdraw.validation.amountInvalid"), (value) => { - return /^\d+(\.\d+)?$/.test(value || ""); + return /^\d+(?:\.\d+)?$/.test(value || ""); }) .test("max-amount", t("withdraw.validation.amountExceedsBalance"), (value) => { if (!value || maxAmount === "0") diff --git a/vault.md b/vault.md index ab314ab..badf08e 100644 --- a/vault.md +++ b/vault.md @@ -1,8 +1,8 @@ -open float Y 开盘价 每一个纬度(例如天纬度,就是一天的第一笔成交价格)的第一笔成交价格 -high float Y 最高价 -low float Y 最低价 -close float Y 收盘价 -settle float Y 结算价 每一个纬度(某一个时间段之内的金额总和 / 交易量) +open float Y 开盘价 每一个纬度(例如天纬度,就是一天的第一笔成交价格)的第一笔成交价格 +high float Y 最高价 +low float Y 最低价 +close float Y 收盘价 +settle float Y 结算价 每一个纬度(某一个时间段之内的金额总和 / 交易量) 接口 代币化分类接口