zs 2 vuotta sitten
vanhempi
commit
2c643c2cd9
1 muutettua tiedostoa jossa 12 lisäystä ja 12 poistoa
  1. 12 12
      pagesMatch/match/info.js

+ 12 - 12
pagesMatch/match/info.js

@@ -63,8 +63,8 @@ Page({
         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 });
         }
@@ -132,16 +132,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 });
     },
@@ -178,6 +168,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');