list.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. const app = getApp()
  2. Page({
  3. data: {
  4. frameStyle: { useTop: true, name: '比赛场地', leftArrow: false, useBar: false },
  5. },
  6. toCommon: function (e) {
  7. const { route } = e.currentTarget.dataset;
  8. if (route) wx.navigateTo({ url: `/pages/${route}` });
  9. },
  10. /**
  11. * 生命周期函数--监听页面加载
  12. */
  13. onLoad: function (options) {
  14. },
  15. // 监听用户是否登录
  16. watchLogin: async function () {
  17. // 监听用户是否登录,
  18. wx.getStorage({
  19. key: 'user',
  20. success: async res => {
  21. },
  22. fail: async res => {
  23. // wx.redirectTo({ url: '/pages/index/index' })
  24. }
  25. })
  26. },
  27. /**
  28. * 生命周期函数--监听页面初次渲染完成
  29. */
  30. onReady: function () {
  31. },
  32. /**
  33. * 生命周期函数--监听页面显示
  34. */
  35. onShow: function () {
  36. const that = this;
  37. // 监听用户是否登录
  38. that.watchLogin();
  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. onReachBottom: function () {
  59. },
  60. /**
  61. * 用户点击右上角分享
  62. */
  63. onShareAppMessage: function () {
  64. }
  65. })