index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. const app = getApp()
  2. Page({
  3. data: {
  4. info: {}
  5. },
  6. toPath(e) {
  7. let data = e.detail;
  8. let url = `/${data.route}`;
  9. if (data.type == '0') wx.navigateTo({ url })
  10. else if (data.type == '1') wx.redirectTo({ url })
  11. else if (data.type == '2') wx.relaunch({ url })
  12. else if (data.type == '3') wx.switchTab({ url })
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad(options) {
  18. const that = this;
  19. wx.showLoading({ title: '加载中', mask: true })
  20. that.search()
  21. wx.hideLoading()
  22. },
  23. // 查询通知
  24. async search() {
  25. const that = this;
  26. },
  27. /**
  28. * 生命周期函数--监听页面初次渲染完成
  29. */
  30. onReady() {
  31. },
  32. /**
  33. * 生命周期函数--监听页面显示
  34. */
  35. onShow() {
  36. },
  37. /**
  38. * 生命周期函数--监听页面隐藏
  39. */
  40. onHide() {
  41. },
  42. /**
  43. * 生命周期函数--监听页面卸载
  44. */
  45. onUnload() {
  46. },
  47. /**
  48. * 页面相关事件处理函数--监听用户下拉动作
  49. */
  50. onPullDownRefresh() {
  51. },
  52. /**
  53. * 页面上拉触底事件的处理函数
  54. */
  55. onReachBottom() {
  56. },
  57. /**
  58. * 用户点击右上角分享
  59. */
  60. onShareAppMessage() {
  61. }
  62. })