Bladeren bron

修改排名

zs 3 jaren geleden
bovenliggende
commit
3c2495ee34
2 gewijzigde bestanden met toevoegingen van 9 en 18 verwijderingen
  1. 3 12
      pages/match/info.js
  2. 6 6
      pages/match/info.wxml

+ 3 - 12
pages/match/info.js

@@ -19,16 +19,7 @@ Page({
         // 赛程列表
         scheduleList: [],
         // 榜单
-        rankingList: [
-            {
-                pm: '1',
-                logo: [{ url: '/image/team_1.jpg' }],
-                team_name: '测试战队',
-                sheng: '10',
-                fu: '10',
-                jf: '111'
-            }
-        ],
+        rankingList: [],
         // 状态
         statusList: match_status,
         // 选项卡
@@ -71,8 +62,6 @@ Page({
                 // 查询比赛信息
                 arr = await app.$get(`/courtAdmin/api/match/${that.data.match_id}`)
                 if (arr.errcode == '0') {
-                    console.log(match_status);
-                    console.log(arr);
                     let status = match_status.find((i) => i.label == arr.data.status);
                     if (status) arr.data.status_name = status.value;
                     that.setData({ matchInfo: arr.data })
@@ -81,6 +70,8 @@ Page({
                 if (arr.errcode == '0') that.setData({ matchteamList: arr.data })
                 arr = await app.$get(`/courtAdmin/api/schedule`, { match_id: that.data.match_id });
                 if (arr.errcode == '0') that.setData({ scheduleList: arr.data })
+                arr = await app.$get(`/courtAdmin/api/statistics/match`, { match_id: that.data.match_id });
+                if (arr.errcode == '0') that.setData({ rankingList: arr.data })
             },
             fail: res => {
                 return wx.redirectTo({ url: '/pages/index/index', })

+ 6 - 6
pages/match/info.wxml

@@ -59,18 +59,18 @@
                         <view>胜负</view>
                         <view>积分</view>
                     </view>
-                    <view class="ranking rankingList" wx:for="{{rankingList}}" wx:key="item">
-                        <view><text>{{item.pm}}</text></view>
+                    <view class="ranking rankingList" wx:for="{{rankingList}}" wx:key="item" wx:for-index="index">
+                        <view><text>{{index+1}}</text></view>
                         <view class="textOver">
                             <image src="{{item.logo[0].url}}"></image>
-                            <text>{{item.team_name}}</text>
+                            <text>{{item.name}}</text>
                         </view>
                         <view>
-                            <text>{{item.sheng}}</text>
+                            <text>{{item.win}}</text>
                             <text>/</text>
-                            <text>{{item.fu}}</text>
+                            <text>{{item.lose}}</text>
                         </view>
-                        <view><text>{{item.jf}}</text></view>
+                        <view><text>{{item.score}}</text></view>
                     </view>
                 </view>
             </view>