From 0591d0575d07f5a01993853b373104e84aada921 Mon Sep 17 00:00:00 2001 From: Megghy Date: Mon, 28 Apr 2025 04:09:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=92=A4=E5=9B=9E=E6=84=8F=E5=A4=96?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/obs/blivechat/constants.js | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/views/obs/blivechat/constants.js b/src/views/obs/blivechat/constants.js index a86fcd5..fda7658 100644 --- a/src/views/obs/blivechat/constants.js +++ b/src/views/obs/blivechat/constants.js @@ -10,21 +10,17 @@ export const AUTHOR_TYPE_TO_TEXT = [ 'owner' // 主播 ] -import * as i18n from '@/i18n' - -const GUARD_LEVEL_TO_TEXT_KEY = [ - '', - 'chat.guardLevel1', - 'chat.guardLevel2', - 'chat.guardLevel3' -] - export function getShowGuardLevelText(guardLevel) { - let key = GUARD_LEVEL_TO_TEXT_KEY[guardLevel] || '' - if (key === '') { - return '' + switch (guardLevel) { + case 1: + return '总督' + case 2: + return '提督' + case 3: + return '舰长' + default: + return '' } - return i18n.i18n.t(key) } export const MESSAGE_TYPE_TEXT = 0 @@ -199,7 +195,7 @@ export function getGiftShowContent(message, showGiftName) { if (!showGiftName) { return '' } - return i18n.i18n.t('chat.sendGift', { giftName: message.giftName, num: message.num }) + return `赠送 ${message.giftName}x${message.num}` } export function getGiftShowNameAndNum(message) {