From babd307b606e4d2daa703e902cb8360c52662dcb Mon Sep 17 00:00:00 2001 From: Seven Date: Thu, 8 Jan 2026 00:02:56 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20@riwa/api-types=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E8=87=B3=200.0.89=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E5=AF=B9=E5=92=8C=E5=9B=BE=E8=A1=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- pnpm-lock.yaml | 12 ++++++------ src/tradingview/index.ts | 14 ++++++++++++++ src/views/trade/components/trade-pairs-modal.vue | 8 ++++++-- src/views/trade/index.vue | 13 +++---------- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index a3b9640..e3f8e90 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@elysiajs/eden": "^1.4.5", "@ionic/vue": "^8.7.11", "@ionic/vue-router": "^8.7.11", - "@riwa/api-types": "http://192.168.1.17:9527/api/riwa-eden-0.0.87.tgz", + "@riwa/api-types": "http://192.168.1.17:9527/api/riwa-eden-0.0.89.tgz", "@tailwindcss/vite": "^4.1.18", "@vee-validate/yup": "^4.15.1", "@vueuse/core": "^14.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 60366ef..14e6d47 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ^8.7.11 version: 8.7.11(@stencil/core@4.39.0)(vue-router@4.6.3(vue@3.5.25(typescript@5.9.3)))(vue@3.5.25(typescript@5.9.3)) '@riwa/api-types': - specifier: http://192.168.1.17:9527/api/riwa-eden-0.0.87.tgz - version: '@riwa/eden@http://192.168.1.17:9527/api/riwa-eden-0.0.87.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))' + specifier: http://192.168.1.17:9527/api/riwa-eden-0.0.89.tgz + version: '@riwa/eden@http://192.168.1.17:9527/api/riwa-eden-0.0.89.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))' '@tailwindcss/vite': specifier: ^4.1.18 version: 4.1.18(vite@7.2.7(@types/node@24.10.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(yaml@2.8.2)) @@ -2766,9 +2766,9 @@ packages: '@remirror/core-constants@3.0.0': resolution: {integrity: sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==} - '@riwa/eden@http://192.168.1.17:9527/api/riwa-eden-0.0.87.tgz': - resolution: {tarball: http://192.168.1.17:9527/api/riwa-eden-0.0.87.tgz} - version: 0.0.87 + '@riwa/eden@http://192.168.1.17:9527/api/riwa-eden-0.0.89.tgz': + resolution: {tarball: http://192.168.1.17:9527/api/riwa-eden-0.0.89.tgz} + version: 0.0.89 peerDependencies: '@elysiajs/eden': ^1.4.5 @@ -12077,7 +12077,7 @@ snapshots: '@remirror/core-constants@3.0.0': {} - '@riwa/eden@http://192.168.1.17:9527/api/riwa-eden-0.0.87.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))': + '@riwa/eden@http://192.168.1.17:9527/api/riwa-eden-0.0.89.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))': dependencies: '@elysiajs/eden': 1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)) diff --git a/src/tradingview/index.ts b/src/tradingview/index.ts index 7249b72..caf3d62 100644 --- a/src/tradingview/index.ts +++ b/src/tradingview/index.ts @@ -68,6 +68,9 @@ const defaultOptions = { }, } satisfies ChartingLibraryWidgetOptions; +export interface TradingViewChartExpose { +} + export const TradingViewChart = defineComponent({ name: "TradingViewChart", props: { @@ -141,6 +144,17 @@ export const TradingViewChart = defineComponent({ }, 0); }); + // 监听交易对变化,动态更新图表数据 + watch(() => props.symbol, (newSymbol) => { + if (!widget.value || !newSymbol) + return; + widget.value.activeChart().setSymbol(newSymbol, () => { + console.log(`[TradingView]: Symbol changed to ${newSymbol}`); + }); + }); + return () => h("div", { ref: el, class: "w-full", style: styles.value }); }, }); + +export type TradingViewInst = InstanceType & TradingViewChartExpose; diff --git a/src/views/trade/components/trade-pairs-modal.vue b/src/views/trade/components/trade-pairs-modal.vue index 646fd37..a112b29 100644 --- a/src/views/trade/components/trade-pairs-modal.vue +++ b/src/views/trade/components/trade-pairs-modal.vue @@ -6,7 +6,11 @@ const emit = defineEmits<{ select: [symbol: string]; }>(); -const { data } = safeClient(client.api.trading_pairs.get()); +const [query] = useResetRef({ + offset: 0, + limit: 200, +}); +const { data } = safeClient(client.api.trading_pairs.get({ query: query.value })); const searchText = ref(""); function handleSelect(symbol: string) { @@ -22,7 +26,7 @@ function handleSelect(symbol: string) {
-
+
{{ item.baseAsset }}/ {{ item.quoteAsset }} diff --git a/src/views/trade/index.vue b/src/views/trade/index.vue index f3bcb05..e3f08b0 100644 --- a/src/views/trade/index.vue +++ b/src/views/trade/index.vue @@ -1,5 +1,6 @@