🔧 feat: 更新依赖版本 修复类型错误 优化首页推荐样式

This commit is contained in:
alger
2025-03-20 01:07:39 +08:00
parent e355341596
commit 650e4ff786
17 changed files with 196 additions and 538 deletions
@@ -181,10 +181,11 @@ import { computed, onMounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { getMusicDetail } from '@/api/music';
import { usePlayerStore } from '@/store/modules/player';
// import { usePlayerStore } from '@/store/modules/player';
import { useSettingsStore } from '@/store/modules/settings';
// import { audioService } from '@/services/audioService';
import { getImgUrl } from '@/utils';
// import { SongResult } from '@/type/music';
const { t } = useI18n();
@@ -209,7 +210,7 @@ interface DownloadedItem {
}
const message = useMessage();
const playerStore = usePlayerStore();
// const playerStore = usePlayerStore();
const settingsStore = useSettingsStore();
const showDrawer = computed({
@@ -343,11 +344,11 @@ const confirmDelete = async () => {
};
// 播放音乐
const handlePlay = async (musicInfo: SongResult) => {
await playerStore.setPlay(musicInfo);
playerStore.setPlayMusic(true);
playerStore.setIsPlay(true);
};
// const handlePlay = async (musicInfo: SongResult) => {
// await playerStore.setPlay(musicInfo);
// playerStore.setPlayMusic(true);
// playerStore.setIsPlay(true);
// };
// 获取已下载音乐列表
const refreshDownloadedList = async () => {
@@ -1,5 +1,5 @@
<template>
<div class="search-item" :class="[item.type, shape]" @click="handleClick">
<div class="search-item" :class="[shape, item.type]" @click="handleClick">
<div class="search-item-img">
<n-image
class="w-full h-full"
@@ -107,16 +107,15 @@ const handleClick = async () => {
}
if (props.item.type === 'mv') {
handleShowMv(getCurrentMv());
handleShowMv();
}
};
const handleShowMv = async (item: IMvItem) => {
const handleShowMv = async () => {
playerStore.setIsPlay(false);
playerStore.setPlayMusic(false);
audioService.getCurrentSound()?.pause();
showPop.value = true;
currentMv.value = item;
};
</script>
@@ -172,15 +171,15 @@ const handleShowMv = async (item: IMvItem) => {
}
}
.mv {
.search-item.mv {
&:hover {
.play {
@apply opacity-60;
}
}
.search-item-img {
width: 160px;
height: 90px;
width: 160px !important;
height: 90px !important;
@apply rounded-lg relative;
}
.play {
@@ -71,7 +71,7 @@
<script setup lang="ts">
import { marked } from 'marked';
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
import { computed, onMounted, onUnmounted, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useSettingsStore } from '@/store/modules/settings';