|
@@ -2,7 +2,7 @@
|
|
<view class="container global-audio-box" v-if="showAudioPop">
|
|
<view class="container global-audio-box" v-if="showAudioPop">
|
|
<view class="bg-overlay" @click="isShowMaskHandler"></view>
|
|
<view class="bg-overlay" @click="isShowMaskHandler"></view>
|
|
<view class="audio-box">
|
|
<view class="audio-box">
|
|
- <view class="activity-title text_oneLine">
|
|
|
|
|
|
+ <view class="activity-title">
|
|
{{ activityTitle }}
|
|
{{ activityTitle }}
|
|
<view class="icon-cross" @click.stop="isShowMaskHandler">
|
|
<view class="icon-cross" @click.stop="isShowMaskHandler">
|
|
<van-icon name="cross" font-size="32" />
|
|
<van-icon name="cross" font-size="32" />
|
|
@@ -23,7 +23,6 @@
|
|
<view class="is-paly-card">
|
|
<view class="is-paly-card">
|
|
<image
|
|
<image
|
|
@click.stop="handleChangePlayStatus"
|
|
@click.stop="handleChangePlayStatus"
|
|
- class=""
|
|
|
|
:src="play ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/play_icon.gif' : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/pause_icon.png'"
|
|
:src="play ? 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/play_icon.gif' : 'https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/pause_icon.png'"
|
|
></image>
|
|
></image>
|
|
</view>
|
|
</view>
|
|
@@ -75,16 +74,26 @@ export default {
|
|
{ name: "1.5倍", value: 1.5 },
|
|
{ name: "1.5倍", value: 1.5 },
|
|
{ name: "2倍", value: 2 },
|
|
{ name: "2倍", value: 2 },
|
|
],
|
|
],
|
|
- isTimes: 1,
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ //重新
|
|
audioInit() {
|
|
audioInit() {
|
|
return {
|
|
return {
|
|
activityId: this.$store.state.audioBg.activityId,
|
|
activityId: this.$store.state.audioBg.activityId,
|
|
reportId: this.$store.state.audioBg.reportId,
|
|
reportId: this.$store.state.audioBg.reportId,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ // 几倍的播放速度
|
|
|
|
+ isTimes() {
|
|
|
|
+ return this.$store.state.audioBg.multiple;
|
|
|
|
+ // get() {
|
|
|
|
+ // return this.$store.state.audioBg.multiple;
|
|
|
|
+ // },
|
|
|
|
+ // set(val) {
|
|
|
|
+ // return this.$store.state.audioBg.multiple = val;
|
|
|
|
+ // },
|
|
|
|
+ },
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
audioInit: {
|
|
audioInit: {
|
|
@@ -108,21 +117,25 @@ export default {
|
|
init() {
|
|
init() {
|
|
const curAudio = this.$store.state.audioBg.list;
|
|
const curAudio = this.$store.state.audioBg.list;
|
|
if (this.globalBgAudioManager.src != curAudio.Url) {
|
|
if (this.globalBgAudioManager.src != curAudio.Url) {
|
|
|
|
+ this.$store.commit("audioBg/setMultiple", 1);
|
|
this.globalBgAudioManager.src = curAudio.Url;
|
|
this.globalBgAudioManager.src = curAudio.Url;
|
|
this.globalBgAudioManager.title = curAudio.Name;
|
|
this.globalBgAudioManager.title = curAudio.Name;
|
|
- this.isTimes = 1;
|
|
|
|
|
|
+ this.$store.commit("audioBg/updateAudioTime", 0);
|
|
|
|
+ console.log("进来了?");
|
|
}
|
|
}
|
|
this.globalBgAudioManager.playbackRate = this.isTimes;
|
|
this.globalBgAudioManager.playbackRate = this.isTimes;
|
|
this.audioTime = curAudio.PlaySeconds;
|
|
this.audioTime = curAudio.PlaySeconds;
|
|
this.title = curAudio.Name;
|
|
this.title = curAudio.Name;
|
|
this.activityTitle = this.$store.state.audioBg.activityTitle;
|
|
this.activityTitle = this.$store.state.audioBg.activityTitle;
|
|
- this.curTime = parseInt(this.globalBgAudioManager.currentTime || 0);
|
|
|
|
|
|
+ this.curTime = this.$store.state.audioBg.curTime;
|
|
|
|
+ // console.log(this.curTime, this.globalBgAudioManager.currentTime, this.$store.state.audioBg.curTime);
|
|
this.play = !this.globalBgAudioManager.paused;
|
|
this.play = !this.globalBgAudioManager.paused;
|
|
this.listenAudio();
|
|
this.listenAudio();
|
|
},
|
|
},
|
|
//音频播放事件
|
|
//音频播放事件
|
|
listenAudio() {
|
|
listenAudio() {
|
|
this.globalBgAudioManager.onPlay(async () => {
|
|
this.globalBgAudioManager.onPlay(async () => {
|
|
|
|
+ console.log("onPlay", 123);
|
|
this.play = true;
|
|
this.play = true;
|
|
this.$store.commit("audioBg/updateAudioPause", false);
|
|
this.$store.commit("audioBg/updateAudioPause", false);
|
|
if (this.$store.state.audioBg.activityId) {
|
|
if (this.$store.state.audioBg.activityId) {
|
|
@@ -130,7 +143,7 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
this.globalBgAudioManager.onPause(() => {
|
|
this.globalBgAudioManager.onPause(() => {
|
|
- console.log("音频暂停");
|
|
|
|
|
|
+ console.log("音频暂停", 123);
|
|
this.play = false;
|
|
this.play = false;
|
|
this.$store.commit("audioBg/updateAudioPause", true);
|
|
this.$store.commit("audioBg/updateAudioPause", true);
|
|
});
|
|
});
|
|
@@ -140,6 +153,7 @@ export default {
|
|
success: (res) => {
|
|
success: (res) => {
|
|
if (res.osName == "ios") {
|
|
if (res.osName == "ios") {
|
|
console.log("ios");
|
|
console.log("ios");
|
|
|
|
+ this.play = false;
|
|
this.$store.commit("audioBg/removeAudio");
|
|
this.$store.commit("audioBg/removeAudio");
|
|
} else {
|
|
} else {
|
|
this.play = false;
|
|
this.play = false;
|
|
@@ -152,10 +166,12 @@ export default {
|
|
console.log("音频onEnded");
|
|
console.log("音频onEnded");
|
|
this.play = false;
|
|
this.play = false;
|
|
this.$store.commit("audioBg/updateAudioPause", true);
|
|
this.$store.commit("audioBg/updateAudioPause", true);
|
|
|
|
+ this.$store.commit("audioBg/setMultiple", 1);
|
|
});
|
|
});
|
|
this.globalBgAudioManager.onError((e) => {
|
|
this.globalBgAudioManager.onError((e) => {
|
|
console.log("音频onError", e);
|
|
console.log("音频onError", e);
|
|
this.$store.commit("audioBg/removeAudio");
|
|
this.$store.commit("audioBg/removeAudio");
|
|
|
|
+ this.$store.commit("audioBg/setMultiple", 1);
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: "音频播放错误",
|
|
title: "音频播放错误",
|
|
icon: "none",
|
|
icon: "none",
|
|
@@ -188,7 +204,7 @@ export default {
|
|
//倍速播放
|
|
//倍速播放
|
|
isTimesHandler(i) {
|
|
isTimesHandler(i) {
|
|
let index = i == 3 ? 0 : i + 1;
|
|
let index = i == 3 ? 0 : i + 1;
|
|
- this.isTimes = this.timesTheSpeed[index].value;
|
|
|
|
|
|
+ this.$store.commit("audioBg/setMultiple", this.timesTheSpeed[index].value);
|
|
this.globalBgAudioManager.pause();
|
|
this.globalBgAudioManager.pause();
|
|
this.play = true;
|
|
this.play = true;
|
|
this.globalBgAudioManager.playbackRate = this.isTimes;
|
|
this.globalBgAudioManager.playbackRate = this.isTimes;
|
|
@@ -230,7 +246,6 @@ export default {
|
|
font-size: 30rpx;
|
|
font-size: 30rpx;
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
margin-bottom: 35rpx;
|
|
margin-bottom: 35rpx;
|
|
- text-align: center;
|
|
|
|
padding-right: 30rpx;
|
|
padding-right: 30rpx;
|
|
.icon-cross {
|
|
.icon-cross {
|
|
position: absolute;
|
|
position: absolute;
|
|
@@ -244,12 +259,11 @@ export default {
|
|
position: absolute;
|
|
position: absolute;
|
|
bottom: 0;
|
|
bottom: 0;
|
|
left: 0;
|
|
left: 0;
|
|
|
|
+ padding: 30rpx;
|
|
padding-bottom: constant(safe-area-inset-bottom);
|
|
padding-bottom: constant(safe-area-inset-bottom);
|
|
padding-bottom: env(safe-area-inset-bottom);
|
|
padding-bottom: env(safe-area-inset-bottom);
|
|
width: 100%;
|
|
width: 100%;
|
|
- height: 460rpx;
|
|
|
|
background: #ffffff;
|
|
background: #ffffff;
|
|
- padding: 30rpx;
|
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
border-radius: 30rpx 30rpx 0 0;
|
|
border-radius: 30rpx 30rpx 0 0;
|
|
}
|
|
}
|