From de18ebf37095154c8605fea48fc0ad2733590956 Mon Sep 17 00:00:00 2001 From: Seven Date: Mon, 22 Dec 2025 04:43:46 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20useRouterBack=20?= =?UTF-8?q?=E7=BB=84=E5=90=88=E5=87=BD=E6=95=B0=EF=BC=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6=E4=BB=A5=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20API=20=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89=EF=BC=8C=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BE=9D=E8=B5=96=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto-imports.d.ts | 3 + components.d.ts | 2 - package.json | 2 +- pnpm-lock.yaml | 12 +-- src/api/types.ts | 2 +- src/composables/useRouterBack.ts | 10 +++ src/router/auth.ts | 14 ---- src/views/auth/login/index.vue | 5 +- src/views/deposit/fiat.vue | 16 ++-- src/views/issue/issuing-apply/done.vue | 11 +-- .../my-subscribe/components/category.vue | 47 ++++++++++++ .../components/my-subscribe-list.vue | 76 +++++++++++++++++++ .../trade-settings/my-subscribe/index.vue | 51 +++++++++++-- src/views/withdraw/index.vue | 25 +++--- 14 files changed, 227 insertions(+), 49 deletions(-) create mode 100644 src/composables/useRouterBack.ts create mode 100644 src/views/trade-settings/my-subscribe/components/category.vue create mode 100644 src/views/trade-settings/my-subscribe/components/my-subscribe-list.vue diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 82507d6..1350f2a 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -156,6 +156,7 @@ declare global { const useAsyncState: typeof import('@vueuse/core').useAsyncState const useAttrs: typeof import('vue').useAttrs const useAuth: typeof import('./src/composables/useAuth').useAuth + const useBack: typeof import('./src/composables/useBack').useBack const useBase64: typeof import('@vueuse/core').useBase64 const useBattery: typeof import('@vueuse/core').useBattery const useBluetooth: typeof import('@vueuse/core').useBluetooth @@ -263,6 +264,7 @@ declare global { const useResizeObserver: typeof import('@vueuse/core').useResizeObserver const useRoute: typeof import('vue-router').useRoute const useRouter: typeof import('vue-router').useRouter + const useRouterBack: typeof import('./src/composables/useRouterBack').useRouterBack const useSSRWidth: typeof import('@vueuse/core').useSSRWidth const useScreenOrientation: typeof import('@vueuse/core').useScreenOrientation const useScreenSafeArea: typeof import('@vueuse/core').useScreenSafeArea @@ -623,6 +625,7 @@ declare module 'vue' { readonly useResizeObserver: UnwrapRef readonly useRoute: UnwrapRef readonly useRouter: UnwrapRef + readonly useRouterBack: UnwrapRef readonly useSSRWidth: UnwrapRef readonly useScreenOrientation: UnwrapRef readonly useScreenSafeArea: UnwrapRef diff --git a/components.d.ts b/components.d.ts index d4552fa..fc91f2d 100644 --- a/components.d.ts +++ b/components.d.ts @@ -51,7 +51,6 @@ declare module 'vue' { IonTabButton: typeof import('@ionic/vue')['IonTabButton'] IonTabs: typeof import('@ionic/vue')['IonTabs'] IonText: typeof import('@ionic/vue')['IonText'] - IonTextarea: typeof import('@ionic/vue')['IonTextarea'] IonTitle: typeof import('@ionic/vue')['IonTitle'] IonToolbar: typeof import('@ionic/vue')['IonToolbar'] LayoutDefault: typeof import('./src/components/layout/default.vue')['default'] @@ -115,7 +114,6 @@ declare global { const IonTabButton: typeof import('@ionic/vue')['IonTabButton'] const IonTabs: typeof import('@ionic/vue')['IonTabs'] const IonText: typeof import('@ionic/vue')['IonText'] - const IonTextarea: typeof import('@ionic/vue')['IonTextarea'] const IonTitle: typeof import('@ionic/vue')['IonTitle'] const IonToolbar: typeof import('@ionic/vue')['IonToolbar'] const LayoutDefault: typeof import('./src/components/layout/default.vue')['default'] diff --git a/package.json b/package.json index f7b7725..61b83e5 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@elysiajs/eden": "^1.4.5", "@ionic/vue": "^8.7.11", "@ionic/vue-router": "^8.7.11", - "@riwa/api-types": "http://192.168.1.27:9527/api/riwa-api-types-0.0.41.tgz", + "@riwa/api-types": "http://192.168.1.27:9527/api/riwa-api-types-0.0.44.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 c7f0907..12a46dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,8 +54,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.27:9527/api/riwa-api-types-0.0.41.tgz - version: http://192.168.1.27:9527/api/riwa-api-types-0.0.41.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.27:9527/api/riwa-api-types-0.0.44.tgz + version: http://192.168.1.27:9527/api/riwa-api-types-0.0.44.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)) @@ -1354,9 +1354,9 @@ packages: resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.41.tgz': - resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.41.tgz} - version: 0.0.41 + '@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.44.tgz': + resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.44.tgz} + version: 0.0.44 peerDependencies: '@elysiajs/eden': ^1.4.5 @@ -6453,7 +6453,7 @@ snapshots: '@pkgr/core@0.2.9': {} - '@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.41.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/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.44.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/api/types.ts b/src/api/types.ts index 1f77960..40fafb7 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -51,7 +51,7 @@ export type RwaData = Treaty.Data["data"][number]; -export type MySubscribeRwaData = Treaty.Data; +export type MySubscribeRwaData = Treaty.Data["data"][number]; export type MySubscribeRwaBody = TreatyQuery; diff --git a/src/composables/useRouterBack.ts b/src/composables/useRouterBack.ts new file mode 100644 index 0000000..8927109 --- /dev/null +++ b/src/composables/useRouterBack.ts @@ -0,0 +1,10 @@ +import { router } from "@/router"; + +export function useRouterBack() { + if (window.history.state.back) { + router.back(); + } + else { + router.replace("/"); + } +} diff --git a/src/router/auth.ts b/src/router/auth.ts index 77f2195..985442c 100644 --- a/src/router/auth.ts +++ b/src/router/auth.ts @@ -1,20 +1,6 @@ import type { RouteRecordRaw } from "vue-router"; const routes: Array = [ - // { - // path: "/auth", - // component: () => import("@/views/auth/index.vue"), - // children: [ - // { - // path: "/auth/login", - // component: () => import("@/views/auth/login/index.vue"), - // }, - // { - // path: "/auth/signup", - // component: () => import("@/views/auth/signup/index.vue"), - // }, - // ], - // }, { path: "/auth/login", component: () => import("@/views/auth/login/index.vue"), diff --git a/src/views/auth/login/index.vue b/src/views/auth/login/index.vue index 235f1dd..1f7f0d5 100644 --- a/src/views/auth/login/index.vue +++ b/src/views/auth/login/index.vue @@ -34,6 +34,9 @@ async function handleSignInPhoneNumber(value: PhoneNumberVerifyClient) { useNavigateToRedirect(route.query.redirect as string); } } +function onClose() { + useRouterBack(); +}