App.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <script>
  2. export default {
  3. globalData: {
  4. SET_STATUS_BAR: 0,
  5. SET_CUSTOM_BAR: 0,
  6. SET_SYSTEM_INFO: {}
  7. },
  8. onLaunch: function() {
  9. console.log('App Launch')
  10. uni.getSystemInfo({
  11. success: (e) => {
  12. let statusBar = 0
  13. let customBar = 0
  14. // #ifdef MP
  15. statusBar = e.statusBarHeight
  16. customBar = e.statusBarHeight + 45
  17. if (e.platform === 'android') {
  18. customBar = e.statusBarHeight + 50
  19. }
  20. // #endif
  21. // #ifdef MP-WEIXIN
  22. statusBar = e.statusBarHeight
  23. const custom = wx.getMenuButtonBoundingClientRect()
  24. customBar = custom.bottom + custom.top - e.statusBarHeight
  25. // #endif
  26. // #ifdef MP-ALIPAY
  27. statusBar = e.statusBarHeight
  28. customBar = e.statusBarHeight + e.titleBarHeight
  29. // #endif
  30. // #ifdef APP-PLUS
  31. console.log('app-plus', e)
  32. statusBar = e.statusBarHeight
  33. customBar = e.statusBarHeight + 45
  34. // #endif
  35. // #ifdef H5
  36. statusBar = 0
  37. customBar = e.statusBarHeight + 45
  38. // #endif
  39. this.globalData.SET_SYSTEM_INFO = e
  40. this.globalData.SET_CUSTOM_BAR = customBar
  41. this.globalData.SET_STATUS_BAR = statusBar
  42. console.log(this.globalData)
  43. }
  44. })
  45. },
  46. onShow: function() {
  47. console.log('App Show')
  48. },
  49. onHide: function() {
  50. console.log('App Hide')
  51. }
  52. }
  53. </script>
  54. <style>
  55. /*每个页面公共css */
  56. @import url("@/utils/style/style.css");
  57. @import url("@/utils/style/icon.css");
  58. @import url("@/utils/style/color.css");
  59. page {
  60. background: #f5f5f5;
  61. }
  62. .my-button {
  63. border-radius: 0px;
  64. transform: initial;
  65. background-color: transparent;
  66. }
  67. .my-button:after {
  68. border-width: 0px;
  69. border-radius: 0px;
  70. transform: initial;
  71. background-color: transparent;
  72. }
  73. .bule_line{
  74. width: 10rpx;
  75. height: 30rpx;
  76. background-color: #1e8ff9 ;
  77. border-radius: 6rpx;
  78. box-shadow: 1px 2px 3px 1px #6ba9f9;
  79. }
  80. </style>