App.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <script>
  2. import Vue from 'vue'
  3. export default {
  4. created() {
  5. // #ifdef APP-PLUS
  6. plus.navigator.closeSplashscreen();
  7. // #endif
  8. },
  9. onLaunch: function() {
  10. console.log('App Launch')
  11. uni.getSystemInfo({
  12. success: function(e) {
  13. // #ifndef MP
  14. Vue.prototype.StatusBar = e.statusBarHeight;
  15. if (e.platform == 'android') {
  16. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  17. } else {
  18. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  19. };
  20. // #endif
  21. // #ifdef MP-WEIXIN
  22. Vue.prototype.StatusBar = e.statusBarHeight;
  23. let custom = wx.getMenuButtonBoundingClientRect();
  24. Vue.prototype.Custom = custom;
  25. Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
  26. // #endif
  27. // #ifdef MP-ALIPAY
  28. Vue.prototype.StatusBar = e.statusBarHeight;
  29. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  30. // #endif
  31. }
  32. })
  33. },
  34. onShow: function() {
  35. console.log('App 开启')
  36. },
  37. onHide: function() {
  38. console.log('App 关闭')
  39. }
  40. }
  41. </script>
  42. <style >
  43. body{
  44. background: #FFFFFF !important;
  45. }
  46. </style>