App.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 || MP-QQ
  16. Vue.prototype.StatusBar = e.statusBarHeight;
  17. let capsule = wx.getMenuButtonBoundingClientRect();
  18. if (capsule) {
  19. Vue.prototype.Custom = capsule;
  20. // Vue.prototype.capsuleSafe = uni.upx2px(750) - capsule.left + uni.upx2px(750) - capsule.right;
  21. Vue.prototype.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
  22. } else {
  23. Vue.prototype.CustomBar = e.statusBarHeight + 50;
  24. }
  25. // #endif
  26. // #ifdef MP-ALIPAY
  27. Vue.prototype.StatusBar = e.statusBarHeight;
  28. Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
  29. // #endif
  30. }
  31. })
  32. },
  33. onShow: function() {
  34. console.log('App Show')
  35. },
  36. onHide: function() {
  37. console.log('App Hide')
  38. }
  39. }
  40. </script>
  41. <style>
  42. @import "utils/css/main.css";
  43. @import "utils/css/icon.css";
  44. .skeleton-line{
  45. background: linear-gradient(90deg, #f1f2f4 25%, #e6e6e6 37%, #f1f2f4 50%);
  46. background-size: 400% 100%;
  47. border-radius: 3px;
  48. min-height: 30upx;
  49. height: 100%;
  50. width: 100%;
  51. }
  52. @keyframes skeleton {
  53. 0% {
  54. background-position: 100% 50%
  55. }
  56. 100% {
  57. background-position: 0 50%
  58. }
  59. }
  60. </style>