App.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. .mt15{margin-top: 15rpx;}
  53. .skeleton-line.short{
  54. width: 60%;
  55. }
  56. .skeleton-line.max{
  57. height: 80upx;
  58. }
  59. .animate {
  60. animation: skeleton 1.8s ease infinite
  61. }
  62. @keyframes skeleton {
  63. 0% {
  64. background-position: 100% 50%
  65. }
  66. 100% {
  67. background-position: 0 50%
  68. }
  69. }
  70. </style>