-
+
+
diff --git a/src/components/SongPlayer.vue b/src/components/SongPlayer.vue
new file mode 100644
index 0000000..e9758a2
--- /dev/null
+++ b/src/components/SongPlayer.vue
@@ -0,0 +1,127 @@
+
+
+
+
+
+
diff --git a/src/data/constants.ts b/src/data/constants.ts
index cd1da22..18f5b52 100644
--- a/src/data/constants.ts
+++ b/src/data/constants.ts
@@ -33,6 +33,7 @@ export const ScheduleTemplateMap = {
} as { [key: string]: { name: string; compoent: any } }
export const SongListTemplateMap = {
'': { name: '默认', compoent: defineAsyncComponent(() => import('@/views/view/songListTemplate/DefaultSongListTemplate.vue')) },
+ simple: { name: '简单', compoent: defineAsyncComponent(() => import('@/views/view/songListTemplate/SimpleSongListTemplate.vue')) },
} as { [key: string]: { name: string; compoent: any } }
export const IndexTemplateMap = {
'': { name: '默认', compoent: defineAsyncComponent(() => import('@/views/view/indexTemplate/DefaultIndexTemplate.vue')) },
diff --git a/src/views/ViewerLayout.vue b/src/views/ViewerLayout.vue
index 79984a8..721186f 100644
--- a/src/views/ViewerLayout.vue
+++ b/src/views/ViewerLayout.vue
@@ -148,7 +148,7 @@ onMounted(async () => {
-
+
themeType = value ? ThemeType.Light : ThemeType.Dark">
@@ -168,7 +168,9 @@ onMounted(async () => {
- VTSURU
+
+ VTSURU
+
diff --git a/src/views/open_live/MusicRequest.vue b/src/views/open_live/MusicRequest.vue
index d4137c4..952e7c2 100644
--- a/src/views/open_live/MusicRequest.vue
+++ b/src/views/open_live/MusicRequest.vue
@@ -62,6 +62,7 @@ import { computed, h, onActivated, onDeactivated, onMounted, onUnmounted, ref }
import { useRoute } from 'vue-router'
import SongRequestOBS from '../obs/SongRequestOBS.vue'
import APlayer from 'vue3-aplayer'
+import SongPlayer from '@/components/SongPlayer.vue'
const defaultSettings = {
orderPrefix: '点歌',
@@ -115,13 +116,7 @@ const settings = computed({
}
},
})
-const aplayerMusic = ref<{
- title: string
- artist: string
- src: string
- lrc: string
- autoplay: boolean
-}>()
+const selectedSong = ref()
const props = defineProps<{
client: DanmakuClient
@@ -693,96 +688,7 @@ async function updateActive() {
console.error(err)
}
}
-function playMusic(song: SongRequestInfo) {
- aplayerMusic.value = undefined
- if (song.song?.from == SongFrom.Netease) GetLyric(song.song)
- else {
- aplayerMusic.value = {
- title: song.song?.name ?? '未知',
- artist: song.song?.author?.join('/') ?? '',
- src: song.song?.url ?? '',
- lrc: '',
- autoplay: true,
- }
- }
-}
const isLrcLoading = ref('')
-async function GetLyric(song: SongsInfo) {
- isLrcLoading.value = song.key
- QueryGetAPI<{ lyric: string; tlyric: string }>(SONG_API_URL + 'get-netease-lyric', { id: song.id })
- .then((data) => {
- console.log(mergeLyrics(data.data.lyric, data.data.tlyric))
- if (data.code == 200) {
- aplayerMusic.value = {
- title: song.name,
- artist: song.author.join('/') ?? '',
- src: song.url,
- lrc: data.data.tlyric ? mergeLyrics(data.data.lyric, data.data.tlyric) : data.data.lyric,
-
- autoplay: true,
- }
- //aplayerMusic.value.lrc = data.data.lyric
- }
- })
- .catch((err) => {
- console.error(err)
- aplayerMusic.value = {
- title: song.name,
- artist: song.author.join('/') ?? '',
- src: song.url,
- lrc: '',
- autoplay: true,
- }
- })
- .finally(() => {
- isLrcLoading.value = ''
- })
-}
-function mergeLyrics(originalLyrics: string, translatedLyrics: string): string {
- const originalLines = originalLyrics.split('\n')
- const translatedLines = translatedLyrics.split('\n')
-
- let mergedLyrics = ''
-
- for (let i = 0; i < originalLines.length; i++) {
- const originalLine = originalLines[i]?.trim()
- const originalTimeMatch = originalLine?.match(/\[(\d{2}:\d{2}\.\d{2,3})\]/) // 匹配原歌词的时间字符串
-
- let mergedLine = originalLine
-
- if (originalTimeMatch) {
- const originalTime = originalTimeMatch[1]
- const translatedLineIndex = translatedLines.findIndex((line) => line.includes(originalTime))
-
- if (translatedLineIndex !== -1) {
- const translatedLine = translatedLines[translatedLineIndex]
- const translatedTimeMatch = translatedLine.match(/\[(\d{2}:\d{2}\.\d{2,3})\]/) // 匹配翻译歌词的时间字符串
-
- if (translatedTimeMatch && translatedTimeMatch[1] === originalTime) {
- const translatedText = translatedLine.slice(translatedTimeMatch[0].length).trim()
- if (translatedText) {
- mergedLine += ` (${translatedText})`
- }
- translatedLines.splice(translatedLineIndex, 1) // 从翻译歌词数组中移除已匹配的行
- }
- }
- }
- if (!mergedLine.match(/^\[(\d{2}:\d{2}\.\d{2,3})\]$/)) {
- //不是空行
- mergedLyrics += `${mergedLine}\n`
- }
- }
-
- // 将剩余的非空翻译歌词单独放在一行
- for (const translatedLine of translatedLines) {
- const translatedText = translatedLine.trim()
- if (translatedText) {
- mergedLyrics += `${translatedText}\n`
- }
- }
-
- return mergedLyrics.trim()
-}
let timer: any
let updateActiveTimer: any
@@ -849,16 +755,7 @@ onUnmounted(() => {
- {
- if (aplayerMusic) aplayerMusic.autoplay = false
- }
- "
- >
+
@@ -888,8 +785,8 @@ onUnmounted(() => {
共 {{ activeSongs.length }} 首
-
-
+
+
@@ -945,7 +842,7 @@ onUnmounted(() => {
-
+
diff --git a/src/views/view/SongListView.vue b/src/views/view/SongListView.vue
index 163e3f4..fc8eff8 100644
--- a/src/views/view/SongListView.vue
+++ b/src/views/view/SongListView.vue
@@ -2,23 +2,23 @@
-
-
-
+
+
+
+
+
+ 标签
+
+
+ {{ tag }}
+
+
+ 搜索歌曲
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+ {{ author }}
+
+
+
+
+
+
+
+
+ {{ item.description }}
+
+
+
+ SC | {{ item.options?.scMinPrice }}
+ 粉丝牌 | {{ item.options?.fanMedalMinLevel }}
+ 总督
+ 提督
+ 舰长
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 试听
+
+
+
+ {
+ isLoading = item.key
+ emits('requestSong', item)
+ isLoading = ''
+ }
+ "
+ :type="!songRequestSettings.allowFromWeb || item.options ? 'warning' : 'info'"
+ :loading="isLoading == item.key"
+ >
+
+
+
+
+
+ {{ !songRequestSettings.allowFromWeb || item.options ? '点歌 | 用户或此歌曲不允许从网页点歌, 点击后将复制点歌内容到剪切板' : !accountInfo ? '点歌 | 你需要登录后才能点歌' : '点歌' }}
+
+
+
+
+
+
+
+
+ 加载更多
+
+
+