feat: 添加链上地址页面,更新路由配置并优化用户信息组件链接

This commit is contained in:
2025-12-13 15:02:39 +07:00
parent 9f74717c56
commit cfee4c1c77
5 changed files with 205 additions and 5 deletions

8
components.d.ts vendored
View File

@@ -12,9 +12,9 @@ export {}
/* prettier-ignore */ /* prettier-ignore */
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
IMaterialIconThemeGoogle: typeof import('~icons/material-icon-theme/google')['default']
IonApp: typeof import('@ionic/vue')['IonApp'] IonApp: typeof import('@ionic/vue')['IonApp']
IonAvatar: typeof import('@ionic/vue')['IonAvatar'] IonAvatar: typeof import('@ionic/vue')['IonAvatar']
IonBackButton: typeof import('@ionic/vue')['IonBackButton']
IonButton: typeof import('@ionic/vue')['IonButton'] IonButton: typeof import('@ionic/vue')['IonButton']
IonButtons: typeof import('@ionic/vue')['IonButtons'] IonButtons: typeof import('@ionic/vue')['IonButtons']
IonCard: typeof import('@ionic/vue')['IonCard'] IonCard: typeof import('@ionic/vue')['IonCard']
@@ -26,13 +26,13 @@ declare module 'vue' {
IonHeader: typeof import('@ionic/vue')['IonHeader'] IonHeader: typeof import('@ionic/vue')['IonHeader']
IonIcon: typeof import('@ionic/vue')['IonIcon'] IonIcon: typeof import('@ionic/vue')['IonIcon']
IonInputOtp: typeof import('@ionic/vue')['IonInputOtp'] IonInputOtp: typeof import('@ionic/vue')['IonInputOtp']
IonItem: typeof import('@ionic/vue')['IonItem']
IonLabel: typeof import('@ionic/vue')['IonLabel'] IonLabel: typeof import('@ionic/vue')['IonLabel']
IonPage: typeof import('@ionic/vue')['IonPage'] IonPage: typeof import('@ionic/vue')['IonPage']
IonRouterOutlet: typeof import('@ionic/vue')['IonRouterOutlet'] IonRouterOutlet: typeof import('@ionic/vue')['IonRouterOutlet']
IonTabBar: typeof import('@ionic/vue')['IonTabBar'] IonTabBar: typeof import('@ionic/vue')['IonTabBar']
IonTabButton: typeof import('@ionic/vue')['IonTabButton'] IonTabButton: typeof import('@ionic/vue')['IonTabButton']
IonTabs: typeof import('@ionic/vue')['IonTabs'] IonTabs: typeof import('@ionic/vue')['IonTabs']
IonText: typeof import('@ionic/vue')['IonText']
IonTitle: typeof import('@ionic/vue')['IonTitle'] IonTitle: typeof import('@ionic/vue')['IonTitle']
IonToolbar: typeof import('@ionic/vue')['IonToolbar'] IonToolbar: typeof import('@ionic/vue')['IonToolbar']
LayoutDefault: typeof import('./src/components/layout/default.vue')['default'] LayoutDefault: typeof import('./src/components/layout/default.vue')['default']
@@ -46,9 +46,9 @@ declare module 'vue' {
// For TSX support // For TSX support
declare global { declare global {
const IMaterialIconThemeGoogle: typeof import('~icons/material-icon-theme/google')['default']
const IonApp: typeof import('@ionic/vue')['IonApp'] const IonApp: typeof import('@ionic/vue')['IonApp']
const IonAvatar: typeof import('@ionic/vue')['IonAvatar'] const IonAvatar: typeof import('@ionic/vue')['IonAvatar']
const IonBackButton: typeof import('@ionic/vue')['IonBackButton']
const IonButton: typeof import('@ionic/vue')['IonButton'] const IonButton: typeof import('@ionic/vue')['IonButton']
const IonButtons: typeof import('@ionic/vue')['IonButtons'] const IonButtons: typeof import('@ionic/vue')['IonButtons']
const IonCard: typeof import('@ionic/vue')['IonCard'] const IonCard: typeof import('@ionic/vue')['IonCard']
@@ -60,13 +60,13 @@ declare global {
const IonHeader: typeof import('@ionic/vue')['IonHeader'] const IonHeader: typeof import('@ionic/vue')['IonHeader']
const IonIcon: typeof import('@ionic/vue')['IonIcon'] const IonIcon: typeof import('@ionic/vue')['IonIcon']
const IonInputOtp: typeof import('@ionic/vue')['IonInputOtp'] const IonInputOtp: typeof import('@ionic/vue')['IonInputOtp']
const IonItem: typeof import('@ionic/vue')['IonItem']
const IonLabel: typeof import('@ionic/vue')['IonLabel'] const IonLabel: typeof import('@ionic/vue')['IonLabel']
const IonPage: typeof import('@ionic/vue')['IonPage'] const IonPage: typeof import('@ionic/vue')['IonPage']
const IonRouterOutlet: typeof import('@ionic/vue')['IonRouterOutlet'] const IonRouterOutlet: typeof import('@ionic/vue')['IonRouterOutlet']
const IonTabBar: typeof import('@ionic/vue')['IonTabBar'] const IonTabBar: typeof import('@ionic/vue')['IonTabBar']
const IonTabButton: typeof import('@ionic/vue')['IonTabButton'] const IonTabButton: typeof import('@ionic/vue')['IonTabButton']
const IonTabs: typeof import('@ionic/vue')['IonTabs'] const IonTabs: typeof import('@ionic/vue')['IonTabs']
const IonText: typeof import('@ionic/vue')['IonText']
const IonTitle: typeof import('@ionic/vue')['IonTitle'] const IonTitle: typeof import('@ionic/vue')['IonTitle']
const IonToolbar: typeof import('@ionic/vue')['IonToolbar'] const IonToolbar: typeof import('@ionic/vue')['IonToolbar']
const LayoutDefault: typeof import('./src/components/layout/default.vue')['default'] const LayoutDefault: typeof import('./src/components/layout/default.vue')['default']

View File

@@ -6,6 +6,10 @@ const routes: Array<RouteRecordRaw> = [
path: "/", path: "/",
redirect: "/layout/riwa", redirect: "/layout/riwa",
}, },
{
path: "/:pathMatch(.*)*",
redirect: "/layout/riwa",
},
{ {
path: "/layout", path: "/layout",
component: () => import("@/components/layout/default.vue"), component: () => import("@/components/layout/default.vue"),
@@ -28,6 +32,10 @@ const routes: Array<RouteRecordRaw> = [
}, },
], ],
}, },
{
path: "/onchain-address",
component: () => import("@/views/onchain-address/index.vue"),
},
]; ];
const router = createRouter({ const router = createRouter({

View File

@@ -1,6 +1,71 @@
/* For information on how to create your own theme, please refer to: /* For information on how to create your own theme, please refer to:
http://ionicframework.com/docs/theming/ */ http://ionicframework.com/docs/theming/ */
:root {
--ion-color-primary: #0d0d0d;
--ion-color-primary-rgb: 13, 13, 13;
--ion-color-primary-contrast: #ffffff;
--ion-color-primary-contrast-rgb: 255, 255, 255;
--ion-color-primary-shade: #0b0b0b;
--ion-color-primary-tint: #252525;
--ion-color-secondary: #4a4a4a;
--ion-color-secondary-rgb: 74, 74, 74;
--ion-color-secondary-contrast: #ffffff;
--ion-color-secondary-contrast-rgb: 255, 255, 255;
--ion-color-secondary-shade: #414141;
--ion-color-secondary-tint: #5c5c5c;
--ion-color-tertiary: #666666;
--ion-color-tertiary-rgb: 102, 102, 102;
--ion-color-tertiary-contrast: #ffffff;
--ion-color-tertiary-contrast-rgb: 255, 255, 255;
--ion-color-tertiary-shade: #5a5a5a;
--ion-color-tertiary-tint: #757575;
--ion-color-success: #2dd55b;
--ion-color-success-rgb: 45, 213, 91;
--ion-color-success-contrast: #000000;
--ion-color-success-contrast-rgb: 0, 0, 0;
--ion-color-success-shade: #28bb50;
--ion-color-success-tint: #42d96b;
--ion-color-warning: #ffc409;
--ion-color-warning-rgb: 255, 196, 9;
--ion-color-warning-contrast: #000000;
--ion-color-warning-contrast-rgb: 0, 0, 0;
--ion-color-warning-shade: #e0ac08;
--ion-color-warning-tint: #ffca22;
--ion-color-danger: #c5000f;
--ion-color-danger-rgb: 197, 0, 15;
--ion-color-danger-contrast: #ffffff;
--ion-color-danger-contrast-rgb: 255, 255, 255;
--ion-color-danger-shade: #ad000d;
--ion-color-danger-tint: #cb1a27;
--ion-color-light: #f6f8fc;
--ion-color-light-rgb: 246, 248, 252;
--ion-color-light-contrast: #000000;
--ion-color-light-contrast-rgb: 0, 0, 0;
--ion-color-light-shade: #d8dade;
--ion-color-light-tint: #f7f9fc;
--ion-color-medium: #5f5f5f;
--ion-color-medium-rgb: 95, 95, 95;
--ion-color-medium-contrast: #ffffff;
--ion-color-medium-contrast-rgb: 255, 255, 255;
--ion-color-medium-shade: #545454;
--ion-color-medium-tint: #6f6f6f;
--ion-color-dark: #2f2f2f;
--ion-color-dark-rgb: 47, 47, 47;
--ion-color-dark-contrast: #ffffff;
--ion-color-dark-contrast-rgb: 255, 255, 255;
--ion-color-dark-shade: #292929;
--ion-color-dark-tint: #444444;
}
:root { :root {
--ion-font-family: --ion-font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",

View File

@@ -0,0 +1,127 @@
<script lang='ts' setup>
import { copyOutline, qrCodeOutline, shareOutline } from "ionicons/icons";
const { user } = useAuth();
</script>
<template>
<IonPage>
<IonHeader>
<IonToolbar class="toolbar">
<ion-buttons slot="start">
<ion-back-button default-href="/layout/user" />
</ion-buttons>
<ion-title>My Onchain Address</ion-title>
</IonToolbar>
</IonHeader>
<IonContent :fullscreen="true" class="ion-padding">
<div class="content-wrapper">
<div class="container">
<div class="user-info">
<div class="avatar-wrapper">
<ion-avatar class="avatar">
<img alt="User avatar" :src="user?.image || 'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg'">
</ion-avatar>
</div>
<IonText class="user-email">
{{ user?.email }}
</IonText>
</div>
<div class="ion-text-center address-info">
<ion-icon :icon="qrCodeOutline" class="qr-code" />
<div class="ion-margin-top">
<ion-text color="secondary">
<div>Onchain address</div>
</ion-text>
<ion-text>
<div>0x1234567890abcdef1234</div>
</ion-text>
</div>
</div>
</div>
<div class="ion-margin-top ion-text-center operations">
<ion-button fill="clear">
<ion-icon slot="start" :icon="shareOutline" />
Share
</ion-button>
<ion-button fill="clear">
<ion-icon slot="start" :icon="copyOutline" />
Copy
</ion-button>
</div>
</div>
</IonContent>
</IonPage>
</template>
<style lang="css" scoped>
.content-wrapper {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100%;
--background: #f4f6f8;
--border-color: #c6c5c5;
}
@media (prefers-color-scheme: dark) {
.content-wrapper {
--background: #232324;
--border-color: #3a3a3b;
}
}
.container {
width: 80vw;
height: 80vw;
max-width: 500px;
max-height: 500px;
border-radius: 14px;
padding: 16px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
background-color: var(--background);
border: 1px solid var(--border-color);
}
.user-email {
margin-top: 4px;
font-weight: 500;
font-size: 1.1rem;
}
.user-info {
position: absolute;
top: 0;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
.avatar-wrapper {
background-color: var(--background);
padding: 4px;
border-radius: 100%;
width: fit-content;
}
.avatar {
border: 1px solid var(--border-color);
}
.address-info {
width: 100%;
margin-top: 20px;
}
.qr-code {
width: 50vw;
height: 50vw;
max-width: 250px;
max-height: 250px;
}
.operations {
display: flex;
gap: 24px;
}
</style>

View File

@@ -19,7 +19,7 @@ const { user } = useAuth();
</div> </div>
</div> </div>
</div> </div>
<div class="link"> <div class="link" @click="$router.push('/onchain-address')">
<ion-icon :icon="qrCodeOutline" class="qr-code" /> <ion-icon :icon="qrCodeOutline" class="qr-code" />
<ion-icon :icon="chevronForwardOutline" /> <ion-icon :icon="chevronForwardOutline" />
</div> </div>