Переглянути джерело

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

zs 3 роки тому
батько
коміт
0911299c8a
5 змінених файлів з 132 додано та 30 видалено
  1. 52 0
      pages/manage/index.js
  2. 13 6
      pages/manage/index.wxml
  3. 64 21
      pages/manage/index.wxss
  4. 1 1
      pages/me/index.js
  5. 2 2
      pages/me/index.wxml

+ 52 - 0
pages/manage/index.js

@@ -20,6 +20,58 @@ Page({
   back: function () {
     wx.navigateBack({ url: '/pages/home/index' })
   },
+  // 审核团队
+  toCheck: function (e) {
+    const that = this;
+    let { id, status } = e.currentTarget.dataset;
+    wx.showModal({
+        content: `您确定提交${status == '1' ? '通过' : '驳回'}操作吗?`,
+        title: '提示',
+        success(result) {
+            if (result.confirm) {
+                if (status == '1') {
+                    wx.request({
+                        url: `${app.globalData.publicUrl}/courtAdmin/api/team/${id}`,
+                        method: "post",
+                        data: { status: status },
+                        header: {},
+                        success: res => {
+                          console.log(res.data.data);
+
+                            if (res.data.errcode === 0) {
+                                wx.showToast({ title: '审核成功', icon: 'success', duration: 2000 });
+                                that.watchLogin();
+                            } else {
+                                wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })
+                            }
+                        },
+                        error: err => {
+                        }
+                    })
+                } else {
+                    wx.request({
+                        url: `${app.globalData.publicUrl}/courtAdmin/api/team/${id}`,
+                        method: "post",
+                        data: { status: status },
+                        header: {},
+                        success: res => {
+                          console.log(res.data.data);
+                            if (res.data.errcode === 0) {
+                                wx.showToast({ title: '审核成功', icon: 'success', duration: 2000 });
+                                that.watchLogin();
+                            } else {
+                                wx.showToast({ title: res.data.errmsg, icon: 'error', duration: 2000 })
+                            }
+                        },
+                        error: err => {
+                        }
+                    })
+
+                }
+            } else if (result.cancel) { }
+        }
+    })
+},
   //查询解散或参赛团队详情
   shen: function (e) {
     let obj = e.currentTarget.dataset;

+ 13 - 6
pages/manage/index.wxml

@@ -4,14 +4,21 @@
       <van-tabs active="{{ active }}">
         <van-tab title="全部团队">
           <view>
-            <view class="list" wx:key="item" wx:for="{{teamlist}}" data-id="{{item._id}}" bindtap='shens'>
+            <view class="list" wx:key="item" wx:for="{{teamlist}}" >
               <view class="two">
-                <view class="left">
+                <view class="left" bindtap='shens' data-id="{{item._id}}">
                   <image class="head" src="{{item.logo[0].url}}"></image>
                   <text class="group" bindtap="tiao">{{item.name}}</text>
                   <text class="person">共{{item.members.length||0}}人</text>
                   <view class="fou"><text>创建人:{{item.create_user}}</text></view>
-                  <view class="time"><text class="date">{{item.create_time}}创建</text></view>
+                  <view class="time">
+                    <text class="date">{{item.create_time}}创建</text>
+                    <text class="shenhe">{{item.status=='1'?'已通过':item.status=='0'?'待通过':'已驳回'}}</text>
+                  </view>
+                </view>
+                <view class="right">
+                  <button class="button_1" wx:if="{{item.status=='0'}}" data-id="{{item._id}}" data-status="1" bindtap="toCheck">通过</button>
+                  <button class="button_2" wx:if="{{item.status=='0'}}" data-id="{{item._id}}" data-status="-1" bindtap="toCheck">驳回</button>
                 </view>
               </view>
             </view>
@@ -40,13 +47,13 @@
             <view class="list" wx:key="item" wx:for="{{dissolution}}">
               <view class="two">
                 <view class="left">
-                  <text class="group" data-id="{{item._id}}" data-name="{{item.team_id}}" bindtap='shen' data-route="detail" >{{item.team_name}}</text>
+                  <text class="group" data-id="{{item._id}}" data-name="{{item.team_id}}" bindtap='shen' data-route="detail">{{item.team_name}}</text>
                   <view class="fou"><text>创建人:{{item.create_user}}</text></view>
                   <view class="time"><text class="date">申请时间:{{item.apply_time}}</text></view>
                   <view class="time"><text class="date">解散团队原因:{{item.resaon}}</text></view>
                 </view>
-                <view class="right" >
-                  <button class="buttons" wx:if="{{item.status=='0'}}"data-id="{{item._id}}" data-teamid="{{item.team_id}}" bindtap='out'>通过</button>
+                <view class="right">
+                  <button class="buttons" wx:if="{{item.status=='0'}}" data-id="{{item._id}}" data-teamid="{{item.team_id}}" bindtap='out'>通过</button>
                 </view>
               </view>
             </view>

+ 64 - 21
pages/manage/index.wxss

@@ -2,63 +2,101 @@
   position: relative;
   width: 100%;
 }
