|
@@ -1,3 +1,5 @@
|
|
|
+
|
|
|
+
|
|
|
// pages/me/me.ts
|
|
|
const app = getApp();
|
|
|
|
|
@@ -26,12 +28,13 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad() {
|
|
|
+
|
|
|
// wx.getStorage("userInfo")
|
|
|
const _this = this;
|
|
|
wx.getStorage({
|
|
|
key: "userInfo",
|
|
|
success(res) {
|
|
|
- if (!res.data.phone) {
|
|
|
+ if(!res.data.phone){
|
|
|
return;
|
|
|
};
|
|
|
_this.setData({
|
|
@@ -50,18 +53,18 @@ Page({
|
|
|
gologin() {
|
|
|
//
|
|
|
const _this = this;
|
|
|
- if (this.data.islogin) {
|
|
|
+ if(this.data.islogin){
|
|
|
// 退出登录
|
|
|
wx.removeStorage({
|
|
|
key: 'userInfo',
|
|
|
- success(res) {
|
|
|
+ success (res) {
|
|
|
_this.setData({
|
|
|
islogin: false,
|
|
|
userName: "未登录",
|
|
|
userPic: "./../../img/head_pic.png",
|
|
|
});
|
|
|
wx.switchTab({
|
|
|
- url: `./../index/index`
|
|
|
+ url: `./../home/home`
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -74,7 +77,7 @@ Page({
|
|
|
url: './../login/login',
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
@@ -87,7 +90,6 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow() {
|
|
|
- // 当前的index
|
|
|
let num = this.data.rightId === 1 ? 2 : 1
|
|
|
if (typeof this.getTabBar === 'function' &&
|
|
|
this.getTabBar()) {
|