feat: 集成二维码扫描功能,更新相关组件和国际化支持

This commit is contained in:
2025-12-24 04:34:40 +07:00
parent 648ca3edc9
commit 5ff44e4de0
12 changed files with 450 additions and 218 deletions

View File

@@ -10,6 +10,7 @@ import WalletCard from "./components/wallet-card.vue";
const { vibrate } = useHaptics();
const walletStore = useWalletStore();
const { openScanner } = useQRScanner();
async function handleRefresh(event: RefresherCustomEvent) {
vibrate();
@@ -18,6 +19,20 @@ async function handleRefresh(event: RefresherCustomEvent) {
event.target.complete();
}, 500);
}
// 处理扫描二维码
async function handleScan() {
vibrate();
const result = await openScanner({
title: "扫描二维码",
});
if (result) {
console.log("扫描结果:", result);
// TODO: 根据扫描结果进行相应处理
// 例如:跳转到对应页面、显示信息等
}
}
</script>
<template>
@@ -25,7 +40,7 @@ async function handleRefresh(event: RefresherCustomEvent) {
<ion-header class="ion-no-border">
<ion-toolbar class="ui-toolbar">
<div slot="end">
<ion-button fill="clear">
<ion-button fill="clear" @click="handleScan">
<ion-icon slot="icon-only" :icon="scanOutline" />
</ion-button>
<ion-button fill="clear">