|
@@ -100,6 +100,7 @@ Page({
|
|
wx.showLoading({ title: '加载中', mask: true })
|
|
wx.showLoading({ title: '加载中', mask: true })
|
|
//验证规则函数
|
|
//验证规则函数
|
|
that.initValidate();
|
|
that.initValidate();
|
|
|
|
+ await that.searchUser()
|
|
await that.searchOther()
|
|
await that.searchOther()
|
|
await that.search()
|
|
await that.search()
|
|
wx.hideLoading()
|
|
wx.hideLoading()
|
|
@@ -109,39 +110,42 @@ Page({
|
|
const messages = { match_name: { required: '请输入比赛名称' }, team_name: { required: '请输入团队名称' } };
|
|
const messages = { match_name: { required: '请输入比赛名称' }, team_name: { required: '请输入团队名称' } };
|
|
this.WxValidate = new WxValidate(rules, messages)
|
|
this.WxValidate = new WxValidate(rules, messages)
|
|
},
|
|
},
|
|
- // 查询其他信息
|
|
|
|
- async searchOther() {
|
|
|
|
- const that = this;
|
|
|
|
- let res;
|
|
|
|
- // 团队
|
|
|
|
- res = await app.$api('team', 'GET', { administrator: that.data.user._id, status: '1' })
|
|
|
|
- if (res.errcode == '0') that.setData({ teamList: res.data })
|
|
|
|
- },
|
|
|
|
- search() {
|
|
|
|
|
|
+ async searchUser() {
|
|
const that = this;
|
|
const that = this;
|
|
wx.getStorage({
|
|
wx.getStorage({
|
|
key: 'user',
|
|
key: 'user',
|
|
async success(res) {
|
|
async success(res) {
|
|
that.setData({ user: res.data })
|
|
that.setData({ user: res.data })
|
|
- if (that.data.id) {
|
|
|
|
- let arr = await app.$api(`application/${that.data.id}`, 'GET', {})
|
|
|
|
- if (arr.errcode == '0') {
|
|
|
|
- let data = that.data.teamList.find(i => i._id == arr.data.team_id);
|
|
|
|
- if (data) that.setData({ userList: data.member })
|
|
|
|
- that.setData({ form: arr.data, memberList: arr.data.user_id })
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- let aee = await app.$api(`match/${that.data.match_id}`, 'GET', {})
|
|
|
|
- if (aee.errcode == '0') {
|
|
|
|
- that.setData({ 'form.match_id': aee.data._id, 'form.match_name': aee.data.name })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
fail(err) {
|
|
fail(err) {
|
|
// console.log(err);
|
|
// console.log(err);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 查询其他信息
|
|
|
|
+ async searchOther() {
|
|
|
|
+ const that = this;
|
|
|
|
+ let res;
|
|
|
|
+ // 团队
|
|
|
|
+ res = await app.$api('team', 'GET', { administrator: that.data.user._id, status: '1' })
|
|
|
|
+ if (res.errcode == '0') that.setData({ teamList: res.data })
|
|
|
|
+ },
|
|
|
|
+ async search() {
|
|
|
|
+ const that = this;
|
|
|
|
+ if (that.data.id) {
|
|
|
|
+ let arr = await app.$api(`application/${that.data.id}`, 'GET', {})
|
|
|
|
+ if (arr.errcode == '0') {
|
|
|
|
+ let data = that.data.teamList.find(i => i._id == arr.data.team_id);
|
|
|
|
+ if (data) that.setData({ userList: data.member })
|
|
|
|
+ that.setData({ form: arr.data, memberList: arr.data.user_id })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ let aee = await app.$api(`match/${that.data.match_id}`, 'GET', {})
|
|
|
|
+ if (aee.errcode == '0') {
|
|
|
|
+ that.setData({ 'form.match_id': aee.data._id, 'form.match_name': aee.data.name })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
* 生命周期函数--监听页面初次渲染完成
|