list.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. const app = getApp()
  2. Page({
  3. data: {
  4. frameStyle: { useTop: true, name: '学校学习情况', leftArrow: true, useBar: false },
  5. },
  6. // 返回
  7. back(e) {
  8. wx.navigateBack({ delta: 1 })
  9. },
  10. /**
  11. * 生命周期函数--监听页面加载
  12. */
  13. onLoad: function (options) { },
  14. // 监听用户是否登录
  15. watchLogin: async function () {
  16. const that = this;
  17. wx.getStorage({
  18. key: 'user',
  19. success: async res => { },
  20. fail: async res => {
  21. // wx.redirectTo({ url: '/pages/index/index' })
  22. }
  23. })
  24. },
  25. /**
  26. * 生命周期函数--监听页面初次渲染完成
  27. */
  28. onReady: function () { },
  29. /**
  30. * 生命周期函数--监听页面显示
  31. */
  32. onShow: function () {
  33. const that = this;
  34. // 监听用户是否登录
  35. that.watchLogin();
  36. },
  37. /**
  38. * 页面上拉触底事件的处理函数
  39. */
  40. /**
  41. * 生命周期函数--监听页面隐藏
  42. */
  43. onHide: function () {
  44. },
  45. /**
  46. * 生命周期函数--监听页面卸载
  47. */
  48. onUnload: function () {
  49. },
  50. /**
  51. * 页面相关事件处理函数--监听用户下拉动作
  52. */
  53. onPullDownRefresh: function () {
  54. },
  55. /**
  56. * 用户点击右上角分享
  57. */
  58. onShareAppMessage: function () {
  59. }
  60. })