Explorar o código

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

zs %!s(int64=2) %!d(string=hai) anos
pai
achega
11dbac55a6

+ 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
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"
 }