zs 3 år sedan
förälder
incheckning
6e3f4eb8b5
3 ändrade filer med 63 tillägg och 30 borttagningar
  1. 20 7
      pages/me/index.js
  2. 28 20
      pages/me/index.wxml
  3. 15 3
      pages/me/index.wxss

+ 20 - 7
pages/me/index.js

@@ -10,16 +10,17 @@ Page({
     src: '/image/fen.jpg',
     src3: '/image/huang.png',
     src4: '/image/zan.png',
+    showMore: false,
     frameStyle: { useTop: false, name: '我的', leftArrow: false, useBar: true },
     // 主体高度
     infoHeight: '',
-    total:'4', 
+    total: '4',
     listbisai: [
-          {
-            id: '1',head2: '/image/head2.png', head1: '/image/head1.png', fraction2: '0', groupname2: '马尼拉组', fraction1: '0', site: '第一场', groupname1: '哈拉海组',week: '星期五', time: '13:00',
-            state: '已结束', date: '01.15',start:'未开始'
-          }
-        ],
+      {
+        id: '1', head2: '/image/head2.png', head1: '/image/head1.png', fraction2: '0', groupname2: '马尼拉组', fraction1: '0', site: '第一场', groupname1: '哈拉海组', week: '星期五', time: '13:00',
+        state: '已结束', date: '01.15', start: '未开始'
+      }
+    ],
     list: [
       {
         id: '1', name: '张爽', company: '福瑞科技有限公司', gender: '女', src: '/image/tou.png', address: '马利克克海拉队', team: '队员',
@@ -32,13 +33,25 @@ Page({
       {
         id: '2', head: '/image/head1.png', group: '尼奥尔队', time: '08:30', ball: '篮球', date: '2022.01.15', person: '9',
       },
+      {
+        id: '1', head: '/image/head1.png', group: '哈拉海队', time: '08:30', ball: '足球', grade: 'c', date: '2022.01.15', person: '10',
+      },
+      {
+        id: '1', head: '/image/head1.png', group: '哈拉海队', time: '08:30', ball: '足球', grade: 'c', date: '2022.01.15', person: '10',
+      },
     ],
-    
+
   },
   tabPath(e) {
     let query = e.detail.detail;
     if (query) wx.redirectTo({ url: `/pages/${query}/index` })
   },
+  //展开
+  listToggle: function () {
+    this.setData({
+      showMore: !this.data.showMore
+    })
+  },
   /**
    * 生命周期函数--监听页面加载
    */

+ 28 - 20
pages/me/index.wxml

@@ -86,34 +86,42 @@
           <text class="total">共参加{{total}}个队伍</text>
           <text class="chuang">创建团队</text>
         </view>
-        <view class="list3" wx:key="item" wx:for="{{list3}}">
-          <view class="dui-left">
-            <view class="dui-left1">
-              <image src="{{item.head}}" class="dui-image"></image>
+        <view class="weui-cells mgt-0 {{!showMore? 'hiddenmore' : 'showmore'}}">
+          <view wx:key="item" wx:for="{{list3}}" wx:for-index="idx" wx:key="" class="list3 {{idx>1 ? 'more-item' : ''}}">
+            <view class="dui-left">
+              <view class="dui-left1">
+                <image src="{{item.head}}" class="dui-image"></image>
+              </view>
+              <view class="dui-right1">
+                <text class="group">{{item.group}}</text>
+              </view>
+              <button class="ball" size="mini" wx:if="{{item.ball=='足球'}}" style="background-color:rgb(63, 127, 245);">{{item.ball}}</button>
+              <button class="ball" size="mini" wx:if="{{item.ball=='篮球'}}" style="background-color:rgb(245, 172, 63);">{{item.ball}}</button>
+              <!-- <text class=" icon iconfont icon-C1" wx:if="{{item.grade}}"></text> -->
+              <button class="grade" size="mini">{{item.grade}}</button>
             </view>
-            <view class="dui-right1">
-              <text class="group">{{item.group}}</text>
+            <view class="dui-right"><text class="person">
+                共{{item.person}}人
+              </text>
             </view>
-            <button class="ball" size="mini" wx:if="{{item.ball=='足球'}}" style="background-color:rgb(63, 127, 245);">{{item.ball}}</button>
-            <button class="ball" size="mini" wx:if="{{item.ball=='篮球'}}" style="background-color:rgb(245, 172, 63);">{{item.ball}}</button>
-            <!-- <text class=" icon iconfont icon-C1" wx:if="{{item.grade}}"></text> -->
-            <button class="grade" size="mini">{{item.grade}}</button>
+            <text class="date">{{item.date}}</text>
+            <text class="date">{{item.time}}创建</text>
           </view>
-          <view class="dui-right"><text class="person">
-              共{{item.person}}人
-            </text>
-          </view>
-          <text class="date">{{item.date}}</text>
-          <text class="date">{{item.time}}创建</text>
-        </view>
-        <view class="van">
-          <van-icon name="arrow-down" />
+          <block wx:if="{{list3.length>2}}">
+            <view wx:if="{{showMore}}" class="van" bindtap='listToggle'>
+              <van-icon name="arrow-up" />
+            </view>
+            <view wx:else class="van" bindtap='listToggle'>
+              <van-icon name="arrow-down" />
+            </view>
+          </block>
         </view>
+
       </view>
       <view class="list0" wx:if="{{total==''}}">
         <view class="otherInfo">
           <text class="tuan">我的团队</text>
-          <text class="total">暂无加入任何团队</text>
+          <text class="total1">暂无加入任何团队</text>
           <text class="chuang">创建团队</text>
         </view>
         <view class="jian">

+ 15 - 3
pages/me/index.wxss

@@ -271,7 +271,6 @@
   margin-top: 13%;
   margin-left: 5%;
   width: 91%;
-  height: 220px;
   border-radius: 5px;
   background-color: #fff;
 }
@@ -286,7 +285,12 @@
 .total {
   font-size: 13px;
   color: rgb(160, 160, 160);
-  margin-right: 90px;
+  margin-right: 85px;
+}
+.total1{
+  font-size: 13px;
+  color: rgb(160, 160, 160);
+  margin-right: 70px;
 }
 
 .chuang {
@@ -390,7 +394,7 @@
 }
 
 .viewjian {
-  margin-top: 13%;
+  margin-top: -4%;
   line-height: 62px;
 }
 
@@ -412,6 +416,7 @@
 .six {
   width: 91%;
   height: 90px;
+  margin-top: 6%;
   margin-left: 5%;
   border-radius: 5px;
   background-color: #fff;
@@ -458,4 +463,11 @@
   color: rgb(163, 163, 163);
   font-size: 13px;
 
+}
+.listtuan{
+  background-color: white;
+  border-radius: 5%;
+}
+.hiddenmore .more-item {
+  display: none;
 }