+
 .van-tabs__line {
   background-color: blue !important;
 }
-.one{
+
+.one {
   margin-top: -5px;
 }
 
-.list{
+.list {
   margin-top: 5%;
 }
-.two{
+
+.two {
   width: 93%;
   float: left;
   margin-left: 3%;
 }
-.left{
+
+.left {
   float: left;
   width: 70%;
   padding-top: 10px;
   padding-left: 10px;
   padding-bottom: 10px;
 }
-.two{
+
+.two {
   background-color: white;
   margin-bottom: 3%;
   border-radius: 8px;
 }
-.right{
+
+.right {
   float: left;
   width: 20%;
   margin-top: 9%;
 }
-.button{
+
+.shenhe {
+  color: red;
+  margin: 0 0 0 35px;
+}
+
+.button_1 {
+  margin-top: -16px !important;
+  width: 77px !important;
+  height: 30px;
+  background-color: rgba(243, 32, 162, 0.5);
+  background-image: linear-gradient(to right, rgb(236, 75, 83), rgb(247, 41, 230));
+  border-radius: 30px;
+  color: #ffffff;
+  font-size: 13px;
+  line-height: 15px;
+}
+
+.button_2 {
+  margin-top: 12px !important;
+  width: 77px !important;
+  height: 30px;
+  background-color: rgb(105, 105, 105);
+  border-radius: 30px;
+  color: #ffffff;
+  font-size: 13px;
+  line-height: 15px;
+}
+
+.button {
   margin-top: 0 !important;
   width: 77px !important;
   height: 30px;
-  background-color: rgba(243, 32, 162,0.5);
-  background-image: linear-gradient(to right, rgb(236, 75, 83) , rgb(247, 41, 230));
-  border-radius: 30px; 
-  color:#ffffff; 
+  background-color: rgba(243, 32, 162, 0.5);
+  background-image: linear-gradient(to right, rgb(236, 75, 83), rgb(247, 41, 230));
+  border-radius: 30px;
+  color: #ffffff;
   font-size: 13px;
   line-height: 15px;
 }
-.resaon{
+
+.resaon {
   padding-left: 2px;
 }
-.buttons{
+
+.buttons {
   margin-top: 0 !important;
   width: 77px !important;
   height: 30px;
   background-color: rgba(59, 63, 247, 0.5);
-  background-image: linear-gradient(to right, rgb(75, 91, 236) , rgb(213, 41, 247));
-  border-radius: 30px; 
-  color:#ffffff; 
+  background-image: linear-gradient(to right, rgb(75, 91, 236), rgb(213, 41, 247));
+  border-radius: 30px;
+  color: #ffffff;
   font-size: 13px;
   line-height: 15px;
 }
+
 .head {
   float: left;
   margin-left: 7px;
@@ -67,14 +105,16 @@
   overflow: hidden;
   border-radius: 90px;
 }
-.group{
+
+.group {
   font-size: 16px;
   line-height: 30px;
   font-weight: 500;
   margin-left: 4%;
   margin-right: 8%;
 }
-.fou{
+
+.fou {
   font-size: 13px;
   color: #9e9e9e;
   margin: 2%;
@@ -82,16 +122,19 @@
   float: left;
   width: 100%;
 }
-.person{
+
+.person {
   font-size: 13px;
   color: #9e9e9e;
 }
-.time{
+
+.time {
   margin-left: 10px;
   margin-bottom: 1.5%;
   font-size: 13px;
   color: #9e9e9e;
 }
-.date{
+
+.date {
   margin-right: 5px;
 }

+ 1 - 1
pages/me/index.js

@@ -135,7 +135,7 @@ Page({
       wx.request({
         url: `${app.globalData.publicUrl}/courtAdmin/api/team`,
         method: "get",
-        data: { create_id: id },
+        data: { create_id: id, status: 1 },
         header: {},
         success: res => {
           this.setData({ list: res.data.data })

+ 2 - 2
pages/me/index.wxml

@@ -36,11 +36,11 @@
     </view>
     <!-- 上传比分 -->
     <view class="four" wx:if="{{item1.type=='1'}}" wx:for="{{match}}" wx:key="item">
-      <view class="thr" wx:if="{{item.status=='1'}}">
+      <view class="thr">
         <view class="left2">
           <text class="text4">可对正在进行的比赛上次比分</text>
         </view>
-        <view class="right2" bindtap="upload" data-id="{{item._id}}">
+        <view class="right2" bindtap="upload" data-id="{{item._id}}" wx:if="{{item.status=='1'}}">
           <button class="buttons" size="mini">上传比分</button>
         </view>
       </view>