|
@@ -83,7 +83,11 @@
|
|
|
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
+ <!-- <audio id="video" controls autoplay="autoplay" ref="iosclick" loop="loop" >
|
|
|
+ <source src="http://dmsimg.66km.com/music/sakuratears.mp3" type="audio/mpeg">
|
|
|
+ </audio> -->
|
|
|
+ <img src="../../static/img/mp3.png" class="mp3Img" @click="play()" v-if="!payshow&mp3Url!=''">
|
|
|
+ <img src=".../../static/img/mp31.png" class="mp3Img" @click="play2()" id="bofang" v-if="payshow&mp3Url!=''">
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -97,6 +101,10 @@
|
|
|
shopInfo:'',
|
|
|
useShopShow:false,
|
|
|
shopckList:'',
|
|
|
+ ckmusic:'',
|
|
|
+ bgmMusic:'',
|
|
|
+ payshow:false,
|
|
|
+ mp3Url:'',
|
|
|
}
|
|
|
},
|
|
|
onLoad(opt) {
|
|
@@ -110,8 +118,42 @@
|
|
|
}
|
|
|
this.getShopinfo()
|
|
|
this.shopckList= uni.getStorageSync("shopckList");
|
|
|
+ this.ckmusic=uni.getStorageSync("ckmusic");
|
|
|
+ if(this.ckmusic){
|
|
|
+ this.mp3Url=this.ckmusic.music;
|
|
|
+ this.bgmMusic = uni.createInnerAudioContext();
|
|
|
+ this.bgmMusic.autoplay = true;//自动播放
|
|
|
+ this.bgmMusic.loop = true;//循环播放
|
|
|
+ this.bgmMusic.src = 'http://dmsimg.66km.com/music/sakuratears.mp3';//背景音乐地址
|
|
|
+ this.bgmMusic.onPlay(function(){
|
|
|
+ console.log('背景音乐播放中');
|
|
|
+
|
|
|
+ });
|
|
|
+ this.bgmMusic.onError((res) => {
|
|
|
+ console.log(res.errMsg);
|
|
|
+ console.log(res.errCode);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //console.log(this.bgmMusic)
|
|
|
+
|
|
|
+ },
|
|
|
+ onUnload(){
|
|
|
+ this.bgmMusic.stop()
|
|
|
},
|
|
|
methods: {
|
|
|
+ play2(){
|
|
|
+ this.bgmMusic.play();
|
|
|
+ this.payshow=false;
|
|
|
+ },
|
|
|
+ play(){
|
|
|
+ this.payshow=true;
|
|
|
+ this.bgmMusic.stop(()=>{
|
|
|
+
|
|
|
+ console.log('背景音乐停止了');
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
noShowShop2(){
|
|
|
this.useShopShow=false;
|
|
|
},
|
|
@@ -171,7 +213,16 @@
|
|
|
},
|
|
|
getShopinfo(){
|
|
|
this.$http('openH5SetTheGuest/getShopinfo',{},'GET').then(res => {
|
|
|
- this.shopInfo=res.data
|
|
|
+ //this.shopInfo=res.data;
|
|
|
+ var shopinfo=res.data;
|
|
|
+ this.shopckList.forEach(item=>{
|
|
|
+ if(item.id==shopinfo.id){
|
|
|
+ this.shopInfo=shopinfo
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(this.shopInfo==''){
|
|
|
+ this.shopInfo=this.shopckList[0]
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
generate(){
|
|
@@ -200,6 +251,14 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+ .mp3Img{
|
|
|
+ /* transform: translate(-1584.4%, 121.5%) scale(1); */
|
|
|
+ position: fixed;
|
|
|
+ top: 100rpx;
|
|
|
+ right: 40rpx;
|
|
|
+ width: 60rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ }
|
|
|
.shopImg {
|
|
|
width: 146rpx;
|
|
|
height: 146rpx;
|