|
@@ -101,6 +101,7 @@
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
<u-toast ref="uToast"></u-toast>
|
|
|
+ <!-- <image @click="audioClick" :class="{rotate:musicPlay}" class="audio-btn" :showLoading="false" :src="staticUrl+'/img/music.svg'"></image> -->
|
|
|
<tabbar :tabbarIndexProps='0' />
|
|
|
</view>
|
|
|
</template>
|
|
@@ -108,6 +109,7 @@
|
|
|
<script>
|
|
|
import { systemInfo } from "@/mixin.js";
|
|
|
import tabbar from "../../components/tabbar.vue";
|
|
|
+ // const innerAudioContext = uni.createInnerAudioContext();
|
|
|
export default {
|
|
|
onShareAppMessage(res) {
|
|
|
if (res.from === 'button') {// 来自页面内分享按钮
|
|
@@ -144,15 +146,16 @@
|
|
|
posterShow:false,
|
|
|
posterStyle:{},
|
|
|
posterSrc:'',
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ musicPlay:true,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
},
|
|
|
onShow() {
|
|
|
-
|
|
|
+ // if(innerAudioContext.src){
|
|
|
+ // this.audioStop();
|
|
|
+ // this.audioPlay();
|
|
|
+ // }
|
|
|
},
|
|
|
beforeRouteLeave() {
|
|
|
|
|
@@ -176,13 +179,22 @@
|
|
|
// console.log('navHeight',this.navHeight);
|
|
|
// console.log('vuex_member_info=======',this.vuex_member_info);
|
|
|
this.getClientIndex();
|
|
|
+
|
|
|
+ //音乐地址
|
|
|
+ // innerAudioContext.src = this.staticUrl+'/img/audio.mp3';
|
|
|
+ // innerAudioContext.autoplay = true;//自动播放
|
|
|
+ // innerAudioContext.loop = true; //循环播放
|
|
|
+ //音乐播放
|
|
|
+ // this.audioStop();
|
|
|
+ // this.audioPlay();
|
|
|
+
|
|
|
|
|
|
},
|
|
|
onReady() {
|
|
|
|
|
|
},
|
|
|
onUnload() {
|
|
|
-
|
|
|
+ // this.audioStop();
|
|
|
},
|
|
|
methods: {
|
|
|
getMemberInfo(){
|
|
@@ -324,9 +336,23 @@
|
|
|
id: item.id,
|
|
|
type:'swiperDetail'
|
|
|
});
|
|
|
+ },
|
|
|
+ audioClick(){
|
|
|
+ console.log('musicPlay',this.musicPlay);
|
|
|
+ if (this.musicPlay == true) {
|
|
|
+ this.audioStop();
|
|
|
+ } else if(this.musicPlay == false){
|
|
|
+ this.audioPlay();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ audioStop(){
|
|
|
+ this.musicPlay = false;
|
|
|
+ innerAudioContext.stop()
|
|
|
+ },
|
|
|
+ audioPlay(){
|
|
|
+ this.musicPlay = true;
|
|
|
+ innerAudioContext.play()
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -523,4 +549,23 @@ $pagegap:32rpx;
|
|
|
right: 16rpx;
|
|
|
bottom: 174rpx;
|
|
|
}
|
|
|
+.audio-btn{
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 50%;
|
|
|
+ position: fixed;
|
|
|
+ right: 24rpx;
|
|
|
+ top: 150px;
|
|
|
+}
|
|
|
+.rotate{
|
|
|
+ animation: rotate 4s infinite linear;
|
|
|
+}
|
|
|
+@keyframes rotate {
|
|
|
+ 0% {
|
|
|
+ transform: rotate(0deg);
|
|
|
+ }
|
|
|
+ 100% {
|
|
|
+ transform: rotate(360deg);
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|