Commit cb398c89 authored by 李维's avatar 李维

匿名登出,清除信息

parent 74745214
...@@ -34,6 +34,17 @@ export default class NewClass extends cc.Component { ...@@ -34,6 +34,17 @@ export default class NewClass extends cc.Component {
// 点击左上角登录 // 点击左上角登录
handleClickLogin() { handleClickLogin() {
global.middleLayer.isLogin = false;
this.Viewer.getComponent("PageViewer").setUserInfo({
phone: "",
isAnonymous: false,
isIOSReview: false,
});
// 清空信息
cc.sys.localStorage.setItem('token', "");
cc.sys.localStorage.setItem('phone', "");
const vc = this.Viewer.getComponent("PageViewer"); const vc = this.Viewer.getComponent("PageViewer");
vc.toView("LoginPage", "leftIn") vc.toView("LoginPage", "leftIn")
} }
...@@ -56,7 +67,6 @@ export default class NewClass extends cc.Component { ...@@ -56,7 +67,6 @@ export default class NewClass extends cc.Component {
this.userPageClass = cc.find("right_part/class/label", this.userPagePanel).getComponent(cc.Label); this.userPageClass = cc.find("right_part/class/label", this.userPagePanel).getComponent(cc.Label);
this.userPageTeacher = cc.find("right_part/teacher/label", this.userPagePanel).getComponent(cc.Label); this.userPageTeacher = cc.find("right_part/teacher/label", this.userPagePanel).getComponent(cc.Label);
this.userPageTime = cc.find("right_part/time/label", this.userPagePanel).getComponent(cc.Label); this.userPageTime = cc.find("right_part/time/label", this.userPagePanel).getComponent(cc.Label);
} }
this.userPageName.string = this.userInfo.nick_name; this.userPageName.string = this.userInfo.nick_name;
...@@ -96,6 +106,12 @@ export default class NewClass extends cc.Component { ...@@ -96,6 +106,12 @@ export default class NewClass extends cc.Component {
jc_arr: userInfo.jc_arr, jc_arr: userInfo.jc_arr,
}); });
// 无数据
if(rows && rows.length == 0) {
this.loading.active = false;
return
}
const canvas = cc.find("Canvas"); const canvas = cc.find("Canvas");
this.SvContent.opacity = 0; this.SvContent.opacity = 0;
if (!this.SvContent['baseH']) { if (!this.SvContent['baseH']) {
...@@ -162,10 +178,7 @@ export default class NewClass extends cc.Component { ...@@ -162,10 +178,7 @@ export default class NewClass extends cc.Component {
this.SvContent.addChild(ci); this.SvContent.addChild(ci);
} }
// 防止在没有数据情况下 加载动画不消失
if(rows.length == 0) {
this.loading.active = false;
}
// this.loading.active = false; // this.loading.active = false;
} }
// onLoad () {} // onLoad () {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment