|
@@ -8,9 +8,9 @@ Page({
|
|
|
matchList: []
|
|
|
},
|
|
|
initValidate() {
|
|
|
- const rules = { name: { required: true }, age: { required: false }, explain: { required: false }, match_name: { required: true } }
|
|
|
+ const rules = { name: { required: true }, age: { required: false }, explain: { required: false }, match_id: { required: false } }
|
|
|
// 验证字段的提示信息,若不传则调用默认的信息
|
|
|
- const messages = { name: { required: '未输入名称' }, age: { required: '未输入年龄限制' }, explain: { required: '未输入说明' }, match_name: { required: '未选择比赛名称' } };
|
|
|
+ const messages = { name: { required: '组别名称' }, age: { required: '年龄限制' }, explain: { required: '说明' }, match_id: { required: '比赛名称' } };
|
|
|
this.WxValidate = new WxValidate(rules, messages)
|
|
|
},
|
|
|
// 返回
|
|
@@ -36,10 +36,11 @@ Page({
|
|
|
return false
|
|
|
} else {
|
|
|
let arr;
|
|
|
- if (params._id) { arr = await app.$post(`/matchGroup/${params._id}`, params, 'race') }
|
|
|
- else { arr = await app.$post(`/matchGroup`, params, 'race') }
|
|
|
- if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
|
|
|
- else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
|
|
|
+ console.log(params);
|
|
|
+ // if (params._id) { arr = await app.$post(`/matchGroup/${params._id}`, params, 'race') }
|
|
|
+ // else { arr = await app.$post(`/matchGroup`, params, 'race') }
|
|
|
+ // if (arr.errcode == '0') { wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 }); that.back(); }
|
|
|
+ // else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
|
|
|
}
|
|
|
},
|
|
|
/**
|