zs 3 anni fa
parent
commit
85563ae450
6 ha cambiato i file con 144 aggiunte e 141 eliminazioni
  1. 41 25
      pages/home/index.js
  2. 9 13
      pages/home/index.wxml
  3. 31 19
      pages/home/index.wxss
  4. 36 65
      pages/match/detail.js
  5. 19 16
      pages/match/detail.wxml
  6. 8 3
      pages/match/detail.wxss

+ 41 - 25
pages/home/index.js

@@ -11,6 +11,7 @@ Page({
     // 主体高度
     // 主体高度
     infoHeight: '',
     infoHeight: '',
     teamlist: [],
     teamlist: [],
+    schedulelist: [],
   },
   },
   // 跳转菜单
   // 跳转菜单
   tabPath(e) {
   tabPath(e) {
@@ -19,29 +20,37 @@ Page({
   },
   },
   //跳转详情
   //跳转详情
   tiao: function (e) {
   tiao: function (e) {
-    console.log(e);
-
-    // let id = e.currentTarget.dataset.id;
-    // wx.navigateTo({
-    //   url: '/pages/list/index?id=' + id,
-    // })
+    let id = e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: '/pages/list/index?id=' + id,
+    })
   },
   },
   //跳转循环赛
   //跳转循环赛
   xun: function (e) {
   xun: function (e) {
-    console.log(e);
-    // wx.navigateTo({
-    //   url: '/pages/match/detail',
-    // })
+    let id = e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: '/pages/match/detail?id=' + id,
+    })
   },
   },
