audioFrequency.vue
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<template>
<view class="audioPlayback">
<view class="audioPlayback-bg">
<image class="audioPlayback-bg-img" :src="info.cover"></image>
</view>
<TopNavigation />
<PaddingTopB>
<view class="audioPlayback-c audioPlayback-content">
<view class="audioPlayback-content-1">
<view class="ItemQ">
<view class="ItemQ-1">
<image :src="info.cover"></image>
</view>
<view class="ItemQ-2">{{ info.name }}</view>
</view>
</view>
<view class="audioPlayback-content-2">
<yz-audio
@ended="ended"
:autoplay="true"
:singer="info.created_user"
:epname="info.name"
:title="info.name"
ref="player1"></yz-audio>
</view>
</view>
</PaddingTopB>
</view>
</template>
<script>
import TopNavigation from "./components/TopNavigation/index.vue"
import PaddingTopB from "@/components/PaddingTopB/index.vue"
export default {
components: {
TopNavigation,
PaddingTopB
},
data() {
return {
id: null,
info: {}
};
},
onLoad({ id }) {
this.id = id
this.getData()
},
onUnload() {
console.log('onUnload')
},
methods: {
getData() {
this.$service.P_get('/course/info', { id: this.id }).then(res => {
console.log(res.data.data)
this.info = res.data.data
this.$nextTick(() => {
// const bgAudioManager = uni.getBackgroundAudioManager();
// bgAudioManager.title = '致爱丽丝';
// bgAudioManager.singer = '暂无';
// bgAudioManager.coverImgUrl = 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/music-a.png';
// bgAudioManager.src = 'https://edudev.baoshanjiaoyu.com/code.mp3';
this.$refs.player1.setSrc(this.info.url)
})
})
},
ended() {
}
}
}
</script>
<style lang="scss">
.audioPlayback{
.ItemQ{
display: flex;
flex-direction: column;
align-items: center;
padding: 0 100rpx;
.ItemQ-1{
image{
height: 390rpx;
width: 390rpx;
border-radius: 45rpx;
}
}
.ItemQ-2{
font-size: 30rpx;
line-height: 45rpx;
color: #FFFFFF;
margin-top: 40rpx;
text-align: center;
}
}
.audioPlayback-c{
width: 100%;
}
.audioPlayback-bg{
position: absolute;
top: 0;
left: 0;
background: #000;
z-index: 0;
.audioPlayback-bg-img{
height: 100vh;
width: 100vh;
filter: blur(100rpx);
opacity: 0.1;
}
}
.audioPlayback-content{
.audioPlayback-content-1{
padding-top: 150rpx;
}
.audioPlayback-content-2{
padding: 0 50rpx;
margin-top: 130rpx;
}
}
}
</style>