73 lines
2.1 KiB
Vue
73 lines
2.1 KiB
Vue
<script setup lang="ts">
|
|
import type { RefresherCustomEvent } from "@ionic/vue";
|
|
import { notificationsOutline, scanOutline, settingsOutline } from "ionicons/icons";
|
|
import Asset from "./components/asset.vue";
|
|
import IssuingAsset from "./components/issuing-asset.vue";
|
|
import MyRevenue from "./components/my-revenue.vue";
|
|
import TradeSettings from "./components/trade-settings.vue";
|
|
import UserInfo from "./components/user-info.vue";
|
|
import WalletCard from "./components/wallet-card.vue";
|
|
|
|
const { vibrate } = useHaptics();
|
|
const walletStore = useWalletStore();
|
|
const { open } = useQRScanner();
|
|
|
|
async function handleRefresh(event: RefresherCustomEvent) {
|
|
vibrate();
|
|
await walletStore.initializeWallet();
|
|
setTimeout(() => {
|
|
event.target.complete();
|
|
}, 500);
|
|
}
|
|
|
|
// 处理扫描二维码
|
|
async function handleScan() {
|
|
vibrate();
|
|
const result = await open({
|
|
title: "扫描二维码",
|
|
});
|
|
|
|
if (result) {
|
|
console.log("扫描结果:", result);
|
|
// TODO: 根据扫描结果进行相应处理
|
|
// 例如:跳转到对应页面、显示信息等
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<IonPage>
|
|
<ion-header class="ion-no-border">
|
|
<ion-toolbar class="ui-toolbar">
|
|
<div slot="end">
|
|
<ion-button fill="clear" @click="handleScan">
|
|
<ion-icon slot="icon-only" :icon="scanOutline" />
|
|
</ion-button>
|
|
<ion-button fill="clear">
|
|
<ion-icon slot="icon-only" :icon="notificationsOutline" />
|
|
</ion-button>
|
|
<ion-button fill="clear" router-link="/system-settings">
|
|
<ion-icon slot="icon-only" :icon="settingsOutline" />
|
|
</ion-button>
|
|
</div>
|
|
</ion-toolbar>
|
|
</ion-header>
|
|
<IonContent :fullscreen="true" class="ion-padding">
|
|
<ion-refresher slot="fixed" @ion-refresh="handleRefresh($event)">
|
|
<ion-refresher-content />
|
|
</ion-refresher>
|
|
|
|
<div class="flex flex-col space-y-5">
|
|
<UserInfo />
|
|
<WalletCard />
|
|
<Asset />
|
|
<IssuingAsset />
|
|
<MyRevenue />
|
|
<TradeSettings />
|
|
</div>
|
|
</IonContent>
|
|
</IonPage>
|
|
</template>
|
|
|
|
<style scoped></style>
|