Browse Source

bug修改

yanym 5 years ago
parent
commit
54f39a0837

+ 1 - 1
dorm-manager-wx/pages/teacher/facephoto/facephoto.js

@@ -132,7 +132,7 @@ Page({
   onLoad: function(options) {
     const that = this;
     that.setData({
-      apiTotal: api.total
+      apiTotal: api.total.substring(0, api.total.length - 4)
     })
     that.data.userInfo = wx.getStorageSync('user');
     that.getCollegeInfo();

+ 122 - 7
dorm-manager-wx/pages/teacher/pass/pass.js

@@ -9,8 +9,17 @@ Page({
    * 页面的初始数据
    */
   data: {
-    userIndex: 0,
-    userArray: ['软件学院计算机系刘天仙', '文学院哲学系陈方明'],
+    userInfo: '',
+    apiTotal: '',
+    listCollege: '',
+    listDept: '',
+    listUser: '',
+    userArray: [
+      [],
+      [],
+      []
+    ],
+    value: [0, 0, 0],
     deviceIndex: 2,
     deviceArray: [],
     deviceList: '',
@@ -19,10 +28,113 @@ Page({
     list: []
   },
 
+  getCollegeInfo: function(e) {
+    const that = this;
+    util.httpRequest(api.getDeptInfo, {
+      companyId: that.data.userInfo.companyId,
+      level: 1
+    }, 'post').then(res => {
+      let arrayCollege = [];
+      if (res.data.length >= 1) {
+        for (let i = 0; i < res.data.length; i++) {
+          arrayCollege.push(res.data[i].deptName)
+          if (i == res.data.length - 1) {
+            let userArray = that.data.userArray;
+            userArray[0] = arrayCollege;
+            that.setData({
+              userArray: userArray,
+              listCollege: res.data
+            })
+            that.getDeptInfo();
+          }
+        }
+      }
+    })
+  },
+
+  getDeptInfo: function(e) {
+    const that = this;
+    util.httpRequest(api.getDeptInfo, {
+      companyId: that.data.userInfo.companyId,
+      parentId: that.data.listCollege[that.data.value[0]].deptId
+    }, 'post').then(res => {
+      let arrayDept = [];
+      if (res.data.length >= 1) {
+        for (let i = 0; i < res.data.length; i++) {
+          arrayDept.push(res.data[i].deptName)
+          if (i == res.data.length - 1) {
+            let userArray = that.data.userArray
+            userArray[1] = arrayDept
+            that.setData({
+              userArray: userArray,
+              listDept: res.data
+            })
+            that.getRegisterInfo()
+          }
+        }
+      } else {
+        let userArray = that.data.userArray;
+        userArray[1] = arrayDept
+        userArray[2] = []
+        that.setData({
+          userArray: userArray,
+          listDept: '',
+          list: ''
+        })
+      }
+    })
+  },
+
+  getRegisterInfo: function(status = 0) {
+    const that = this;
+    util.httpRequest(api.getRegisterInfo, {
+      deptId: that.data.listDept[that.data.value[1]].deptId,
+      register: status
+    }, 'post').then(res => {
+      let arrayUser = [];
+      if (res.data.data.data.length >= 1) {
+        for (let i = 0; i < res.data.data.data.length; i++) {
+          arrayUser.push(res.data.data.data[i].userName)
+          if (i == res.data.data.data.length - 1) {
+            let userArray = that.data.userArray
+            userArray[2] = arrayUser
+            that.setData({
+              userArray: userArray,
+              listUser: res.data.data.data
+            })
+            that.getPassInfo();
+          }
+        }
+      } else {
+        let userArray = that.data.userArray
+        userArray[2] = arrayUser
+        that.setData({
+          userArray: userArray,
+          listUser: '',
+          list: ''
+        })
+      }
+    })
+  },
+
   bindUserChange: function(e) {
-    this.setData({
-      userIndex: e.detail.value
+
+  },
+
+  columnChange: function(e) {
+    const that = this;
+    let value = that.data.value
+    value[e.detail.column] = e.detail.value
+    that.setData({
+      value: value
     })
+    if (e.detail.column == 0) {
+      that.getDeptInfo()
+    } else if (e.detail.column == 1) {
+      that.getRegisterInfo()
+    } else if (e.detail.column == 2) {
+      that.getPassInfo();
+    }
   },
 
   bindDeviceChange: function(e) {
@@ -57,7 +169,6 @@ Page({
             deviceArray: deviceArray,
             deviceList: res.data
           })
-          that.getPassInfo();
         }
       }
     })
@@ -66,7 +177,7 @@ Page({
   getPassInfo: function(e) {
     const that = this;
     util.httpRequest(api.getPassInfo, {
-      loginId: 15286831873,
+      loginId: that.data.listUser[that.data.value[2]].loginid,
       start: that.data.startDate,
       end: that.data.endDate,
       driviceId: that.data.deviceList[that.data.deviceIndex].id,
@@ -96,7 +207,6 @@ Page({
     minute = minute < 10 ? "0" + minute : minute;
     second = second < 10 ? "0" + second : second;
     date = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
-    console.log(date);
     return date;
   },
 
@@ -105,6 +215,11 @@ Page({
    */
   onLoad: function(options) {
     const that = this;
+    that.setData({
+      apiTotal: api.total.substring(0, api.total.length - 4)
+    })
+    that.data.userInfo = wx.getStorageSync('user');
+    that.getCollegeInfo();
     that.getDeviceInfo();
   },
 

+ 3 - 3
dorm-manager-wx/pages/teacher/pass/pass.wxml

@@ -5,9 +5,9 @@
       <view class="desc-t desc-c">选择人员</view>
     </view>
     <view class="my-row my-align-c">
-      <picker value="{{userIndex}}" range="{{userArray}}" bindchange="bindUserChange">
+      <picker value="{{value}}" mode='multiSelector' range="{{userArray}}" bindchange="bindUserChange" bindcolumnchange='columnChange'>
         <view class="desc-t">
-          {{userArray[userIndex]}}
+          {{userArray[0][value[0]]}}{{userArray[1][value[1]]}}{{userArray[2][value[2]]}}
         </view>
       </picker>
       <image src="/images/jiantou-bottom.png" class="icon-bottom"></image>
@@ -47,7 +47,7 @@
   <scroll-view scroll-y='true'>
     <block wx:for='{{list}}'>
       <view class="list-item" hover-class="myhover" hover-start-time="50" hover-stay-time="50">
-        <image src="{{item.headImage?item.headImage:'/images/default-urser.png'}}" class="head-img"></image>
+        <image src="{{item.headImage?apiTotal+item.headImage:'/images/default-urser.png'}}" class="head-img"></image>
         <view class="my-column my-flex-sb" style="height:150rpx;">
           <view class="name">{{item.displayName}}</view>
           <view class="address">

+ 4 - 1
dorm-manager-wx/pages/teacher/visitorcheck/visitorcheck.js

@@ -9,6 +9,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    apiTotal:'',
     isregiste: true,
     approvalNum: 0,
     approvedNum: 0,
@@ -44,7 +45,6 @@ Page({
     }, 'post').then(res => {
       for (let i = 0; i < res.data.data.data.length; i++) {
         res.data.data.data[i].createDate = that.getLocalTime(res.data.data.data[i].createDate)
-        // res.data.data.data[i].headImage = 
       }
       that.setData({
         list: res.data.data.data,
@@ -77,6 +77,9 @@ Page({
    */
   onLoad: function(options) {
     const that = this;
+    that.setData({
+      apiTotal: api.total.substring(0, api.total.length - 4)
+    })
     that.getVisitorCheckInfo(2);
   },
 

+ 1 - 1
dorm-manager-wx/pages/teacher/visitorcheck/visitorcheck.wxml

@@ -7,7 +7,7 @@
   <scroll-view scroll-y='true'>
     <block wx:for='{{list}}'>
       <view class="list-item" hover-class="myhover" hover-start-time="50" hover-stay-time="50" bindtap="todetail" data-id="{{item.visitorId}}">
-        <image src="{{item.headImage?item.headImage:'/images/default-urser.png'}}" class="head-img"></image>
+        <image src="{{item.headImage?apiTotal+item.headImage:'/images/default-urser.png'}}" class="head-img"></image>
         <view class="my-column my-flex-sb" style="height:150rpx;">
           <view class="name">{{item.userName}}</view>
           <view class="address">

+ 4 - 0
dorm-manager-wx/pages/teacher/warning/warning.js

@@ -9,6 +9,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    apiTotal: '',
     tab: 1,
     list: []
   },
@@ -61,6 +62,9 @@ Page({
    */
   onLoad: function(options) {
     const that = this;
+    that.setData({
+      apiTotal: api.total.substring(0, api.total.length - 4)
+    })
     that.getUnInInfo();
   },
 

+ 1 - 1
dorm-manager-wx/pages/teacher/warning/warning.wxml

@@ -8,7 +8,7 @@
   <scroll-view scroll-y='true'>
     <block wx:for='{{list}}'>
       <view class="list-item">
-        <image src="{{item.headImage?item.headImage:'/images/default-urser.png'}}" class="head-img"></image>
+        <image src="{{item.headImage?apiTotal+item.headImage:'/images/default-urser.png'}}" class="head-img"></image>
         <view class="my-column my-flex-sb" style="height:170rpx;">
           <view class="name">{{item.userName}}</view>
           <view class="address">

+ 1 - 1
dorm-manager-wx/utils/api.js

@@ -105,7 +105,7 @@ const index = 2,
     getVisitorCheck: '/visitor/approvalAlumniVisitor.if', //访客信息审批
     getUnInfo: '/access/unIn.if', //未归记录
 
-    total: '', //图片拼接域名
+    total: '.if', //图片拼接域名
   },
   [oneportal, root] = [
     ["http://192.168.100.234:8080/oneportal/", "https://zhll.dgtis.com/wx/"],