zhaoxiaohai 3 years ago
parent
commit
653a6bbcb3

+ 1 - 2
app.json

@@ -78,8 +78,7 @@
     "sitemapLocation": "sitemap.json",
     "lazyCodeLoading": "requiredComponents",
     "networkTimeout": {
-        "request": 10000,
-        "downloadFile": 10000
+        "request": 20000
     },
     "debug": true
 }

+ 57 - 8
pages/teamManagement/applyFor.js

@@ -13,18 +13,38 @@ Page({
         pattern: false, //显示方式选择
         tabsList: ['商户二维码', '加入请求'], //tabs
         tabsIndex: 0, //tabs 选中下标
+        joinList: [], //申请加入列表
     },
     /**
      * 生命周期函数--监听页面加载
      */
-    onLoad: function (options) {},
+    onLoad: function (options) {
+        /* 获取申请列表 */
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.usercenter.teammsg.teammsg",
+            "method": "getEntryTeamApplyList",
+            "content": {
+                pageSize: 1000
+            }
+        }).then(res => {
+            console.log("团队申请加入列表", res)
+            if (res.msg != '成功') return wx.showToast({
+                title: res.data,
+                icon: "none"
+            });
+            this.setData({
+                joinList: res.data
+            })
+        })
+    },
     /* tabs切换页面 */
     setIndex({
         detail
     }) {
         this.setData({
             tabsIndex: detail
-        })
+        });
     },
     /* 下拉触底 */
     scrolltolower() {
@@ -48,22 +68,51 @@ Page({
         const {
             index
         } = e.currentTarget.dataset;
-        this.closeTheDropDown();
-        if (index == this.data.showBtn) return;
+        if (index == this.data.showBtn) return this.setData({
+            showBtn: -1
+        });
         this.setData({
             pattern: false,
             showBtn: index,
-        })
+        });
     },
     /* 同意 */
     ratify(e) {
-        console.log('同意')
+        const that = this;
+        wx.showModal({
+            title: "提示",
+            content: "是否同意“" + that.data.joinList[that.data.showBtn].fname + "”加入到您的团队",
+            success: (res => {
+                if (res.confirm) that.checkEntryTeamApply(1);
+            })
+        })
     },
     /* 拒绝 */
     refuse(e) {
-        console.log('拒绝')
+        const that = this;
+        wx.showModal({
+            title: "提示",
+            content: "是否拒绝“" + that.data.joinList[that.data.showBtn].fname + "”加入团队申请",
+            success: (res => {
+                if (res.confirm) that.checkEntryTeamApply(0);
+            })
+        })
+    },
+    /* 审核 */
+    checkEntryTeamApply(isPass) {
+        _Http.basic({
+            "accesstoken": wx.getStorageSync('userData').token,
+            "classname": "customer.usercenter.teammsg.teammsg",
+            "method": "checkEntryTeamApply",
+            "content": {
+                "isPass": isPass,
+                "tenterprise_userid": this.data.joinList[this.data.showBtn].tenterprise_userid,
+                "tagentteamapplyid": this.data.joinList[this.data.showBtn].tagentteamapplyid
+            }
+        }).then(res => {
+            console.log(res)
+        })
     },
-
     /**
      * 生命周期函数--监听页面显示
      */

+ 2 - 1
pages/teamManagement/applyFor.json

@@ -1,6 +1,7 @@
 {
   "usingComponents": {
     "My_DisplayBox": "/components/My_DisplayBox/index",
-    "My_TwoDimensionalCode": "/components/My_TwoDimensionalCode/index"
+    "My_TwoDimensionalCode": "/components/My_TwoDimensionalCode/index",
+    "van-empty": "@vant/weapp/empty/index"
   }
 }

+ 3 - 2
pages/teamManagement/applyFor.wxml

@@ -6,10 +6,11 @@
 <My_DisplayBox wx:else title="请求列表" isMore="{{false}}">
     <image slot="display-box-img" class="display-title_image" src="/static/icon-05.png" mode="aspectFit"></image>
     <scroll-view class="list-scroll-view" scroll-y bindscrolltolower="scrolltolower">
-        <view class="company-data" wx:for="{{requestList}}" data-index="{{index}}" bindtap="showBtnIndex">
+        <van-empty wx:if="{{!joinList.length>=1}}" description="暂无申请记录" />
+        <view class="company-data" wx:for="{{joinList}}" data-index="{{index}}" bindtap="showBtnIndex">
             <image class="company-data-image" src="{{item.attinfos[0].fobsurl}}"></image>
             <view class="company-data-brandName u-line-1">
-                {{item.fbrand}}
+                {{item.fname}}
             </view>
             <!-- 按钮 -->
             <view wx:if="{{showBtn==index}}" class="company-data-but">

+ 1 - 2
pages/teamManagement/index.json

@@ -1,7 +1,6 @@
 {
   "usingComponents": {
     "My_MembersAndProducts": "/components/My_MembersAndProducts/index",
-    "My_SearchInputBox":"/components/My_SearchInputBox/index",
-    "van-empty": "@vant/weapp/empty/index"
+    "My_SearchInputBox":"/components/My_SearchInputBox/index"
   }
 }

+ 1 - 1
pages/teamManagement/index.wxml

@@ -5,5 +5,5 @@
     <view class="member_list">
         <My_MembersAndProducts wx:for="{{memberList}}" data-index="{{index}}" bind:changeMessage="changeMemberMessage" title="{{item.fname}}" twoRow="{{'身份/职位:'+item.frole}}" threeRow="{{'手机:'+item.fphonenumber}}" fisadministrator="{{fisadministrator}}" attinfos="{{item.attinfos[0]}}"></My_MembersAndProducts>
     </view>
-    <van-empty description="暂无数据" />
+    <van-empty wx:if="{{!memberList.length>=1}}" description="暂无数据" />
 </My_GeneralTemplate>

+ 11 - 0
utils/Http.js

@@ -17,11 +17,13 @@ class HTTP {
             title: '加载中...',
             mask: true
         })
+        console.log("发送请求")
         wx.request({
             url: baseUrl + url,
             data: data,
             method: method,
             header: header,
+            timeout: 20000,
             success: (res) => {
                 resolve(res.data);
                 wx.hideLoading()
@@ -29,6 +31,15 @@ class HTTP {
             fial: (err) => {
                 reject(err);
                 wx.hideLoading();
+            },
+            complete: (res) => {
+                if (res.errMsg != 'request:ok') {
+                    wx.hideLoading();
+                    wx.showToast({
+                        title: '网络异常,请重新进入',
+                        icon: "none"
+                    })
+                }
             }
         })
     }