YY 2 năm trước cách đây
mục cha
commit
c13b6924a7
5 tập tin đã thay đổi với 267 bổ sung126 xóa
  1. 120 112
      icon/icon.wxss
  2. 30 13
      pagesMatch/match/info.js
  3. 50 0
      pagesMatch/match/info.less
  4. 30 1
      pagesMatch/match/info.wxml
  5. 37 0
      pagesMatch/match/info.wxss

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 120 - 112
icon/icon.wxss


+ 30 - 13
pagesMatch/match/info.js

@@ -6,6 +6,9 @@ Page({
         id: '',
         info: {},
         user: {},
+        // 选手
+        player: {},
+        showIndex: 10000, //默认不显示
         // 选项卡
         tabs: {
             active: 'a',
@@ -32,22 +35,23 @@ Page({
         const { item } = e.currentTarget.dataset;
         wx.navigateTo({ url: `/pagesMatch/match/sign?id=${item._id}` })
     },
+    panel: function (e) {
+        //获取到当前点击元素的下标
+        let index = e.currentTarget.dataset.index;
+        //当前显示隐藏内容的元素
+        let showIndex = this.data.showIndex;
+        if (index != showIndex) {
+            this.setData({ showIndex: index })
+        } else {
+            this.setData({ showIndex: 10000 })
+        }
+    },
     /**
      * 生命周期函数--监听页面加载
      */
-    onLoad: function (options) {
+    onLoad: async function (options) {
         const that = this;
         that.setData({ id: options.id || '' });
-    },
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () { },
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: async function () {
-        const that = this;
         // 查询其他信息
         await that.searchOther();
         // 监听用户是否登录
@@ -60,12 +64,21 @@ Page({
         arr = await app.$get(`/dict`, { code: "match_status" });
         if (arr.errcode == '0' && arr.total > 0) { that.setData({ statusList: arr.data[0].list }); }
     },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () { },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: async function () { },
+
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
         const statusList = that.data.statusList;
         wx.getStorage({
-            key: 'raceuser',
+            key: 'user',
             success: async res => {
                 that.setData({ user: res.data })
                 let arr;
@@ -78,9 +91,13 @@ Page({
                     if (regular) arr.data.zhRegular = regular;
                     that.setData({ info: arr.data })
                 } else { wx.showToast({ title: `${res.errmsg}`, icon: 'fail', duration: 2000 }); }
+                arr = await app.$get(`/match/getAll/${that.data.id}`, {}, 'race');
+                if (arr.errcode == '0') {
+                    that.setData({ player: arr.data })
+                }
             },
             fail: async res => {
-                wx.redirectTo({ url: '/pages/index/index' })
+                // wx.redirectTo({ url: '/pages/index/index' })
             }
         })
     },

+ 50 - 0
pagesMatch/match/info.less

@@ -101,6 +101,56 @@
                     }
                 }
             }
+
+        }
+
+        .b {
+            height: 83vh;
+
+            .b_1 {
+                width: 96vw;
+                display: flex;
+                flex-direction: column;
+                background-color: var(--mainColor);
+                position: relative;
+                margin: 2vw;
+                .Title{
+                    display: flex;
+                    flex-direction: row;
+                }
+                .content {
+                    .project {
+                        .title {
+                            color: var(--redColor);
+                        }
+
+                        .user {
+                            display: flex;
+                            flex-direction: row;
+                            flex-wrap: wrap;
+
+
+                            .user_name {
+                                width: 20vw;
+                                margin: 2vw;
+                                text-align: center;
+
+                                .icon {
+                                    width: 70px;
+                                    height: 70px;
+                                    border: 2px dashed var(--redColor);
+
+                                    image {
+                                        width: 80%;
+                                        height: 80%;
+                                    }
+                                }
+
+                            }
+                        }
+                    }
+                }
+            }
         }
     }
 }

+ 30 - 1
pagesMatch/match/info.wxml

@@ -70,7 +70,36 @@
                     </view>
                 </scroll-view>
             </view>
-            <view wx:if="{{tabs.active=='b'}}" class="b">选手</view>
+            <view wx:if="{{tabs.active=='b'}}" class="b">
+                <scroll-view scroll-y="true" class="scroll-view">
+                    <view class="list-scroll-view">
+                        <view class="b_1">
+                            <view wx:for="{{player.group}}" wx:key="item">
+                                <view class="Title">
+                                    <view bindtap="panel" data-index="{{ index }}">{{item.name}}</view>
+                                    <view>
+                                        <iconfont class="iconfont {{showIndex == index ? 'icon-jiantou_liebiaozhankai' : 'icon-jiantou_liebiaoxiangyou'}}"></iconfont>
+                                    </view>
+                                </view>
+                                <view class="list-text {{selected[index] ? '' : 'hidden-content'}}">
+                                    <view class="content" wx:if="{{showIndex == index}}">
+                                        <view class='project' wx:for="{{item.project}}" wx:key="item">
+                                            <view class='title'>{{item.name}} </view>
+                                            <view class="user">
+                                                <view class="user_name" wx:for="{{item.user }}" wx:key="item">
+                                                    <image class="icon" src="{{item.icon&&item.icon.length>0?item.icon[0].url:''}}"></image>
+                                                    <text>{{ item.name }}</text>
+                                                </view>
+                                            </view>
+                                        </view>
+                                    </view>
+                                </view>
+
+                            </view>
+                        </view>
+                    </view>
+                </scroll-view>
+            </view>
             <view wx:if="{{tabs.active=='c'}}" class="c">秩序册</view>
             <view wx:if="{{tabs.active=='d'}}" class="d">赛况</view>
             <view wx:if="{{tabs.active=='e'}}" class="e">成绩册</view>

+ 37 - 0
pagesMatch/match/info.wxss

@@ -81,6 +81,43 @@
   color: var(--f85Color);
   text-indent: 1rem;
 }
+.main .two .b {
+  height: 83vh;
+}
+.main .two .b .b_1 {
+  width: 96vw;
+  display: flex;
+  flex-direction: column;
+  background-color: var(--mainColor);
+  position: relative;
+  margin: 2vw;
+}
+.main .two .b .b_1 .Title {
+  display: flex;
+  flex-direction: row;
+}
+.main .two .b .b_1 .content .project .title {
+  color: var(--redColor);
+}
+.main .two .b .b_1 .content .project .user {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+}
+.main .two .b .b_1 .content .project .user .user_name {
+  width: 20vw;
+  margin: 2vw;
+  text-align: center;
+}
+.main .two .b .b_1 .content .project .user .user_name .icon {
+  width: 70px;
+  height: 70px;
+  border: 2px dashed var(--redColor);
+}
+.main .two .b .b_1 .content .project .user .user_name .icon image {
+  width: 80%;
+  height: 80%;
+}
 .scroll-view {
   position: absolute;
   top: 0;