App.vue 958 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <script>
  2. export default {
  3. globalData: {
  4. // navBarBgColor: '#000',
  5. // navBarFsColor: '#fff',
  6. navBarHeight: 50,
  7. statusBarHeight: 0, // 状态烂高度
  8. screenWidth: null,
  9. screenHeight: null,
  10. appVersion: null,
  11. appVersionCode: null
  12. },
  13. onLaunch: function() {
  14. uni.getSystemInfo({
  15. success: (res) => {
  16. this.globalData.statusBarHeight = res.statusBarHeight;
  17. this.globalData.screenWidth = res.screenWidth;
  18. this.globalData.screenHeight = res.screenHeight;
  19. this.globalData.appVersion = res.appVersion;
  20. this.globalData.appVersionCode = res.appVersionCode;
  21. },
  22. fail: fail => {
  23. console.log('fail = ', fail)
  24. }
  25. });
  26. },
  27. onShow: function() {
  28. console.log('App Show')
  29. },
  30. onHide: function() {
  31. console.log('App Hide')
  32. }
  33. }
  34. </script>
  35. <style lang="scss">
  36. *{
  37. padding: 0;
  38. margin: 0;
  39. box-sizing: border-box
  40. }
  41. @import '@/static/index.scss';
  42. /*每个页面公共css */
  43. </style>