瀏覽代碼

Merge branch 'master' of http://git.ycjcjy.com/support-game/wechat

陈冉 6 年之前
父節點
當前提交
341e297ed7
共有 5 個檔案被更改,包括 21 行新增8 行删除
  1. 10
    3
      src/components/music.vue
  2. 1
    1
      src/store/vote.js
  3. 3
    1
      src/views/vote/detail.vue
  4. 5
    1
      src/views/vote/list.vue
  5. 2
    2
      vue.config.js

+ 10
- 3
src/components/music.vue 查看文件

@@ -1,7 +1,6 @@
1 1
 <template>
2 2
     <div class="musicbox" @click="troggle">
3 3
       <img :class="playing" :src="icons[theme][playing]" alt="">
4
-      <audio ref="player" :src="url" preload loop="loop"></audio>
5 4
     </div>
6 5
 </template>
7 6
 <script>
@@ -14,6 +13,7 @@ export default {
14 13
   data() {
15 14
     return {
16 15
       playing: 'off',
16
+      audio: null,
17 17
 
18 18
       icons: {
19 19
         '1': {
@@ -37,12 +37,19 @@ export default {
37 37
   methods: {
38 38
     play() {
39 39
       if (this.url) {
40
-        this.$refs.player.play()
40
+        if (!this.audio) {
41
+          this.audio = window.document.createElement('audio')
42
+          this.audio.src = this.url
43
+          this.audio.preload = true
44
+          this.audio.loop = true
45
+        }
46
+
47
+        this.audio.play()
41 48
         this.playing = 'on'
42 49
       }
43 50
     },
44 51
     stop() {
45
-      this.$refs.player.pause()
52
+      this.audio.pause()
46 53
       this.playing = 'off'
47 54
     },
48 55
     troggle() {

+ 1
- 1
src/store/vote.js 查看文件

@@ -5,7 +5,7 @@ export default {
5 5
   namespaced: true,
6 6
   state: {
7 7
     activity: {},
8
-    user: '4',
8
+    user: '22',
9 9
     detail: {},
10 10
     myprofile: {},
11 11
     toplist: [],

+ 3
- 1
src/views/vote/detail.vue 查看文件

@@ -107,7 +107,9 @@ export default {
107 107
       this.show = false
108 108
     },
109 109
     tolink() {
110
-      window.location.href = this.info.AfterVote
110
+      if (this.info.AfterVote != '') {
111
+        window.location.href = this.info.AfterVote
112
+      }
111 113
     },
112 114
   },
113 115
 };

+ 5
- 1
src/views/vote/list.vue 查看文件

@@ -115,7 +115,11 @@ export default {
115 115
     PullTo
116 116
   },
117 117
   mounted() {
118
-    window.addEventListener("scroll", this.handleScroll, true);
118
+    const scroll = window.scroll
119
+    window.addEventListener("scroll", (e) => {
120
+      scroll(e)
121
+      this.handleScroll()
122
+    }, true);
119 123
   },
120 124
   computed: {
121 125
     ...mapactivityState({

+ 2
- 2
vue.config.js 查看文件

@@ -7,9 +7,9 @@ module.exports = {
7 7
     proxy: {
8 8
       '/api': {
9 9
         // target: 'http://wechatconfigdev.ycjcjy.com',
10
-        // target: 'http://localhost:8080', // wf
10
+        target: 'http://localhost:8080', // wf
11 11
         // target: 'http://192.168.0.102:8080', // hyq
12
-        target: 'http://192.168.0.11:8080', // zys
12
+        // target: 'http://192.168.0.11:8080', // zys
13 13
         // target: 'http://dev.ycjcjy.com', // frp
14 14
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
15 15
         // pathRewrite: {