|
@@ -3,7 +3,6 @@ import WxValidate from '../../../utils/wxValidate';
|
|
Page({
|
|
Page({
|
|
data: {
|
|
data: {
|
|
frameStyle: { useTop: true, name: '自动建组', leftArrow: true, useBar: false },
|
|
frameStyle: { useTop: true, name: '自动建组', leftArrow: true, useBar: false },
|
|
- raceuser: {},
|
|
|
|
list: [],
|
|
list: [],
|
|
dialog: { title: '审核申请', show: false, type: '1' },
|
|
dialog: { title: '审核申请', show: false, type: '1' },
|
|
form: {},
|
|
form: {},
|
|
@@ -115,7 +114,7 @@ Page({
|
|
that.setData({ memberList: mem });
|
|
that.setData({ memberList: mem });
|
|
wx.showToast({ title: `小组赛维护信息完成`, icon: 'success', duration: 2000 });
|
|
wx.showToast({ title: `小组赛维护信息完成`, icon: 'success', duration: 2000 });
|
|
that.toClose();
|
|
that.toClose();
|
|
- that.watchLogin(list);
|
|
|
|
|
|
+ that.searchOther(list);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//自动生成
|
|
//自动生成
|
|
@@ -124,9 +123,8 @@ Page({
|
|
const params = e.detail.value;
|
|
const params = e.detail.value;
|
|
const arr = await app.$post(`/matchTeamGroup/auto`, params, 'race');
|
|
const arr = await app.$post(`/matchTeamGroup/auto`, params, 'race');
|
|
if (arr.errcode == '0') {
|
|
if (arr.errcode == '0') {
|
|
- wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 });
|
|
|
|
that.toClose();
|
|
that.toClose();
|
|
- that.watchLogin(arr.data);
|
|
|
|
|
|
+ that.searchOther(arr.data);
|
|
}
|
|
}
|
|
else wx.showToast({ title: `${arr.errmsg}`, icon: 'none', duration: 2000 })
|
|
else wx.showToast({ title: `${arr.errmsg}`, icon: 'none', duration: 2000 })
|
|
},
|
|
},
|
|
@@ -170,25 +168,22 @@ Page({
|
|
*/
|
|
*/
|
|
onShow: async function () {
|
|
onShow: async function () {
|
|
const that = this;
|
|
const that = this;
|
|
- // 查询其他信息
|
|
|
|
- await that.searchOther();
|
|
|
|
// 监听用户是否登录
|
|
// 监听用户是否登录
|
|
- await that.watchLogin();
|
|
|
|
|
|
+ that.watchLogin();
|
|
},
|
|
},
|
|
- searchOther: async function () {
|
|
|
|
|
|
+ searchOther: async function (e) {
|
|
const that = this;
|
|
const that = this;
|
|
- const raceuser = that.data.raceuser;
|
|
|
|
- let arr;
|
|
|
|
- arr = await app.$get(`/match`, { belong_id: raceuser._id }, 'race');
|
|
|
|
- if (arr.errcode == '0') that.setData({ matchList: arr.data });
|
|
|
|
|
|
+ that.setData({ list: e });
|
|
},
|
|
},
|
|
// 监听用户是否登录
|
|
// 监听用户是否登录
|
|
- watchLogin: async function (e) {
|
|
|
|
|
|
+ watchLogin: async function () {
|
|
const that = this;
|
|
const that = this;
|
|
wx.getStorage({
|
|
wx.getStorage({
|
|
key: 'raceuser',
|
|
key: 'raceuser',
|
|
success: async res => {
|
|
success: async res => {
|
|
- that.setData({ list: e, raceuser: res.data });
|
|
|
|
|
|
+ let arr;
|
|
|
|
+ arr = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
|
|
|
|
+ if (arr.errcode == '0') that.setData({ matchList: arr.data });
|
|
},
|
|
},
|
|
fail: async res => {
|
|
fail: async res => {
|
|
wx.redirectTo({ url: '/pages/index/index' })
|
|
wx.redirectTo({ url: '/pages/index/index' })
|