zjxpcyc 6 年之前
父節點
當前提交
ff6ab57c4d
共有 5 個文件被更改,包括 67 次插入47 次删除
  1. 20
    16
      src/App.vue
  2. 1
    1
      src/util/api.js
  3. 3
    3
      src/views/vote/index.vue
  4. 39
    23
      src/views/vote/list.vue
  5. 4
    4
      vue.config.js

+ 20
- 16
src/App.vue 查看文件

@@ -15,7 +15,11 @@ const { mapState: mapactivityState } = createNamespacedHelpers("vote");
15 15
 export default {
16 16
   data() {
17 17
     return {
18
-      showPage: true
18
+      showPage: true,
19
+      appid: {
20
+        prod: 'wx32e2e8c81f66070e',
21
+        dev: 'wx776f26b70b03902b',
22
+      },
19 23
     };
20 24
   },
21 25
   components: {
@@ -28,21 +32,21 @@ export default {
28 32
     })
29 33
   },
30 34
   created() {
31
-    // if (location.search && this.toolClass.UrlSearch(location.search).code) {
32
-    //   this.code = this.toolClass.UrlSearch(location.search).code
33
-    //   let oldCode = localStorage.getItem('code')
34
-    //   if (this.code === oldCode) {
35
-    //     localStorage.setItem('code', this.code)
36
-    //     this.toolClass.getCode('wx32e2e8c81f66070e')
37
-    //   } else {
38
-    //     localStorage.setItem('code', this.code)
39
-    //     this.getUser({code: this.code}).then(() => {
40
-    //       this.showPage = true
41
-    //     })
42
-    //   }
43
-    // } else {
44
-    //   this.toolClass.getCode('wx32e2e8c81f66070e')
45
-    // }
35
+    if (location.search && this.toolClass.UrlSearch(location.search).code) {
36
+      this.code = this.toolClass.UrlSearch(location.search).code
37
+      let oldCode = localStorage.getItem('code')
38
+      if (this.code === oldCode) {
39
+        localStorage.setItem('code', this.code)
40
+        this.toolClass.getCode(this.appid.dev)
41
+      } else {
42
+        localStorage.setItem('code', this.code)
43
+        this.getUser({code: this.code}).then(() => {
44
+          this.showPage = true
45
+        })
46
+      }
47
+    } else {
48
+      this.toolClass.getCode(this.appid.dev)
49
+    }
46 50
   },
