lrf 2 år sedan
förälder
incheckning
e2d599ecba

+ 24 - 4
commpents/pagesMatchs/achieve/achieve-1.js

@@ -1,23 +1,43 @@
 // commpents/pagesMatchs/achieve/achieve-1.js
+const app = getApp();
 Component({
+    options: { multipleSlots: true },
     /**
      * 组件的属性列表
      */
     properties: {
-
+        options: {
+            type: Object, observer: function (e) {
+                this.search()
+            }
+        }
     },
 
+    lifetimes: {
+        attached: async function () {
+            // 在组件实例进入页面节点树时执行
+
+        },
+        detached: function () {
+            // 在组件实例被从页面节点树移除时执行
+        },
+    },
     /**
      * 组件的初始数据
      */
     data: {
-
+        teamList: []
     },
 
     /**
      * 组件的方法列表
      */
     methods: {
-
-    }
+        async search() {
+            const keys = Object.keys(this.properties.options)
+            if (keys.length <= 0) return;
+            const res = await app.$get('/msgs/result', this.properties.options, 'race')
+            if (res.errcode == '0') this.setData({ teamList: res.data })
+        }
+    },
 })

+ 57 - 14
commpents/pagesMatchs/achieve/achieve-1.less

@@ -1,21 +1,64 @@
-@import (css) "/app.wxss";
+.ranking {
+    margin: 0 0 2vw 0;
 
-.main {
-    .one {
+    .name {
+        font-size: 14px;
+        font-weight: bold;
         padding: 2vw;
-        background-color: var(--f1Color);
+        background-color: #39434d;
+        color: #fff;
+        text-align: center;
     }
+
+    .view_1 {
+        width: 96vw;
+        margin: 0 0 2vw 0;
+    }
+}
+
+/* 表格代码   */
+.table {
+    border: 1px solid #dadada;
+    border-right: 0;
+    border-bottom: 0;
+    width: 95.6vw;
 }
 
-.scroll-view {
-    position: absolute;
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
+.tr {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    overflow-x: scroll;
+}
 
-    .list-scroll-view {
-        display: flex;
-        flex-direction: column;
-    }
+.th,
+.td {
+    padding: 10px;
+    border-bottom: 1px solid #dadada;
+    border-right: 1px solid #dadada;
+    border-left: 1px solid #dadada;
+    text-align: center;
+    width: 100%;
+}
+
+.th1,
+.th2,
+.td1,
+.td2 {
+    width: 50%;
+}
+
+.th {
+    width: 20vw;
+    font-size: 13px;
+    font-weight: 800;
+    overflow: hidden;
+    word-break: break-all;
+}
+
+.td {
+    width: 20vw;
+    font-size: 13px;
+    overflow: hidden;
+    word-break: break-all;
 }

+ 25 - 6
commpents/pagesMatchs/achieve/achieve-1.wxml

@@ -1,9 +1,28 @@
-<view class="main">
-    <scroll-view scroll-y="true" class="scroll-view">
-        <view class="list-scroll-view">
-            <view class="one">
-                小组赛
+<view class='history-table-wrap'>
+    <view class="ranking" wx:for="{{teamList}}" wx:for-item="t" wx:key="team_id">
+        <view class="name">{{t.team_name}}</view>
+        <view class="view_1">
+            <view class="tr" wx:for="{{t.table}}" wx:for-item="i">
+                <view class="th th1" wx:if="{{index===0}}"></view>
+                <view class="th th1" wx:for="{{i}}" wx:for-item="ii" wx:key="ii">{{ii||''}}</view>
             </view>
         </view>
-    </scroll-view>
+
+
+        <view class="table">
+            <view class="tr">
+                <view class="th th1">排名</view>
+                <view class="th th2">选手</view>
+                <view class="th th3">胜场</view>
+                <view class="th th3">净胜球</view>
+            </view>
+            <view class="tr" wx:for="{{t.score}}" wx:for-item="tp" wx:key="player_id">
+                <view class="td td1">{{index+1}}</view>
+                <view class="td td2">{{tp.player_name}}</view>
+                <view class="td td3">{{tp.win}}</view>
+                <view class="td td3">{{tp.score}}</view>
+            </view>
+        </view>
+    </view>
+
 </view>

+ 57 - 16
commpents/pagesMatchs/achieve/achieve-1.wxss

@@ -1,16 +1,57 @@
-@import "/app.wxss";
-.main .one {
-  padding: 2vw;
-  background-color: var(--f1Color);
-}
-.scroll-view {
-  position: absolute;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-}
-.scroll-view .list-scroll-view {
-  display: flex;
-  flex-direction: column;
-}
+.ranking {
+    margin: 0 0 2vw 0;
+  }
+  .ranking .name {
+    font-size: 14px;
+    font-weight: bold;
+    padding: 2vw;
+    background-color: #39434d;
+    color: #fff;
+    text-align: center;
+  }
+  .ranking .view_1 {
+    width: 96vw;
+    margin: 0 0 2vw 0;
+  }
+  /* 表格代码   */
+  .table {
+    border: 1px solid #dadada;
+    border-right: 0;
+    border-bottom: 0;
+    width: 95.6vw;
+  }
+  .tr {
+    width: 100%;
+    display: flex;
+    justify-content: space-between;
+    overflow-x: scroll;
+  }
+  .th,
+  .td {
+    padding: 10px;
+    border-bottom: 1px solid #dadada;
+    border-right: 1px solid #dadada;
+    border-left: 1px solid #dadada;
+    text-align: center;
+    width: 100%;
+  }
+  .th1,
+  .th2,
+  .td1,
+  .td2 {
+    width: 50%;
+  }
+  .th {
+    width: 20vw;
+    font-size: 13px;
+    font-weight: 800;
+    overflow: hidden;
+    word-break: break-all;
+  }
+  .td {
+    width: 20vw;
+    font-size: 13px;
+    overflow: hidden;
+    word-break: break-all;
+  }
+  

+ 1 - 1
pagesMatch/match/achieve.wxml

@@ -5,7 +5,7 @@
         </view>
         <view class="two">
             <view wx:if="{{tabs.active=='a'}}" class="a">
-                <achieve-1></achieve-1>
+                <achieve-1 options="{{options}}"></achieve-1>
             </view>
             <view wx:elif="{{tabs.active=='b'}}" class="a b">
                 <achieve-2 options="{{options}}"></achieve-2>