diff --git a/components.d.ts b/components.d.ts index 28f4ecd..6c75204 100644 --- a/components.d.ts +++ b/components.d.ts @@ -20,6 +20,7 @@ declare module 'vue' { IIcRoundArrowForwardIos: typeof import('~icons/ic/round-arrow-forward-ios')['default'] IonApp: typeof import('@ionic/vue')['IonApp'] IonAvatar: typeof import('@ionic/vue')['IonAvatar'] + IonBackButton: typeof import('@ionic/vue')['IonBackButton'] IonBadge: typeof import('@ionic/vue')['IonBadge'] IonButton: typeof import('@ionic/vue')['IonButton'] IonButtons: typeof import('@ionic/vue')['IonButtons'] @@ -79,6 +80,7 @@ declare global { const IIcRoundArrowForwardIos: typeof import('~icons/ic/round-arrow-forward-ios')['default'] const IonApp: typeof import('@ionic/vue')['IonApp'] const IonAvatar: typeof import('@ionic/vue')['IonAvatar'] + const IonBackButton: typeof import('@ionic/vue')['IonBackButton'] const IonBadge: typeof import('@ionic/vue')['IonBadge'] const IonButton: typeof import('@ionic/vue')['IonButton'] const IonButtons: typeof import('@ionic/vue')['IonButtons'] diff --git a/src/router/index.ts b/src/router/index.ts index 90cec83..e805c06 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -95,6 +95,12 @@ const routes: Array = [ component: () => import("@/views/wallet/transfer.vue"), meta: { requiresAuth: true }, }, + { + path: "/transfer_to_user/:id", + props: true, + component: () => import("@/views/wallet/transfer-to-user.vue"), + meta: { requiresAuth: true }, + }, { path: "/wallet/funding", component: () => import("@/views/wallet/funding.vue"), diff --git a/src/views/scan-qr/index.vue b/src/views/scan-qr/index.vue index bd21a57..977995b 100644 --- a/src/views/scan-qr/index.vue +++ b/src/views/scan-qr/index.vue @@ -4,13 +4,19 @@ import { toastController } from "@ionic/vue"; const router = useRouter(); const scanner = useTemplateRef>("scanner"); -function handleSuccess(value: string) { - toastController.create({ - message: String(value), - duration: 2000, +async function handleSuccess(value: string) { + const toast = await toastController.create({ + message: "扫描成功", + duration: 1000, position: "bottom", color: "success", - }).then(toast => toast.present()); + }); + await toast.present(); + + if (value.startsWith("/transfer_to_user/")) { + // 完整路径 + router.replace(value); + } } function handleError(error: Error) { diff --git a/src/views/wallet/transfer-to-user.vue b/src/views/wallet/transfer-to-user.vue new file mode 100644 index 0000000..7994d3a --- /dev/null +++ b/src/views/wallet/transfer-to-user.vue @@ -0,0 +1,254 @@ + + +