mine.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // pages/mine/mine.js
  2. var app = getApp();
  3. const request = require("../../utils/request.js");
  4. const login = require("../../utils/login.js");
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. userInfo: null
  11. },
  12. /**
  13. * 生命周期函数--监听页面加载
  14. */
  15. onLoad: function (options) {
  16. let that = this;
  17. that.setData({
  18. userInfo: app.globalData.userInfo
  19. })
  20. },
  21. /**
  22. * 生命周期函数--监听页面初次渲染完成
  23. */
  24. onReady: function () {
  25. },
  26. /**
  27. * 生命周期函数--监听页面显示
  28. */
  29. onShow: function () {
  30. if (typeof this.getTabBar === 'function' &&
  31. this.getTabBar()) {
  32. this.getTabBar().setData({
  33. selected: 3
  34. })
  35. }
  36. login.getUserInfo();
  37. },
  38. /**
  39. * 生命周期函数--监听页面隐藏
  40. */
  41. onHide: function () {
  42. },
  43. /**
  44. * 生命周期函数--监听页面卸载
  45. */
  46. onUnload: function () {
  47. },
  48. /**
  49. * 页面相关事件处理函数--监听用户下拉动作
  50. */
  51. onPullDownRefresh: function () {
  52. },
  53. /**
  54. * 页面上拉触底事件的处理函数
  55. */
  56. onReachBottom: function () {
  57. },
  58. /**
  59. * 用户点击右上角分享
  60. */
  61. onShareAppMessage: function () {
  62. },
  63. personMsg() {
  64. wx.navigateTo({
  65. url: '../personHome/personHome'
  66. })
  67. },
  68. toAboutUs() {
  69. wx.navigateTo({
  70. url: '../aboutUs/aboutUs'
  71. })
  72. },
  73. toBadges() {
  74. login.ifLogin('../badges/badges')
  75. },
  76. toMineMsg() {
  77. login.ifLogin('../mineMessage/mineMessage')
  78. },
  79. toMinePush() {
  80. login.ifLogin('../minePush/minePush')
  81. },
  82. toMineOrder() {
  83. login.ifLogin('../mineOrderBeer/mineOrderBeer')
  84. },
  85. toMineAd() {
  86. login.ifLogin('../mineAddress/mineAddress')
  87. }
  88. })