guhongwei 3 년 전
부모
커밋
0d09d3abee
1개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 4 7
      pages/home/index.js

+ 4 - 7
pages/home/index.js

@@ -11,7 +11,6 @@ Page({
     // 主体高度
     infoHeight: '',
     teamlist: [],
-    schedulelist: [],
   },
   // 跳转菜单
   tabPath(e) {
@@ -64,16 +63,15 @@ Page({
           data: {},
           success(res) {
             if (res.data.errcode == 0) {
-              let datas = res.data.data;
-              for (const val of datas) {
-                if (val.status == 3) {
+              for (const val of res.data.data) {
+                if (val.status == '3') {
                   wx.request({
                     url: `${app.globalData.publicUrl}/courtAdmin/api/schedule`,
                     method: 'get',
                     data: { match_id: val._id },
                     success(res) {
                       if (res.data.errcode == 0) {
-                        that.setData({ schedulelist: res.data.data });
+                        val.schedulelist = res.data.data;
                       } else {
                         wx.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 })
                       }
@@ -81,8 +79,7 @@ Page({
                   })
                 }
               }
-              that.setData({ teamlist: datas });
-              console.log(datas);
+              that.setData({ teamlist: res.data.data })
             } else {
               wx.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 })
             }