guhongwei vor 2 Jahren
Ursprung
Commit
59ef3c15a7
3 geänderte Dateien mit 203 neuen und 517 gelöschten Zeilen
  1. 92 115
      pages/match/info.js
  2. 35 3
      pages/match/info.wxml
  3. 76 399
      pages/match/info.wxss

+ 92 - 115
pages/match/info.js

@@ -1,6 +1,8 @@
 // pages/login/login.js
 import WxValidate from '../../utils/wxValidate'
-const app = getApp()
+const app = getApp();
+import { match_status } from '../../utils/dict';
+
 Page({
 
     /**
@@ -10,47 +12,59 @@ Page({
         frameStyle: { useTop: true, name: '比赛信息', leftArrow: true, useBar: false },
         // 主体高度
         infoHeight: '',
-        src: '/image/yun.jpg',
-        ids: '',
+        bg_img: '/image/yun.jpg',
+        // 比赛信息
+        match_id: '',
+        matchInfo: {},
+        // 参赛队伍
+        matchteamList: [],
+        // 状态
+        statusList: match_status,
         // 选项卡
         tabs: {
-            active: 'd',
-            list: [
-                { title: '赛制信息', name: 'a' },
-                { title: '参赛队伍', name: 'b' },
-                { title: '赛程列表', name: 'c' },
-                { title: '队伍榜单', name: 'd' },
-            ],
+            active: 'b',
+            list: [{ title: '赛制信息', name: 'a' }, { title: '参赛队伍', name: 'b' }, { title: '赛程列表', name: 'c' }, { title: '队伍榜单', name: 'd' }],
         },
-        teamlist: [],
-        ranks: [],
-        listbang: [
-            {
-                pm: '1',
-                team_name: '测试团队',
-                sf: '1/0',
-                jf: '234'
-            },
-            {
-                pm: '1',
-                team_name: '测试团队',
-                sf: '1/0',
-                jf: '234'
-            },
-            {
-                pm: '1',
-                team_name: '测试团队',
-                sf: '1/0',
-                jf: '234'
-            },
-            {
-                pm: '1',
-                team_name: '测试团队',
-                sf: '1/0',
-                jf: '234'
-            },
-        ],
-        schedule: [],
+        // ids: '',
+        // // 选项卡
+        // tabs: {
+        //     active: 'd',
+        //     list: [
+        //         { title: '赛制信息', name: 'a' },
+        //         { title: '参赛队伍', name: 'b' },
+        //         { title: '赛程列表', name: 'c' },
+        //         { title: '队伍榜单', name: 'd' },
+        //     ],
+        // },
+        // teamlist: [],
+        // ranks: [],
+        // listbang: [
+        //     {
+        //         pm: '1',
+        //         team_name: '测试团队',
+        //         sf: '1/0',
+        //         jf: '234'
+        //     },
+        //     {
+        //         pm: '1',
+        //         team_name: '测试团队',
+        //         sf: '1/0',
+        //         jf: '234'
+        //     },
+        //     {
+        //         pm: '1',
+        //         team_name: '测试团队',
+        //         sf: '1/0',
+        //         jf: '234'
+        //     },
+        //     {
+        //         pm: '1',
+        //         team_name: '测试团队',
+        //         sf: '1/0',
+        //         jf: '234'
+        //     },
+        // ],
+        // schedule: [],
     },
     back: function () {
         wx.navigateBack({ url: '/pages/me/index' })
@@ -64,92 +78,55 @@ Page({
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
+        const that = this;
+        that.setData({ match_id: options.id || '629eb5de78fa03648c0535d9' });
         // 计算高度
-        this.searchHeight()
-        this.setData({ ids: options.id || '629eb5de78fa03648c0535d9' });
+        that.searchHeight()
         // 监听用户是否登录
-        this.watchLogin();
+        that.watchLogin();
     },
     // 监听用户是否登录
     watchLogin: function () {
         var that = this;
         wx.getStorage({
             key: 'token',
-            success: res => {
-                wx.request({
-                    url: `${app.globalData.publicUrl}/courtAdmin/api/match/${this.data.ids}`, //接口地址
-                    method: 'get',
-                    // data: {},
-                    success(res) {
-                        if (res.data.errcode == 0) {
-                            let datas = res.data.data
-                            that.setData({
-                                teamlist: datas,
-                            });
-                            // 查询参赛队伍数据
-                            that.ranks();
-                            // 查询赛程列表数据
-                            that.course();
-                        } else {
-                            wx.showToast({
-                                title: res.data.errmsg,
-                                icon: 'none',
-                                duration: 2000
-                            })
-                        }
-                    }
-                })
+            success: async res => {
+                let arr;
+                // 查询比赛信息
+                arr = await app.$get(`/courtAdmin/api/match/${that.data.match_id}`)
+                if (arr.errcode == '0') {
+                    let status = match_status.find((i) => i.label == arr.data.status);
+                    if (status) arr.data.status_name = status.value;
+                    that.setData({ matchInfo: arr.data })
+                }
+                arr = await app.$get(`/courtAdmin/api/matchteam`, { match_id: that.data.match_id });
+                if (arr.errcode == '0') that.setData({ matchteamList: arr.data })
+                // wx.request({
+                //     url: `${app.globalData.publicUrl}/courtAdmin/api/match/${this.data.ids}`, //接口地址
+                //     method: 'get',
+                //     // data: {},
+                //     success(res) {
+                //         if (res.data.errcode == 0) {
+                //             let datas = res.data.data
+                //             that.setData({
+                //                 teamlist: datas,
+                //             });
+                //             // 查询参赛队伍数据
+                //             that.ranks();
+                //             // 查询赛程列表数据
+                //             that.course();
+                //         } else {
+                //             wx.showToast({
+                //                 title: res.data.errmsg,
+                //                 icon: 'none',
+                //                 duration: 2000
+                //             })
+                //         }
+                //     }
+                // })
             },
             fail: res => {
-                return wx.redirectTo({ url: '/pages/login/index', })
-            }
-        })
-    },
-    // 查询参赛队伍数据
-    ranks: function () {
-        var that = this;
-        let match_id = that.data.ids;
-        wx.request({
-            url: `${app.globalData.publicUrl}/courtAdmin/api/matchteam`, //接口地址
-            method: 'get',
-            data: { match_id: match_id },
-            success(res) {
-                if (res.data.errcode == 0) {
-                    let datacan = res.data.data
-                    that.setData({
-                        ranks: datacan,
-                        listbang: datacan,
-                    });
-                } else {
-                    wx.showToast({
-                        title: res.data.errmsg,
-                        icon: 'none',
-                        duration: 2000
-                    })
-                }
-            }
-        })
-    },
-    // 查询赛程列表数据
-    course: function () {
-        var that = this;
-        let match_id = that.data.ids;
-        wx.request({
-            url: `${app.globalData.publicUrl}/courtAdmin/api/schedule`, //接口地址
-            method: 'get',
-            data: { match_id: match_id },
-            success(res) {
-                if (res.data.errcode == 0) {
-                    that.setData({
-                        schedule: res.data.data,
-                    });
-                } else {
-                    wx.showToast({
-                        title: res.data.errmsg,
-                        icon: 'none',
-                        duration: 2000
-                    })
-                }
+                return wx.redirectTo({ url: '/pages/index/index', })
             }
         })
     },

+ 35 - 3
pages/match/info.wxml

@@ -1,6 +1,38 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
-  <view slot="info" class="main" style="height:{{infoHeight}}px;">
-    <view class="one">
+    <view slot="info" class="main" style="height:{{infoHeight}}px;">
+        <view class="one">
+            <image class="image" src="{{bg_img}}"></image>
+            <view class="one_1">
+                <view class="name textOver"><text>{{matchInfo.name}}</text></view>
+                <view class="other">
+                    <view class="otherInfo"><text>比赛状态:</text><text class="color{{matchInfo.status}}">{{matchInfo.status_name}}</text></view>
+                    <view class="otherInfo"><text>比赛时间:</text><text>{{matchInfo.match_time}}</text></view>
+                    <view class="otherInfo"><text>比赛地点:</text><text>{{matchInfo.address}}</text></view>
+                </view>
+            </view>
+        </view>
+        <view class="two">
+            <e-tabs tabs="{{tabs}}" bind:tabsChange="tabsChange"></e-tabs>
+            <view class="two_1">
+                <view wx:if="{{tabs.active=='a'}}" class="a">
+                    赛制信息
+                </view>
+                <view wx:if="{{tabs.active=='b'}}" class="b">
+                    <view class="list" wx:for="{{matchteamList}}" wx:key="item">
+                        <image src="{{item.logo[0].url}}"></image>
+                        <view class="name textOver">{{item.team_name}}</view>
+                        <view class="num">共{{item.members.length}}人</view>
+                    </view>
+                </view>
+                <view wx:if="{{tabs.active=='c'}}" class="c">
+                    1
+                </view>
+                <view wx:if="{{tabs.active=='d'}}" class="d">
+                    1
+                </view>
+            </view>
+        </view>
+        <!-- <view class="one">
       <image class="image" src="{{src}}"></image>
     </view>
     <view class="two">
@@ -141,6 +173,6 @@
           </view>
         </view>
       </view>
+    </view> -->
     </view>
-  </view>
 </mobile-main>

+ 76 - 399
pages/match/info.wxss

@@ -3,466 +3,143 @@
     width: 100%;
 }
 
-.main .one .image {
+.main .one {
+    float: left;
     width: 100%;
-    height: 240px;
-    background-color: #eeeeee;
-}
-
-.main .two {
+    height: 300px;
+    overflow: hidden;
     position: relative;
-    margin: -75px 0 0 10px;
-    width: 95%;
-    width: 95%;
-}
-
-.main .two .list {
-    background-color: #fff;
-    margin-bottom: 10px;
-    border-radius: 8px;
-    padding-top: 5px;
+    margin: 0 0 10px 0;
 }
 
-.main .two .list .listtou .name {
+.main .one .image {
     float: left;
-    margin: 6px;
-    margin-left: 10px;
-    font-size: 16px;
-    color: #0034cf;
-    font-weight: bold;
-}
-
-.main .two .list .listtou .listbut .color0 {
-    background: rgb(238, 147, 28);
-}
-
-.main .two .list .listtou .listbut .color1 {
-    background: rgb(54, 233, 48);
-}
-
-.main .two .list .listtou .listbut .color2 {
-    background: rgb(238, 88, 28);
-}
-
-.main .two .list .listtou .listbut .color3 {
-    background: rgb(238, 147, 28);
-}
-
-.main .two .list .listtou .listbut .color4 {
-    background: rgb(136, 136, 136);
-}
-
-.main .two .list .listtou button {
-    margin-top: 4px;
-    border-radius: 15px;
-    font-size: 13px !important;
-    color: #fff;
-}
-
-.main .two .list .left1 {
-    margin: 5px;
-    border-radius: 25px;
-}
-
-.main .two .list .left1 .otherInfos {
-    padding: 0 0 0px 5px;
-}
-
-.main .two .list .left1 .otherInfos .text1 {
-    margin-right: 3px;
-    font-size: 14px;
-    color: #5e5e5e;
-}
-
-.main .two .list .left1 .otherInfoq .text3 {
-    font-size: 13px;
-    color: #adadad;
-    margin-left: 1%;
-}
-
-.main .two .list .left1 .otherInfo .text3 {
-    font-size: 13px;
-    color: #adadad;
-    margin-left: 1%;
-}
-
-.main .two .list .right1 {
-    border-radius: 5px;
-    position: relative;
     width: 100%;
-    height: 80px;
-    background-color: #e9e9e9;
-}
-
-.main .two .list .right1 .right1_1 {
-    text-align: center;
-}
-
-.main .two .list .right1 .right1_1 .text4 {
-    font-size: 14px;
-    margin: 5px;
-    color: #868686;
-    font-weight: 600;
-}
-
-.main .two .list .right1 .right1_2 {
-    float: left;
-    width: 101%
-}
-
-.main .two .list .right1 .right1_2 .right1_2o {
-    float: left;
-    width: 11%;
-    height: 40px;
+    height: 240px;
     overflow: hidden;
 }
 
-.main .two .list .right1 .right1_2 .right1_2o .head1 {
-    float: left;
-    width: 20%;
-    font-size: 14px;
-    margin-left: 19px;
-    margin-top: 6px;
-}
-
-.main .two .list .right1 .right1_2 .right1_2o .head2 {
-    float: left;
-    width: 26%;
-    font-size: 13px;
-    margin-left: 5px;
-    margin-top: 6px;
-}
-
-.main .two .list .right1 .right1_2 .right1_2t {
-    float: left;
-    width: 33%;
-    text-align: center;
-    padding: 10px 0;
-}
-
-.main .two .list .right1 .right1_2 .right1_2t text {
-    font-size: 14px;
-}
-
-.main .two .list .right1 .right1_2 .right1_2i {
+.main .one .one_1 {
     float: left;
-    width: 10%;
-    text-align: center;
-    padding: 6px 0;
-}
-
-.main .two .list .right1 .right1_2 .right1_2i .text6 {
-    font-size: 23px;
-    color: rgb(46, 46, 245);
-    font-weight: 500;
-}
-
-.main .two .list .right1 .right1_2 .right1_2i .text7 {
-    font-size: 23px;
-    color: rgb(243, 19, 19);
-    font-weight: 500;
-}
-
-.main .two .list .right1 .right1_2 .right1_2i .text8 {
-    font-size: 23px;
-    font-weight: 500;
-    margin-right: 5px;
-    margin-left: 5px;
+    width: 89%;
+    height: 120px;
+    margin: 0 10px;
+    padding: 10px;
+    border-radius: 5px;
+    overflow: hidden;
+    background-color: #fff;
+    position: absolute;
+    bottom: 0;
 }
 
-.main .thr .thrsss {
+.main .one .one_1 .name {
     float: left;
     width: 100%;
-    padding-top: 3%;
+    font-size: 16px;
+    font-weight: bold;
+    margin: 0 0 5px 0;
 }
 
-.main .thr .thrsss .thr-1 {
-    margin-left: 2%;
-    margin-bottom: 2%;
-    padding-top: 15px;
-    padding-bottom: 5px;
+.main .one .one_1 .other {
     float: left;
-    width: 23%;
-    background-color: #ffffff;
-}
-
-.main .thr .thrsss .thr-1 .thr1 {
-    display: flex;
-    flex-direction: column;
-}
-
-.main .thr .thrsss .thr-1 .thr1 .thr-left {
-    margin: auto;
-    width: 70%;
-}
-
-
-.main .thr .thrsss .thr-1 .thr1 .thr-left .img {
     width: 100%;
-    height: 57.38px;
-    border-radius: 90px;
-}
-
-.main .thr .thrsss .thr-1 .thr1 .thr-right {
-    margin: auto;
-    text-align: center;
-}
-
-.main .thr .thrsss .thr-1 .thr1 .thr-right .thrname {
-    text-align: center;
-    font-size: 12px;
-    color: #727272;
 }
 
-.main .thr .thrsss .thr-1 .thr1 .thr-right .thrperson {
-    font-size: 12px;
-    color: #727272;
-}
-
-.main .thr .root {
+.main .one .one_1 .other .otherInfo {
     float: left;
-    width: 96%;
-    margin-left: 2%;
-    padding-top: 5%;
-}
-
-.main .thr .root .background-image {
-    position: relative;
-    width: 100%;
-    height: 70px;
-    border-radius: 10px;
-}
-
-.main .thr .root .content {
-    position: absolute;
-    padding-top: 5%;
     width: 100%;
-    margin-top: -28%;
-    margin-left: -2%;
-}
-
-.main .thr .root .content .four .four-1 .fourleft3 .fourtext5 {
-    position: absolute;
-    padding-top: 3px;
-    padding-left: 20px;
-    color: #fff;
-    font-size: 13px;
+    font-size: 14px;
+    margin: 0 0 5px 0;
+    color: #666;
 }
 
-.main .thr .root .content .four .four-1 .fourleft3 .fourtext6 {
-    padding-left: 225px;
+.main .one .one_1 .other .otherInfo:nth-child(1) text:nth-child(2) {
     color: #fff;
-    font-size: 13px;
-}
-
-.main .thr .root .content .four .four-1 .fourright4 .fourright1_2 {
-    float: left;
-    width: 100%;
-    margin-top: 1%;
-}
-
-.main .thr .root .content .four .four-1 .fourright4 .fourright1_2 .fourright1_2o {
-    float: left;
-    width: 15%;
+    padding: 0 10px;
+    border-radius: 5px;
 }
 
-.main .thr .root .content .four .four-1 .fourright4 .fourright1_2 .fourright1_2o .fourhead1 {
-    margin-left: 25%;
-    width: 75%;
-    height: 40.09px;
+.main .one .one_1 .other .otherInfo:nth-child(3) {
     overflow: hidden;
-    border-radius: 90px;
+    text-overflow: ellipsis;
+    -webkit-line-clamp: 2;
+    word-break: break-all;
+    display: -webkit-box;
+    -webkit-box-orient: vertical;
 }
 
-.main .thr .root .content .four .four-1 .fourright4 .fourright1_2 .fourright1_2t {
-    float: left;
-    width: 26%;
-    text-align: center;
-    padding: 10px 0;
-    font-size: 14px;
-    font-weight: 500;
-}
-
-.main .thr .root .content .four .four-1 .fourright4 .fourright1_2 .fourright1_2i {
-    float: left;
-    width: 14%;
-    text-align: center;
-    padding: 6px 0;
-}
-
-.main .thr .root .content .four .four-1 .fourright4 .fourright1_2 .fourright1_2i .fourtext6-1 {
-    background-color: rgb(228, 226, 226);
-    text-align: center;
-    color: #00427b;
-    font-size: 20px;
-    font-weight: bold;
-    text-decoration: line-through;
-    text-decoration-color: #fff;
+.main .one .one_1 .other .otherInfo text:nth-child(2) {
+    color: #000;
 }
 
-.main .thr .root .content .four .four-1 .fourright4 .fourright1_2 .fourright1_2i .fourtext7-1 {
-    background-color: rgb(228, 226, 226);
-    text-align: center;
-    color: #e70000;
-    font-size: 20px;
-    font-weight: bold;
-    text-decoration-color: #fff;
+.main .one .one_1 .other .otherInfo .color0 {
+    background: rgb(238, 147, 28);
 }
 
-.main .thr .root .content .four .four-1 .fourright4 .fourright1_2 .fourright1_2i .fourtext8-1 {
-    font-size: 20px;
-    font-weight: bold;
-    margin: 0 5px;
+.main .one .one_1 .other .otherInfo .color1 {
+    background: rgb(54, 233, 48);
 }
 
-.main .thr .root .content .four .four-1 .fourright4 .fourright1_2 .fourright1_2oi {
-    float: left;
-    width: 15%;
+.main .one .one_1 .other .otherInfo .color2 {
+    background: rgb(238, 88, 28);
 }
 
-.main .thr .root .content .four .four-1 .fourright4 .fourright1_2 .fourright1_2oi .fourhead2 {
-    margin-left: 10%;
-    width: 75%;
-    height: 40.09px;
-    overflow: hidden;
-    border-radius: 90px;
+.main .one .one_1 .other .otherInfo .color3 {
+    background: rgb(238, 147, 28);
 }
 
-.main .thr .head {
-    background-color: rgb(43, 43, 43);
-    color: white;
-    width: 87.8%;
-    margin-left: 22px;
-    margin-bottom: -1px;
-    border-top-left-radius: 0.5em;
-    border-top-right-radius: 0.5em;
-    border-bottom-right-radius: 0em;
-    border-bottom-left-radius: 0em;
-    padding: 0 0 32px 3.5px;
-    margin-top: 2%;
+.main .one .one_1 .other .otherInfo .color4 {
+    background: rgb(136, 136, 136);
 }
 
-.main .thr .head .head1 {
+.main .two {
     float: left;
-    width: 20%;
-    font-size: 14px;
-    margin-left: 19px;
-    margin-top: 6px;
+    width: 95%;
+    padding: 0 10px;
 }
 
-.main .thr .head .head2 {
+.main .two .two_1 {
     float: left;
-    width: 26%;
-    font-size: 13px;
-    margin-left: 5px;
-    margin-top: 6px;
+    width: 100%;
+    margin: 10px 0 0 0;
 }
 
-.main .thr .head .head3 {
+.two_1 .b {
     float: left;
-    width: 16%;
-    font-size: 14px;
-    margin-left: 29px;
-    margin-top: 6px;
+    width: 100%;
 }
 
-.main .thr .head .head4 {
+.two_1 .b .list {
     float: left;
-    width: 9%;
-    font-size: 14px;
-    margin-left: 29px;
-    margin-top: 6px;
-}
-
-.main .thr .headList {
-    width: 95%;
-    margin-left: 2.5%;
-    margin-bottom: 0.2%;
-}
-
-.main .thr .headList .item:nth-child(1) {
-    background-color: rgb(255, 21, 60);
-}
-
-.main .thr .headList .item:nth-child(2) {
-    background-color: rgb(253, 83, 111);
-}
-
-.main .thr .headList .item:nth-child(3) {
-    background-color: rgb(255, 151, 168);
-}
-
-
-.main .thr .headList .select-item {
-    color: #ffff;
-}
-
-.main .thr .headList .dis-select-item {
-    margin-top: 3px;
-    background-color: white;
-    color: #000;
-}
-
-.main .thr .sortContent {
-    width: 88%;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    margin-left: 3.5%;
-    margin-bottom: 0.2%;
-    padding: 5px 10px 10px 10px;
-}
-
-.main .thr .headList .item .pai {
-    margin-left: 5px;
+    width: 20%;
+    margin: 0 10px 10px 0;
+    background-color: #fff;
+    text-align: center;
+    padding: 10px 5px;
+    border-radius: 5px;
 }
 
-.main .thr .headList .item .pai .pai1 {
-    font-size: 20px;
-    font-style: italic;
+.two_1 .b .list:nth-child(4n) {
+    margin: 0 0 10px 0;
 }
 
-.main .thr .headList .item .headtou {
-    float: left;
-    margin-left: 20px;
-    width: 55px;
-    height: 33px;
-    overflow: hidden;
+.two_1 .b .list image {
+    width: 50px;
+    height: 50px;
     border-radius: 90px;
 }
 
-.main .thr .headList .item .dui {
+.two_1 .b .list .name {
     float: left;
-    width: 68%;
-    font-size: 14px;
-    margin-left: 5px;
-}
-
-.main .thr .headList .item .fen {
-    float: left;
-    width: 54%;
-    font-weight: 500;
+    width: 100%;
+    text-align: center;
+    font-size: 12px;
+    margin: 0 0 5px 0;
 }
 
-.main .thr .headList .item .fens {
+.two_1 .b .list .num {
     float: left;
-    width: 9%;
-    font-weight: 500;
-}
-
-.main .thr .headList .item .fen .score .scorea {
-    color: white;
-
-}
-
-.main .thr .headList .item .fen .scoreb {
-    color: red;
-}
-
-.main .thr .headList .item .fens .score .scorea {
-    color: white;
-}
-
-.main .thr .headList .item .fens .scorec {
-    color: black;
+    width: 100%;
+    font-size: 12px;
+    color: #666;
 }