|
@@ -27,7 +27,6 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- </van-overlay> -->
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -56,6 +55,7 @@ export default {
|
|
|
title: "", //当前音频标题
|
|
|
activityTitle: "", //当前活动标题
|
|
|
play: false,
|
|
|
+ isEnded: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -102,9 +102,6 @@ export default {
|
|
|
this.globalBgAudioManager.onPlay(async () => {
|
|
|
this.play = true;
|
|
|
this.$store.commit("audioBg/updateAudioPause", false);
|
|
|
- const res = await activity.backAudioPlay({
|
|
|
- ActivityId: this.$store.state.audioBg.activityId,
|
|
|
- });
|
|
|
});
|
|
|
this.globalBgAudioManager.onPause(() => {
|
|
|
console.log("音频暂停");
|
|
@@ -113,11 +110,13 @@ export default {
|
|
|
});
|
|
|
this.globalBgAudioManager.onStop(() => {
|
|
|
console.log("音频停止");
|
|
|
- this.$store.commit("audioBg/removeAudio");
|
|
|
+ this.play = false;
|
|
|
+ this.$store.commit("audioBg/updateAudioPause", true);
|
|
|
});
|
|
|
this.globalBgAudioManager.onEnded(() => {
|
|
|
console.log("音频onEnded");
|
|
|
- this.$store.commit("audioBg/removeAudio");
|
|
|
+ this.play = false;
|
|
|
+ this.$store.commit("audioBg/updateAudioPause", true);
|
|
|
});
|
|
|
this.globalBgAudioManager.onError((e) => {
|
|
|
console.log("音频onError", e);
|
|
@@ -140,10 +139,14 @@ export default {
|
|
|
},
|
|
|
//音频点击暂停播放
|
|
|
handleChangePlayStatus() {
|
|
|
- if (!this.globalBgAudioManager.paused) {
|
|
|
- this.globalBgAudioManager.pause();
|
|
|
+ if (this.globalBgAudioManager.src) {
|
|
|
+ if (!this.globalBgAudioManager.paused) {
|
|
|
+ this.globalBgAudioManager.pause();
|
|
|
+ } else {
|
|
|
+ this.globalBgAudioManager.play();
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.globalBgAudioManager.play();
|
|
|
+ this.init();
|
|
|
}
|
|
|
},
|
|
|
},
|
|
@@ -208,7 +211,7 @@ export default {
|
|
|
}
|
|
|
.card-title {
|
|
|
color: #3385ff;
|
|
|
- font-size: 26rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
padding: 0 66rpx;
|
|
|
text-align: center;
|
|
|
margin-bottom: 35rpx;
|