App.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <script>
  2. import Vue from 'vue';
  3. export default {
  4. onLaunch: function() {
  5. uni.getSystemInfo({
  6. success: function(e) {
  7. // #ifndef MP
  8. Vue.prototype.StatusBar = e.statusBarHeight;
  9. if (e.platform == 'android') {
  10. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  11. } else {
  12. Vue.prototype.CustomBar = e.statusBarHeight + 45;
  13. };
  14. // #endif
  15. // #ifdef MP-WEIXIN
  16. Vue.prototype.StatusBar = e.statusBarHeight;
  17. let custom = wx.getMenuButtonBoundingClientRect();
  18. Vue.prototype.Custom = custom;
  19. Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
  20. // #endif
  21. // #ifdef MP-ALIPAY
  22. Vue.prototype.StatusBar = e.statusBarHeight;
  23. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  24. // #endif
  25. }
  26. })
  27. console.log('App Launch')
  28. },
  29. onShow: function() {
  30. console.log('App Show')
  31. },
  32. onHide: function() {
  33. console.log('App Hide')
  34. }
  35. }
  36. </script>
  37. <style>
  38. @import "colorui/main.css";
  39. @import "colorui/icon.css";
  40. @import "weatherIcon/iconfont.css";
  41. /* @import "app.css"; *//* 你的项目css */
  42. /*每个页面公共css */
  43. </style>