guhongwei 2 vuotta sitten
vanhempi
commit
26ca1fc268

+ 1 - 0
pages/basic/index.js

@@ -91,6 +91,7 @@ Page({
                 const arr = await app.$get(`/courtAdmin/api/user/${res.data._id}`);
                 const arr = await app.$get(`/courtAdmin/api/user/${res.data._id}`);
                 if (arr.errcode == '0') {
                 if (arr.errcode == '0') {
                     let form = arr.data;
                     let form = arr.data;
+                    wx.setStorage({ key: "token", data: form })
                     that.setData({ form: form });
                     that.setData({ form: form });
                     that.setData({ icon: form.icon });
                     that.setData({ icon: form.icon });
                 }
                 }

+ 2 - 1
pages/matchTeamsh/index.wxml

@@ -22,8 +22,9 @@
             </view>
             </view>
             <view wx:elif="{{tabs.active=='b'}}" class="b">
             <view wx:elif="{{tabs.active=='b'}}" class="b">
                 <view class="blist" wx:for="{{bList}}" wx:key="item">
                 <view class="blist" wx:for="{{bList}}" wx:key="item">
-                    <view class="name">{{item.status=='0'?'待审中':item.status=='1'?'审核通过':'审核拒绝'}}</view>
+                    <view class="name">{{item.team_name}}</view>
                     <view class="other">
                     <view class="other">
+                        <view class="otherInfo">审核状态:<text>{{item.status=='0'?'待审中':item.status=='1'?'审核通过':'审核拒绝'}}</text></view>
                         <view class="otherInfo">申请时间:<text>{{item.apply_time}}</text></view>
                         <view class="otherInfo">申请时间:<text>{{item.apply_time}}</text></view>
                         <view class="otherInfo">解散原因:<text>{{item.resaon }}</text></view>
                         <view class="otherInfo">解散原因:<text>{{item.resaon }}</text></view>
                     </view>
                     </view>

+ 22 - 1
pages/notice/index.js

@@ -43,6 +43,26 @@ Page({
         if (arr.errcode == '0') wx.showToast({ title: `已读信息成功`, icon: 'success', duration: 2000 })
         if (arr.errcode == '0') wx.showToast({ title: `已读信息成功`, icon: 'success', duration: 2000 })
         that.watchLogin()
         that.watchLogin()
     },
     },
+    // 撤回
+    toDel: function (e) {
+        const that = this;
+        const { id } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认删除该条数据?',
+            async success(res) {
+                if (res.confirm) {
+                    const arr = await app.$delete(`/courtAdmin/api/notice/${id}`);
+                    if (arr.errcode == '0') {
+                        wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
+                        that.watchLogin()
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            }
+        })
+    },
     // 关闭弹框
     // 关闭弹框
     toClose: function () {
     toClose: function () {
         this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
         this.setData({ dialog: { title: '详细信息', show: false, type: '1' } })
@@ -105,7 +125,8 @@ Page({
      * 生命周期函数--监听页面显示
      * 生命周期函数--监听页面显示
      */
      */
     onShow: function () {
     onShow: function () {
-
+        const that = this;
+        that.watchLogin()
     },
     },
 
 
     /**
     /**

+ 2 - 2
pages/notice/index.wxml

@@ -7,12 +7,12 @@
             <view class="list" wx:for="{{list}}" wx:key="item">
             <view class="list" wx:for="{{list}}" wx:key="item">
                 <view class="name"><text>{{item.send_time}}</text></view>
                 <view class="name"><text>{{item.send_time}}</text></view>
                 <view class="other">
                 <view class="other">
-                    <view class="other_1"><text>发送类型:</text><text>{{typeList[item.type].value}}</text></view>
-                    <view class="other_1"><text>发送人姓名:{{item.send_name||'暂无昵称'}}</text></view>
+                    <view class="other_1"><text>接收人类型:</text><text>{{typeList[item.type].value}}</text></view>
                     <view class="other_1"><text>发送内容:</text><text>{{item.content}}</text></view>
                     <view class="other_1"><text>发送内容:</text><text>{{item.content}}</text></view>
                 </view>
                 </view>
                 <view class="btn">
                 <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}}">详情</button>
+                    <button size="mini" type="warn" bindtap="toDel" data-id="{{item._id}}" wx:if="{{user.type=='0'}}">删除</button>
                     <button size="mini" type="default" bindtap="toSend" data-id="{{item._id}}" wx:if="{{item.is_read=='0'}}">已读</button>
                     <button size="mini" type="default" bindtap="toSend" data-id="{{item._id}}" wx:if="{{item.is_read=='0'}}">已读</button>
                 </view>
                 </view>
             </view>
             </view>

+ 37 - 8
pages/user/index.js

@@ -10,6 +10,15 @@ Page({
         frameStyle: { useTop: true, name: '用户管理', leftArrow: true, useBar: false },
         frameStyle: { useTop: true, name: '用户管理', leftArrow: true, useBar: false },
         // 主体高度
         // 主体高度
         infoHeight: '',
         infoHeight: '',
+        // 选项卡
+        tabs: {
+            active: 'a',
+            list: [
+                { title: '管理员', name: 'a' },
+                { title: '团队创建人', name: 'b' },
+                { title: '个人用户', name: 'c' },
+            ],
+        },
         list: [],
         list: [],
         // 弹框
         // 弹框
         dialog: { title: '详细信息', show: false, type: '1' },
         dialog: { title: '详细信息', show: false, type: '1' },
@@ -25,6 +34,12 @@ Page({
     back: function () {
     back: function () {
         wx.navigateBack({ url: '/pages/me/index' })
         wx.navigateBack({ url: '/pages/me/index' })
     },
     },
+    // 选项卡
+    tabsChange: function (e) {
+        const that = this;
+        that.setData({ 'tabs.active': e.detail.name })
+        that.watchLogin()
+    },
     // 添加用户
     // 添加用户
     toAdd: function () {
     toAdd: function () {
         wx.navigateTo({ url: `/pages/user/detail` })
         wx.navigateTo({ url: `/pages/user/detail` })
@@ -58,12 +73,22 @@ Page({
     // 删除
     // 删除
     toDel: async function (e) {
     toDel: async function (e) {
         const that = this;
         const that = this;
-        let { id } = e.currentTarget.dataset;
-        const arr = await app.$delete(`/courtAdmin/api/user/${id}`);
-        if (arr.errcode == '0') {
-            wx.showToast({ title: `删除信息成功`, icon: 'error', duration: 2000 });
-            that.watchLogin();
-        }
+        const { id } = e.currentTarget.dataset;
+        wx.showModal({
+            title: '提示',
+            content: '是否确认删除该条数据?',
+            async success(res) {
+                if (res.confirm) {
+                    const arr = await app.$delete(`/courtAdmin/api/user/${id}`);
+                    if (arr.errcode == '0') {
+                        wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
+                        that.watchLogin()
+                    } else {
+                        wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
+                    }
+                }
+            }
+        })
     },
     },
     // 选择状态
     // 选择状态
     statusChange: function (e) {
     statusChange: function (e) {
@@ -107,11 +132,15 @@ Page({
     // 监听用户是否登录
     // 监听用户是否登录
     watchLogin: function () {
     watchLogin: function () {
         const that = this;
         const that = this;
+        let active = that.data.tabs.active;
+        let type = active == 'a' ? '0' : active == 'b' ? '1' : '2';
         wx.getStorage({
         wx.getStorage({
             key: 'token',
             key: 'token',
             success: async res => {
             success: async res => {
-                const arr = await app.$get(`/courtAdmin/api/user`);
-                if (arr.errcode == '0') this.setData({ list: arr.data })
+                const arr = await app.$get(`/courtAdmin/api/user`, { type: type });
+                if (arr.errcode == '0') {
+                    that.setData({ list: arr.data })
+                }
             },
             },
             fail: res => {
             fail: res => {
                 wx.redirectTo({ url: '/pages/login/index', })
                 wx.redirectTo({ url: '/pages/login/index', })

+ 2 - 1
pages/user/index.json

@@ -2,6 +2,7 @@
     "component": true,
     "component": true,
     "usingComponents": {
     "usingComponents": {
         "mobile-main": "/commpents/mobile-frame/mobile-main",
         "mobile-main": "/commpents/mobile-frame/mobile-main",
-        "e-dialog": "/commpents/dialog/index"
+        "e-dialog": "/commpents/dialog/index",
+        "e-tabs": "/commpents/tabs/index"
     }
     }
 }
 }

+ 47 - 12
pages/user/index.wxml

@@ -3,19 +3,54 @@
         <view class="one">
         <view class="one">
             <button size="mini" bindtap="toAdd">添加用户</button>
             <button size="mini" bindtap="toAdd">添加用户</button>
         </view>
         </view>
-        <view class="two">
-            <view class="list" wx:for="{{list}}" wx:key="item">
-                <view class="name textOver">{{item.nickname||'暂无昵称'}}</view>
-                <view class="other">
-                    <view class="other_1"><text>用户类型:</text><text>{{item.type=='0'?'管理员':item.type=='1'?'团队创建人':item.type=='2'?'个人用户':''}}</text></view>
-                    <view class="other_1"><text>手机:</text><text>{{item.phone}}</text></view>
-                    <view class="other_1"><text>状态:</text><text>{{item.status=='1'?'审核通过':item.status=='0'?'待审核':'拒绝审核'}}</text></view>
+        <view class="two" style="height:{{infoHeight-45}}px;">
+            <e-tabs tabs="{{tabs}}" bind:tabsChange="tabsChange"></e-tabs>
+            <view wx:if="{{tabs.active=='a'}}" class="a">
+                <view class="list" wx:for="{{list}}" wx:key="item">
+                    <view class="name textOver">{{item.nickname||'暂无昵称'}}</view>
+                    <view class="other">
+                        <view class="other_1"><text>用户类型:</text><text>{{item.type=='0'?'管理员':item.type=='1'?'团队创建人':item.type=='2'?'个人用户':''}}</text></view>
+                        <view class="other_1"><text>手机:</text><text>{{item.phone}}</text></view>
+                        <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="primary" bindtap="toEdit" data-id="{{item._id}}" wx:if="{{item.status=='0'||item.status=='-1'}}">修改</button>
+                        <button size="mini" type="default" bindtap="toCheck" data-id="{{item._id}}" wx:if="{{item.status=='0'}}">审核</button>
+                        <!-- <button size="mini" type="warn" bindtap="toDel" data-id="{{item._id}}">删除</button> -->
+                    </view>
                 </view>
                 </view>
-                <view class="btn">
-                    <button size="mini" type="default" bindtap="toView" data-id="{{item._id}}">详情</button>
-                    <button size="mini" type="primary" bindtap="toEdit" data-id="{{item._id}}" wx:if="{{item.status=='0'||item.status=='-1'}}">修改</button>
-                    <button size="mini" type="default" bindtap="toCheck" data-id="{{item._id}}" wx:if="{{item.status=='0'}}">审核</button>
-                    <button size="mini" type="warn" bindtap="toDel" data-id="{{item._id}}">删除</button>
+            </view>
+            <view wx:elif="{{tabs.active=='b'}}" class="b">
+                <view class="list" wx:for="{{list}}" wx:key="item">
+                    <view class="name textOver">{{item.nickname||'暂无昵称'}}</view>
+                    <view class="other">
+                        <view class="other_1"><text>用户类型:</text><text>{{item.type=='0'?'管理员':item.type=='1'?'团队创建人':item.type=='2'?'个人用户':''}}</text></view>
+                        <view class="other_1"><text>手机:</text><text>{{item.phone}}</text></view>
+                        <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="primary" bindtap="toEdit" data-id="{{item._id}}" wx:if="{{item.status=='0'||item.status=='-1'}}">修改</button>
+                        <button size="mini" type="default" bindtap="toCheck" data-id="{{item._id}}" wx:if="{{item.status=='0'}}">审核</button>
+                        <button size="mini" type="warn" bindtap="toDel" data-id="{{item._id}}">删除</button>
+                    </view>
+                </view>
+            </view>
+            <view wx:elif="{{tabs.active=='c'}}" class="c">
+                <view class="list" wx:for="{{list}}" wx:key="item">
+                    <view class="name textOver">{{item.nickname||'暂无昵称'}}</view>
+                    <view class="other">
+                        <view class="other_1"><text>用户类型:</text><text>{{item.type=='0'?'管理员':item.type=='1'?'团队创建人':item.type=='2'?'个人用户':''}}</text></view>
+                        <view class="other_1"><text>手机:</text><text>{{item.phone}}</text></view>
+                        <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="primary" bindtap="toEdit" data-id="{{item._id}}" wx:if="{{item.status=='0'||item.status=='-1'}}">修改</button>
+                        <button size="mini" type="default" bindtap="toCheck" data-id="{{item._id}}" wx:if="{{item.status=='0'}}">审核</button>
+                        <button size="mini" type="warn" bindtap="toDel" data-id="{{item._id}}">删除</button>
+                    </view>
                 </view>
                 </view>
             </view>
             </view>
         </view>
         </view>

+ 6 - 4
pages/user/index.wxss

@@ -1,15 +1,18 @@
 .main {
 .main {
     position: relative;
     position: relative;
     width: 100%;
     width: 100%;
+    overflow: hidden;
 }
 }
 
 
 .main .one {
 .main .one {
     float: left;
     float: left;
     width: 100%;
     width: 100%;
+    height: 45px;
+    overflow: hidden;
     text-align: center;
     text-align: center;
     background-color: #fff;
     background-color: #fff;
     padding: 5px 0;
     padding: 5px 0;
-    margin: 0 0 10px 0;
+    border-bottom: 1px solid #f1f1f1;
     overflow-x: hidden;
     overflow-x: hidden;
 }
 }
 
 
@@ -21,9 +24,8 @@
 
 
 .main .two {
 .main .two {
     float: left;
     float: left;
-    width: 95%;
-    padding: 0 10px;
-    overflow-x: hidden;
+    width: 100%;
+    overflow-y: auto;
 }
 }
 
 
 .main .two .list {
 .main .two .list {