feat: 添加国际化支持,更新相关配置和组件,优化余额格式化

This commit is contained in:
2025-12-13 20:03:34 +07:00
parent 3866c85815
commit f5c7b1fb0a
14 changed files with 159 additions and 23 deletions

View File

@@ -1,30 +1,46 @@
<script lang='ts' setup>
import { client } from "@/api";
const balance = ref(9999999.00);
const { t } = useI18n();
const balance = ref(9999999);
const formattedBalance = formatBalance(balance);
const { data } = await client.asset.balances.get();
const { data } = await client.api.asset.balances.get();
</script>
<template>
<ion-card>
<ion-card-header>
<ion-card-title>{{ formattedBalance }}</ion-card-title>
<ion-card-subtitle>Wallet</ion-card-subtitle>
</ion-card-header>
<div class="mt-20px">
<div class="grid grid-cols-2 gap-20px p-20px bg-[var(--ion-card-background)] rounded-t-6px">
<div class="flex flex-col gap-4px">
<div class="ion-text-uppercase text-xs color-text-400 font-500 tracking-0.4px">
{{ t('wallet.balance') }}
</div>
<div class="text-lg font-bold">
{{ formattedBalance }}
</div>
</div>
<div class="flex flex-col gap-4px">
<div class="ion-text-uppercase text-xs color-text-400 font-500 tracking-0.4px">
{{ t('wallet.balance') }}
</div>
<div class="text-lg font-bold">
{{ formattedBalance }}
</div>
</div>
</div>
<!-- <ion-card-content>
Here's a small text description for the card content. Nothing more, nothing less.
</ion-card-content> -->
<ion-button fill="clear">
Recharge
</ion-button>
<ion-button fill="clear">
Withdrawal
</ion-button>
</ion-card>
<div class="px-10px pb-20px bg-[var(--ion-card-background)] rounded-b-6px">
<ion-buttons class="gap-10px" expand="block">
<ion-button expand="block" fill="clear">
{{ t("wallet.recharge") }}
</ion-button>
<ion-button expand="block" fill="clear">
{{ t("wallet.withdraw") }}
</ion-button>
</ion-buttons>
</div>
</div>
</template>
<style scoped></style>