-
   /**
   /**
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
-    // 监听用户是否登录
-    this.watchLogin();
     // 计算高度
     // 计算高度
     this.searchHeight();
     this.searchHeight();
+    // 监听用户是否登录
+    this.watchLogin();
+  },
+  // 计算高度
+  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 })
   },
   },
   // 监听用户是否登录
   // 监听用户是否登录
   watchLogin: function () {
   watchLogin: function () {
@@ -55,7 +64,25 @@ Page({
           data: {},
           data: {},
           success(res) {
           success(res) {
             if (res.data.errcode == 0) {
             if (res.data.errcode == 0) {
-              that.setData({ teamlist: res.data.data });
+              let datas = res.data.data;
+              for (const val of datas) {
+                if (val.status == 3) {
+                  wx.request({
+                    url: `${app.globalData.publicUrl}/courtAdmin/api/schedule`,
+                    method: 'get',
+                    data: { match_id: val._id },
+                    success(res) {
+                      if (res.data.errcode == 0) {
+                        that.setData({ schedulelist: res.data.data });
+                      } else {
+                        wx.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 })
+                      }
+                    }
+                  })
+                }
+              }
+              that.setData({ teamlist: datas });
+              console.log(datas);
             } else {
             } else {
               wx.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 })
               wx.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 })
             }
             }
@@ -67,17 +94,6 @@ Page({
       }
       }
     })
     })
   },
   },
-  // 计算高度
-  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 })
-  },
 
 
   /**
   /**
    * 生命周期函数--监听页面初次渲染完成
    * 生命周期函数--监听页面初次渲染完成

+ 9 - 13
pages/home/index.wxml

@@ -16,24 +16,20 @@
           </view>
           </view>
           <view class="otherInfo textOver"><text class="text3">{{item.address}}</text></view>
           <view class="otherInfo textOver"><text class="text3">{{item.address}}</text></view>
         </view>
         </view>
-        <view class="right1" wx:if="{{item.match_team}}" wx:for="{{teamlist.match_team}}" 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:if="{{item.status=='3'}}" wx:for="{{schedulelist}}" wx:for-item="items" wx:key="key" >
+          <view class="right1_2" bindtap="xun" data-id="{{items._id}}" >
             <view class="right1_2o">
             <view class="right1_2o">
-              <image class="head1" src="{{items.head1}}"></image>
+              <image class="head1" src="{{items.blue_logo[0].url}}"></image>
             </view>
             </view>
-            <view class="right1_2t"><text>{{items.groupname1}}</text></view>
+            <view class="right1_2t"><text>{{items.blue_name}}</text></view>
             <view class="right1_2i">
             <view class="right1_2i">
-              <text class="text6">{{items.fraction1}}</text>
+              <text class="text6">{{items.blue_branch||0}}</text>
               <text class="text8">:</text>
               <text class="text8">:</text>
-              <text class="text7">{{items.fraction2}}</text>
+              <text class="text7">{{items.red_branch||0}}</text>
             </view>
             </view>
-            <view class="right1_2t"><text>{{items.groupname2}}</text></view>
-            <view class="right1_2o">
-              <image class="head2" src="{{items.head2}}"></image>
+            <view class="right1_2tb"><text>{{items.red_name}}</text></view>
+            <view class="right1_2ob">
+              <image class="head2" src="{{items.red_logo[0].url}}"></image>
             </view>
             </view>
           </view>
           </view>
         </view>
         </view>

+ 31 - 19
pages/home/index.wxss

@@ -18,7 +18,7 @@
 }
 }
 
 
 .two .list .listtou .listbut .color3 {
 .two .list .listtou .listbut .color3 {
-  background: rgb(54, 233, 48)
+  background: rgb(238, 147, 28);
 }
 }
 
 
 .two .list .listtou .listbut .color4 {
 .two .list .listtou .listbut .color4 {
@@ -52,10 +52,6 @@
   font-weight: bold;
   font-weight: bold;
 }
 }
 
 
-listbut {
-  float: left;
-  width: 30%;
-}
 
 
 .left1 {
 .left1 {
   margin: 5px;
   margin: 5px;
@@ -104,19 +100,19 @@ button {
 }
 }
 
 
 .text6 {
 .text6 {
-  font-size: 23px;
-  color: rgb(46, 46, 245);
+  font-size: 25px;
+  color: rgb(2, 2, 190);
   font-weight: 500;
   font-weight: 500;
 }
 }
 
 
 .text7 {
 .text7 {
-  font-size: 23px;
-  color: rgb(243, 19, 19);
+  font-size: 25px;
+  color: rgb(194, 1, 1);
   font-weight: 500;
   font-weight: 500;
 }
 }
 
 
 .text8 {
 .text8 {
-  font-size: 23px;
+  font-size: 20px;
   font-weight: 500;
   font-weight: 500;
   margin-right: 5px;
   margin-right: 5px;
   margin-left: 5px;
   margin-left: 5px;
@@ -141,11 +137,18 @@ button {
 
 
 .right1_2 {
 .right1_2 {
   float: left;
   float: left;
-  width: 101%
+  width: 100%;
+  margin-top: 5%;
 }
 }
 
 
 .right1_2 .right1_2o {
 .right1_2 .right1_2o {
-  margin-left: 1%;
+  margin-left: 3%;
+  float: left;
+  width: 11%;
+  height: 40px;
+  overflow: hidden;
+}
+.right1_2 .right1_2ob {
   float: left;
   float: left;
   width: 11%;
   width: 11%;
   height: 40px;
   height: 40px;
@@ -154,32 +157,41 @@ button {
 
 
 .head1 {
 .head1 {
   width: 100%;
   width: 100%;
-  height: 33px;
+  height: 39.2px;
   overflow: hidden;
   overflow: hidden;
 }
 }
 
 
 .head2 {
 .head2 {
-  width: 89%;
-  height: 36px;
+  width: 100%;
+  height: 39.2px;
   overflow: hidden;
   overflow: hidden;
 }
 }
 
 
 .right1_2 .right1_2t {
 .right1_2 .right1_2t {
   float: left;
   float: left;
-  width: 33%;
-  text-align: center;
+  width: 27%;
+  padding: 10px 0;
+  padding-left: 2%;
+}
+.right1_2 .right1_2tb {
+  float: left;
+  width: 27%;
   padding: 10px 0;
   padding: 10px 0;
 }
 }
 
 
 .right1_2 .right1_2t text {
 .right1_2 .right1_2t text {
   font-size: 14px;
   font-size: 14px;
+  padding-left: 2px;
+}
+.right1_2 .right1_2tb text {
+  font-size: 14px;
 }
 }
 
 
 .right1_2 .right1_2i {
 .right1_2 .right1_2i {
   float: left;
   float: left;
-  width: 10%;
-  text-align: center;
+  width: 13%;
   padding: 6px 0;
   padding: 6px 0;
+  padding-right: 2%;
 }
 }
 
 
 .right1_1 {
 .right1_1 {

+ 36 - 65
pages/match/detail.js

@@ -14,80 +14,23 @@ Page({
     fileList: [],
     fileList: [],
     // 主体高度
     // 主体高度
     infoHeight: '',
     infoHeight: '',
-    listb: [
-      {
-        time: '1-15 15:00',
-        ranks1: '哈拉海队幼儿园组',
-        score1: '2',
-        score2: '1',
-        ranks2: '马尼拉老年组',
-        state: '未开始'
-      }
-    ],
-    lists: [
-      {
-        id: '1', name: '老头1', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头2', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头3', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头4', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头5', head: '/image/tou.png'
-      }
-    ],
-    list: [
-      {
-        id: '1', name: '老头1', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头2', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头3', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头4', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头5', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头6', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头7', head: '/image/tou.png'
-      },
-
-      {
-        id: '1', name: '老头8', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头9', head: '/image/tou.png'
-      },
-      {
-        id: '1', name: '老头10', head: '/image/tou.png'
-      }
-    ],
+    id: '',
+    schedulelist: [
+    ]
   },
   },
   //上传图片
   //上传图片
-  imgUpload:function(e){
+  imgUpload: function (e) {
     const that = this;
     const that = this;
     let data = that.data.fileList;
     let data = that.data.fileList;
     data.push(e.detail)
     data.push(e.detail)
-    that.setData({fileList:data})
+    that.setData({ fileList: data })
   },
   },
   //删除图片
   //删除图片
-  imgDel:function(e){
+  imgDel: function (e) {
     const that = this;
     const that = this;
     let data = that.data.fileList;
     let data = that.data.fileList;
-    let arr = data.filter((i,index) => index != e.detail.index)
-    that.setData({fileList:arr})
+    let arr = data.filter((i, index) => index != e.detail.index)
+    that.setData({ fileList: arr })
   },
   },
   back: function () {
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
     wx.navigateBack({ url: '/pages/home/index' })
@@ -96,8 +39,36 @@ Page({
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad: function (options) {
   onLoad: function (options) {
+    const that = this;
+    that.setData({ id: options.id })
     // 计算高度
     // 计算高度
     this.searchHeight()
     this.searchHeight()
+    // 监听用户是否登录
+    this.watchLogin();
+  },
+  // 监听用户是否登录
+  watchLogin: function () {
+    const that = this;
+    let id = that.data.id;
+    wx.getStorage({
+      key: 'token',
+      success: res => {
+        wx.request({
+          url: `${app.globalData.publicUrl}/courtAdmin/api/schedule/${id}`, //接口地址
+          method: 'get',
+          data: {},
+          success(res) {
+            console.log(res.data.data);
+            that.setData({
+              schedulelist: res.data.data,
+            })
+          }
+        })
+      },
+      fail: res => {
+        return wx.redirectTo({ url: '/pages/login/index', })
+      }
+    })
   },
   },
   // 计算高度
   // 计算高度
   searchHeight: function () {
   searchHeight: function () {

+ 19 - 16
pages/match/detail.wxml

@@ -1,42 +1,43 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
   <view slot="info" class="main" style="height:{{infoHeight}}px;">
   <view slot="info" class="main" style="height:{{infoHeight}}px;">
     <view class="ones">
     <view class="ones">
-      <view class="one" wx:key="item" wx:for="{{listb}}">
+      <view class="one">
         <view class="one_1">
         <view class="one_1">
           <view class="one_1_img">
           <view class="one_1_img">
-            <image class="one_logo1" src="/image/logo1.png"></image>
+            <image class="one_logo1" src="{{schedulelist.blue_logo[0].url}}"></image>
           </view>
           </view>
-          <view class="one_1_text">{{item.ranks1}}</view>
+          <view class="one_1_text">{{schedulelist.blue_name}}</view>
         </view>
         </view>
         <view class="one_2">
         <view class="one_2">
           <view class="one_2_1">
           <view class="one_2_1">
-            <text class="time">{{item.time}}</text>
+            <text class="time">{{schedulelist.match_time}}</text>
           </view>
           </view>
           <view class="one_2_2">
           <view class="one_2_2">
-            <text class="text1">{{item.score1}}</text>
+            <text class="text1">{{schedulelist.blue_branch||0}}</text>
             <text class="text2">:</text>
             <text class="text2">:</text>
-            <text class="text3">{{item.score2}}</text>
+            <text class="text3">{{schedulelist.red_branch||0}}</text>
           </view>
           </view>
           <view class="one_2_2">
           <view class="one_2_2">
-            <text class="text">{{item.state}}</text>
+            <text class="text">{{item.status=='0'?'未开始':item.status=='1'?'报名中':item.status=='2'?'待比赛':item.status=='3'?'进行中':'已结束'}}</text>
           </view>
           </view>
         </view>
         </view>
         <view class="one_3">
         <view class="one_3">
           <view class="one_3_img">
           <view class="one_3_img">
-            <image class="one_logo2" src="/image/logo2.png"></image>
+            <image class="one_logo2" src="{{schedulelist.red_logo[0].url}}"></image>
           </view>
           </view>
-          <view class="one_3_text">{{item.ranks2}}</view>
+          <view class="one_3_text">{{schedulelist.red_name}}</view>
         </view>
         </view>
-        <view class="one_4">第二届老年组小区板王比赛</view>
+        <view class="one_4">{{schedulelist.match_name}}</view>
       </view>
       </view>
     </view>
     </view>
     <view class="two">
     <view class="two">
       <view class="two1"><text class="twos">参赛阵容</text></view>
       <view class="two1"><text class="twos">参赛阵容</text></view>
       <view class="tworight">
       <view class="tworight">
         <view class="two-1">
         <view class="two-1">
-          <image class="imgs" src="{{src1}}"></image>
+          <image class="imgs" src="{{schedulelist.blue_logo[0].url}}"></image>
+          <text class="thrs">{{schedulelist.blue_name}}</text>
         </view>
         </view>
-        <view class="two-2" wx:key="item" wx:for="{{lists}}">
+        <view class="two-2" wx:key="item" wx:for="{{schedulelist.blue_members}}">
           <view class="two2">
           <view class="two2">
             <view class="two-left">
             <view class="two-left">
               <image class="img" src="{{item.head}}"></image>
               <image class="img" src="{{item.head}}"></image>
@@ -49,10 +50,12 @@
     <view class="thr">
     <view class="thr">
       <view class="thrright">
       <view class="thrright">
         <view class="thrleft">
         <view class="thrleft">
-          <image class="imgs" src="{{src1}}"></image>
-          <text class="thrss">马尼拉队</text>
+          <view class="two-9">
+            <image class="imgss" src="{{schedulelist.red_logo[0].url}}"></image>
+          </view>
+          <text class="thrss">{{schedulelist.red_name}}</text>
         </view>
         </view>
-        <view class="thr-1" wx:key="item" wx:for="{{list}}">
+        <view class="thr-1" wx:key="item" wx:for="{{schedulelist.red_members}}">
           <view class="thr1">
           <view class="thr1">
             <view class="thr-left">
             <view class="thr-left">
               <image class="img" src="{{item.head}}"></image>
               <image class="img" src="{{item.head}}"></image>
@@ -70,7 +73,7 @@
     </view>
     </view>
     <view class="upload">
     <view class="upload">
       <view class="upload_1">
       <view class="upload_1">
-        <upload list="{{fileList}}" count="{{4}}"  bind:imgUpload="imgUpload" bind:imgDel="imgDel"></upload>
+        <upload list="{{fileList}}" count="{{4}}" bind:imgUpload="imgUpload" bind:imgDel="imgDel"></upload>
       </view>
       </view>
     </view>
     </view>
     <view class="five">
     <view class="five">

+ 8 - 3
pages/match/detail.wxss

@@ -35,6 +35,10 @@
   width: 85%;
   width: 85%;
   height: 40.83px;
   height: 40.83px;
 }
 }
+.imgss {
+  width: 85%;
+  height: 40.83px;
+}
 
 
 .img {
 .img {
   width: 100%;
   width: 100%;
@@ -48,6 +52,9 @@
   width: 15%;
   width: 15%;
   background-color: #ffffff;
   background-color: #ffffff;
 }
 }
+.two-9 {
+  width: 70%;
+}
 
 
 .two2 {
 .two2 {
   background-color: #ffffff;
   background-color: #ffffff;
@@ -127,14 +134,12 @@
 }
 }
 
 
 .thrss {
 .thrss {
-  margin-left: -3px;
   font-size: 14px;
   font-size: 14px;
   font-weight: 500;
   font-weight: 500;
 }
 }
 
 
 .thrleft {
 .thrleft {
   float: left;
   float: left;
-  height: 100px;
   padding-top: 38px;
   padding-top: 38px;
   padding-left: 10px;
   padding-left: 10px;
   padding-right: 2px;
   padding-right: 2px;
@@ -297,7 +302,7 @@
   width: 100%;
   width: 100%;
   font-size: 14px;
   font-size: 14px;
   color: #999;
   color: #999;
-  margin-left: 28%;
+  text-align: center;
 }
 }
 
 
 .one_logo1 {
 .one_logo1 {