张延森 преди 3 години
родител
ревизия
cd5dc75f8b
променени са 2 файла, в които са добавени 7 реда и са изтрити 2 реда
  1. 6
    1
      src/components/BgMusic.vue
  2. 1
    1
      src/pages/Honghe.vue

+ 6
- 1
src/components/BgMusic.vue Целия файл

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <div class="bg-music" :class="{ ['icon-playing']: playing }" @click="handleClick" v-show="show">
3
-    <audio :src="url" ref="audioRef" loop @canplay="show = true" @play="handlePlay"></audio>
3
+    <audio :src="url" ref="audioRef" loop @loadedmetadata="show = true" @play="handlePlay"></audio>
4 4
   </div>
5 5
 </template>
6 6
 
@@ -18,6 +18,11 @@ export default {
18 18
   },
19 19
   mounted() {
20 20
     document.body.addEventListener("click", this.handleClick);
21
+
22
+    this.$nextTick(() => {
23
+      this.$refs.audioRef.load()
24
+    })
25
+
21 26
   },
22 27
   methods: {
23 28
     handleClick() {

+ 1
- 1
src/pages/Honghe.vue Целия файл

@@ -253,7 +253,7 @@ export default {
253 253
       this.binggo = false
254 254
     },
255 255
     handleMonthClick(month) {
256
-      if (!this.person || !this.personId) {
256
+      if (!this.person || !this.person.personId) {
257 257
         alert('为了您能够正常参与抽奖,请刷新页面并同意授权微信昵称!')
258 258
         return
259 259
       }