47 51
   methods: {
48 52
     ...mapIndexActions(["getUser"])

+ 1
- 1
src/util/api.js 查看文件

@@ -1,4 +1,4 @@
1
-const baseUrl = '/api'
1
+const baseUrl = '/voteapi'
2 2
 
3 3
 const $api = {
4 4
   file: {

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

@@ -31,9 +31,9 @@ export default {
31 31
     this.getActivity({
32 32
       actid: this.actid,
33 33
     })
34
-    this.getMine({
35
-      actid: this.actid,
36
-    })
34
+    // this.getMine({
35
+    //   actid: this.actid,
36
+    // })
37 37
   },
38 38
   computed: {
39 39
     ...mapvoteState({

+ 39
- 23
src/views/vote/list.vue 查看文件

@@ -15,7 +15,13 @@
15 15
           <div slot="title">
16 16
             <span :class="{ [`theme${theme}`]: true, 'active': active }">最新上传</span>
17 17
           </div>
18
-          <pull-to :bottom-load-method="loadNewList">
18
+          <!-- <pull-to :bottom-load-method="loadNewList"> -->
19
+            <van-list
20
+              v-model="loading"
21
+              :finished="finished"
22
+              finished-text="没有更多了"
23
+              @load="loadNewList"
24
+            >
19 25
             <div class="LatestUpload">
20 26
               <div class="LatestUploadList" v-for="(item,index) in newList" :key="index">
21 27
                 <div :class="signupBtn?ActivePersonnelBox1:ActivePersonnelBox2" @click="gotovotingdetails(item.MemberId)">
@@ -30,13 +36,20 @@
30 36
                 </div>
31 37
               </div>
32 38
             </div>
33
-          </pull-to>
39
+          <!-- </pull-to> -->
40
+            </van-list>
34 41
         </van-tab>
35 42
         <van-tab title="TOP50">
36 43
           <div slot="title">
37 44
             <span :class="{ [`theme${theme}`]: true, 'active': !active }">Top50</span>
38 45
           </div>
39
-            <pull-to :bottom-load-method="loadTopList">
46
+            <!-- <pull-to :bottom-load-method="loadTopList"> -->
47
+            <van-list
48
+              v-model="loading"
49
+              :finished="finished"
50
+              finished-text="没有更多了"
51
+              @load="loadTopList"
52
+            >
40 53
               <div class="LatestUpload">
41 54
                 <div class="LatestUploadList" v-for="(item,index) in topList" :key="index">
42 55
                   <div :class="signupBtn?ActivePersonnelBox1:ActivePersonnelBox2" @click="gotovotingdetails(item.MemberId)">
@@ -51,7 +64,8 @@
51 64
                   </div>
52 65
                 </div>
53 66
               </div>
54
-            </pull-to>
67
+              </van-list>
68
+            <!-- </pull-to> -->
55 69
         </van-tab>
56 70
       </van-tabs>
57 71
     </div>
@@ -61,7 +75,7 @@
61 75
 </template>
62 76
 
63 77
 <script>
64
-import PullTo from 'vue-pull-to'
78
+// import PullTo from 'vue-pull-to'
65 79
 import { createNamespacedHelpers } from "vuex";
66 80
 import wxsdk from "../../util/share.js";
67 81
 import toast from "../../components/toast.vue";
@@ -112,14 +126,16 @@ export default {
112 126
   },
113 127
   components: {
114 128
     toast,
115
-    PullTo
129
+    // PullTo
116 130
   },
117 131
   mounted() {
118
-    const scroll = window.scroll
119
-    window.addEventListener("scroll", (e) => {
120
-      scroll(e)
121
-      this.handleScroll()
122
-    }, true);
132
+    // const scroll = window.scroll
133
+    // window.addEventListener("scroll", (e) => {
134
+    //   scroll(e)
135
+    //   this.handleScroll()
136
+    // }, true);
137
+
138
+    window.addEventListener("scroll", this.handleScroll, true);
123 139
   },
124 140
   computed: {
125 141
     ...mapactivityState({
@@ -165,16 +181,16 @@ export default {
165 181
       actid: this.actid
166 182
     });
167 183
 
168
-    this.newlist().then((res) => {
169
-      if ((res || []).length === this.pageSize) {
170
-        this.newpage += 1
171
-      }
172
-    })
173
-    this.toplist().then((res) => {
174
-      if ((res || []).length === this.pageSize) {
175
-        this.toppage += 1
176
-      }
177
-    })
184
+    // this.newlist().then((res) => {
185
+    //   if ((res || []).length === this.pageSize) {
186
+    //     this.newpage += 1
187
+    //   }
188
+    // })
189
+    // this.toplist().then((res) => {
190
+    //   if ((res || []).length === this.pageSize) {
191
+    //     this.toppage += 1
192
+    //   }
193
+    // })
178 194
   },
179 195
   methods: {
180 196
     ...mapactivityActions([
@@ -240,7 +256,7 @@ export default {
240 256
         }
241 257
 
242 258
         this.loading = false;
243
-        loaded('done')
259
+        loaded && loaded('done')
244 260
       });
245 261
     },
246 262
     loadTopList(loaded) {
@@ -252,7 +268,7 @@ export default {
252 268
         }
253 269
 
254 270
         this.loading = false;
255
-        loaded('done')
271
+        loaded && loaded('done')
256 272
       });
257 273
     },
258 274
     signup() {

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

@@ -5,16 +5,16 @@ module.exports = {
5 5
   chainWebpack: config => config.plugins.delete('named-chunks'),
6 6
   devServer: {
7 7
     proxy: {
8
-      '/api': {
8
+      '/voteapi': {
9 9
         // target: 'http://wechatconfigdev.ycjcjy.com',
10 10
         target: 'http://localhost:8080', // wf
11 11
         // target: 'http://192.168.0.102:8080', // hyq
12 12
         // target: 'http://192.168.0.11:8080', // zys
13 13
         // target: 'http://dev.ycjcjy.com', // frp
14 14
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
15
-        // pathRewrite: {
16
-        //   '^/api': '/api-v2/api'
17
-        // },
15
+        pathRewrite: {
16
+          '^/voteapi': '/api'
17
+        },
18 18
       },
19 19
     },
20 20
     // compress: true,