From c79656bc77ca54b258f65471aba0f0efa1aef56d Mon Sep 17 00:00:00 2001
From: Megghy
Date: Fri, 21 Nov 2025 23:25:29 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=B0=86=20OBS=20=E9=80=9A?=
=?UTF-8?q?=E7=9F=A5=E4=BB=8E=20notification=20=E6=94=B9=E4=B8=BA=20messag?=
=?UTF-8?q?e=20=E7=BB=84=E4=BB=B6=E5=B9=B6=E4=BC=98=E5=8C=96=E7=82=B9?=
=?UTF-8?q?=E6=AD=8C=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将 OBS 通知组件从 n-notification 改为 n-message,简化显示逻辑
- 优化通知内容格式,将标题和元信息作为前缀显示
- 调整通知持续时间:成功 4 秒,错误 6 秒
- 重构点歌页面布局,将功能开关和 OBS 组件按钮移至顶部卡片
- 在 MinimalRequestOBS 组件中添加点歌要求信息显示(前缀、允许类型、SC、粉丝牌等)
- 优化点歌队
---
src/store/useOBSNotification.ts | 28 +-
src/views/manage/point/PointManage.vue | 10 +
src/views/manage/point/PointTestPanel.vue | 331 +++++++++++
.../obs/live-request/MinimalRequestOBS.vue | 79 +++
src/views/open_live/LiveRequest.vue | 85 +--
src/views/open_live/MusicRequest.vue | 515 +++++++++---------
src/views/open_live/OpenQueue.vue | 97 ++--
.../components/SongRequestHistory.vue | 32 +-
.../open_live/components/SongRequestItem.vue | 231 ++++----
.../open_live/components/SongRequestList.vue | 220 ++++----
10 files changed, 1016 insertions(+), 612 deletions(-)
create mode 100644 src/views/manage/point/PointTestPanel.vue
diff --git a/src/store/useOBSNotification.ts b/src/store/useOBSNotification.ts
index 63d1bd3..7a10044 100644
--- a/src/store/useOBSNotification.ts
+++ b/src/store/useOBSNotification.ts
@@ -44,32 +44,30 @@ export const useOBSNotification = defineStore('obs-notification', () => {
}
function showNotification(payload: ObsNotificationPayload) {
- const notification = window.$notification
- if (!notification) {
- console.warn('[OBS] notification instance missing')
+ const message = window.$message
+ if (!message) {
+ console.warn('[OBS] message instance missing')
return
}
console.log('[OBS] 收到通知', payload)
const method = payload.Type === 'success' ? 'success' : 'error'
const title = resolveTitle(payload)
- const description = payload.Message || '未知通知'
const meta = resolveMeta(payload)
+ const prefix = [title, meta].filter(Boolean).join(' · ')
+ const description = payload.Message || '未知通知'
+ const finalContent = prefix ? `${prefix}\n${description}` : description
- if (typeof notification[method] === 'function') {
- notification[method]({
- title: payload.Type === 'success' ? '成功' : `失败`,
- description,
- duration: method === 'error' ? 8000 : 5000,
- keepAliveOnHover: true,
+ if (typeof message[method] === 'function') {
+ message[method](finalContent, {
+ duration: method === 'error' ? 6000 : 4000,
+ closable: true,
})
} else {
- notification.create({
- title: payload.Type === 'success' ? '成功' : `失败`,
- content: description,
- duration: method === 'error' ? 8000 : 5000,
- keepAliveOnHover: true,
+ message.create(finalContent, {
type: method,
+ duration: method === 'error' ? 6000 : 4000,
+ closable: true,
})
}
}
diff --git a/src/views/manage/point/PointManage.vue b/src/views/manage/point/PointManage.vue
index 65c7464..2272f95 100644
--- a/src/views/manage/point/PointManage.vue
+++ b/src/views/manage/point/PointManage.vue
@@ -68,6 +68,7 @@ import { copyToClipboard } from '@/Utils'
import PointOrderManage from './PointOrderManage.vue'
import PointSettings from './PointSettings.vue'
import PointUserManage from './PointUserManage.vue'
+import PointTestPanel from './PointTestPanel.vue'
const message = useMessage()
const accountInfo = useAccount()
@@ -734,6 +735,15 @@ onMounted(() => { })
>
+
+
+
+
+
diff --git a/src/views/manage/point/PointTestPanel.vue b/src/views/manage/point/PointTestPanel.vue
new file mode 100644
index 0000000..19ecbed
--- /dev/null
+++ b/src/views/manage/point/PointTestPanel.vue
@@ -0,0 +1,331 @@
+
+
+
+
+
+
+ 测试账户 OUId: 00000000-0000-0000-0000-000000000000
+
+
+
+
+
+
+ 此功能用于测试积分系统的配置,所有测试事件将记录到一个专用的 mock 账户(OUId=0)。你可以在这里测试不同类型事件的积分获取情况。
+
+
+
+
+
+
+
+
+ 分
+
+
+
+
+
+
+ 重置积分
+
+
+ 确定要重置测试账户的积分吗?
+
+
+
+
+ 测试表单
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 执行测试
+
+
+
+
+
+
+ 请先配置积分设置
+
+
+
+
+
+
+
diff --git a/src/views/obs/live-request/MinimalRequestOBS.vue b/src/views/obs/live-request/MinimalRequestOBS.vue
index dcaab81..d80bb89 100644
--- a/src/views/obs/live-request/MinimalRequestOBS.vue
+++ b/src/views/obs/live-request/MinimalRequestOBS.vue
@@ -172,6 +172,39 @@ onUnmounted(() => {
description="暂无人点歌"
/>
+
+
+
+ 前缀
+ {{ settings.orderPrefix || '-' }}
+
+
+ 允许
+ {{ settings.allowAllDanmaku ? '所有弹幕' : allowGuardTypes.length > 0 ? allowGuardTypes.join('/') : '无' }}
+
+
+
+
+ SC
+ {{ settings.allowSC ? `≥ ¥${settings.scMinPrice}` : '不允许' }}
+
+
+ 粉丝牌
+
+ {{
+ settings.needWearFanMedal
+ ? settings.fanMedalMinLevel > 0
+ ? `≥ ${settings.fanMedalMinLevel}级`
+ : '需佩戴'
+ : '无需'
+ }}
+
+
+
+
@@ -370,4 +403,50 @@ onUnmounted(() => {
.minimal-list-inner.animating:hover {
animation-play-state: paused;
}
+
+.minimal-requirements {
+ margin-top: 6px;
+ padding: 4px 4px 0;
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ font-size: 11px;
+ color: #e2e8f0;
+ text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
+}
+
+.minimal-requirements-row {
+ display: flex;
+ gap: 8px;
+}
+
+.minimal-requirements-tag {
+ flex: 1;
+ min-width: 0;
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ padding: 3px 8px;
+ border-radius: 999px;
+ background: rgba(0, 0, 0, 0.35);
+ backdrop-filter: blur(2px);
+}
+
+.tag-label {
+ font-size: 10px;
+ letter-spacing: 0.08em;
+ color: rgba(226, 232, 240, 0.75);
+ text-transform: uppercase;
+ opacity: 0.8;
+}
+
+.tag-value {
+ margin-top: 0;
+ font-size: 12px;
+ font-weight: 600;
+ color: #e2e8f0;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
diff --git a/src/views/open_live/LiveRequest.vue b/src/views/open_live/LiveRequest.vue
index fd8480c..f34a6b8 100644
--- a/src/views/open_live/LiveRequest.vue
+++ b/src/views/open_live/LiveRequest.vue
@@ -151,19 +151,43 @@ onUnmounted(() => {
-
- 启用弹幕点播功能
-
-
-
-
- 如果没有部署
+
+
+
+
+
+ 启用弹幕点播功能
+
+
+
+
+
+
+
+ OBS 组件
+
+
+ {{ liveRequest.configCanEdit ? '配置 OBS 样式与参数' : '登陆后才可以使用此功能' }}
+
+
+
+
+
+
+ 如果没有部署
{
>
VtsuruEventFetcher
- 则其需要保持此页面开启才能点播, 也不要同时开多个页面, 会导致点播重复 !(部署了则不影响)
-
-
+ 则其需要保持此页面开启才能点播, 也不要同时开多个页面, 会导致点播重复 (部署了则不影响)
+
+
+
{
前往登录或注册
-
-
-
-
-
-
- OBS 组件
-
-
- {{ liveRequest.configCanEdit ? '' : '登陆后才可以使用此功能' }}
-
-
-
-
-
+
+
+
@@ -223,12 +233,13 @@ onUnmounted(() => {
-
+
diff --git a/src/views/open_live/MusicRequest.vue b/src/views/open_live/MusicRequest.vue
index 4b50f20..ac1385e 100644
--- a/src/views/open_live/MusicRequest.vue
+++ b/src/views/open_live/MusicRequest.vue
@@ -385,288 +385,287 @@ onUnmounted(() => {
-
-
- 搜索时会优先选择非VIP歌曲, 所以点到付费曲目时可能会是猴版或者各种奇怪的歌
-
-
-
-
-
- {{ listening ? '停止监听' : '开始监听' }}
-
-
- OBS组件
-
-
- 从网易云歌单导入空闲歌单
-
-
-
- 保存配置到服务器
-
-
-
-
- 从服务器获取配置
-
-
- 这将覆盖当前设置, 确定?
-
-
-
-
-
-
- 暂无
-
-
-
-
-
- 播放
-
-
- 取消
-
-
- 拉黑
-
-
- 网易
- 酷狗
-
-
- {{ item.from.name }}
-
-
- {{ item.music.name }} - {{ item.music.author?.join('/') }}
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
- 网易云
-
-
- 酷狗
-
-
-
- 点歌弹幕前缀
-
-
- {
- settings.orderCooldown = checked ? 300 : undefined
- }
- "
+
- 是否启用点歌冷却
-
-
+
- 冷却时间 (秒)
- {
- if (!value || value <= 0) settings.orderCooldown = undefined
- }
- "
- />
-
+ OBS组件
+
-
-
- 空闲时播放空闲歌单
-
-
- 优先播放点歌
-
-
-
-
+
+
+
+ 保存配置到服务器
+
+
- 获取输出设备
+ 从服务器获取配置
- 获取和修改输出设备需要打开麦克风权限
-
-
+ 这将覆盖当前设置, 确定?
+
-
-
-
-
-
-
- 清空
-
-
- 确定清空吗?
-
-
- 从网易云歌单导入
-
-
-
-
- 暂无
-
-
+
+ 搜索时会优先选择非VIP歌曲, 所以点到付费曲目时可能会是猴版或者各种奇怪的歌
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ 播放
+
+
+ 取消
+
+
+ 拉黑
+
+
+ 网易
+ 酷狗
+
+
+ {{ item.from.name }}
+
+
+ {{ item.music.name }} - {{ item.music.author?.join('/') }}
+
+
+
+
+
+
+
+
+
+
+
+ 清空
+
+
+ 确定清空吗?
+
+
+ 从网易云歌单导入
+
+
+
+
+ 暂无
+
+
+
+
+
+
+
+
+ 删除
+
+
+ 确定删除?
+
+
+
+ 播放
+
+ {{ item.name }} - {{ item.author?.join('/') }}
+
+
+
+
+
+
+
+
+
-
-
-
- 删除
-
-
- 确定删除?
-
-
- 播放
+ 删除
- {{ item.name }} - {{ item.author?.join('/') }}
+ {{ item }}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ 网易云
+
+
+ 酷狗
+
+
+
+ 点歌弹幕前缀
+
+
+ {
+ settings.orderCooldown = checked ? 300 : undefined
+ }
+ "
>
- 删除
-
- {{ item }}
+ 是否启用点歌冷却
+
+
+ 冷却时间 (秒)
+ {
+ if (!value || value <= 0) settings.orderCooldown = undefined
+ }
+ "
+ />
+
-
-
-
-
-
+
+
+ 空闲时播放空闲歌单
+
+
+ 优先播放点歌
+
+
+
+
+
+
+ 获取输出设备
+
+
+ 获取和修改输出设备需要打开麦克风权限
+
+
+
+
+
+
+
-
-
+
+
-
- 启用弹幕队列功能
-
+
+
+ 启用弹幕队列功能
+
+
+
+
+
+ OBS 组件
+
+
+ 登录后可使用 OBS 组件功能
+
-
+
如果没有部署
则其需要保持此页面开启才能点播, 也不要同时开多个页面, 会导致点播重复 (部署了则不影响)
-
-
+
+
+
-
-
-
-
-
-
- OBS 组件
-
-
- 登录后可使用 OBS 组件功能
-
-
-
-
-
-
+
-
-
+
+
-
-
+
+
+
+
= [
-
+
-
+
筛选曲名
@@ -225,11 +226,12 @@ const columns: DataTableColumns = [
-
- 筛选用户名
+
+ 筛选用户
@@ -243,17 +245,17 @@ const columns: DataTableColumns = [
-
-
-
+
+