открытие модального окна при попытке переключиться на плейлист - при уловии отсутствия авторизации и плейлиста
This commit is contained in:
parent
f8cc500a23
commit
3d294096f8
|
|
@ -73,7 +73,7 @@ export default boot(async ({ app, router }) => {
|
|||
}),
|
||||
toggle: createInput(toggle, {
|
||||
props: ['placeholder', 'disabled', 'readonly'],
|
||||
emits: ['toggle'],
|
||||
// emits: ['toggle', 'customEvent'],
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
import { defineProps, ref, onUpdated, computed } from 'vue';
|
||||
|
||||
export default {
|
||||
name: 'toggle',
|
||||
props: {
|
||||
context: {
|
||||
type: Object,
|
||||
|
|
|
|||
|
|
@ -46,14 +46,15 @@
|
|||
</template>
|
||||
<div class="player__tools">
|
||||
<q-skeleton v-if="loaderPlay" class="player__tools m--skeleton" />
|
||||
<FormKit
|
||||
v-else
|
||||
@click="toggleMyMusic"
|
||||
v-model="isUserMusic"
|
||||
type="toggle"
|
||||
label="Включить мою музыку"
|
||||
:disabled="!user?.id || userSongList.length === 0"
|
||||
/>
|
||||
<div v-else @click="toggleMyMusic">
|
||||
<FormKit
|
||||
v-model="isUserMusic"
|
||||
type="toggle"
|
||||
label="Включить мою музыку"
|
||||
:disabled="!user?.id || userSongList.length === 0"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<q-skeleton v-if="loaderPlay" class="player__tools m--skeleton" />
|
||||
<div v-else class="player__volume">
|
||||
<span
|
||||
|
|
@ -112,9 +113,9 @@ export default {
|
|||
isPlayRadio: false,
|
||||
connection: null,
|
||||
isUserMusic: !this.$store.state.currentPlay.live,
|
||||
bolTemp: true, // Заглушка для теста
|
||||
songVolume: 0.5,
|
||||
// Локальное значение для хранения громкости перед toggleVolume
|
||||
preToggleVol: null,
|
||||
preToggleVol: null, // Локальное значение для хранения громкости перед toggleVolume
|
||||
playerInfo: {
|
||||
progress: 0,
|
||||
currentTime: 0,
|
||||
|
|
@ -246,7 +247,7 @@ export default {
|
|||
// Первый ответ
|
||||
jsonData?.connect?.subs?.['station:it-radio']?.publications?.[0]?.data;
|
||||
// console.log('getPlaying', data);
|
||||
console.log(data);
|
||||
// console.log(data);
|
||||
|
||||
if (!data) return;
|
||||
if (this.currentPlay.live) {
|
||||
|
|
@ -254,7 +255,7 @@ export default {
|
|||
const dataUrl = data.np.station.listen_url;
|
||||
// Объект с данными музыки
|
||||
const dataSong = data.np.now_playing.song;
|
||||
console.log(dataSong);
|
||||
// console.log(dataSong);
|
||||
const playerUrl = this.player.target.src;
|
||||
if (dataUrl !== playerUrl) {
|
||||
// console.log('data.np.station.listen_url', dataUrl);
|
||||
|
|
@ -380,6 +381,10 @@ export default {
|
|||
this.$store.dispatch('handlerPlayer', { volume: this.songVolume });
|
||||
}
|
||||
},
|
||||
toggleMyMusic(e) {
|
||||
if (this.user?.id) return;
|
||||
this.$store.dispatch('setModal', { auth: true });
|
||||
},
|
||||
},
|
||||
getAudio(id) {
|
||||
app
|
||||
|
|
@ -442,10 +447,5 @@ export default {
|
|||
if (!paddedSeconds) paddedSeconds = '00';
|
||||
return `${paddedMinutes}:${paddedSeconds}`;
|
||||
},
|
||||
toggleMyMusic() {
|
||||
console.log('toggleMyMusic');
|
||||
if (this.user.id) return;
|
||||
this.$store.dispatch('setModal', { auth: true });
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue