修改金额、时间格式

This commit is contained in:
John Smith
2026-04-25 17:59:41 +08:00
parent 85691b3690
commit b4995cc358
4 changed files with 13 additions and 5 deletions

View File

@@ -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',

View File

@@ -21,7 +21,7 @@ export default {
disabledByServer: 'サーバーによって無効にされました',
general: '常規',
useAuthCodeWarning: 'アイデンティティコードを優先的に使用してください。そうしないと、アイコンやユーザー名が表示されません',
useAuthCodeWarning: 'アイデンティティコードを優先的に使用してください。そうしないと、ユーザー名が表示されず、コメントを受信できなくなる可能性があります',
room: 'ルーム',
roomId: 'ルームID推奨されません',
authCode: 'アイデンティティコード',

View File

@@ -21,7 +21,7 @@ export default {
disabledByServer: '已被服务器禁用',
general: '常规',
useAuthCodeWarning: '请优先使用身份码,否则无法显示头像和昵称',
useAuthCodeWarning: '请优先使用身份码,否则无法显示昵称,并且随时可能无法获取弹幕',
room: '房间',
roomId: '房间ID不推荐',
authCode: '身份码',

View File

@@ -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}`
}