Skip to content

Commit 62e5166

Browse files
committed
fix: 修复更多设置弹窗被歌词窗口遮挡问题 并优化为互斥弹窗, 优化样式
1 parent 7685ad3 commit 62e5166

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

src/renderer/components/EQControl.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="eq-control">
33
<div class="eq-header">
44
<h3>{{ t('player.eq.title') }}
5-
<n-tag type="warning" size="small" round>
5+
<n-tag type="warning" size="small" round v-if="!isElectron">
66
桌面版可用,网页端不支持
77
</n-tag>
88
</h3>
@@ -56,6 +56,7 @@ import { onMounted, ref } from 'vue';
5656
import { useI18n } from 'vue-i18n';
5757
5858
import { audioService } from '@/services/audioService';
59+
import { isElectron } from '@/utils';
5960
6061
const { t } = useI18n();
6162

src/renderer/components/player/AdvancedControlsPopover.vue

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</n-dropdown>
2727

2828
<!-- EQ 均衡器弹窗 -->
29-
<n-modal v-model:show="showEQModal" :mask-closable="true" :unstable-show-mask="false">
29+
<n-modal v-model:show="showEQModal" :mask-closable="true" :unstable-show-mask="false" :z-index="9999999">
3030
<div class="eq-modal-content">
3131
<div class="modal-close" @click="showEQModal = false">
3232
<i class="ri-close-line"></i>
@@ -36,7 +36,7 @@
3636
</n-modal>
3737

3838
<!-- 定时关闭弹窗 -->
39-
<n-modal v-model:show="playerStore.showSleepTimer" :mask-closable="true" :unstable-show-mask="false">
39+
<n-modal v-model:show="playerStore.showSleepTimer" :mask-closable="true" :unstable-show-mask="false" :z-index="9999999">
4040
<div class="timer-modal-content">
4141
<div class="modal-close" @click="playerStore.showSleepTimer = false">
4242
<i class="ri-close-line"></i>
@@ -46,7 +46,7 @@
4646
</n-modal>
4747

4848
<!-- 播放速度设置弹窗 -->
49-
<n-modal v-model:show="showSpeedModal" :mask-closable="true" :unstable-show-mask="false">
49+
<n-modal v-model:show="showSpeedModal" :mask-closable="true" :unstable-show-mask="false" :z-index="9999999">
5050
<div class="speed-modal-content">
5151
<div class="modal-close" @click="showSpeedModal = false">
5252
<i class="ri-close-line"></i>
@@ -68,7 +68,7 @@
6868
</template>
6969

7070
<script lang="ts" setup>
71-
import { ref, computed, h } from 'vue';
71+
import { ref, computed, h, watch } from 'vue';
7272
import { useI18n } from 'vue-i18n';
7373
import { DropdownOption } from 'naive-ui';
7474
import { usePlayerStore } from '@/store/modules/player';
@@ -84,10 +84,34 @@ const showEQModal = ref(false);
8484
const showSpeedModal = ref(false);
8585
const isEQVisible = ref(false);
8686
87+
// 监听弹窗状态,确保互斥
88+
watch(showEQModal, (newValue) => {
89+
if (newValue) {
90+
// 如果EQ弹窗打开,关闭其他弹窗
91+
playerStore.showSleepTimer = false;
92+
showSpeedModal.value = false;
93+
}
94+
});
95+
96+
watch(() => playerStore.showSleepTimer, (newValue) => {
97+
if (newValue) {
98+
// 如果睡眠定时器弹窗打开,关闭其他弹窗
99+
showEQModal.value = false;
100+
showSpeedModal.value = false;
101+
}
102+
});
103+
104+
watch(showSpeedModal, (newValue) => {
105+
if (newValue) {
106+
// 如果播放速度弹窗打开,关闭其他弹窗
107+
showEQModal.value = false;
108+
playerStore.showSleepTimer = false;
109+
}
110+
});
111+
87112
// 播放速度状态
88113
const playbackRate = computed(() => playerStore.playbackRate);
89114
90-
91115
// 播放速度选项
92116
const playbackRateOptions = [
93117
{ label: '0.5x', key: 0.5 },
@@ -131,6 +155,12 @@ const dropdownOptions = computed<DropdownOption[]>(() => [
131155
132156
// 处理菜单选择
133157
const handleSelect = (key: string) => {
158+
// 先关闭所有弹窗
159+
showEQModal.value = false;
160+
playerStore.showSleepTimer = false;
161+
showSpeedModal.value = false;
162+
163+
// 然后仅打开所选弹窗
134164
switch (key) {
135165
case 'eq':
136166
showEQModal.value = true;
@@ -212,11 +242,15 @@ const selectSpeed = (speed: number) => {
212242
.eq-modal-content,
213243
.timer-modal-content,
214244
.speed-modal-content {
215-
@apply p-6 rounded-3xl bg-white dark:bg-dark;
245+
@apply p-6 rounded-3xl bg-light-100 dark:bg-dark-100 bg-opacity-80 filter backdrop-blur-sm;
216246
max-width: 600px;
217247
margin: 0 auto;
218248
}
219249
250+
.eq-modal-content {
251+
@apply p-10 max-w-[800px];
252+
}
253+
220254
.speed-modal-content {
221255
h3 {
222256
@apply text-lg font-medium mb-4 text-center;

0 commit comments

Comments
 (0)