|
@@ -17,7 +17,9 @@ Page({
|
|
|
// 弹框
|
|
|
dialog: { title: '详细信息', show: false, type: '1' },
|
|
|
//详情
|
|
|
- form: {}
|
|
|
+ form: {},
|
|
|
+ // 状态
|
|
|
+ statusList: [{ label: '未开始', value: '0' }, { label: '进行中', value: '1' }, { label: '已结束', value: '2' }],
|
|
|
},
|
|
|
back: function () {
|
|
|
wx.navigateBack({ url: '/pages/matchadmin/index' })
|
|
@@ -37,8 +39,33 @@ Page({
|
|
|
that.setData({ dialog: { title: '详细信息', show: true, type: '1' } })
|
|
|
}
|
|
|
},
|
|
|
- //维护
|
|
|
- toEdit: function () {
|
|
|
+ //比赛进度
|
|
|
+ toEdit: async function (e) {
|
|
|
+ const that = this;
|
|
|
+ let { id } = e.currentTarget.dataset;
|
|
|
+ const arr = await app.$get(`/courtAdmin/api/schedule/${id}`);
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ that.setData({ form: arr.data })
|
|
|
+ that.setData({ dialog: { title: '比赛进度', show: true, type: '2' } })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 选择状态
|
|
|
+ statusChange: function (e) {
|
|
|
+ const that = this;
|
|
|
+ const { value } = e.detail;
|
|
|
+ that.setData({ 'form.status': value })
|
|
|
+ },
|
|
|
+ // 提交
|
|
|
+ onSubmit: async function (e) {
|
|
|
+ const that = this;
|
|
|
+ const data = that.data.form;
|
|
|
+ const params = e.detail.value;
|
|
|
+ const arr = await app.$post(`/courtAdmin/api/schedule/${data.id}`, params);
|
|
|
+ if (arr.errcode == '0') {
|
|
|
+ wx.showToast({ title: `维护信息成功`, icon: 'error', duration: 2000 });
|
|
|
+ that.toClose();
|
|
|
+ that.watchLogin();
|
|
|
+ } else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
|
|
|
},
|
|
|
// 维护赛程信息
|
|
|
toRace: function (e) {
|