feat: 添加国际化支持,更新 RWA 申购页面和相关文本,优化用户体验

This commit is contained in:
2025-12-19 23:02:09 +07:00
parent fb8cec3027
commit 384b0855d3
5 changed files with 87 additions and 22 deletions

View File

@@ -5,10 +5,13 @@ const props = defineProps<{
unitPrice: number;
max: number;
}>();
const emit = defineEmits<{
(e: "subscribed", value: number): void;
}>();
const { t } = useI18n();
const walletStore = useWalletStore();
const { balances } = storeToRefs(walletStore);
const currentUSDTBalance = computed(() => balances.value[0].available);
@@ -18,7 +21,7 @@ const num = ref<number | null>(null);
async function handleSubscribe() {
if (!num.value || num.value <= 0) {
const toast = await toastController.create({
message: "请输入申购数量",
message: t("market.subscribeRwa.enterQuantityError"),
duration: 2000,
position: "bottom",
color: "warning",
@@ -32,26 +35,26 @@ async function handleSubscribe() {
<template>
<div class="space-y-5 mt-3 ion-padding">
<div>申购RWA</div>
<div>{{ t('market.subscribeRwa.title') }}</div>
<ion-input
v-model="num"
:placeholder="`最大可申购数量: ${max}`"
:placeholder="t('market.subscribeRwa.maxSubscribePlaceholder', { max })"
type="number"
inputmode="numeric"
:max="max"
/>
<div class="mt-4 text-sm color-(--ion-text-color-secondary)">
单价: ${{ unitPrice }}
{{ t('market.subscribeRwa.unitPrice') }}: ${{ unitPrice }}
</div>
<div class="mt-4 text-sm color-(--ion-text-color-secondary)">
可用余额: ${{ Number(currentUSDTBalance) }}
{{ t('market.subscribeRwa.availableBalance') }}: ${{ Number(currentUSDTBalance) }}
</div>
<ion-button expand="block" class="mt-6 ui-button" color="primary" @click="handleSubscribe">
确认申购
{{ t('market.subscribeRwa.confirmSubscribe') }}
</ion-button>
</div>
</template>