From b4995cc35870fc8a246c432bb709364be221d35a Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 25 Apr 2026 17:59:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=87=91=E9=A2=9D=E3=80=81?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/en.js | 2 +- frontend/src/lang/ja.js | 2 +- frontend/src/lang/zh.js | 2 +- frontend/src/utils/index.js | 12 ++++++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index dc2b92d..7cdb805 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -21,7 +21,7 @@ export default { disabledByServer: 'Disabled by the server', general: 'General', - useAuthCodeWarning: 'Please prioritize the identity code, otherwise the avatars and usernames will not display', + useAuthCodeWarning: 'Please prioritize the identity code, otherwise usernames will not display and you may not be able to receive messages at any time', room: 'Room', roomId: 'Room ID (not recommended)', authCode: 'Identity code', diff --git a/frontend/src/lang/ja.js b/frontend/src/lang/ja.js index 4ec10c2..484527e 100644 --- a/frontend/src/lang/ja.js +++ b/frontend/src/lang/ja.js @@ -21,7 +21,7 @@ export default { disabledByServer: 'サーバーによって無効にされました', general: '常規', - useAuthCodeWarning: 'アイデンティティコードを優先的に使用してください。そうしないと、アイコンやユーザー名が表示されません', + useAuthCodeWarning: 'アイデンティティコードを優先的に使用してください。そうしないと、ユーザー名が表示されず、コメントを受信できなくなる可能性があります', room: 'ルーム', roomId: 'ルームID(推奨されません)', authCode: 'アイデンティティコード', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 818163d..bc1dde8 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -21,7 +21,7 @@ export default { disabledByServer: '已被服务器禁用', general: '常规', - useAuthCodeWarning: '请优先使用身份码,否则无法显示头像和昵称', + useAuthCodeWarning: '请优先使用身份码,否则无法显示昵称,并且随时可能无法获取弹幕', room: '房间', roomId: '房间ID(不推荐)', authCode: '身份码', diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index b07909b..533e4c9 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -30,13 +30,21 @@ export function toFloat(val, _default) { } export function formatCurrency(price) { + let minimumFractionDigits + if (price < 10) { + minimumFractionDigits = 2 + } else if (price < 100) { + minimumFractionDigits = 1 + } else { + minimumFractionDigits = 0 + } return new Intl.NumberFormat('zh-CN', { - minimumFractionDigits: price < 100 ? 2 : 0 + minimumFractionDigits }).format(price) } export function getTimeTextHourMin(date) { - let hour = date.getHours() + let hour = `00${date.getHours()}`.slice(-2) let min = `00${date.getMinutes()}`.slice(-2) return `${hour}:${min}` }