Browse Source

修改比赛管理

zs 3 years ago
parent
commit
08bb251309

+ 13 - 3
icon/icon.wxss

@@ -1,9 +1,9 @@
 @font-face {
   font-family: "iconfont";
   /* Project id 3244772 */
-  src: url('//at.alicdn.com/t/font_3244772_i1xnf3btn.woff2?t=1648689795959') format('woff2'),
-    url('//at.alicdn.com/t/font_3244772_i1xnf3btn.woff?t=1648689795959') format('woff'),
-    url('//at.alicdn.com/t/font_3244772_i1xnf3btn.ttf?t=1648689795959') format('truetype');
+  src: url('//at.alicdn.com/t/font_3244772_fzxoodk18u.woff2?t=1649642530027') format('woff2'),
+    url('//at.alicdn.com/t/font_3244772_fzxoodk18u.woff?t=1649642530027') format('woff'),
+    url('//at.alicdn.com/t/font_3244772_fzxoodk18u.ttf?t=1649642530027') format('truetype');
 }
 
 .iconfont {
@@ -14,6 +14,16 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-shenpi:before {
+  content: "\e626";
+  font-size: 20px !important;
+}
+
+.icon-paiming_paiming:before {
+  content: "\e6dc";
+  font-size: 20px !important;
+}
+
 .icon-bisaiguanli:before {
   content: "\e6a5";
 }

BIN
image/paiming.png


BIN
image/shenpi.png


+ 63 - 62
pages/administration/index.js

@@ -6,16 +6,17 @@ Page({
    * 页面的初始数据
    */
   data: {
-    background: '/image/bisai.png',
-    match: '/image/chuangjian.png',
-    black: '/image/hei.png',
-    ranking: '/image/paiming.png',
-    approval: '/image/shenpi.png',
     frameStyle: { useTop: true, name: '比赛管理', leftArrow: false, useBar: true },
     // 主体高度
     infoHeight: '',
+    background: '/image/bisai.png',
+    match: '/image/chuangjian.png',
+    black: '/image/hei.png',
+    //进行中数据
     conduct: [],
+    //未开始数据
     nostart: [],
+    //已结束数据
     complete: [],
   },
   // 跳转菜单
@@ -23,18 +24,11 @@ Page({
     let { route } = e.detail.detail;
     if (route) wx.redirectTo({ url: `/${route}` })
   },
-  //跳转详情
+  //跳转详情
   tiao: function (e) {
-    let id = e.currentTarget.dataset.name;
-    wx.navigateTo({
-      url: '/pages/list/index?id=' + id,
-    })
-  },
-  //循环赛数组详情跳转
-  xun: function () {
-    wx.navigateTo({
-      url: '/pages/match/detail',
-    })
+    let { id, type } = e.currentTarget.dataset;
+    if (type == 1) wx.navigateTo({ url: `/pages/list/index?id=${id}` })
+    else wx.navigateTo({ url: `/pages/match/detail?id=${id}` })
   },
   //创建比赛
   jump: function () {
@@ -63,63 +57,70 @@ Page({
     // 计算高度
     this.searchHeight();
   },
+
   // 监听用户是否登录
-  watchLogin: function () {
+  watchLogin: async function () {
+    const that = this;
     wx.getStorage({
       key: 'token',
-      success: res => {
-        var that = this;
-        wx.request({
-          url: `${app.globalData.publicUrl}/courtAdmin/api/match`, //接口地址
-          method: 'get',
-          data: {},
-          success(res) {
-            if (res.data.errcode == 0) {
-              let datas = res.data.data
-              let datass = []
-              let datastart = []
-              let dataend = []
-              for (let i = 0; i < datas.length; i++) {
-                if (datas[i].status == 2) {
-                  datastart.push(datas[i])
-                } else if (datas[i].status == 3) {
-                  datass.push(datas[i])
-                } else if (datas[i].status == 4) {
-                  dataend.push(datas[i])
-                }
-              }
-              that.setData({
-                conduct: datass,
-                nostart: datastart,
-                complete: dataend,
-              });
-            } else {
-              wx.showToast({
-                title: res.data.errmsg,
-                icon: 'none',
-                duration: 2000
-              })
+      success: async res => {
+        const arr = await app.$get('/courtAdmin/api/match');
+        if (arr.errcode === 0) {
+          for (const val of arr.data) {
+            if (val.status == '3') {
+              const aee = await app.$get('/courtAdmin/api/schedule', { match_id: val._id });
+              if (aee.errcode === 0) val.schedulelist = aee.data;
             }
           }
-        })
+          let datas = arr.data
+          let datass = []
+          let datastart = []
+          let dataend = []
+          for (let i = 0; i < datas.length; i++) {
+            if (datas[i].status == 2) {
+              datastart.push(datas[i])
+            } else if (datas[i].status == 3) {
+              datass.push(datas[i])
+            } else if (datas[i].status == 4) {
+              dataend.push(datas[i])
+            }
+          }
+          that.setData({
+            conduct: datass,
+            nostart: datastart,
+            complete: dataend,
+          });
+        }
       },
       fail: res => {
         return wx.redirectTo({ url: '/pages/login/index', })
       }
     })
   },
- // 计算高度
- searchHeight: function () {
-  let frameStyle = this.data.frameStyle;
-  let client = app.globalData.client;
-  let infoHeight = client.windowHeight;
-  // 是否去掉状态栏
-  if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
-  // 是否减去底部菜单
-  if (frameStyle.useBar) infoHeight = infoHeight - 50;
-  if (infoHeight) this.setData({ infoHeight: infoHeight })
-},
-  
+  searchschedule: function (e) {
+    wx.request({
+      url: `${app.globalData.publicUrl}/courtAdmin/api/schedule`,
+      method: 'get',
+      data: { match_id: e._id },
+      success(res) {
+        if (res.data.errcode == 0) { } else {
+          wx.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 })
+        }
+      }
+    })
+  },
+  // 计算高度
+  searchHeight: function () {
+    let frameStyle = this.data.frameStyle;
+    let client = app.globalData.client;
+    let infoHeight = client.windowHeight;
+    // 是否去掉状态栏
+    if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
+    // 是否减去底部菜单
+    if (frameStyle.useBar) infoHeight = infoHeight - 50;
+    if (infoHeight) this.setData({ infoHeight: infoHeight })
+  },
+
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 18 - 61
pages/administration/index.wxml

@@ -10,20 +10,24 @@
     <view class="thr">
       <view class="left">
         <text class="th" bindtap='tuan'>团队排名</text>
-        <image class="imagx" src="{{ranking}}"></image>
+        <view class="imagx">
+          <text class="icon iconfont icon-paiming_paiming"></text>
+        </view>
         <image class="imagh" src="{{black}}"></image>
       </view>
       <view class="right">
         <text class="th" bindtap='shen'>团队审批</text>
-        <image class="imagx" src="{{approval}}"></image>
+        <view class="imagx">
+          <text class="icon iconfont icon-shenpi"></text>
+        </view>
         <image class="imagh" src="{{black}}"></image>
       </view>
     </view>
     <view class="four">
-      <van-tabs v-model:active="activeName" sticky>
+      <van-tabs v-model:active="activeName">
         <van-tab title="进行中">
           <view class="list" wx:key="item" wx:for="{{conduct}}">
-            <view class="name" data-name="{{item._id}}" bindtap="tiao">{{item.name}}</view>
+            <view class="name" bindtap="tiao" data-id="{{item._id}}" data-type="1">{{item.name}}</view>
             <view class="listbut"> <button class="color{{item.status}}" size="mini">{{item.status=='0'?'未开始':item.status=='1'?'报名中':item.status=='2'?'待比赛':item.status=='3'?'进行中':'已结束'}}</button>
             </view>
             <view class="left1">
@@ -32,24 +36,20 @@
               </view>
               <view class="otherInfo textOver"><text class="text3">{{item.address}}</text></view>
             </view>
-            <view class="right1" wx:if="{{item.listbisai}}" wx:for="{{item.listbisai}}" wx:for-item="items" wx:key="key">
-              <view class="right1_1" bindtap="xun">
-                <text class="text4">{{items.match}}</text>
-                <text class="text4">{{items.group}}</text>
-              </view>
-              <view class="right1_2">
+            <view class="right1" wx:for="{{item.schedulelist}}" wx:for-item="tag" wx:key="tag">
+              <view class="right1_2" bindtap="tiao" data-id="{{tag._id}}" data-type="2">
                 <view class="right1_2o">
-                  <image src="{{items.head1}}"></image>
+                  <image src="{{tag.blue_logo[0].url}}"></image>
                 </view>
-                <view class="right1_2t"><text>{{items.groupname1}}</text></view>
+                <view class="right1_2t"><text>{{tag.blue_name}}</text></view>
                 <view class="right1_2i">
-                  <text class="text6">{{items.fraction1}}</text>
+                  <text class="text6">{{tag.blue_branch||0}}</text>
                   <text class="text8">:</text>
-                  <text class="text7">{{items.fraction2}}</text>
+                  <text class="text7">{{tag.red_branch||0}}</text>
                 </view>
-                <view class="right1_2t"><text>{{items.groupname2}}</text></view>
+                <view class="right1_2t"><text>{{tag.red_name}}</text></view>
                 <view class="right1_2o">
-                  <image src="{{items.head2}}"></image>
+                  <image src="{{tag.red_logo[0].url}}"></image>
                 </view>
               </view>
             </view>
@@ -57,7 +57,7 @@
         </van-tab>
         <van-tab title="未开始">
           <view class="list" wx:key="item" wx:for="{{nostart}}">
-            <view class="name" data-name="{{item._id}}" bindtap="tiao">{{item.name}}</view>
+            <view class="name" bindtap="tiao" data-id="{{item._id}}" data-type="1">{{item.name}}</view>
             <view class="listbut"> <button class="color{{item.status}}" size="mini">{{item.status=='0'?'未开始':item.status=='1'?'报名中':item.status=='2'?'待比赛':item.status=='3'?'进行中':'已结束'}}</button>
             </view>
             <view class="left1">
@@ -66,32 +66,11 @@
               </view>
               <view class="otherInfo textOver"><text class="text3">{{item.address}}</text></view>
             </view>
-            <view class="right1" wx:if="{{item.listbisai}}" wx:for="{{item.listbisai}}" wx:for-item="items" wx:key="key">
-              <view class="right1_1" bindtap="xun">
-                <text class="text4">{{items.match}}</text>
-                <text class="text4">{{items.group}}</text>
-              </view>
-              <view class="right1_2">
-                <view class="right1_2o">
-                  <image src="{{items.head1}}"></image>
-                </view>
-                <view class="right1_2t"><text>{{items.groupname1}}</text></view>
-                <view class="right1_2i">
-                  <text class="text6">{{items.fraction1}}</text>
-                  <text class="text8">:</text>
-                  <text class="text7">{{items.fraction2}}</text>
-                </view>
-                <view class="right1_2t"><text>{{items.groupname2}}</text></view>
-                <view class="right1_2o">
-                  <image src="{{items.head2}}"></image>
-                </view>
-              </view>
-            </view>
           </view>
         </van-tab>
         <van-tab title="已结束">
           <view class="list" wx:key="item" wx:for="{{complete}}">
-            <view class="name" data-name="{{item._id}}" bindtap="tiao">{{item.name}}</view>
+            <view class="name" bindtap="tiao" data-id="{{item._id}}" data-type="1">{{item.name}}</view>
             <button class="color{{item.status}}" size="mini">{{item.status=='0'?'未开始':item.status=='1'?'报名中':item.status=='2'?'待比赛':item.status=='3'?'进行中':'已结束'}}</button>
             <view class="left1">
               <view class="otherInfos">
@@ -99,31 +78,9 @@
               </view>
               <view class="otherInfo textOver"><text class="text3">{{item.address}}</text></view>
             </view>
-            <view class="right1" wx:if="{{item.listbisai}}" wx:for="{{item.listbisai}}" wx:for-item="items" wx:key="key">
-              <view class="right1_1">
-                <text class="text4">{{items.match}}</text>
-                <text class="text4">{{items.group}}</text>
-              </view>
-              <view class="right1_2">
-                <view class="right1_2o">
-                  <image src="{{items.head1}}"></image>
-                </view>
-                <view class="right1_2t"><text>{{items.groupname1}}</text></view>
-                <view class="right1_2i">
-                  <text class="text6">{{items.fraction1}}</text>
-                  <text class="text8">:</text>
-                  <text class="text7">{{items.fraction2}}</text>
-                </view>
-                <view class="right1_2t"><text>{{items.groupname2}}</text></view>
-                <view class="right1_2o">
-                  <image src="{{items.head2}}"></image>
-                </view>
-              </view>
-            </view>
           </view>
         </van-tab>
       </van-tabs>
     </view>
-
   </view>
 </mobile-main>

+ 9 - 5
pages/administration/index.wxss

@@ -7,7 +7,7 @@
 }
 
 .list .listbut .color1 {
-  background: rgb(54, 233, 48)
+  background: rgb(54, 233, 48);
 }
 
 .list .listbut .color2 {
@@ -15,7 +15,7 @@
 }
 
 .list .listbut .color3 {
-  background: rgb(54, 233, 48)
+  background: rgb(238, 147, 28);
 }
 
 .list .color4 {
@@ -34,7 +34,7 @@
 }
 
 .list .color3 {
-  background: rgb(54, 233, 48)
+  background: rgb(238, 147, 28);
 }
 
 .list .color4 {
@@ -203,10 +203,12 @@ button{
   width: 100%;
   height: 80px;
   background-color: #e9e9e9;
+  border-bottom: 2px solid white;
 }
 .right1_2 {
   float: left;
-  width: 100%
+  width: 100%;
+  margin-top: 5%;
 }
 
 .right1_2 .right1_2o {
@@ -214,15 +216,17 @@ button{
   width: 11%;
   height: 40px;
   overflow: hidden;
+  margin-left: 2%;
 }
 .right1_2 .right1_2o image {
   width: 100%;
   height: 36px;
   overflow: hidden;
+  border-radius: 90px;
 }
 .right1_2 .right1_2t {
   float: left;
-  width: 33%;
+  width: 30%;
   text-align: center;
   padding: 10px 0;
 }

+ 5 - 4
pages/home/index.wxss

@@ -100,14 +100,14 @@ button {
 }
 
 .text6 {
-  font-size: 25px;
-  color: rgb(2, 2, 190);
+  font-size: 23px;
+  color: rgb(46, 46, 245);
   font-weight: 500;
 }
 
 .text7 {
-  font-size: 25px;
-  color: rgb(194, 1, 1);
+  font-size: 23px;
+  color: rgb(243, 19, 19);
   font-weight: 500;
 }
 
@@ -140,6 +140,7 @@ button {
   float: left;
   width: 100%;
   margin-top: 5%;
+  text-align: center;
 }
 
 .right1_2 .right1_2o {

+ 2 - 2
pages/list/index.wxss

@@ -514,7 +514,7 @@ button {
 }
 
 .two .list .listtou .listbut .color1 {
-  background: rgb(54, 233, 48)
+  background: rgb(54, 233, 48);
 }
 
 .two .list .listtou .listbut .color2 {
@@ -522,7 +522,7 @@ button {
 }
 
 .two .list .listtou .listbut .color3 {
-  background: rgb(54, 233, 48)
+  background: rgb(238, 147, 28);
 }
 
 .two .list .listtou .listbut .color4 {