index.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. pathList: [{
  8. name: "团队管理",
  9. icon: "icon-a-wodetuanduiguanli",
  10. color: "var(--assist)",
  11. path: "/pages/teams/index"
  12. }, {
  13. name: "修改登录密码",
  14. icon: "icon-a-wodeguanyuyingyong",
  15. color: "var(--warning)",
  16. path: "/pages/tabbar/mine/changePassword/index"
  17. }, {
  18. name: "绑定微信",
  19. icon: "icon-a-wodebangdingweixin",
  20. color: "var(--success)",
  21. path: "#"
  22. }]
  23. },
  24. /**
  25. * 生命周期函数--监听页面加载
  26. */
  27. onLoad(options) {
  28. this.queryUserMsg();
  29. },
  30. /* 查询用户信息 */
  31. queryUserMsg() {
  32. _Http.basic({
  33. "classname": "common.usercenter.usercenter",
  34. "method": "queryUserMsg",
  35. "content": {}
  36. }).then(res => {
  37. if (res.msg != '成功') return wx.showToast({
  38. title: res.data,
  39. icon: "none"
  40. })
  41. this.setData({
  42. userMsg: res.data
  43. })
  44. })
  45. },
  46. /**
  47. * 生命周期函数--监听页面初次渲染完成
  48. */
  49. onReady() {
  50. },
  51. /**
  52. * 生命周期函数--监听页面显示
  53. */
  54. onShow() {
  55. this.getTabBar().init();
  56. },
  57. /**
  58. * 生命周期函数--监听页面隐藏
  59. */
  60. onHide() {
  61. },
  62. /**
  63. * 生命周期函数--监听页面卸载
  64. */
  65. onUnload() {
  66. },
  67. /**
  68. * 页面相关事件处理函数--监听用户下拉动作
  69. */
  70. onPullDownRefresh() {
  71. },
  72. /**
  73. * 页面上拉触底事件的处理函数
  74. */
  75. onReachBottom() {
  76. },
  77. /**
  78. * 用户点击右上角分享
  79. */
  80. onShareAppMessage() {
  81. },
  82. /* 退出登录 */
  83. outLogin() {
  84. _Http.logout().then(res => {
  85. wx.showToast({
  86. title: '退出成功'
  87. });
  88. setTimeout(() => {
  89. wx.reLaunch({
  90. url: '/pages/login/index',
  91. })
  92. }, 300)
  93. })
  94. },
  95. /* 去修改用户信息 */
  96. toChangeUserMsg() {
  97. wx.navigateTo({
  98. url: './userMsg/index'
  99. })
  100. },
  101. })