feat: 添加悬停动画效果并优化音频播放逻辑
为多个元素添加悬停动画效果,提升用户体验 重构音频播放逻辑,增加judgmentPlayUrl方法统一处理播放 更新HTML元数据,优化SEO和移动端适配 修改部分文案内容
This commit is contained in:
@@ -118,10 +118,6 @@ const search = createApp({
|
||||
bannerList.value = data.banner;
|
||||
awardMVList.value = data.awardMVList;
|
||||
|
||||
data.awardAudioList.forEach((item, index) => {
|
||||
item["playurl"] = `https://app.gter.net/image/miniApp/mp3/${index + 1}.mp3`;
|
||||
});
|
||||
|
||||
awardAudioList.value = data.awardAudioList;
|
||||
|
||||
customList.value = data.customAudioList;
|
||||
@@ -235,7 +231,11 @@ const search = createApp({
|
||||
// 管理音频播放
|
||||
const manageAudio = (src, area) => {
|
||||
const audio = audioPlayer.value;
|
||||
|
||||
console.log("src, area", src, area);
|
||||
|
||||
closeAll();
|
||||
|
||||
setTimeout(() => {
|
||||
if (audio?.src != src) audio.src = src;
|
||||
audio.play().then(() => {
|
||||
@@ -494,6 +494,11 @@ const search = createApp({
|
||||
id = item.id;
|
||||
}
|
||||
|
||||
if (area == "works") {
|
||||
const item = awardAudioList.value[index];
|
||||
id = item.id;
|
||||
}
|
||||
|
||||
ajax("https://pujianchaoyin.com/api/getMusicDetail", {
|
||||
id,
|
||||
}).then((res) => {
|
||||
@@ -508,9 +513,19 @@ const search = createApp({
|
||||
customList.value[index] = { ...data, ...customList.value[index] };
|
||||
manageAudio(data.playurl, area);
|
||||
}
|
||||
|
||||
if (area == "works") {
|
||||
awardAudioList.value[index] = { ...data, ...awardAudioList.value[index] };
|
||||
manageAudio(data.playurl, area);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return { cutSong, getPlayUrl, handleBarDragBottomClick, startBarDragBottom, volumeShow, handleVolumeHide, handleVolumeShow, zeroOrderStudents, rePlay, playData, awardAudioList, changeInterval, awardMVList, bannerList, albumBoxRef, volume, handleVolumeClick, handleVolumeDrag, startDrag, stopDrag, volume, cutStudent, studentList, studentIndex, scrollToPrevious, scrollToNext, changePointer, pointerIndex, visibleRef, studentRef, customRef, formatTime, currentTimeFormatted, durationFormatted, worksRef, introduceRef, customList, closeAll, manageAudio, progress, closePreview, openPreview, previewState, audioPlayer, trait, fastForward };
|
||||
const judgmentPlayUrl = (url, area, index) => {
|
||||
if (url) manageAudio(url, area);
|
||||
else getPlayUrl(index, area);
|
||||
};
|
||||
|
||||
return { judgmentPlayUrl, cutSong, getPlayUrl, handleBarDragBottomClick, startBarDragBottom, volumeShow, handleVolumeHide, handleVolumeShow, zeroOrderStudents, rePlay, playData, awardAudioList, changeInterval, awardMVList, bannerList, albumBoxRef, volume, handleVolumeClick, handleVolumeDrag, startDrag, stopDrag, volume, cutStudent, studentList, studentIndex, scrollToPrevious, scrollToNext, changePointer, pointerIndex, visibleRef, studentRef, customRef, formatTime, currentTimeFormatted, durationFormatted, worksRef, introduceRef, customList, closeAll, manageAudio, progress, closePreview, openPreview, previewState, audioPlayer, trait, fastForward };
|
||||
},
|
||||
}).mount("#appIndex");
|
||||
|
||||
Reference in New Issue
Block a user