YY 3 роки тому
батько
коміт
5e731af365

+ 1 - 19
pages/dissolution/detail.js

@@ -44,25 +44,7 @@ Page({
           method: 'get',
           data: { "team_id": team_id },
           success(res) {
-            if (res.data.errcode == 0) {
-              let datas = res.data.data
-              for (let i = 0; i < datas.length; i++) {
-                if (datas[i].status == 0) {
-                  datas[i].status = '待审'
-                } else if (datas[i].status == 1) {
-                  datas[i].status = '通过'
-                } else if (datas[i].status == -1) {
-                  datas[i].status = '拒绝'
-                }
-              }
-              that.setData({ jslist: datas });
-            } else {
-              wx.showToast({
-                title: res.data.errmsg,
-                icon: 'none',
-                duration: 2000
-              })
-            }
+              that.setData({ jslist: res.data.data });
           }
         })
       },

+ 1 - 1
pages/dissolution/detail.wxml

@@ -12,7 +12,7 @@
           <view class="time"><text class="date">解散团队原因:{{item.resaon}}</text></view>
         </view>
         <view class="right">
-          <text class="status">{{item.status}}</text>
+          <text class="status">{{item.status=='0'?'待审核':item.status=='1'?'已通过':'已驳回'}}</text>
         </view>
       </view>
     </view>

+ 1 - 1
pages/me/index.wxml

@@ -101,7 +101,7 @@
               <view class="dui-right1 ">
                 <text class="group" bindtap="ToDetails" data-id="{{item._id}}">{{item.name}}</text>
               </view>
-              <button class="color{{item.type}}" size="mini">{{item.type=='0'?'乒乓球':item.type=='1'?'足球':'篮球'}}</button>
+              <button class="color{{item.type=='乒乓球'?'0':item.type=='篮球'?'1':'足球'}}" size="mini">{{item.type}}</button>
             </view>
             <view class="dui-right"><text class="person">
                 共{{item.members.length||0}}人

+ 1 - 2
pages/me/index.wxss

@@ -100,14 +100,13 @@
   position: relative;
   top: 10px;
 }
-
 .color0 {
   margin-top: 10px;
   margin-right: 2px;
   border-radius: 10px;
   font-size: 12px !important;
   color: #fff;
-  background: rgb(63, 127, 245);
+  background: rgb(48, 155, 84);
 }
 
 .color1 {

+ 2 - 12
pages/meMatch/detail.js

@@ -21,7 +21,7 @@ Page({
   },
   //维护
   maintain: function (e) {
-    let {id , type} = e.currentTarget.dataset;
+    let { id, type } = e.currentTarget.dataset;
     if (type) wx.navigateTo({ url: `/pages/${type}/index?id=${id}` })
   },
   /**
@@ -44,17 +44,7 @@ Page({
           method: 'get',
           data: {},
           success(res) {
-            if (res.data.errcode == 0) {
-              that.setData({
-                teamlist: res.data.data,
-              });
-            } else {
-              wx.showToast({
-                title: res.data.errmsg,
-                icon: 'none',
-                duration: 2000
-              })
-            }
+            that.setData({ teamlist: res.data.data });
           }
         })
       },

+ 1 - 1
pages/meMatch/detail.wxml

@@ -3,7 +3,7 @@
     <view class="beijing1">
       <view class="list1" wx:key="item" wx:for="{{teamlist}}">
       <view class="annns">
-          <view class="names" data-name="{{item._id}}" bindtap="tiao">{{item.name}}</view>
+          <view class="names" data-name="{{item._id}}">{{item.name}}</view>
           <view class="listbut"> <button class="color{{item.status}}" size="mini">{{item.status=='0'?'未开始':item.status=='1'?'报名中':item.status=='2'?'待比赛':item.status=='3'?'进行中':'已结束'}}</button>
           </view> 
           <view class="leftmueen">

+ 21 - 36
pages/meMatch/index.js

@@ -27,50 +27,35 @@ Page({
   },
   //报名比赛
   signUp: function (e) {
-    let team_id = this.data.list1._id;
-    let team_name = this.data.list1.name;
-    let logo = this.data.list1.logo;
-    let create_id = this.data.list1.create_id;
-    let create_user = this.data.list1.create_user;
-    let create_time = this.data.list1.create_time;
-    let members = this.data.list1.members;
-    let match_num = this.data.list1.members.length;
-    let apply_time = this.data.apply_time;
+    const that = this
+    const arr = {
+      team_id: this.data.list1._id,
+      team_name: this.data.list1.name,
+      logo: this.data.list1.logo,
+      create_id: this.data.list1.create_id,
+      create_user: this.data.list1.create_user,
+      create_time: this.data.list1.create_time,
+      members: this.data.list1.members,
+      match_num: this.data.list1.members.length,
+      apply_time: this.data.apply_time,
+      match_id: e.currentTarget.dataset.id,
+      match_name: e.currentTarget.dataset.name,
+    }
     wx.showModal({
       title: '',
       content: '是否申请报名入',
       success(res) {
         if (res.confirm) {
           wx.request({
-            url: `${app.globalData.publicUrl}/courtAdmin/api/matchteam`, //接口地址
+            url: `${app.globalData.publicUrl}/courtAdmin/api/matchteam`,
             method: 'post',
-            data: {
-              match_id: e.currentTarget.dataset.id,
-              match_name: e.currentTarget.dataset.name,
-              team_id: team_id,
-              team_name: team_name,
-              logo: logo,
-              create_id: create_id,
-              create_user: create_user,
-              create_time: create_time,
-              members: members,
-              match_num: match_num,
-              apply_time: apply_time,
-            },
+            data: arr,
             success(res) {
               if (res.data.errcode == 0) {
-                wx.showToast({
-                  title: `报名成功`,
-                  icon: 'success',
-                  duration: 2000
-                })
-
+                wx.showToast({ title: `报名成功`, icon: 'success', duration: 2000 });
+                that.watchLogin();
               } else {
-                wx.showToast({
-                  title: res.data.errmsg,
-                  icon: 'none',
-                  duration: 2000
-                })
+                wx.showToast({ title: res.data.errmsg, icon: 'none', duration: 2000 })
               }
             }
           })
@@ -100,7 +85,7 @@ Page({
       success: res => {
         //待申请-报名中的比赛
         wx.request({
-          url: `${app.globalData.publicUrl}/courtAdmin/api/match`, //接口地址
+          url: `${app.globalData.publicUrl}/courtAdmin/api/match`,
           method: 'get',
           data: { status: '1' },
           success(res) {
@@ -109,7 +94,7 @@ Page({
         })
         //已申请-已报名的比赛
         wx.request({
-          url: `${app.globalData.publicUrl}/courtAdmin/api/matchteam`, //接口地址
+          url: `${app.globalData.publicUrl}/courtAdmin/api/matchteam`, 
           method: 'get',
           data: { team_id: team_id },
           success(res) {

+ 1 - 0
pages/meMatch/index.wxss

@@ -170,6 +170,7 @@
 }
 
 .img1 {
+  border-radius: 50%;
   float: left;
   margin: 7px;
   width: 50px;