zs 2 years ago
parent
commit
d3faadda85
1 changed files with 13 additions and 13 deletions
  1. 13 13
      pagesMatch/userAdmin/schedule/list.js

+ 13 - 13
pagesMatch/userAdmin/schedule/list.js

@@ -79,19 +79,19 @@ Page({
         wx.getStorage({
             key: 'raceuser',
             success: async res => {
-                if (tabs.active == 'a') {
-                    let info = { skip: that.data.skip, limit: that.data.limit, user_id: res.data._id };
-                    let arr = await app.$get(`/msgs`, { ...info }, 'race');
-                    if (arr.errcode == '0') {
-                        let list = [...that.data.list, ...arr.data]
-                        for (const val of list) {
-                            let status = that.data.statusList.find(i => i.value == val.status)
-                            if (status) val.zhStatus = status.label;
-                        }
-                        that.setData({ list })
-                        that.setData({ total: arr.total })
-                    } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
-                }
+                let arr;
+                let info = { skip: that.data.skip, limit: that.data.limit, user_id: res.data._id };
+                if (tabs.active == 'a') arr = await app.$get(`/msgs`, { ...info }, 'race');
+                if (tabs.active == 'b') arr = await app.$get(`/eliminate`, { ...info }, 'race');
+                if (arr.errcode == '0') {
+                    let list = [...that.data.list, ...arr.data]
+                    for (const val of list) {
+                        let status = that.data.statusList.find(i => i.value == val.status)
+                        if (status) val.zhStatus = status.label;
+                    }
+                    that.setData({ list })
+                    that.setData({ total: arr.total })
+                } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
             },
             fail: async res => {
                 wx.redirectTo({ url: '/pages/index/index' })