|
@@ -1,4 +1,4 @@
|
|
|
-// custom-tab-bar/mine/index.js
|
|
|
+const _Http = getApp().globalData.http;
|
|
|
Page({
|
|
|
|
|
|
/**
|
|
@@ -27,7 +27,23 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
-
|
|
|
+ this.queryUserMsg();
|
|
|
+ },
|
|
|
+ /* 查询用户信息 */
|
|
|
+ queryUserMsg() {
|
|
|
+ _Http.basic({
|
|
|
+ "classname": "common.usercenter.usercenter",
|
|
|
+ "method": "queryUserMsg",
|
|
|
+ "content": {}
|
|
|
+ }).then(res => {
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ userMsg: res.data
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -77,6 +93,19 @@ Page({
|
|
|
*/
|
|
|
onShareAppMessage() {
|
|
|
|
|
|
+ },
|
|
|
+ /* 退出登录 */
|
|
|
+ outLogin() {
|
|
|
+ _Http.logout().then(res => {
|
|
|
+ wx.showToast({
|
|
|
+ title: '退出成功'
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ wx.reLaunch({
|
|
|
+ url: '/pages/login/index',
|
|
|
+ })
|
|
|
+ }, 300)
|
|
|
+ })
|
|
|
},
|
|
|
/* 去修改用户信息 */
|
|
|
toChangeUserMsg() {
|