zjxpcyc 6 lat temu
rodzic
commit
4ecd6fde4e
1 zmienionych plików z 17 dodań i 2 usunięć
  1. 17
    2
      src/views/vote/list.vue

+ 17
- 2
src/views/vote/list.vue Wyświetl plik

121
       newpage: 1,
121
       newpage: 1,
122
       toppage: 1,
122
       toppage: 1,
123
       show: false,
123
       show: false,
124
-      pageSize: 10
124
+      pageSize: 10,
125
+      loaddingData: false,
125
     };
126
     };
126
   },
127
   },
127
   components: {
128
   components: {
144
       topList: x => x.toplist,
145
       topList: x => x.toplist,
145
       user: x => x.user,
146
       user: x => x.user,
146
       theme: x => x.theme,
147
       theme: x => x.theme,
147
-      myID: x => (x.myprofile.filter(x => x.ActivityId === (x.activity || {}).ActivityId)[0] || {}).MemberId
148
+      myprofile: x => x.myprofile,
149
+      myID: s => (s.myprofile.filter(x => x.ActivityId === (s.activity || {}).ActivityId)[0] || {}).MemberId
148
     }),
150
     }),
149
   },
151
   },
150
   created() {
152
   created() {
177
           thu_image: act.ShareIcon
179
           thu_image: act.ShareIcon
178
         }
180
         }
179
       );
181
       );
182
+
183
+      console.log('------>', this.activity, this.myprofile, this.myID)
180
     });
184
     });
181
     // this.getMine({
185
     // this.getMine({
182
     //   actid: this.actid,
186
     //   actid: this.actid,
248
       // });
252
       // });
249
     },
253
     },
250
     loadNewList(loaded) {
254
     loadNewList(loaded) {
255
+      if (this.loaddingData) {
256
+        return
257
+      }
258
+
259
+      this.loaddingData = true
251
       this.newlist().then(res => {
260
       this.newlist().then(res => {
252
         console.log(res.length, this.pageSize)
261
         console.log(res.length, this.pageSize)
253
 
262
 
258
         }
267
         }
259
 
268
 
260
         this.loading = false;
269
         this.loading = false;
270
+        this.loaddingData = false
261
         loaded && loaded('done')
271
         loaded && loaded('done')
262
       });
272
       });
263
     },
273
     },
264
     loadTopList(loaded) {
274
     loadTopList(loaded) {
275
+      if (this.loaddingData) {
276
+        return
277
+      }
278
+
265
       this.toplist().then(res => {
279
       this.toplist().then(res => {
266
         if ((res || []).length >= this.pageSize) {
280
         if ((res || []).length >= this.pageSize) {
267
           this.toppage += 1;
281
           this.toppage += 1;
270
         }
284
         }
271
 
285
 
272
         this.loading = false;
286
         this.loading = false;
287
+        this.loaddingData = false
273
         loaded && loaded('done')
288
         loaded && loaded('done')
274
       });
289
       });
275
     },
290
     },