Browse Source

bug修改

yanym 5 years ago
parent
commit
0e99c16ebb

+ 12 - 5
dorm-manager-wx/pages/teacher/facephoto/facephoto.js

@@ -66,7 +66,7 @@ Page({
       level: 1
     }, 'post').then(res => {
       let arrayCollege = [];
-      if (res.data.length > 1) {
+      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) {
@@ -79,7 +79,10 @@ Page({
         }
       } else {
         that.setData({
-          arrayCollege: arrayCollege
+          arrayCollege: arrayCollege,
+          arrayDept: [],
+          listDept: '',
+          list: ''
         })
       }
     })
@@ -92,7 +95,7 @@ Page({
       parentId: that.data.listCollege[that.data.indexCollege].deptId
     }, 'post').then(res => {
       let arrayDept = [];
-      if (res.data.length > 1) {
+      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) {
@@ -105,9 +108,13 @@ Page({
         }
       } else {
         that.setData({
-          arrayDept: arrayDept
+          arrayClass: [],
+          arrayDept: [],
+          listDept: '',
+          registerCount: 0,
+          unRegisterCount: 0,
+          list: ''
         })
-        that.getRegisterInfo();
       }
     })
   },

+ 6 - 6
dorm-manager-wx/pages/teacher/visitorcheck/visitorcheck.js

@@ -76,11 +76,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function(options) {
-    const that = this;
-    that.setData({
-      apiTotal: api.total.substring(0, api.total.length - 4)
-    })
-    that.getVisitorCheckInfo(2);
+    
   },
 
   /**
@@ -94,7 +90,11 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function() {
-
+    const that = this;
+    that.setData({
+      apiTotal: api.total.substring(0, api.total.length - 4)
+    })
+    that.getVisitorCheckInfo(2);
   },
 
   /**