Преглед на файлове

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

zs преди 3 години
родител
ревизия
e22dbc8cdc
променени са 3 файла, в които са добавени 141 реда и са изтрити 143 реда
  1. 92 83
      pages/auditTeam/index.js
  2. 18 15
      pages/auditTeam/index.wxml
  3. 31 45
      pages/auditTeam/index.wxss

+ 92 - 83
pages/auditTeam/index.js

@@ -11,129 +11,127 @@ Page({
         frameStyle: { useTop: true, name: '审核队员', leftArrow: true, useBar: false },
         frameStyle: { useTop: true, name: '审核队员', leftArrow: true, useBar: false },
         //加入团队列表
         //加入团队列表
         list: [],
         list: [],
-        menbers: [],
+        // 团队id
         id: '',
         id: '',
         show: false,
         show: false,
-        show1: false
     },
     },
-
     back: function () {
     back: function () {
         wx.navigateBack({ url: '/pages/me/index' })
         wx.navigateBack({ url: '/pages/me/index' })
     },
     },
-    chickme: function (e) {
-        this.setData({ 
-            show: true ,
-            id1:e.currentTarget.dataset.id1
-        })
-        
-    },
-    chickme1: function (e) {
-        this.setData({
-             show1: true,
-             id1:e.currentTarget.dataset.id1
-            })
-    },
-    onClose() {
-        this.setData({ show: false })
-    },
-    //通过
-    adopt: function (e) {
+    // 详细信息
+    toView: function (e) {
         const that = this;
         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 { userid } = e.currentTarget.dataset;
+        that.setData({ show: true })
         //用户详情
         //用户详情
-        let id1 = e.currentTarget.dataset.id1;
         wx.request({
         wx.request({
-            url: `${app.globalData.publicUrl}/courtAdmin/api/user/${id1}`, //接口地址
+            url: `${app.globalData.publicUrl}/courtAdmin/api/user/${userid}`, //接口地址
             method: "get",
             method: "get",
             data: {},
             data: {},
             header: {},
             header: {},
             success: res => {
             success: res => {
-                let id_1 = that.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 => {
-                    }
-                })
+                that.setData({ details: res.data.data })
             },
             },
             error: err => {
             error: err => {
             }
             }
         })
         })
     },
     },
