You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.1KB

  1. // pages/mine/mine.js
  2. import {getFlightData, getTaskTotal} from '../../api/mine.js'
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. userInfo: {}
  9. },
  10. /**
  11. * 生命周期函数--监听页面加载
  12. */
  13. onLoad: function (options) {
  14. let userInfo = wx.getStorageSync('userInfo')
  15. this.setData({userInfo: userInfo})
  16. },
  17. /**
  18. * 生命周期函数--监听页面显示
  19. */
  20. onShow: function () {
  21. },
  22. // 退出登录
  23. outLogin: function(event) {
  24. wx.showModal({
  25. title: '确认',
  26. content: '确认要退出登录吗?',
  27. success (res) {
  28. if (res.confirm) {
  29. wx.removeStorageSync('token')
  30. wx.removeStorageSync('userInfo')
  31. wx.reLaunch({
  32. url: '/pages/login/login',
  33. })
  34. } else if (res.cancel) {
  35. wx.switchTab({
  36. url: '/pages/mine/mine',
  37. })
  38. }
  39. }
  40. })
  41. }
  42. })