Browse Source

Merge branch 'master' of http://git.cc-lotus.info/ball-court/ball-applet

guhongwei 2 years ago
parent
commit
1c642a01cc

+ 43 - 0
pagesMatch/matchAdmin/elimmatch/add.js

@@ -121,6 +121,7 @@ Page({
         that.setData({ match_id: options.match_id, group_id: options.group_id, project_id: options.project_id })
         await this.search();
         await this.searchUser();
+        that.searchLevel();
     },
     /**
      * 查询函数
@@ -161,6 +162,48 @@ Page({
             this.setTopPlayerName();
         }
     },
+    searchLevel: function (e) {
+        const that = this;
+        let nodes = that.data.winData.nodes;
+        nodes = nodes.filter(f => !f.id.includes('l'));
+        let mls = nodes.map(i => i.level);
+        let marr = [];
+        for (const i of mls) {
+            if (!marr.includes(i)) marr.push(i)
+        }
+        const group = marr.map(i => {
+            const list = nodes.filter(f => f.level == i)
+            return list;
+        })
+        const schList = that.data.schList;
+        for (const i of nodes) {
+            const { level, id } = i;
+            const r1 = group.find(f => f[0].level == level)
+            let J1 = r1.length, J2 = J1 / 2;
+            const r2 = schList.find(f => f.player_one_node == id)
+            if (!r2) continue;
+            r2.J1 = J1, r2.J2 = J2;
+        }
+        // let levels = {};
+        // for (const val of nodes) {
+        //     let level = val.level;
+        //     levels[level];
+        //     if (levels[level]) {
+        //         levels[level].push(val);
+        //     } else {
+        //         let dui = [val];
+        //         levels[level] = dui;
+        //     }
+        // }
+        // for (const val of nodes) {
+        //     let level = val.level;
+        //     let node = schList.find((i) => i.player_one_node == val.id);
+        //     let J1 = levels[level].length;
+        //     let J2 = levels[level].length / 2;
+        //     if (node) node.J1 = J1, node.J2 = J2;
+        // }
+        that.setData({ schList: schList })
+    },
     /**
      * 同步图与赛程的人名
      * @param {Object} data 赛程数据

+ 7 - 0
pagesMatch/matchAdmin/elimmatch/add.wxml

@@ -35,6 +35,13 @@
                                                 <view>{{s.zhStatus||'暂无状态'}}</view>
                                             </view>
                                         </view>
+                                        <view class="change" wx:if="{{s.J1&&s.J2}}">
+                                            <view class="change_1 textOver" style="color: green;">
+                                                <text>{{s.J1}}</text>
+                                                进
+                                                <text>{{s.J2}}</text>
+                                            </view>
+                                        </view>
                                         <view class="name">
                                             <view class="name_1">{{s.player_one_name || s.player_one_node}}</view>
                                             <view> <text style="color: red;">PK</text></view>

+ 1 - 1
pagesMatch/system/index.js

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

+ 13 - 13
pagesMatch/userAdmin/schedule/list.js

@@ -79,19 +79,19 @@ Page({
         wx.getStorage({
             key: 'raceuser',
             success: async res => {
-                if (tabs.active == 'a') {
-                    let info = { skip: that.data.skip, limit: that.data.limit, user_id: res.data._id };
-                    let arr = await app.$get(`/msgs`, { ...info }, 'race');
-                    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 }) }
-                }
+                let arr;
+                let info = { skip: that.data.skip, limit: that.data.limit, user_id: res.data._id };
+                if (tabs.active == 'a') arr = await app.$get(`/msgs`, { ...info }, 'race');
+                if (tabs.active == 'b') arr = await app.$get(`/eliminate`, { ...info }, 'race');
+                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 }) }
             },
             fail: async res => {
                 wx.redirectTo({ url: '/pages/index/index' })

+ 1 - 1
project.private.config.json

@@ -1,7 +1,7 @@
 {
     "projectname": "%E7%BE%BD%E6%A0%A1%E7%AE%A1%E7%90%86%E5%B9%B3%E5%8F%B0",
     "setting": {
-        "compileHotReLoad": false
+        "compileHotReLoad": true
     },
     "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
 }