index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // components/My_navBar/index.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. },
  8. lifetimes: {
  9. attached: function () {
  10. // 在组件实例进入页面节点树时执行
  11. //获取当前登录用户名
  12. /* const userName = getApp().globalData.accountList[wx.getStorageSync('userIndex')].fname;
  13. this.setData({
  14. userName
  15. }) */
  16. },
  17. detached: function () {
  18. // 在组件实例被从页面节点树移除时执行
  19. },
  20. },
  21. /**
  22. * 组件的初始数据
  23. */
  24. data: {
  25. userName: "", //用户名
  26. NavHeight: getApp().globalData.myNavBorHeight, //头部导航高度
  27. capsule: wx.getMenuButtonBoundingClientRect(), //胶囊位置
  28. },
  29. /**
  30. * 组件的方法列表
  31. */
  32. methods: {
  33. a1212() {
  34. //跳转到选择账号
  35. wx.navigateTo({
  36. url: '/pages/login/index?type=' + 2,
  37. })
  38. }
  39. }
  40. })