|
@@ -56,24 +56,22 @@ Page({
|
|
|
fieldtabsChange: async function (e) {
|
|
|
const that = this;
|
|
|
let match = that.data.info;
|
|
|
- const { active } = e.detail;
|
|
|
+ if (e.detail) var active = e.detail;
|
|
|
+ if (e.detail == 0) var active = 0;
|
|
|
that.setData({ 'fieldtabs.active': active });
|
|
|
that.setData({ active: active });
|
|
|
let address = that.data.fieldtabs.menu.find((i) => i.active == active);
|
|
|
if (address && address.menu != 0) {
|
|
|
let arr;
|
|
|
- if (address._id == '') arr = await app.$get(`/msgs`, { match: match._id }, 'race');
|
|
|
- else arr = await app.$get(`/msgs`, { match: match._id, address_id: address._id }, 'race');
|
|
|
+ if (address._id == '') arr = await app.$get(`/msgs`, { match_id: match._id }, 'race');
|
|
|
+ else arr = await app.$get(`/msgs`, { match_id: match._id, address_id: address._id }, 'race');
|
|
|
if (arr.errcode == '0') that.setData({ matchList: arr.data });
|
|
|
else wx.showToast({ title: `${arr.errmsg}`, icon: 'fail', duration: 2000 });
|
|
|
}
|
|
|
},
|
|
|
// 赛况详情
|
|
|
toCommon: function (e) {
|
|
|
- const that = this;
|
|
|
- const { item, route } = e.currentTarget.dataset;
|
|
|
- that.setData({ skip: 0, page: 0, list: [] });
|
|
|
- wx.navigateTo({ url: `/pagesMatch/${route}?id=${item && item._id ? item._id : ''}` })
|
|
|
+ wx.navigateTo({ url: `/pagesMatch/userAdmin/schedule/sinfo?id=${e.detail._id}` })
|
|
|
},
|
|
|
//比赛报名
|
|
|
toSign: function (e) {
|
|
@@ -128,16 +126,6 @@ Page({
|
|
|
// 赛制列表
|
|
|
arr = await app.$get(`/dict`, { code: "match_format" });
|
|
|
if (arr.errcode == '0' && arr.total > 0) that.setData({ formatList: arr.data[0].list });
|
|
|
- // 场地
|
|
|
- arr = await app.$get(`/matchAddress`, { is_use: '0' }, 'race');
|
|
|
- if (arr.errcode == '0') {
|
|
|
- let groundList = []
|
|
|
- arr.data.unshift({ _id: '', title: '全部场地', active: '0' });
|
|
|
- for (const [index, val] of arr.data.entries()) {
|
|
|
- groundList.push({ _id: val._id, title: val.title || val.name, active: index })
|
|
|
- }
|
|
|
- that.setData({ 'fieldtabs.menu': groundList })
|
|
|
- }
|
|
|
arr = await app.$get(`/dict`, { code: "gender" });
|
|
|
if (arr.errcode == '0' && arr.total > 0) that.setData({ genderList: arr.data[0].list });
|
|
|
},
|
|
@@ -174,6 +162,16 @@ Page({
|
|
|
let regular = arr.data.regular.replace(/\<img/gi, '<img style="width:100%;height:auto;margin: 5px 0"');
|
|
|
if (regular) arr.data.zhRegular = regular;
|
|
|
that.setData({ info: arr.data })
|
|
|
+ // 场地
|
|
|
+ let address = await app.$get(`/matchAddress`, { is_use: '0', belong_id: arr.data.belong_id }, 'race');
|
|
|
+ if (address.errcode == '0') {
|
|
|
+ let groundList = []
|
|
|
+ address.data.unshift({ _id: '', title: '全部场地', active: 0 });
|
|
|
+ for (const [index, val] of address.data.entries()) {
|
|
|
+ groundList.push({ _id: val._id, title: val.title || val.name, active: index })
|
|
|
+ }
|
|
|
+ that.setData({ 'fieldtabs.menu': groundList })
|
|
|
+ }
|
|
|
} else { wx.showToast({ title: `${res.errmsg}`, icon: 'fail', duration: 2000 }); }
|
|
|
// 选手
|
|
|
arr = await app.$get(`/match/getAll/${that.data.id}`, {}, 'race');
|