index.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. const app = getApp(),
  2. {
  3. globalData: {
  4. util: {
  5. regeneratorRuntime,
  6. goLogin,
  7. navigate_auth_native,
  8. getUserInfo
  9. }
  10. }
  11. } = app;
  12. Page({
  13. onLoad() {
  14. this.setData({
  15. // topList: [
  16. // {
  17. // title: '系统消息',
  18. // icon: 'systemMsg',
  19. // url: 'message/index',
  20. // },
  21. // {
  22. // title: '用户信息',
  23. // icon: 'material',
  24. // url: 'myInfo/index',
  25. // },
  26. // {
  27. // title: '一键定位',
  28. // icon: 'nav',
  29. // url: 'localtion/index',
  30. // }
  31. // ],
  32. list: [
  33. {
  34. title: '个人信息',
  35. icon: 'user-icon',
  36. url: '../student/user/user',
  37. },
  38. // {
  39. // title: '我的预约',
  40. // icon: 'yuyue',
  41. // url: 'reservation/index',
  42. // },
  43. // {
  44. // title: '我的排队',
  45. // icon: 'paidui',
  46. // url: '',
  47. // },
  48. // {
  49. // title: '我的材料',
  50. // icon: 'cailiao',
  51. // url: 'myData/myData',
  52. // },
  53. // {
  54. // title: '我的收藏',
  55. // icon: 'shoucang',
  56. // url: 'myCollect/index',
  57. // },
  58. // {
  59. // title: '我的评价',
  60. // icon: 'assess',
  61. // url: 'assess/assess',
  62. // },
  63. // {
  64. // title: '我的咨询',
  65. // icon: 'zixun',
  66. // url: 'advisory/advisory',
  67. // },
  68. // {
  69. // title: '我的投诉',
  70. // icon: 'tousu',
  71. // url: 'complaint/complaint',
  72. // },
  73. {
  74. title: '我的设置',
  75. icon: 'setting',
  76. url: 'setting/index',
  77. }
  78. ]
  79. })
  80. },
  81. async onShow() {
  82. let userInfo = wx.getStorageSync('userInfo')
  83. if (!userInfo){
  84. let { viewName = '', photo = '' } = await getUserInfo()
  85. this.setData({
  86. photo,
  87. viewName
  88. })
  89. }else{
  90. this.setData({
  91. photo: userInfo.avatarUrl,
  92. viewName: userInfo.nickName
  93. })
  94. }
  95. },
  96. navigate_auth:function(e){
  97. wx.navigateTo({
  98. url: e.currentTarget.dataset.url,
  99. })
  100. },
  101. goLogin,
  102. // navigate_auth_native
  103. })