Browse Source

修改测试问题

zs 3 years ago
parent
commit
a29bb33d5e

+ 2 - 2
pages/dissolution/index.wxml

@@ -2,7 +2,7 @@
     <view slot="info" class="main" style="height:{{infoHeight}}px;">
         <form catchsubmit="formSubmit" catchreset="formReset">
             <view class="form" style="height:{{infoHeight-140}}px;">
-                <view class="one">
+                <view class="one" style="display: none;">
                     <view class="text">团队id</view>
                     <input class="input" name="team_id" disabled="true" value="{{form.id}}" placeholder="" />
                 </view>
@@ -14,7 +14,7 @@
                     <view class="text">团队创建人</view>
                     <input class="input" name="create_user" disabled="true" value="{{form.create_user}}" placeholder="" />
                 </view>
-                <view class="one">
+                <view class="one" style="display: none;">
                     <view class="text">团队创建人id</view>
                     <input class="input" name="create_id" disabled="true" value="{{form.create_id}}" placeholder="" />
                 </view>

+ 1 - 2
pages/list/index.js

@@ -104,9 +104,8 @@ Page({
       data: { match_id:match_id},
       success(res) {
         if (res.data.errcode == 0) {
-          let datasai = res.data.data
           that.setData({
-            schedule: datasai,
+            schedule: res.data.data,
           });
         } else {
           wx.showToast({

+ 3 - 3
pages/list/index.wxml

@@ -60,7 +60,7 @@
           </view>
         </van-tab>
         <van-tab title="赛程列表">
-          <view class="root" wx:if="{{item.status=='0'}}" wx:key="item" wx:for="{{schedule}}">
+          <view class="root" wx:if="{{item.status=='0'||item.status=='1'}}" wx:key="item" wx:for="{{schedule}}">
             <image class='background-image' src='/image/huang.png'></image>
             <view class="content">
               <view class="four">
@@ -90,13 +90,13 @@
               </view>
             </view>
           </view>
-          <view class="root" wx:if="{{item.status=='4'}}" wx:key="item" wx:for="{{schedule}}">
+          <view class="root" wx:if="{{item.status=='2'}}" wx:key="item" wx:for="{{schedule}}">
             <image class='background-image' src='/image/hhh.png'></image>
             <view class="content">
               <view class="four">
                 <view class="four-1">
                   <view class="fourleft3">
-                    <text class="fourtext5">{{item.status=='0'?'未开始':item.status=='1'?'报名中':item.status=='2'?'待比赛':item.status=='3'?'进行中':'已结束'}}</text>
+                    <text class="fourtext5">{{item.status=='0'?'未开始':item.status=='1'?'开始':'已结束'}}</text>
                     <text class="fourtext6">{{item.match_time}}</text>
                   </view>
                   <view class="fourright4">

+ 15 - 14
pages/team/apply.js

@@ -63,17 +63,17 @@ Page({
     })
   },
   back: function () {
-    wx.navigateBack({ url: '/pages/home/index' })
+    wx.navigateBack({ url: '/pages/team/index' })
   },
   //点击退出团队
   out() {
+    var team_id = this.data.teamlist.id;
+    var user_id = this.data.user_id;
     wx.showModal({
       title: '',
       content: '是否确认退出团队',
       success(res) {
         if (res.confirm) {
-          var team_id = this.data.teamlist.id;
-          var user_id = this.data.user_id;
           wx.request({
             url: `${app.globalData.publicUrl}/courtAdmin/api/team/leaves`, //接口地址
             method: 'get',
@@ -84,6 +84,7 @@ Page({
             success(res) {
               if (res.data.errcode == 0) {
                 wx.showToast({ title: `退出团队成功`, icon: 'success', duration: 2000 }) //创建成功提示
+                that.back()
               } else {
                 wx.showToast({
                   title: res.data.errmsg,
@@ -171,17 +172,17 @@ 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 })
-},
+  // 计算高度
+  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 })
+  },
 
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 2 - 1
pages/team/apply.wxss

@@ -44,7 +44,7 @@
 }
 
 .imgs {
-  border-radius: 50%;
+  border-radius: 90px;
   width: 70px;
   height: 70px;
 }
@@ -117,6 +117,7 @@
 }
 
 .img {
+  border-radius: 90px;
   width: 100%;
   height: 49px;
 }

+ 3 - 1
pages/team/examine.wxss

@@ -43,7 +43,7 @@
 }
 
 .imgs {
-  border-radius: 50%;
+  border-radius: 90px;
   width: 70px;
   height: 70px;
 }
@@ -122,6 +122,7 @@
 }
 
 .img {
+  border-radius: 90px;
   width: 100%;
   height: 49px;
 }
@@ -159,6 +160,7 @@
 }
 
 .name {
+  margin: auto;
   text-align: center;
   font-size: 13px;
   color: #727272;

+ 20 - 1
pages/team/index.js

@@ -14,6 +14,10 @@ Page({
     infoHeight: '',
     //团队列表
     teamlist: [],
+    //判断
+    keyindex:[],
+    //用户id
+    user_id: ''
   },
   // 跳转菜单
   tabPath(e) {
@@ -42,6 +46,7 @@ Page({
       success: res => {
         that.setData({
           type: res.data.type,
+          user_id: res.data.id
         })
         //查询数据
         wx.request({
@@ -50,8 +55,22 @@ Page({
           data: '',
           success(res) {
             if (res.data.errcode == 0) {
+              let datas = res.data.data
+              let user_id = that.data.user_id
               that.setData({
-                teamlist: res.data.data,
+                teamlist: datas,
+              });
+              let arr = []
+              for (let j = 0; j < datas.length; j++) {
+                for (let i = 0; i < datas[j].members.length; i++) {
+                  arr.push(-1)
+                  if (user_id == datas[j].members[i].id) {
+                    arr[j]= j
+                  }
+                }
+              }
+              that.setData({
+                keyindex:arr,
               });
             } else {
               wx.showToast({

+ 3 - 2
pages/team/index.wxml

@@ -22,8 +22,9 @@
           <view class="fou"><text>创建人:{{item.create_user}}</text></view>
           <view class="time"><text class="date">{{item.create_time}}创建</text></view>
         </view>
-        <view class="right">
-          <button class="button" wx:if="{{type== 2}}" bindtap="jump" data-id="{{item._id}}" data-type="apply">加入</button>
+        <view class="right"  v-for="(item,index) of list" :key="index">
+          <button class="button" wx:if="{{type== 2&&keyindex[index]!=index }}" bindtap="jump" data-id="{{item._id}}"data-type="apply">加入</button>
+          <button class="button"  wx:if="{{type== 2&&keyindex[index]==index}}" bindtap="jump" data-id="{{item._id}}" data-type="apply">查看</button>
           <button class="button"  wx:if="{{type!= 2}}" bindtap="jump" data-id="{{item._id}}" data-type="examine">查看</button>
         </view>
       </view>