-    //驳回
-    reject: function (e) {
-        let { id } = e.currentTarget.dataset;
-        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
+    // 审核
+    toCheck: function (e) {
+        const that = this;
+        let { id, userid, status } = e.currentTarget.dataset;
+        let id_1 = that.data.id
+        wx.showModal({
+            content: `您确定提交${status == '1' ? '通过' : '驳回'}操作吗?`,
+            title: '提示',
+            success: (result) => {
+                if (status == '1') {
+                    //修改状态-加入团队修改
+                    wx.request({
+                        url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply/${id}`,
+                        method: "post",
+                        data: { status: status },
+                        header: {},
+                        success: res => {
+                            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 => {
+                        }
+                    })
+                    //用户详情
+                    wx.request({
+                        url: `${app.globalData.publicUrl}/courtAdmin/api/user/${userid}`, //接口地址
+                        method: "get",
+                        data: {},
+                        header: {},
+                        success: res => {
+                            let member = [];
+                            member.push({ id: res.data.data.id, nickname: res.data.data.nickname, icon: res.data.data.icon })
+                            that.setData({ member: member })
+                            let members = that.data.members;
+                            members = [...members, ...member];
+                            wx.request({
+                                url: `${app.globalData.publicUrl}/courtAdmin/api/team/${id_1}`,
+                                method: "post",
+                                data: { members: members },
+                                header: {},
+                                success: res => {
+                                },
+                                error: err => {
+                                }
+                            })
+                        },
+                        error: err => {
+                        }
+                    })
+                } else {
+                    wx.request({
+                        url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply/${id}`,
+                        method: "post",
+                        data: { status: status },
+                        header: {},
+                        success: res => {
+                            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 => {
+                        }
                     })
                     })
+
                 }
                 }
             },
             },
-            error: err => {
-            }
         })
         })
     },
     },
     /**
     /**
     * 生命周期函数--监听页面加载
     * 生命周期函数--监听页面加载
     */
     */
     onLoad: function (options) {
     onLoad: function (options) {
-        this.setData({ id: options.id })
+        let id = options.id;
+        this.setData({ id: id })
         // 计算高度
         // 计算高度
         this.searchHeight();
         this.searchHeight();
         // 监听用户是否登录
         // 监听用户是否登录
-        this.watchLogin();
+        this.watchLogin(id);
     },
     },
     // 监听用户是否登录
     // 监听用户是否登录
     watchLogin: function () {
     watchLogin: function () {
         const that = this;
         const that = this;
-        var id = that.data.id;
         wx.getStorage({
         wx.getStorage({
             key: 'token',
             key: 'token',
             success: res => {
             success: res => {
                 wx.request({
                 wx.request({
                     url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply`,
                     url: `${app.globalData.publicUrl}/courtAdmin/api/joinapply`,
                     method: "get",
                     method: "get",
-                    data: { team_id: id },
+                    data: { team_id: that.data.id },
                     header: {},
                     header: {},
                     success: res => {
                     success: res => {
                         that.setData({ list: res.data.data })
                         that.setData({ list: res.data.data })
@@ -141,6 +139,17 @@ Page({
                     error: err => {
                     error: err => {
                     }
                     }
                 })
                 })
+                wx.request({
+                    url: `${app.globalData.publicUrl}/courtAdmin/api/team/${that.data.id}`,
+                    method: "get",
+                    data: {},
+                    header: {},
+                    success: res => {
+                        that.setData({ members: res.data.data.members })
+                    },
+                    error: err => {
+                    }
+                })
 
 
             },
             },
             fail: res => {
             fail: res => {

+ 18 - 15
pages/auditTeam/index.wxml

@@ -1,24 +1,27 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="main" style="height:{{infoHeight}}px;">
     <view slot="info" class="main" style="height:{{infoHeight}}px;">
-        <view class="one" wx:key="item" wx:for="{{list}}">
-            <view class="two">
-                <view class="two_l">
-                    <view class="text1">{{item.apply_user}}
+        <view class="one">
+            <view class="list" wx:for="{{list}}" wx:key="item">
+                <view class="list_1">
+                    <view class="list_1_1 textOver">
+                        <text>{{item.apply_user}}</text>
                         <text class="text3">{{item.status=='1'?'已通过':item.status=='0'?'待通过':'已驳回'}}</text>
                         <text class="text3">{{item.status=='1'?'已通过':item.status=='0'?'待通过':'已驳回'}}</text>
                     </view>
                     </view>
-                    <view class="text2">申请时间:{{item.apply_time}}</view>
+                    <view class="list_1_2">申请时间:{{item.apply_time}}</view>
                 </view>
                 </view>
-                <view class="two_r">
-                    <!-- <button size="mini" wx:if="{{item.status=='0'}}" bindtap="reject" data-id="{{item._id}}" data-id1="{{item.apply_id}}" class="btn1">驳回</button>
-                    <button size="mini" wx:if="{{item.status=='0'}}" bindtap="adopt" data-id="{{item._id}}" data-id1="{{item.apply_id}}" class="btn2">通过</button> -->
-                    <button size="mini" bindtap="chickme" data-id1="{{item.apply_id}}" class="btn1">驳回</button>
-                    <van-dialog use-solt show="{{show}}" title="是否驳回" message="id为{{id1}}的申请" show-cancel-button bind:close="onClose" bind:confirm="reject" data-id="{{item._id}}" data-id1="{{item.apply_id}}">
-                    </van-dialog>
-                    <button size="mini" bindtap="chickme1" data-id1="{{item.apply_id}}" class="btn2">通过</button>
-                    <van-dialog use-solt show="{{show1}}" title="是否通过" message="id为{{id1}}的申请" show-cancel-button bind:close="onClose" data-id="{{item._id}}" bind:confirm="adopt" data-id1="{{item.apply_id}}">
-                    </van-dialog>
+                <view class="list_2">
+                    <button type="warn" size="mini" wx:if="{{item.status=='0'}}" bindtap="toCheck" data-id="{{item._id}}" data-userid="{{item.apply_id}}" data-status="-1">驳回</button>
+                    <button type="primary" size="mini" wx:if="{{item.status=='0'}}" bindtap="toCheck" data-id="{{item._id}}" data-userid="{{item.apply_id}}" data-status="1">通过</button>
+                    <button size="mini" bindtap="toView" data-userid="{{item.apply_id}}" data-id="{{item._id}}">信息</button>
                 </view>
                 </view>
             </view>
             </view>
         </view>
         </view>
     </view>
     </view>
-</mobile-main>
+</mobile-main>
+<van-dialog use-slot title="详细信息" show="{{ show }}" :showCancelButton="{{false}}" confirmButtonText="返回" :closeOnClickOverlay="{{false}}">
+    <view class="text1">id:  {{details.id}}</view>
+    <view class="text1">名称: {{details.nickname}}</view>
+    <view class="text1">phone:  {{details.phone}}</view>
+    <view class="text1">性别:  {{details.gender}}</view>
+    <view class="text1">邮箱:  {{details.email}}</view>
+</van-dialog>

+ 31 - 45
pages/auditTeam/index.wxss

@@ -2,73 +2,59 @@
     position: relative;
     position: relative;
     width: 100%;
     width: 100%;
     background-color: #eeeeee;
     background-color: #eeeeee;
-    padding: 10px 0 0 0;
 }
 }
 
 
-.one {
-    margin: 0 12px 10px 12px;
-    background-color: #fff;
-    height: 96px;
+.main .one {
+    float: left;
+    width: 95%;
+    margin: 10px 10px 0 10px;
 }
 }
 
 
-.two {
+.main .one .list {
+    float: left;
+    width: 95%;
+    margin: 0 0 10px 0;
     background-color: #fff;
     background-color: #fff;
+    border-radius: 5px;
+    padding: 10px;
 }
 }
 
 
-.two_l {
-    width: 70%;
+.main .one .list .list_1 {
     float: left;
     float: left;
-    margin: 10px 0 0 12px;
+    width: 70%;
 }
 }
 
 
-.two_r {
-    width: 20%;
+.main .one .list .list_1 .list_1_1 {
     float: left;
     float: left;
-    padding: 13px 0 0 0;
-}
-
-.icon {
-    height: 50px;
-    width: 50px;
-    padding: 12px;
+    width: 100%;
+    font-size: 16px;
+    margin: 0 0 5px 0;
 }
 }
 
 
-.text1 {
-    margin: 10px 0 10px 0;
+.main .one .list .list_1 .list_1_1 text:nth-child(2) {
+    padding: 0 0 0 10px;
+    color: #ff0000;
+    font-size: 14px;
 }
 }
 
 
-.text2 {
-    margin: 0 0 8px 0;
+.main .one .list .list_1 .list_1_2 {
+    float: left;
+    width: 100%;
     font-size: 14px;
     font-size: 14px;
     color: #666;
     color: #666;
 }
 }
 
 
-.btn1 {
-    width: 70px !important;
-    height: 30px !important;
-    background-color: rgba(136, 136, 136, 0.4);
-    border-radius: 30px;
-    color: #5e5e5e;
-}
-
-.btn2 {
-    width: 70px !important;
-    height: 30px !important;
-    background-image: linear-gradient(to right, #f43f3f, #ce4bd2);
-    border-radius: 30px;
-    color: #ffffff;
+.main .one .list .list_2 {
+    float: left;
+    width: 30%;
     text-align: center;
     text-align: center;
-    margin: 10px 0 0 0;
 }
 }
 
 
-.text3 {
+.main .one .list .list_2 button {
+    margin: 0 2px 2px 0;
     font-size: 12px;
     font-size: 12px;
-    margin: 0 0 0 20px;
-    color: #f18080;
 }
 }
-.van-dialog__header {
-    padding-top: 20px;
-    font-weight: 500;
-    line-height: 24px;
-    text-align: center;
+
+.text1 {
+    margin: 4px 0 0 20px;
 }
 }