Jelajahi Sumber

Merge branch 'master' of http://git.cc-lotus.info/ball-court/court-mobile

zs 3 tahun lalu
induk
melakukan
97b4784e12
5 mengubah file dengan 121 tambahan dan 57 penghapusan
  1. 54 1
      pages/auditTeam/index.js
  2. 1 1
      pages/auditTeam/index.wxml
  3. 48 37
      pages/me/index.js
  4. 16 16
      pages/me/index.wxml
  5. 2 2
      pages/me/index.wxss

+ 54 - 1
pages/auditTeam/index.js

@@ -12,6 +12,7 @@ Page({
         frameStyle: { useTop: true, name: '审核队员', leftArrow: true, useBar: false },
         //加入团队列表
         list: [],
+        menbers: [],
         id: ''
     },
 
@@ -20,17 +21,61 @@ Page({
     },
     //通过
     adopt: function (e) {
-        let { id } = e.currentTarget.dataset;
+        const that = this;
+        let id = e.currentTarget.dataset.id;
+        //修改状态-加入团队修改
         wx.request({
             url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply/${id}`, //接口地址
             method: "post",
             data: { status: '1' },
             header: {},
             success: res => {
+                if (res.data.errcode == 0) {
+                    wx.showToast({
+                        title: '已通过',
+                        icon: 'success',
+                        duration: 2000//延迟两秒
+                    })
+                }
+            },
+            error: err => {
+            }
+        })
+        //用户详情
+        let id1 = e.currentTarget.dataset.id1;
+        wx.request({
+            url: `${app.globalData.publicUrl}/courtAdmin/api/user/${id1}`, //接口地址
+            method: "get",
+            data: {},
+            header: {},
+            success: res => {
+                //团队修改
+                let id_1 = this.data.id
+                let members = [];
+                members.push({ id: res.data.data.id, nickname: res.data.data.nickname, icon: res.data.data.icon })
+                that.setData({ members: members })
+                wx.request({
+                    url: `${app.globalData.publicUrl}/courtAdmin/api/team/${id_1}`, //接口地址
+                    method: "post",
+                    data: { members: members },
+                    header: {},
+                    success: res => {
+                        if (res.data.errcode == 0) {
+                            wx.showToast({
+                                title: '已通过',
+                                icon: 'success',
+                                duration: 2000//延迟两秒
+                            })
+                        }
+                    },
+                    error: err => {
+                    }
+                })
             },
             error: err => {
             }
         })
+
     },
     //驳回
     reject: function (e) {
@@ -41,6 +86,13 @@ Page({
             data: { status: '-1' },
             header: {},
             success: res => {
+                if (res.data.errcode == 0) {
+                    wx.showToast({
+                        title: '已驳回',
+                        icon: 'success',
+                        duration: 2000//延迟两秒
+                    })
+                }
             },
             error: err => {
             }
@@ -76,6 +128,7 @@ Page({
                     error: err => {
                     }
                 })
+
             },
             fail: res => {
                 wx.redirectTo({ url: '/pages/login/index', })

+ 1 - 1
pages/auditTeam/index.wxml

@@ -10,7 +10,7 @@
                 </view>
                 <view class="two_r">
                     <button size="mini" wx:if="{{item.status=='0'}}" bindtap="reject" data-id="{{item._id}}" class="btn1">驳回</button>
-                    <button size="mini" wx:if="{{item.status=='0'}}" bindtap="adopt" data-id="{{item._id}}" class="btn2">通过</button>
+                    <button size="mini"  bindtap="adopt" data-id="{{item._id}}" data-id1="{{item.apply_id}}" class="btn2">通过</button>
                 </view>
 
             </view>

+ 48 - 37
pages/me/index.js

@@ -23,9 +23,9 @@ Page({
     //个人信息详情
     item1: {},
     //团队创建人-团队列表
-    list3: [],
+    list: [],
     //个人用户-所在团队列表
-    list2: [],
+    // list2: [],
     //头像
     icon: '',
     showModal: false,
@@ -59,18 +59,19 @@ Page({
     })
   },
   //团队创建人-团队详情
-  ToDetails: function (e) {
-    let id = e.currentTarget.dataset.id;
-    wx.navigateTo({
-      url: `/pages/teamDetails/detail?id=` + id,
-    })
-  },
   //个人用户-团队详情
-  ToDetailsMember: function (e) {
+  ToDetails: function (e) {
     let id = e.currentTarget.dataset.id;
-    wx.navigateTo({
-      url: `/pages/teamDetails/index?id=` + id,
-    })
+    let type = this.data.item1.type
+    if (type == 1) {
+      wx.navigateTo({
+        url: `/pages/teamDetails/detail?id=` + id,
+      })
+    } else if (type == 2) {
+      wx.navigateTo({
+        url: `/pages/teamDetails/index?id=` + id,
+      })
+    }
   },
 
   //已上传图片
@@ -119,7 +120,7 @@ Page({
   },
   //团队创建人-比赛管理
   Administration: function (e) {
-    var list = JSON.stringify(this.data.list3[0])
+    var list = JSON.stringify(this.data.list[0])
     wx.navigateTo({
       url: `/pages/meMatch/index?list=${list}`,
     })
@@ -145,6 +146,7 @@ Page({
     wx.getStorage({
       key: 'token',
       success: res => {
+        console.log(res);
         //数据请求
         //用户详情
         wx.request({
@@ -154,6 +156,7 @@ Page({
           header: {},
           success: res => {
             that.setData({ item1: res.data.data })
+            console.log(res.data.data);
             let icon = res.data.data.icon[0];
             if (icon) this.setData({ icon: icon.url })
             else this.setData({ icon: '/image/tou.png' })
@@ -161,30 +164,38 @@ Page({
           error: err => {
           }
         })
-        //团队管理员-团队列表
-        wx.request({
-          url: `${app.globalData.publicUrl}/courtAdmin/api/team`, //接口地址
-          method: "get",//请求方法
-          data: {},//请求参数
-          header: {},
-          success: res => {
-            that.setData({ list3: res.data.data })
-          },
-          error: err => {
-          }
-        })
-        //个人用户-所在团队列表
-        wx.request({
-          url: `${app.globalData.publicUrl}/courtAdmin/api/team/userteams`, //接口地址
-          method: "get",//请求方法
-          data: { user_id: res.data.id },//请求参数
-          header: {},
-          success: res => {
-            that.setData({ list2: res.data.data })
-          },
-          error: err => {
-          }
-        })
+        let type = res.data.type
+        console.log(res.data.type);
+        if (type == 1) {
+          //团队管理员-团队列表
+          wx.request({
+            url: `${app.globalData.publicUrl}/courtAdmin/api/team`, //接口地址
+            method: "get",//请求方法
+            data: {},//请求参数
+            header: {},
+            success: res => {
+              console.log(res);
+              that.setData({ list: res.data.data })
+            },
+            error: err => {
+            }
+          })
+        } else if (type == 2) {
+          //个人用户-所在团队列表
+          wx.request({
+            url: `${app.globalData.publicUrl}/courtAdmin/api/team/userteams`, //接口地址
+            method: "get",//请求方法
+            data: { user_id: res.data.id },//请求参数
+            header: {},
+            success: res => {
+              console.log(res);
+              that.setData({ list: res.data.data })
+            },
+            error: err => {
+            }
+          })
+        }
+
       },
       fail: res => {
         wx.redirectTo({ url: '/pages/login/index', })

+ 16 - 16
pages/me/index.wxml

@@ -80,16 +80,16 @@
     </view>
     <!-- 团队创建人-团队列表 -->
     <view class="five">
-      <view class="listtuan" wx:if="{{item1.type=='1'}}">
+      <view class="listtuan">
         <view class="otherInfo">
-          <view class="otherInfo_1">
+          <!-- <view class="otherInfo_1"> -->
             <text class="tuan">我的团队</text>
-            <text class="total">共参加{{list3.length||0}}个队伍</text>
-            <text class="chuang" bindtap="create" wx:if="{{list3.length<1}}">创建团队</text>
+            <text class="total">共参加{{list.length||0}}个队伍</text>
+            <text class="chuang" bindtap="create" wx:if="{{list.length<1 && item1.type=='1'}}">创建团队</text>
           </view>
-        </view>
+        <!-- </view> -->
         <view class="weui-cells mgt-0 {{!showMore? 'hiddenmore' : 'showmore'}}">
-          <view wx:key="item" wx:for="{{list3}}" wx:for-index="idx" wx:key="key" class="list3 {{idx>1 ? 'more-item' : ''}}">
+          <view wx:key="item" wx:for="{{list}}" wx:for-index="idx" wx:key="key" class="list3 {{idx>1 ? 'more-item' : ''}}">
             <view class="dui-left">
               <view class="dui-left1">
                 <image src="{{item.logo[0].url}}" class="dui-image"></image>
@@ -107,7 +107,7 @@
             </view>
             <text class="date">{{item.create_time}}创建</text>
           </view>
-          <block wx:if="{{list3.length>2}}">
+          <block wx:if="{{list.length>2}}">
             <view wx:if="{{showMore}}" class="van" bindtap='listToggle'>
               <van-icon name="arrow-up" />
             </view>
@@ -116,20 +116,20 @@
             </view>
           </block>
         </view>
+        <view class="jian" wx:if="{{item1.type=='0'}}">
+          <view class="viewjian"><text class="jiantext">该账号无法加入或创建团队</text></view>
+        </view>
       </view>
       <!-- 管理员-团队列表 -->
-      <view class="list0" wx:if="{{item1.type=='0'}}">
+      <!-- <view class="list0" wx:if="{{item1.type=='0'}}">
         <view class="otherInfo">
           <text class="tuan">我的团队</text>
           <text class="total1">暂无加入任何团队</text>
         </view>
-        <view class="jian">
-          <view class="viewjian"><text class="jiantext">该账号无法加入或创建团队</text></view>
-        </view>
-      </view>
+      </view> -->
     </view>
     <!-- 个人用户=所在团队列表 -->
-    <view class="five_1">
+    <!-- <view class="five_1">
       <view class="listtuan" wx:if="{{item1.type=='2'}}">
         <view class="otherInfo">
           <view class="otherInfo1_1">
@@ -166,7 +166,7 @@
           </block>
         </view>
       </view>
-    </view>
+    </view> -->
     <view class="six">
       <view class="six-11"><text class="fui">我的服务</text></view>
       <view class="six-0" bindtap="Uploaded">
@@ -185,7 +185,7 @@
           <text class="six-text">修改密码</text>
         </view>
       </view>
-      <view class="six-2" bindtap="examine" data-id="{{list3[0]._id}}" wx:if="{{item1.type=='1'}}">
+      <view class="six-2" bindtap="examine" data-id="{{list[0]._id}}" wx:if="{{item1.type=='1'}}">
         <view class="six-left">
           <text class=" icon iconfont icon-shenhe"></text>
         </view>
@@ -193,7 +193,7 @@
           <text class="six-text">审核队员</text>
         </view>
       </view>
-      <view class="six-3" bindtap="clickme" data-id="{{list3[0]._id}}" wx:if="{{item1.type=='1'}}">
+      <view class="six-3" bindtap="clickme" data-id="{{list[0]._id}}" wx:if="{{item1.type=='1'}}">
         <view class="six-left">
           <text class=" icon iconfont icon-ren_jiesantuandui_line"></text>
         </view>

+ 2 - 2
pages/me/index.wxss

@@ -90,12 +90,12 @@
 .otherInfo {
   text-align: left;
   padding: 10px 10px 10px 5px;
-  height: 30px;
+  height: 50px;
 }
 
 .otherInfo_1 {
   position: relative;
-  top: -35px;
+  /* top: -35px; */
 }
 .otherInfo1_1 {
   position: relative;