index.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. const app = getApp()
  2. Page({
  3. data: {
  4. frameStyle: { useTop: true, name: '俱乐部', leftArrow: false, useBar: true },
  5. list: [
  6. { name: '宝藏俱乐部', founder: '宝藏', add: '长春市朝阳区前进大街1244号', project: '羽毛球', time: '2000-02-01', tel: '0431-800-800-8800', logo: [{ url: '/image/club.png' }] },
  7. { name: '英语俱乐部', founder: '英语', time: '2000-02-01', add: '长春市朝阳区前进大街1244号', project: '羽毛球', tel: '0431-800-800-8800', logo: [{ url: '/image/club.png' }] },
  8. { name: '宝藏俱乐部', founder: '宝藏', add: '长春市朝阳区前进大街1244号', project: '羽毛球', time: '2000-02-01', tel: '0431-800-800-8800', logo: [{ url: '/image/club.png' }] },
  9. { name: '英语俱乐部', founder: '英语', time: '2000-02-01', add: '长春市朝阳区前进大街1244号', project: '羽毛球', tel: '0431-800-800-8800', logo: [{ url: '/image/club.png' }] },
  10. ],
  11. },
  12. // 跳转菜单
  13. tabPath(e) {
  14. let { route } = e.detail.detail;
  15. if (route) wx.redirectTo({ url: `/${route}` })
  16. },
  17. /**
  18. * 生命周期函数--监听页面加载
  19. */
  20. onLoad: function (options) { },
  21. /**
  22. * 生命周期函数--监听页面初次渲染完成
  23. */
  24. onReady: function () { },
  25. /**
  26. * 生命周期函数--监听页面显示
  27. */
  28. onShow: function () {
  29. const that = this;
  30. // 监听用户是否登录
  31. that.watchLogin();
  32. },
  33. // 监听用户是否登录
  34. watchLogin: async function () {
  35. const that = this;
  36. wx.getStorage({
  37. key: 'user',
  38. success: async res => { },
  39. fail: async res => {
  40. // wx.redirectTo({ url: '/pages/index/index' })
  41. }
  42. })
  43. },
  44. /**
  45. * 页面上拉触底事件的处理函数
  46. */
  47. /**
  48. * 生命周期函数--监听页面隐藏
  49. */
  50. onHide: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面卸载
  54. */
  55. onUnload: function () {
  56. },
  57. /**
  58. * 页面相关事件处理函数--监听用户下拉动作
  59. */
  60. onPullDownRefresh: function () {
  61. },
  62. /**
  63. * 用户点击右上角分享
  64. */
  65. onShareAppMessage: function () {
  66. }
  67. })