App.vue 1.9 KB

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