|
@@ -2,7 +2,8 @@
|
|
|
<view class="index-box box-border-box flex-common-css" @click.stop="play()">
|
|
<view class="index-box box-border-box flex-common-css" @click.stop="play()">
|
|
|
<view class="flex-justify-space box-border-box plr-32">
|
|
<view class="flex-justify-space box-border-box plr-32">
|
|
|
<image class="logo-img" src="@/static/img/c-logo.png" mode="scaleToFill"></image>
|
|
<image class="logo-img" src="@/static/img/c-logo.png" mode="scaleToFill"></image>
|
|
|
- <image class="music-img" :class="isPlay?'music-anumation':''" src="@/static/img/c-music.png" mode="scaleToFill" @click.stop="musicPause()"></image>
|
|
|
|
|
|
|
+<!-- <image class="music-img" :class="isPlay?'music-anumation':''" src="@/static/img/c-music.png" mode="scaleToFill" @click.stop="musicPause()"></image>-->
|
|
|
|
|
+ <mumu-music musicSrc='https://jhxcnc.oss-cn-chengdu.aliyuncs.com/mp3/4272600974.mp3'></mumu-music>
|
|
|
</view>
|
|
</view>
|
|
|
<swiper class="swiper" :vertical='true' @change="swiperChange">
|
|
<swiper class="swiper" :vertical='true' @change="swiperChange">
|
|
|
<!-- 邀请函 -->
|
|
<!-- 邀请函 -->
|
|
@@ -193,27 +194,41 @@
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
musicPlay() {
|
|
musicPlay() {
|
|
|
- if (!this.audioServe) {
|
|
|
|
|
- this.audioServe = uni.createInnerAudioContext();
|
|
|
|
|
- this.audioServe.autoplay = true;
|
|
|
|
|
- this.audioServe.loop = true;
|
|
|
|
|
- this.audioServe.obeyMuteSwitch = true;
|
|
|
|
|
- this.audioServe.src = 'https://jhxcnc.oss-cn-chengdu.aliyuncs.com/mp3/4272600974.mp3';
|
|
|
|
|
- }
|
|
|
|
|
- this.audioServe.play();
|
|
|
|
|
- this.audioServe.onPlay(() => {
|
|
|
|
|
- this.isPlay = true;
|
|
|
|
|
- this.isAutoPlay = true
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // if (!this.audioServe) {
|
|
|
|
|
+ // this.audioServe = uni.createInnerAudioContext();
|
|
|
|
|
+ // this.audioServe.autoplay = true;
|
|
|
|
|
+ // this.audioServe.loop = true;
|
|
|
|
|
+ // this.audioServe.obeyMuteSwitch = true;
|
|
|
|
|
+ // this.audioServe.src = 'https://jhxcnc.oss-cn-chengdu.aliyuncs.com/mp3/4272600974.mp3';
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.audioServe.play();
|
|
|
|
|
+ // this.audioServe.onPlay(() => {
|
|
|
|
|
+ // this.isPlay = true;
|
|
|
|
|
+ // this.isAutoPlay = true
|
|
|
|
|
+ // })
|
|
|
|
|
+
|
|
|
|
|
+ // 创建bgAudioManager对象
|
|
|
|
|
+// const bgAudioManager = uni.getBackgroundAudioManager();
|
|
|
|
|
+// bgAudioManager.src = 'https://jhxcnc.oss-cn-chengdu.aliyuncs.com/mp3/4272600974.mp3';
|
|
|
|
|
+// // 开始播放的回调函数
|
|
|
|
|
+// bgAudioManager.onPlay(() => {
|
|
|
|
|
+// console.log('开始播放');
|
|
|
|
|
+// });
|
|
|
|
|
+// // 播放报错的事件监听
|
|
|
|
|
+// bgAudioManager.onError((res) => {
|
|
|
|
|
+// console.log(res.errMsg);
|
|
|
|
|
+// console.log(res.errCode);
|
|
|
|
|
+// });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
play() {
|
|
play() {
|
|
|
- if (!this.isPlay && this.audioServe) {
|
|
|
|
|
- this.audioServe.play();
|
|
|
|
|
- this.audioServe.onPlay(() => {
|
|
|
|
|
- this.isPlay = true;
|
|
|
|
|
- this.isAutoPlay = true
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (!this.isPlay && this.audioServe ) {
|
|
|
|
|
+ // this.audioServe.play();
|
|
|
|
|
+ // this.audioServe.onPlay(() => {
|
|
|
|
|
+ // this.isPlay = true;
|
|
|
|
|
+ // this.isAutoPlay = true
|
|
|
|
|
+ // })
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
musicPause() {
|
|
musicPause() {
|