|
@@ -122,12 +122,15 @@ Page({
|
|
|
arr = await app.$get(`/courtAdmin/api/schedule/${that.data.id}`);
|
|
|
if (arr.errcode == '0') { schedule = arr.data; that.setData({ form: schedule }); }
|
|
|
|
|
|
- arr = await app.$get(`/courtAdmin/api/team/${schedule.red_id}`);
|
|
|
- if (arr.errcode == '0') that.setData({ redTeam: arr.data });
|
|
|
+ if (schedule && schedule.red_id) {
|
|
|
+ arr = await app.$get(`/courtAdmin/api/team/${schedule.red_id}`);
|
|
|
+ if (arr.errcode == '0') that.setData({ redTeam: arr.data });
|
|
|
+ }
|
|
|
|
|
|
- arr = await app.$get(`/courtAdmin/api/team/${schedule.blue_id}`);
|
|
|
- if (arr.errcode == '0') that.setData({ blueTeam: arr.data });
|
|
|
-
|
|
|
+ if (schedule && schedule.blue_id) {
|
|
|
+ arr = await app.$get(`/courtAdmin/api/team/${schedule.blue_id}`);
|
|
|
+ if (arr.errcode == '0') that.setData({ blueTeam: arr.data });
|
|
|
+ }
|
|
|
},
|
|
|
fail: res => {
|
|
|
wx.redirectTo({ url: '/pages/index/index', })
|