Commit aaedf4a8 by 陈玉桐

add音乐

parent 4623a7cf
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
</div> </div>
</div> </div>
<div id="introduce"> <div id="introduce">
<audio id="music" loop="loop" :src="musicUrl" autoplay v-show="false"></audio>
<img id="iconMusic" v-show="isPlaying" @click="musicPause" src="../assets/icon_music.png">
<img id="iconMusic" v-show="!isPlaying" @click="musicPlay" src="../assets/icon_silent.png">
<img :src="detailImgUrl"> <img :src="detailImgUrl">
</div> </div>
<div id="applyButtonBox"> <div id="applyButtonBox">
...@@ -56,6 +59,9 @@ export default { ...@@ -56,6 +59,9 @@ export default {
peoples: '', peoples: '',
detailImgUrl: '', detailImgUrl: '',
qualifications: '', qualifications: '',
musicUrl: '',
isPlaying: true,
tipDialogShow: false,//弹窗 tipDialogShow: false,//弹窗
tipDialogBtn: '', tipDialogBtn: '',
...@@ -68,6 +74,13 @@ export default { ...@@ -68,6 +74,13 @@ export default {
components: { components: {
loading loading
}, },
ready: function() {
this.isPlaying = true
document.querySelector('#music').play();
document.addEventListener("WeixinJSBridgeReady", function () {
document.querySelector('#music').play();
}, false);
},
mounted() { mounted() {
this.loadingShow = true this.loadingShow = true
request({ request({
...@@ -88,6 +101,7 @@ export default { ...@@ -88,6 +101,7 @@ export default {
this.peoples = response.data.peoples this.peoples = response.data.peoples
this.detailImgUrl = response.data.detailImgUrl this.detailImgUrl = response.data.detailImgUrl
this.qualifications = response.data.qualifications this.qualifications = response.data.qualifications
this.musicUrl = response.data.musicUrl
}) })
...@@ -174,6 +188,14 @@ export default { ...@@ -174,6 +188,14 @@ export default {
}, },
share() { share() {
this.shareWrapShow = true this.shareWrapShow = true
},
musicPause() {
this.isPlaying = false
document.querySelector('#music').pause();
},
musicPlay() {
this.isPlaying = true
document.querySelector('#music').play();
} }
} }
} }
...@@ -225,9 +247,17 @@ export default { ...@@ -225,9 +247,17 @@ export default {
#introduce{ #introduce{
background-color: #fff; background-color: #fff;
padding: 10px 10px 75px; padding: 10px 10px 75px;
img{ position: relative;
>img{
width: 100%; width: 100%;
} }
#iconMusic{
position: absolute;
right: 10px;
top: 10px;
width: 32px;
height: 32px;
}
} }
#applyButtonBox{ #applyButtonBox{
background-color: #fff; background-color: #fff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment