zs 2 år sedan
förälder
incheckning
0db5621ea7

+ 9 - 14
pagesMatch/matchAdmin/mtgroup/auto.js

@@ -3,7 +3,6 @@ import WxValidate from '../../../utils/wxValidate';
 Page({
 Page({
     data: {
     data: {
         frameStyle: { useTop: true, name: '自动建组', leftArrow: true, useBar: false },
         frameStyle: { useTop: true, name: '自动建组', leftArrow: true, useBar: false },
-        raceuser: {},
         list: [],
         list: [],
         dialog: { title: '审核申请', show: false, type: '1' },
         dialog: { title: '审核申请', show: false, type: '1' },
         form: {},
         form: {},
@@ -115,7 +114,7 @@ Page({
             that.setData({ memberList: mem });
             that.setData({ memberList: mem });
             wx.showToast({ title: `小组赛维护信息完成`, icon: 'success', duration: 2000 });
             wx.showToast({ title: `小组赛维护信息完成`, icon: 'success', duration: 2000 });
             that.toClose();
             that.toClose();
-            that.watchLogin(list);
+            that.searchOther(list);
         }
         }
     },
     },
     //自动生成
     //自动生成
@@ -124,9 +123,8 @@ Page({
         const params = e.detail.value;
         const params = e.detail.value;
         const arr = await app.$post(`/matchTeamGroup/auto`, params, 'race');
         const arr = await app.$post(`/matchTeamGroup/auto`, params, 'race');
         if (arr.errcode == '0') {
         if (arr.errcode == '0') {
-            wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 });
             that.toClose();
             that.toClose();
-            that.watchLogin(arr.data);
+            that.searchOther(arr.data);
         }
         }
         else wx.showToast({ title: `${arr.errmsg}`, icon: 'none', duration: 2000 })
         else wx.showToast({ title: `${arr.errmsg}`, icon: 'none', duration: 2000 })
     },
     },
@@ -170,25 +168,22 @@ Page({
      */
      */
     onShow: async function () {
     onShow: async function () {
         const that = this;
         const that = this;
-        // 查询其他信息
-        await that.searchOther();
         // 监听用户是否登录
         // 监听用户是否登录
-        await that.watchLogin();
+        that.watchLogin();
     },
     },
-    searchOther: async function () {
+    searchOther: async function (e) {
         const that = this;
         const that = this;
-        const raceuser = that.data.raceuser;
-        let arr;
-        arr = await app.$get(`/match`, { belong_id: raceuser._id }, 'race');
-        if (arr.errcode == '0') that.setData({ matchList: arr.data });
+        that.setData({ list: e });
     },
     },
     // 监听用户是否登录
     // 监听用户是否登录
-    watchLogin: async function (e) {
+    watchLogin: async function () {
         const that = this;
         const that = this;
         wx.getStorage({
         wx.getStorage({
             key: 'raceuser',
             key: 'raceuser',
             success: async res => {
             success: async res => {
-                that.setData({ list: e, raceuser: res.data });
+                let arr;
+                arr = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
+                if (arr.errcode == '0') that.setData({ matchList: arr.data });
             },
             },
             fail: async res => {
             fail: async res => {
                 wx.redirectTo({ url: '/pages/index/index' })
                 wx.redirectTo({ url: '/pages/index/index' })

+ 9 - 4
pagesMatch/matchAdmin/mtgroup/auto.less

@@ -79,13 +79,18 @@
         .value {
         .value {
             flex-grow: 1;
             flex-grow: 1;
             color: var(--blackColor);
             color: var(--blackColor);
-
-            .label {
+            width: 20vw;
+            .checkbox {
                 display: flex;
                 display: flex;
                 flex-direction: row;
                 flex-direction: row;
-                margin: 0 0 1vw 0;
-            }
+                flex-wrap: wrap;
 
 
+                .member {
+                    width: 23vw;
+                    margin: 0 1vw 0 0;
+                    text-align: center;
+                }
+            }
         }
         }
     }
     }
 
 

+ 3 - 4
pagesMatch/matchAdmin/mtgroup/auto.wxml

@@ -83,11 +83,10 @@
                     <view class="label">成员:</view>
                     <view class="label">成员:</view>
                     <view class="value">
                     <view class="value">
                         <checkbox-group bindchange="checkboxChange">
                         <checkbox-group bindchange="checkboxChange">
-                            <label class="label" wx:for="{{form.member}}" wx:key="{{item.user_id}}">
-                                <view>
-                                    <checkbox value="{{item.user_id}}" checked="{{item.checked}}" />
+                            <label class="checkbox">
+                                <view class="member" wx:for="{{form.member}}" wx:key="{{item.user_id}}">
+                                    <checkbox value="{{item.user_id}}" checked="{{item.checked}}" />{{item.user_name}}
                                 </view>
                                 </view>
-                                <view class="name">{{item.user_name}}</view>
                             </label>
                             </label>
                         </checkbox-group>
                         </checkbox-group>
                     </view>
                     </view>

+ 8 - 2
pagesMatch/matchAdmin/mtgroup/auto.wxss

@@ -65,11 +65,17 @@
 .dialog_1 .content .value {
 .dialog_1 .content .value {
   flex-grow: 1;
   flex-grow: 1;
   color: var(--blackColor);
   color: var(--blackColor);
+  width: 20vw;
 }
 }
-.dialog_1 .content .value .label {
+.dialog_1 .content .value .checkbox {
   display: flex;
   display: flex;
   flex-direction: row;
   flex-direction: row;
-  margin: 0 0 1vw 0;
+  flex-wrap: wrap;
+}
+.dialog_1 .content .value .checkbox .member {
+  width: 23vw;
+  margin: 0 1vw 0 0;
+  text-align: center;
 }
 }
 .dialog_1 .btn {
 .dialog_1 .btn {
   text-align: center;
   text-align: center;

+ 1 - 1
pagesMatch/system/index.js

@@ -49,7 +49,7 @@ Page({
                     const aee = await app.$get(`/user/${arr.data.user_id}`);
                     const aee = await app.$get(`/user/${arr.data.user_id}`);
                     if (aee.errcode == '0') { arr.data.user_id = aee.data; }
                     if (aee.errcode == '0') { arr.data.user_id = aee.data; }
                     that.setData({ user: arr.data })
                     that.setData({ user: arr.data })
-                    let btnData = match_menu.find((i) => i.type == arr.data.type);
+                    let btnData = match_menu.find((i) => i.type == '1');
                     that.setData({ list: [...btnData.menu, ...school_sysmenu] })
                     that.setData({ list: [...btnData.menu, ...school_sysmenu] })
                 }
                 }
                 else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }); }
                 else { wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 }); }