|
@@ -30,7 +30,7 @@ Page({
|
|
this.WxValidate = new WxValidate(rules, messages)
|
|
this.WxValidate = new WxValidate(rules, messages)
|
|
},
|
|
},
|
|
// 返回
|
|
// 返回
|
|
- back: function () { wx.navigateBack({ delta: 1 }) },
|
|
|
|
|
|
+ back: function () { wx.navigateBack({ delta: 1 }); wx.setStorage({ key: "match", data: {} }) },
|
|
// 添加
|
|
// 添加
|
|
toAdd: function (e) {
|
|
toAdd: function (e) {
|
|
const that = this;
|
|
const that = this;
|
|
@@ -81,26 +81,33 @@ Page({
|
|
if (match_id && group_id && project_id) {
|
|
if (match_id && group_id && project_id) {
|
|
if (that.data.btn == '2') {
|
|
if (that.data.btn == '2') {
|
|
wx.navigateTo({ url: `/pagesMatch/matchAdmin/elimmatch/add?match_id=${match_id}&group_id=${group_id}&project_id=${project_id}` }); that.toClose();
|
|
wx.navigateTo({ url: `/pagesMatch/matchAdmin/elimmatch/add?match_id=${match_id}&group_id=${group_id}&project_id=${project_id}` }); that.toClose();
|
|
- } else that.search(e.detail.value); that.toClose();
|
|
|
|
|
|
+ } else {
|
|
|
|
+ wx.setStorage({ key: "match", data: e.detail.value })
|
|
|
|
+ that.search(); that.toClose();
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
wx.showToast({ title: '请选择数据', icon: 'error', duration: 2000 })
|
|
wx.showToast({ title: '请选择数据', icon: 'error', duration: 2000 })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
search: async function (e) {
|
|
search: async function (e) {
|
|
const that = this;
|
|
const that = this;
|
|
- let match = that.data.match;
|
|
|
|
let arr;
|
|
let arr;
|
|
- let info = { skip: that.data.skip, limit: that.data.limit, match_id: match.match_id, group_id: match.group_id, project_id: match.project_id };
|
|
|
|
- arr = await app.$get(`http://192.168.1.197:15001/newCourt/race/v2/api/eliminate`, { ...info });
|
|
|
|
- if (arr.errcode == '0') {
|
|
|
|
- let list = [...that.data.list, ...arr.data]
|
|
|
|
- for (const val of list) {
|
|
|
|
- let status = that.data.statusList.find(i => i.value == val.status)
|
|
|
|
- if (status) val.zhStatus = status.label;
|
|
|
|
- }
|
|
|
|
- that.setData({ list })
|
|
|
|
- that.setData({ total: arr.total })
|
|
|
|
- } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
|
|
|
|
|
|
+ wx.getStorage({
|
|
|
|
+ key: 'match',
|
|
|
|
+ success: async res => {
|
|
|
|
+ let info = { skip: that.data.skip, limit: that.data.limit, match_id: res.data.match_id, group_id: res.data.group_id, project_id: res.data.project_id };
|
|
|
|
+ arr = await app.$get(`http://192.168.1.197:15001/newCourt/race/v2/api/eliminate`, { ...info });
|
|
|
|
+ if (arr.errcode == '0') {
|
|
|
|
+ let list = [...that.data.list, ...arr.data]
|
|
|
|
+ for (const val of list) {
|
|
|
|
+ let status = that.data.statusList.find(i => i.value == val.status)
|
|
|
|
+ if (status) val.zhStatus = status.label;
|
|
|
|
+ }
|
|
|
|
+ that.setData({ list })
|
|
|
|
+ that.setData({ total: arr.total })
|
|
|
|
+ } else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }) }
|
|
|
|
+ },
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 赛程上分
|
|
// 赛程上分
|
|
toScore: function (e) {
|
|
toScore: function (e) {
|
|
@@ -119,7 +126,7 @@ Page({
|
|
wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
|
|
wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
|
|
return false
|
|
return false
|
|
} else {
|
|
} else {
|
|
- let arr = await app.$post(`/eliminate/${form.id}`, params,'race');
|
|
|
|
|
|
+ let arr = await app.$post(`/eliminate/${form.id}`, params, 'race');
|
|
if (arr.errcode == '0') {
|
|
if (arr.errcode == '0') {
|
|
wx.showToast({ title: `上分成功`, icon: 'success', duration: 2000 });
|
|
wx.showToast({ title: `上分成功`, icon: 'success', duration: 2000 });
|
|
that.toClose();
|
|
that.toClose();
|
|
@@ -185,7 +192,7 @@ Page({
|
|
let arr;
|
|
let arr;
|
|
arr = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
|
|
arr = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
|
|
if (arr.errcode == '0') { that.setData({ matchList: arr.data }) }
|
|
if (arr.errcode == '0') { that.setData({ matchList: arr.data }) }
|
|
- // if (that.data.match) that.search();
|
|
|
|
|
|
+ that.search();
|
|
},
|
|
},
|
|
fail: async res => {
|
|
fail: async res => {
|
|
wx.redirectTo({ url: '/pages/index/index' })
|
|
wx.redirectTo({ url: '/pages/index/index' })
|