App.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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("@/static/style/style.css");
  59. @import url("@/static/style/icon.css");
  60. @import url("@/static/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: 0px 2px 4px 0px rgba(121,190,254,0.59);
  81. }
  82. </style>