zs пре 3 година
родитељ
комит
246d0698cb
5 измењених фајлова са 36 додато и 18 уклоњено
  1. 1 1
      pages/administration/index.wxss
  2. 19 4
      pages/home/index.js
  3. 13 10
      pages/home/index.wxml
  4. 2 2
      pages/home/index.wxss
  5. 1 1
      pages/search/index.js

+ 1 - 1
pages/administration/index.wxss

@@ -92,7 +92,7 @@
   margin-top: 34%;
   position: absolute;
   top: 32%;
-  left: 4%;
+  left: 3.5%;
   width: 93%;
   border-radius: 10%;
 }

+ 19 - 4
pages/home/index.js

@@ -13,13 +13,28 @@ Page({
     infoHeight: '',
     list: [
       {
-        id: '1', name: '朝阳区乒乓球比赛', head2: '/image/head2.png', head1: '/image/head1.png',fraction2: '1', groupname2: '马尼拉老年组', group: '第一组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛', week: '星期五', time: '13:00',
-        state: '进行中', date: '2022.01.15', address: '吉林省长春市远创国际A座'
+        id: '1', name: '朝阳区乒乓球比赛', head2: '/image/head2.png', head1: '/image/head1.png', fraction2: '1', groupname2: '马尼拉老年组', group: '第一组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛', week: '星期五', time: '13:00',
+        state: '进行中', listbisai: [
+          {
+            id: '1', head2: '/image/head2.png', head1: '/image/head1.png', fraction2: '1', groupname2: '马尼拉老年组', group: '第一组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛'
+          }
+        ], date: '2022.01.15', address: '吉林省长春市远创国际A座'
+      },
+      {
+        id: '1', name: '经开区足球比赛', fraction2: '1', groupname2: '马尼拉老年组', group: '第二组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛',
+        week: '星期一', listbisai: [], head2: '/image/head2.png', head1: '/image/head1.png', time: '09:00', state: '待比赛', date: '2022.01.20', address: '吉林省长春市远创国际A座'
+      },
+      {
+        id: '1', name: '经开区足球比赛', fraction2: '1', groupname2: '马尼拉老年组', group: '第二组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛',
+        week: '星期一', listbisai: [], head2: '/image/head2.png', head1: '/image/head1.png', time: '09:00', state: '报名中', date: '2022.01.20', address: '吉林省长春市远创国际A座'
+      },
+      {
+        id: '1', name: '经开区足球比赛', fraction2: '1', groupname2: '马尼拉老年组', group: '第二组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛',
+        week: '星期一', listbisai: [], head2: '/image/head2.png', head1: '/image/head1.png', time: '09:00', state: '已结束', date: '2022.01.20', address: '吉林省长春市远创国际A座'
       },
-      { id: '1', name: '经开区足球比赛', fraction2: '1', groupname2: '马尼拉老年组', group: '第二组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛',
-       week: '星期一', head2: '/image/head2.png', head1: '/image/head1.png', time: '09:00', state: '待比赛', date: '2022.01.20', address: '吉林省长春市远创国际A座' },
     ],
   },
+
   tabPath(e) {
     let query = e.detail.detail;
     if (query) wx.redirectTo({ url: `/pages/${query}/index` })

+ 13 - 10
pages/home/index.wxml

@@ -6,7 +6,10 @@
     <view class="two">
       <view class="list" wx:key="item" wx:for="{{list}}">
         <view class="name">{{item.name}}</view>
-        <button class="button" size="mini">{{item.state}}</button>
+        <button class="button" size="mini" style="background:rgb(238, 147, 28);" wx:if="{{item.state == '进行中'}}">{{item.state}}</button>
+        <button class="button" size="mini" style="background:rgb(238, 88, 28);"  wx:if="{{item.state == '待比赛'}}">{{item.state}}</button>
+        <button class="button" size="mini" style="background:rgb(54, 233, 48)"  wx:if="{{item.state == '报名中'}}">{{item.state}}</button>
+        <button class="button" size="mini" style="background:rgb(136, 136, 136);"  wx:if="{{item.state == '已结束'}}">{{item.state}}</button>
         <view class="left1">
           <view class="otherInfo">
             <text class="text1">{{item.date}}</text>
@@ -15,24 +18,24 @@
           </view>
           <view class="otherInfo textOver"><text class="text3">{{item.address}}</text></view>
         </view>
-        <view class="right1">
+        <view class="right1" wx:if="{{item.listbisai}}" wx:for="{{item.listbisai}}" wx:for-item="items">
           <view class="right1_1">
-            <text class="text4">{{item.match}}</text>
-            <text class="text4">{{item.group}}</text>
+            <text class="text4">{{items.match}}</text>
+            <text class="text4">{{items.group}}</text>
           </view>
           <view class="right1_2">
             <view class="right1_2o">
-              <image src="{{item.head1}}"></image>
+              <image src="{{items.head1}}"></image>
             </view>
-            <view class="right1_2t"><text>{{item.groupname1}}</text></view>
+            <view class="right1_2t"><text>{{items.groupname1}}</text></view>
             <view class="right1_2i">
-              <text class="text6">{{item.fraction1}}</text>
+              <text class="text6">{{items.fraction1}}</text>
               <text class="text8">:</text>
-              <text class="text7">{{item.fraction2}}</text>
+              <text class="text7">{{items.fraction2}}</text>
             </view>
-            <view class="right1_2t"><text>{{item.groupname2}}</text></view>
+            <view class="right1_2t"><text>{{items.groupname2}}</text></view>
             <view class="right1_2o">
-              <image src="{{item.head2}}"></image>
+              <image src="{{items.head2}}"></image>
             </view>
           </view>
         </view>

+ 2 - 2
pages/home/index.wxss

@@ -12,7 +12,6 @@
   top: 32%;
   left: 2.5%;
   width: 95%;
-  border-radius: 10px;
 }
 .otherInfo{
   text-align: left;
@@ -38,7 +37,7 @@
 }
 .button{
   margin-top: 7px;
-  background-color: rgb(238, 147, 28);
+  /* background-color: rgb(238, 147, 28); */
   border-radius: 15px;
   font-size: 13px !important;
   color: #fff;
@@ -46,6 +45,7 @@
 .list{
   background-color: #fff;
   margin-bottom: 10px;
+  border-radius: 8px;
 }
 .text3 {
   font-size: 13px;

+ 1 - 1
pages/search/index.js

@@ -14,7 +14,7 @@ Page({
     list: [
       {
         id: '1', name: '朝阳区乒乓球比赛', head2: '/image/head2.png', head1: '/image/head1.png',fraction2: '0', groupname2: '马尼拉组', group: '第一组', fraction1: '0', site: '第一场', groupname1: '哈拉海组', match: '循环赛', week: '星期五', time: '13:00',
-        state: '进行中', date: '2022.01.15', address: '吉林省长春市远创国际A座'
+        state: '待比赛', date: '2022.01.15', address: '吉林省长春市远创国际A座'
       },
       { id: '1', name: '经开区足球比赛', fraction2: '0', groupname2: '马尼拉组', group: '第二组', fraction1: '0', site: '第二场', groupname1: '哈拉海组', match: '循环赛',
        week: '星期一', head2: '/image/head2.png', head1: '/image/head1.png', time: '09:00', state: '待比赛', date: '2022.01.20', address: '吉林省长春市远创国际A座' },