guhongwei 2 years ago
parent
commit
2b52b8aaa3
2 changed files with 36 additions and 10 deletions
  1. 19 7
      pages/teamexam/index.js
  2. 17 3
      pages/teamexam/index.wxml

+ 19 - 7
pages/teamexam/index.js

@@ -12,7 +12,7 @@ Page({
         infoHeight: '',
         // 选项卡
         tabs: {
-            active: 'a',
+            active: 'c',
             list: [
                 { title: '系统团队', name: 'a' },
                 { title: '解散团队', name: 'b' },
@@ -23,6 +23,8 @@ Page({
         aList: [],
         // 解散团队
         bList: [],
+        // 参赛团队
+        cList: [],
         // 弹框
         dialog: { title: '信息审核', show: false, type: '1' },
         form: {},
@@ -43,9 +45,16 @@ Page({
         that.setData({ 'tabs.active': e.detail.name })
     },
     // 系统团队查看详情
-    toView: function (e) {
-        let { id } = e.currentTarget.dataset;
-        wx.navigateTo({ url: `/pages/teamInfo/info?id=${id}` })
+    toView: async function (e) {
+        const that = this;
+        let { id, type } = e.currentTarget.dataset;
+        if (type == 'a') {
+            wx.navigateTo({ url: `/pages/teamInfo/info?id=${id}` })
+        } else if (type == 'c') {
+            const arr = await app.$get(`/courtAdmin/api/matchteam/${id}`);
+            if (arr.errcode == '0') that.setData({ form: arr.data });
+            that.setData({ dialog: { title: '团队信息', show: true, type: '2' } })
+        }
     },
     // 系统团队信息审核
     toCheck: async function (e) {
@@ -54,6 +63,7 @@ Page({
         let arr;
         if (type == 'a') arr = await app.$get(`/courtAdmin/api/team/${id}`);
         else if (type == 'b') arr = await app.$get(`/courtAdmin/api/dismissapply/${id}`);
+        else if (type == 'c') arr = await app.$get(`/courtAdmin/api/matchteam/${id}`);
         if (arr.errcode == '0') {
             let data = { tabs_type: type, ...arr.data };
             that.setData({ form: data })
@@ -82,7 +92,7 @@ Page({
             else if (data.tabs_type == 'b') {
                 arr = await app.$post(`/courtAdmin/api/dismissapply/${data.id}`, params);
                 if (arr.errcode == '0' && data.status == '1') arr = await app.$delete(`/courtAdmin/api/team/${data.team_id}`);
-            }
+            } else if (data.tabs_type == 'c') arr = await app.$post(`/courtAdmin/api/matchteam/${data.id}`, params);
             if (arr.errcode == '0') { wx.showToast({ title: `审核信息成功`, icon: 'error', duration: 2000 }); that.toClose(); }
             else wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
         }
@@ -90,7 +100,7 @@ Page({
     // 关闭弹框
     toClose: function () {
         const that = this;
-        that.setData({ dialog: { title: '信息审核', show: false, type: '1' } })
+        that.setData({ dialog: { title: '信息审核', show: false, } })
         that.watchLogin();
     },
     /**
@@ -117,7 +127,9 @@ Page({
                 // 解散团队
                 arr = await app.$get(`/courtAdmin/api/dismissapply`);
                 if (arr.errcode == '0') that.setData({ bList: arr.data });
-
+                // 参赛团队
+                arr = await app.$get(`/courtAdmin/api/matchteam`);
+                if (arr.errcode == '0') that.setData({ cList: arr.data });
             },
             fail: res => {
                 wx.redirectTo({ url: '/pages/index/index', })

+ 17 - 3
pages/teamexam/index.wxml

@@ -15,7 +15,7 @@
                         <view class="other_1"><text>状态:</text><text>{{item.status=='1'?'审核通过':item.status=='0'?'待审核':'拒绝审核'}}</text></view>
                     </view>
                     <view class="btn">
-                        <button size="mini" type="default" bindtap="toView" data-id="{{item._id}}">详情</button>
+                        <button size="mini" type="default" bindtap="toView" data-id="{{item._id}}" data-type="a">详情</button>
                         <button size="mini" type="default" bindtap="toCheck" data-id="{{item._id}}" data-type="a" wx:if="{{item.status=='0'}}">审核</button>
                     </view>
                 </view>
@@ -32,7 +32,19 @@
                     </view>
                 </view>
             </view>
-            <view wx:elif="{{tabs.active=='c'}}">3</view>
+            <view wx:elif="{{tabs.active=='c'}}" class="b">
+                <view class="blist" wx:for="{{cList}}" wx:key="item">
+                    <view class="name">{{item.status=='0'?'待审中':item.status=='1'?'审核通过':'审核拒绝'}}</view>
+                    <view class="other">
+                        <view class="otherInfo">参赛团队:<text>{{item.team_name}}</text></view>
+                        <view class="otherInfo">申请时间:<text>{{item.apply_time }}</text></view>
+                    </view>
+                    <view class="btn">
+                        <button size="mini" type="default" bindtap="toView" data-id="{{item._id}}" data-type="c">详情</button>
+                        <button size="mini" type="default" bindtap="toCheck" data-id="{{item._id}}" data-type="c" wx:if="{{item.status=='0'}}">审核</button>
+                    </view>
+                </view>
+            </view>
         </view>
     </view>
 </mobile-main>
@@ -53,6 +65,8 @@
                 </view>
             </form>
         </view>
-
+        <view class="dialog_two" wx:elif="{{dialog.type=='2'}}">
+            参赛团队详情
+        </view>
     </view>
 </e-dialog>