nav.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // nova-tourism/components/nav/nav.js
  2. let {
  3. statusBarHeight,
  4. screenHeight,
  5. safeArea: {
  6. bottom
  7. }
  8. } = wx.getSystemInfoSync();
  9. statusBarHeight = Math.abs(statusBarHeight)
  10. let custom = wx.getMenuButtonBoundingClientRect();
  11. let customBarHeight = custom.bottom + custom.top - statusBarHeight;
  12. customBarHeight = Math.abs(customBarHeight)
  13. Component({
  14. /**
  15. * 组件的属性列表
  16. */
  17. properties: {
  18. title: {
  19. value: '首页',
  20. type: String
  21. },
  22. fontColor: {
  23. value: '#ffffff',
  24. type: String
  25. },
  26. type: {
  27. value: 'title',
  28. type: String
  29. },
  30. frontColor: {
  31. value: '#ffffff',
  32. type: String,
  33. },
  34. backgroundImg: {
  35. value: '#ffffff',
  36. type: String,
  37. },
  38. },
  39. /**
  40. * 组件的初始数据
  41. */
  42. data: {
  43. statusBarHeight,
  44. customBarHeight,
  45. screenHeight,
  46. },
  47. /**
  48. * 组件的方法列表
  49. */
  50. methods: {
  51. }
  52. })