zs 2 роки тому
батько
коміт
4a33c97533

+ 8 - 2
pagesMatch/matchAdmin/group/add.js

@@ -50,9 +50,17 @@ Page({
         that.setData({ id: options.id || '' })
         //验证规则函数
         that.initValidate();
+        // 查询其他信息
+        await that.searchOther();
         // 监听用户是否登录
         await that.watchLogin();
     },
+    searchOther: async function () {
+        const that = this;
+        let arr;
+        arr = await app.$get(`/match`, { status: "0" }, 'race');
+        if (arr.errcode == '0') that.setData({ matchList: arr.data })
+    },
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
@@ -60,8 +68,6 @@ Page({
         wx.getStorage({
             key: 'user',
             success: async res => {
-                let match = await app.$get(`/match`, { status: "0" }, 'race');
-                if (match.errcode == '0') that.setData({ matchList: match.data })
                 if (that.data.id) {
                     let arr = await app.$get(`/matchGroup/${that.data.id}`, {}, 'race');
                     if (arr.errcode == '0') {

+ 3 - 0
pagesMatch/matchAdmin/group/list.less

@@ -68,6 +68,9 @@
             .btn {
                 margin: 2vw 0 0 0;
                 text-align: center;
+                button {
+                    margin: 0 2vw;
+                }
             }
         }
 

+ 1 - 1
pagesMatch/matchAdmin/group/list.wxml

@@ -16,7 +16,7 @@
                         <view class="other">
                             <view class="other_1">
                                 <text>比赛名称:</text>
-                                <text>{{item.match_name}}</text>
+                                <text>{{item.match_id_name}}</text>
                             </view>
                             <view class="other_1">
                                 <text>年龄限制:</text>

+ 3 - 0
pagesMatch/matchAdmin/group/list.wxss

@@ -59,6 +59,9 @@
   margin: 2vw 0 0 0;
   text-align: center;
 }
+.main .two .list .btn button {
+  margin: 0 2vw;
+}
 .scroll-view {
   position: absolute;
   top: 0;

+ 7 - 5
pagesMatch/matchAdmin/project/add.js

@@ -98,12 +98,8 @@ Page({
         wx.getStorage({
             key: 'user',
             success: async res => {
-                let match = await app.$get(`/match`, { status: "0" }, 'race');
-                if (match.errcode == '0') that.setData({ matchList: match.data })
-                let group = await app.$get(`/matchGroup`, {}, 'race');
-                if (group.errcode == '0') that.setData({ groupList: group.data })
                 if (that.data.id) {
-                    let arr = await app.$get(`/matchProject/${that.data.id}`, 'race');
+                    let arr = await app.$get(`/matchProject/${that.data.id}`, {}, 'race');
                     if (arr.errcode == '0') {
                         // 比赛名称
                         let match = matchList.find(i => i._id == arr.data.match_id);
@@ -136,6 +132,12 @@ Page({
         // 项目类别
         arr = await app.$get(`/dict`, { code: 'match_project_type' });
         if (arr.errcode == '0' && arr.total > 0) that.setData({ typeList: arr.data[0].list });
+        // 比赛
+        arr = await app.$get(`/match`, { status: "0" }, 'race');
+        if (arr.errcode == '0') that.setData({ matchList: arr.data })
+        // 组别
+        arr = await app.$get(`/matchGroup`, {}, 'race');
+        if (arr.errcode == '0') that.setData({ groupList: arr.data })
     },
     /**
      * 生命周期函数--监听页面初次渲染完成

+ 5 - 0
pagesMatch/matchAdmin/project/list.less

@@ -30,6 +30,7 @@
             }
         }
     }
+
     .two {
         flex-grow: 1;
         position: relative;
@@ -67,6 +68,10 @@
             .btn {
                 margin: 2vw 0 0 0;
                 text-align: center;
+
+                button {
+                    margin: 0 2vw;
+                }
             }
         }
 

+ 1 - 1
pagesMatch/matchAdmin/project/list.wxml

@@ -16,7 +16,7 @@
                         <view class="other">
                             <view class="other_1">
                                 <text>赛事名称:</text>
-                                <text>{{item.match_name}}</text>
+                                <text>{{item.match_id_name}}</text>
                             </view>
                             <view class="other_1">
                                 <text>年龄限制:</text>

+ 3 - 0
pagesMatch/matchAdmin/project/list.wxss

@@ -59,6 +59,9 @@
   margin: 2vw 0 0 0;
   text-align: center;
 }
+.main .two .list .btn button {
+  margin: 0 2vw;
+}
 .scroll-view {
   position: absolute;
   top: 0;