zs 2 lat temu
rodzic
commit
6c26c7be62
3 zmienionych plików z 19 dodań i 8 usunięć
  1. 11 1
      pagesMy/team/index.js
  2. 4 7
      pagesMy/team/index.wxml
  3. 4 0
      pagesMy/team/index.wxss

+ 11 - 1
pagesMy/team/index.js

@@ -29,6 +29,14 @@ Page({
     // 添加团队
     toAdd() {
         wx.navigateTo({ url: `/pagesMy/teamCreate/index` })
+    },
+    // 查看
+    toView(e) {
+
+    },
+    // 加入比赛
+    toMatch(e) {
+
     },
     /**
      * 生命周期函数--监听页面加载
@@ -63,7 +71,9 @@ Page({
     // 查询通知
     async search() {
         const that = this;
-        let info = { skip: that.data.skip, limit: that.data.limit, administrator: that.data.user._id };
+        let info = { skip: that.data.skip, limit: that.data.limit };
+        if (that.data.user.type == '1') info.administrator = that.data.user._id
+        else info.user = that.data.user._id
         let res = await app.$api('team', 'GET', { ...info, ...that.data.searchInfo })
         if (res.errcode == '0') {
             let list = [...that.data.list, ...res.data]

+ 4 - 7
pagesMy/team/index.wxml

@@ -1,9 +1,9 @@
 <view class=" content main">
     <view class="one">
-        <view class="one_1">
+        <view class="one_1 {{user.type=='0'?'type':''}}">
             <input class="input" type="text" bindconfirm="toSearch" confirm-type="search" placeholder-style=' text-align: center;' placeholder="搜索" />
         </view>
-        <view class="one_2">
+        <view class="one_2" wx:if="{{user.type=='1'}}">
             <button class="button" type="primary" size="mini" bindtap="toAdd">添加团队</button>
         </view>
     </view>
@@ -30,12 +30,9 @@
                 </view>
                 <view class="button">
                     <button class="btn" type="primary" size="mini" data-item="{{item}}" bindtap="toView">
-                        查看
+                        查看详情
                     </button>
-                    <button class="btn" type="primary" size="mini" data-item="{{item}}" bindtap="toExam">
-                        审核
-                    </button>
-                    <button class="btn" type="primary" size="mini" data-item="{{item}}" bindtap="toMatch">
+                    <button wx:if="{{user.type=='0'}}" class="btn" type="primary" size="mini" data-item="{{item}}" bindtap="toMatch">
                         加入比赛
                     </button>
                 </view>

+ 4 - 0
pagesMy/team/index.wxss

@@ -77,4 +77,8 @@
     background-image: linear-gradient(to right, var(--rgb3AB), var(--rgb40E));
     border-radius: 30rpx;
     font-size: 15px;
+}
+
+.type {
+    width: 100% !important;
 }