2025-05-15 13:01:14 +00:00
|
|
|
const { checkLogin } = require('../../utils/logcheck');
|
2025-05-16 01:58:51 +00:00
|
|
|
import {url} from '../../request'
|
2025-04-28 07:59:21 +00:00
|
|
|
Page({
|
|
|
|
|
2025-05-11 07:12:01 +00:00
|
|
|
|
2025-04-28 07:59:21 +00:00
|
|
|
data: {
|
2025-05-15 13:01:14 +00:00
|
|
|
userAvatar:'https://tse2-mm.cn.bing.net/th/id/OIP-C.jHUH4s7TQ48X_B-1iozuJgHaHa?w=207&h=207&c=7&r=0&o=5&dpr=1.5&pid=1.7',
|
|
|
|
nickName:'请登录'
|
2025-04-28 07:59:21 +00:00
|
|
|
},
|
|
|
|
|
2025-05-11 07:12:01 +00:00
|
|
|
myteam(){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/wodetuandui/wodetuandui',
|
|
|
|
})
|
|
|
|
},
|
2025-05-16 01:58:51 +00:00
|
|
|
|
2025-04-28 07:59:21 +00:00
|
|
|
onLoad(options) {
|
2025-05-16 01:58:51 +00:00
|
|
|
checkLogin();
|
2025-04-28 07:59:21 +00:00
|
|
|
},
|
|
|
|
onReady() {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onShow() {
|
2025-05-15 13:01:14 +00:00
|
|
|
console.log("页面展示 onShow");
|
|
|
|
try {
|
|
|
|
const userInfo = wx.getStorageSync('usermessage');
|
|
|
|
console.log('用户信息:', userInfo);
|
|
|
|
this.setData({
|
2025-05-16 01:58:51 +00:00
|
|
|
nickName: userInfo.nickName || '请登录',
|
2025-05-15 13:01:14 +00:00
|
|
|
phoneNumber: userInfo.phoneNumber || '',
|
|
|
|
invitationCode: userInfo.invitationCode || '',
|
|
|
|
userAvatar: userInfo.userAvatar || 'https://tse2-mm.cn.bing.net/th/id/OIP-C.jHUH4s7TQ48X_B-1iozuJgHaHa?w=207&h=207&c=7&r=0&o=5&dpr=1.5&pid=1.7'
|
|
|
|
});
|
|
|
|
} catch (e) {
|
|
|
|
console.error('读取缓存失败:', e);
|
|
|
|
}
|
2025-04-28 07:59:21 +00:00
|
|
|
},
|
2025-05-15 01:40:36 +00:00
|
|
|
wodejiedan(){
|
|
|
|
wx.navigateTo({
|
|
|
|
url: '/pages/wodejiedan/wodejiedan',
|
|
|
|
})
|
2025-05-16 01:58:51 +00:00
|
|
|
},
|
|
|
|
out(){
|
|
|
|
wx.showModal({
|
|
|
|
title: '提示',
|
|
|
|
content: '确定退出登录吗?',
|
|
|
|
success: function (res) {
|
|
|
|
if (res.confirm) {
|
|
|
|
console.log('用户点击确定')
|
|
|
|
wx.getStorage({
|
|
|
|
key: "logmessage",
|
|
|
|
success(res) {
|
|
|
|
const userinfo = res.data.Authorization
|
|
|
|
wx.request({
|
|
|
|
url: url + '/userInfo/mini/logout',
|
|
|
|
method: 'GET',
|
|
|
|
data: {
|
|
|
|
|
|
|
|
},
|
|
|
|
header: {
|
|
|
|
'content-type': 'application/json',
|
|
|
|
'Authorization': userinfo
|
|
|
|
},
|
|
|
|
success(res) {
|
|
|
|
console.log('查询成功', res);
|
|
|
|
if(res.data.code==1){
|
|
|
|
wx.showToast({
|
|
|
|
title: "退出成功",
|
|
|
|
icon:'sucess',
|
|
|
|
duration:2000
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
fail(err) {
|
|
|
|
console.error('请求失败', err);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
try {
|
|
|
|
wx.clearStorageSync();
|
|
|
|
console.log("所有缓存清除成功");
|
|
|
|
} catch (e) {
|
|
|
|
console.error("清除缓存失败", e);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
console.log('用户点击取消')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2025-05-15 01:40:36 +00:00
|
|
|
},
|
2025-04-28 07:59:21 +00:00
|
|
|
onHide() {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onUnload() {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onPullDownRefresh() {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onShareAppMessage() {
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|