|
@@ -36,7 +36,6 @@ Page({
|
|
return false
|
|
return false
|
|
} else {
|
|
} else {
|
|
let arr;
|
|
let arr;
|
|
- console.log(params);
|
|
|
|
if (params._id) { arr = await app.$post(`/matchGroup/${params._id}`, params, 'race') }
|
|
if (params._id) { arr = await app.$post(`/matchGroup/${params._id}`, params, 'race') }
|
|
else { arr = await app.$post(`/matchGroup`, params, 'race') }
|
|
else { arr = await app.$post(`/matchGroup`, params, 'race') }
|
|
if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
|
|
if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
|
|
@@ -51,9 +50,17 @@ Page({
|
|
that.setData({ id: options.id || '' })
|
|
that.setData({ id: options.id || '' })
|
|
//验证规则函数
|
|
//验证规则函数
|
|
that.initValidate();
|
|
that.initValidate();
|
|
|
|
+ // 查询其他信息
|
|
|
|
+ await that.searchOther();
|
|
// 监听用户是否登录
|
|
// 监听用户是否登录
|
|
await that.watchLogin();
|
|
await that.watchLogin();
|
|
},
|
|
},
|
|
|
|
+ searchOther: async function () {
|
|
|
|
+ const that = this;
|
|
|
|
+ let arr;
|
|
|
|
+ arr = await app.$get(`/match`, { status: "0" }, 'race');
|
|
|
|
+ if (arr.errcode == '0') that.setData({ matchList: arr.data })
|
|
|
|
+ },
|
|
// 监听用户是否登录
|
|
// 监听用户是否登录
|
|
watchLogin: async function () {
|
|
watchLogin: async function () {
|
|
const that = this;
|
|
const that = this;
|
|
@@ -61,8 +68,6 @@ Page({
|
|
wx.getStorage({
|
|
wx.getStorage({
|
|
key: 'user',
|
|
key: 'user',
|
|
success: async res => {
|
|
success: async res => {
|
|
- let match = await app.$get(`/match`, {}, 'race');
|
|
|
|
- if (match.arrcode == '0') that.setData({ matchList: match.data })
|
|
|
|
if (that.data.id) {
|
|
if (that.data.id) {
|
|
let arr = await app.$get(`/matchGroup/${that.data.id}`, {}, 'race');
|
|
let arr = await app.$get(`/matchGroup/${that.data.id}`, {}, 'race');
|
|
if (arr.errcode == '0') {
|
|
if (arr.errcode == '0') {
|