|
@@ -3,7 +3,8 @@
|
|
|
const app = require('../../utils/util.js');
|
|
|
Page({
|
|
|
data: {
|
|
|
- dataArr: []
|
|
|
+ dataArr: [],
|
|
|
+ showNull: false
|
|
|
},
|
|
|
gomyClass() {
|
|
|
wx.switchTab({
|
|
@@ -15,14 +16,34 @@ Page({
|
|
|
wx.request({
|
|
|
url: app.globalData.publicUrl2 + '/wx/student/selWholeClas',
|
|
|
method: "post",
|
|
|
- data:{
|
|
|
- sessionKey:sessionKey
|
|
|
+ data: {
|
|
|
+ sessionKey: sessionKey
|
|
|
},
|
|
|
success: function (res) {
|
|
|
console.log(res.data.data, "22222")
|
|
|
- _this.setData({
|
|
|
- dataArr: res.data.data
|
|
|
- })
|
|
|
+ if (res.code == 0) {
|
|
|
+ _this.setData({
|
|
|
+ dataArr: res.data.data
|
|
|
+ })
|
|
|
+ if (_this.data.dataArr.length == 0) {
|
|
|
+ _this.setData({
|
|
|
+ showNull: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (_this.data.dataArr.length == 0) {
|
|
|
+ _this.setData({
|
|
|
+ showNull: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function () {
|
|
|
+ if (_this.data.dataArr.length == 0) {
|
|
|
+ _this.setData({
|
|
|
+ showNull: true
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -45,15 +66,15 @@ Page({
|
|
|
success: function (res) {
|
|
|
sessionKey = res.data.sessionKey;
|
|
|
wx.setStorageSync('sessionKey', res.data.sessionKey);
|
|
|
- this.getArr(sessionKey);
|
|
|
+ this.getArr(sessionKey);
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- this.getArr(sessionKey);
|
|
|
+ this.getArr(sessionKey);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
fail() {
|
|
|
console.log("我没有缓存并去登录请求")
|