From 384b0855d319c83a9a3193729b3e0019d0fb1bd7 Mon Sep 17 00:00:00 2001 From: Seven Date: Fri, 19 Dec 2025 23:02:09 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E6=94=AF=E6=8C=81=EF=BC=8C=E6=9B=B4=E6=96=B0=20RWA=20?= =?UTF-8?q?=E7=94=B3=E8=B4=AD=E9=A1=B5=E9=9D=A2=E5=92=8C=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=96=87=E6=9C=AC=EF=BC=8C=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/subscribe-rwa/index.vue | 15 +++++++----- src/locales/en-US.json | 30 ++++++++++++++++++++++++ src/locales/index.ts | 2 +- src/locales/zh-CN.json | 30 ++++++++++++++++++++++++ src/views/trade-rwa/index.vue | 32 ++++++++++++++------------ 5 files changed, 87 insertions(+), 22 deletions(-) diff --git a/src/components/subscribe-rwa/index.vue b/src/components/subscribe-rwa/index.vue index 9c321a4..f7317a0 100644 --- a/src/components/subscribe-rwa/index.vue +++ b/src/components/subscribe-rwa/index.vue @@ -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(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() { diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 40f0ccd..250174a 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -227,6 +227,36 @@ "issueDate": "Issue Date", "subscriptionPrice": "Subscription Price" }, + "tradeRwa": { + "tabs": { + "overview": "Overview", + "moment": "Moment" + }, + "fields": { + "productCode": "Product Code", + "valuation": "Valuation", + "unitPrice": "Unit Price", + "totalSupply": "Total Supply", + "perUserLimit": "Per User Limit", + "launchDate": "Launch Date", + "subscriptionDeadline": "Subscription Deadline" + }, + "units": { + "shares": "shares" + }, + "about": "About", + "noDescription": "No description available.", + "subscribe": "Subscribe", + "subscribeSuccess": "Subscription successful" + }, + "subscribeRwa": { + "title": "Subscribe RWA", + "maxSubscribePlaceholder": "Max quantity: {max}", + "unitPrice": "Unit Price", + "availableBalance": "Available Balance", + "confirmSubscribe": "Confirm Subscribe", + "enterQuantityError": "Please enter quantity" + }, "loading": { "loadingMore": "Loading more..." } diff --git a/src/locales/index.ts b/src/locales/index.ts index a312197..fa6b03d 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -6,7 +6,7 @@ export type MessageSchema = typeof enUS; const i18n = createI18n({ legacy: false, - locale: "zh-CN", + locale: "en-US", fallbackLocale: "en-US", messages: { "en-US": enUS, diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index 46b884f..5dd13d1 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -227,6 +227,36 @@ "issueDate": "发行日期", "subscriptionPrice": "申购单价" }, + "tradeRwa": { + "tabs": { + "overview": "概览", + "moment": "动态" + }, + "fields": { + "productCode": "产品编号", + "valuation": "估值", + "unitPrice": "单价", + "totalSupply": "总发行量", + "perUserLimit": "每人限量", + "launchDate": "发行时间", + "subscriptionDeadline": "认购截止时间" + }, + "units": { + "shares": "份" + }, + "about": "About", + "noDescription": "暂无描述。", + "subscribe": "申购", + "subscribeSuccess": "申购成功" + }, + "subscribeRwa": { + "title": "申购RWA", + "maxSubscribePlaceholder": "最大可申购数量: {max}", + "unitPrice": "单价", + "availableBalance": "可用余额", + "confirmSubscribe": "确认申购", + "enterQuantityError": "请输入申购数量" + }, "loading": { "loadingMore": "加载更多..." } diff --git a/src/views/trade-rwa/index.vue b/src/views/trade-rwa/index.vue index 7b24709..cbfc796 100644 --- a/src/views/trade-rwa/index.vue +++ b/src/views/trade-rwa/index.vue @@ -7,6 +7,8 @@ const props = defineProps<{ id: string; }>(); +const { t } = useI18n(); + const { data } = safeClient(client.api.rwa.subscription.available_editions({ editionId: props.id }).get()); const model = useTemplateRef("model"); @@ -16,7 +18,7 @@ async function handleSubscribe(val: number) { quantity: String(val), })); const toast = await toastController.create({ - message: "申购成功", + message: t("market.tradeRwa.subscribeSuccess"), duration: 2000, position: "bottom", color: "success", @@ -37,8 +39,8 @@ async function handleSubscribe(val: number) { - - + + @@ -53,13 +55,13 @@ async function handleSubscribe(val: number) {
- 产品编号 + {{ t('market.tradeRwa.fields.productCode') }}
{{ data?.product.code }}
- 估值 + {{ t('market.tradeRwa.fields.valuation') }}
${{ formatAmount(data?.product.estimatedValue) }}
@@ -67,27 +69,27 @@ async function handleSubscribe(val: number) {
- 单价 + {{ t('market.tradeRwa.fields.unitPrice') }}
${{ formatAmount(data?.unitPrice) }}
- 总发行量 + {{ t('market.tradeRwa.fields.totalSupply') }}
-
{{ Number(data?.totalSupply) }}份
+
{{ Number(data?.totalSupply) }}{{ t('market.tradeRwa.units.shares') }}
- 每人限量 + {{ t('market.tradeRwa.fields.perUserLimit') }}
-
{{ Number(data?.perUserLimit) }}份
+
{{ Number(data?.perUserLimit) }}{{ t('market.tradeRwa.units.shares') }}
- 发行时间 + {{ t('market.tradeRwa.fields.launchDate') }}
{{ useDateFormat(data?.launchDate || '', 'YYYY/MM/DD') }}
@@ -95,7 +97,7 @@ async function handleSubscribe(val: number) {
- 认购截止时间 + {{ t('market.tradeRwa.fields.subscriptionDeadline') }}
{{ useDateFormat(data?.subscriptionDeadline || '', 'YYYY/MM/DD') }}
@@ -104,10 +106,10 @@ async function handleSubscribe(val: number) {
- About + {{ t('market.tradeRwa.about') }}
- {{ data?.product.description || 'No description available.' }} + {{ data?.product.description || t('market.tradeRwa.noDescription') }}
@@ -117,7 +119,7 @@ async function handleSubscribe(val: number) {
- 申购 + {{ t('market.tradeRwa.subscribe') }}