lrf 2 years ago
parent
commit
961eb62dcb
3 changed files with 12 additions and 6 deletions
  1. 4 4
      commpents/match-achieve/achieve.js
  2. 7 1
      pages/eliminate/add.js
  3. 1 1
      pages/eliminate/add.wxml

+ 4 - 4
commpents/match-achieve/achieve.js

@@ -56,11 +56,11 @@ Component({
                             if (!race) continue;
                             let left, right;
                             if (race.player_one === player_id) {
-                                left = race.score_one
-                                right = race.score_two
+                                left = race.score_one || 0
+                                right = race.score_two || 0
                             } else {
-                                left = race.score_two
-                                right = race.score_one
+                                left = race.score_two || 0
+                                right = race.score_one || 0
                             }
                             arr.push(`${left}:${right}`)
                         }

+ 7 - 1
pages/eliminate/add.js

@@ -23,13 +23,18 @@ Page({
         // picker
         show: false,
         personList: [],
-        selectNode: undefined
+        selectNode: undefined,
+
+
+        loading: true
 
     },
     // 计算晋级图
     computedTreeData() {
         const getWinnerNumList = this.data.riseList; // 将每个小组取多少人收到1个纯数字的数组中
+        console.log(getWinnerNumList)
         const getWinnerNum = getWinnerNumList.reduce((p, n) => p + n, 0); // 小组赛选取人数: 应该是该比赛项目的 各组选取人数加和
+        console.log(getWinnerNum)
         let level = 1;
         let loop = true;
         while (loop) {
@@ -186,6 +191,7 @@ Page({
         await this.searchWinnerList();
         await this.search();
         await this.searchOthers()
+        this.setData({ loading: false })
     },
     // 查询已安排的数据
     async search() {

+ 1 - 1
pages/eliminate/add.wxml

@@ -1,6 +1,6 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back" bind:tabPath="tabPath">
     <view slot="info" class="container main">
-        <view class="zero one">
+        <view class="zero one" wx:if="{{!loading}}">
             <view wx:if="{{view==='graph'}}">
                 <view class="button">
                     <button type="primary" size="mini" bind:tap="toAutoInitData" wx:if="{{!arrangeData._id}}">自动生成</button>