|
@@ -95,6 +95,7 @@ Page({
|
|
|
that.setData({ id: options.id || '62e388d4fd61d871861b80af' });
|
|
|
|
|
|
that.watchLogin();
|
|
|
+ that.search()
|
|
|
},
|
|
|
watchLogin: function () {
|
|
|
const that = this;
|
|
@@ -102,35 +103,38 @@ Page({
|
|
|
key: 'user',
|
|
|
success: async (res) => {
|
|
|
that.setData({ user: res.data })
|
|
|
- if (that.data.id) {
|
|
|
- let arr;
|
|
|
-
|
|
|
- arr = await app.$get(`/newCourt/api/match/${that.data.id}`);
|
|
|
- if (arr.errcode == '0') {
|
|
|
- arr.data.statusZh = that.getStatusZh(arr.data.status);
|
|
|
- that.setData({ info: arr.data })
|
|
|
- } else { wx.showToast({ title: `${res.errmsg}`, icon: 'fail', duration: 2000 }); }
|
|
|
-
|
|
|
- arr = await app.$get(`/newCourt/api/view/groupProjectUser?match_id=${that.data.id}`);
|
|
|
- if (arr.errcode == '0') { that.setData({ groupList: arr.data }) };
|
|
|
-
|
|
|
- arr = await app.$get(`/newCourt/api/ground`, { is_use: '0' });
|
|
|
- let ground = [{ title: '全部场地', name: 0 }]
|
|
|
- if (arr.errcode == '0') {
|
|
|
- for (const [index, val] of arr.data.entries()) {
|
|
|
- ground.push({ title: val.name, name: index + 1, _id: val._id })
|
|
|
- }
|
|
|
- }
|
|
|
- that.setData({ 'dtabs.list': ground })
|
|
|
-
|
|
|
- that.searchOrder();
|
|
|
- }
|
|
|
},
|
|
|
fail: async (res) => {
|
|
|
- wx.redirectTo({ url: '/pages/index/index' });
|
|
|
+ wx.showToast({ title: `暂无登陆信息`, icon: 'fail', duration: 2000 });
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
+ search: async function () {
|
|
|
+ const that = this;
|
|
|
+ if (that.data.id) {
|
|
|
+ let arr;
|
|
|
+
|
|
|
+ arr = await app.$get(`/newCourt/api/match/${that.data.id}`);
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ arr.data.statusZh = that.getStatusZh(arr.data.status);
|
|
|
+ that.setData({ info: arr.data })
|
|
|
+ } else { wx.showToast({ title: `${res.errmsg}`, icon: 'fail', duration: 2000 }); }
|
|
|
+
|
|
|
+ arr = await app.$get(`/newCourt/api/view/groupProjectUser?match_id=${that.data.id}`);
|
|
|
+ if (arr.errcode == '0') { that.setData({ groupList: arr.data }) };
|
|
|
+
|
|
|
+ arr = await app.$get(`/newCourt/api/ground`, { is_use: '0' });
|
|
|
+ let ground = [{ title: '全部场地', name: 0 }]
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ for (const [index, val] of arr.data.entries()) {
|
|
|
+ ground.push({ title: val.name, name: index + 1, _id: val._id })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.setData({ 'dtabs.list': ground })
|
|
|
+
|
|
|
+ that.searchOrder();
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
searchOrder: async function () {
|
|
|
wx.showLoading({ title: '加载中', mask: true })
|