App.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <script>
  2. export default {
  3. globalData: {
  4. musicTimer: null,
  5. musicTimerCount: 0,
  6. postHeader: null,
  7. systemInfo: null
  8. },
  9. beforeDestroy() {
  10. this.stopMusic()
  11. },
  12. onLaunch: function(options) {
  13. let systemInfo = uni.getSystemInfoSync();
  14. // #ifdef APP-PLUS
  15. systemInfo.env = 'app';
  16. // #endif
  17. systemInfo.isXS = systemInfo.screenWidth < 768;
  18. this.globalData.systemInfo = systemInfo;
  19. console.log(systemInfo);
  20. // this.globalData.launchPage = this.$Route.path;
  21. console.log('App Launch');
  22. let postHeader = {
  23. from: "gushi",
  24. uuid: systemInfo.deviceId,
  25. os: "uni",
  26. dev_os_version: systemInfo.appVersion,
  27. device_name: systemInfo.osName,
  28. screen_size: "[" + systemInfo.screenWidth + "," + systemInfo.screenHeight + "]",
  29. own_version: "" + systemInfo.appVersionCode,
  30. channel: "normal",
  31. ios_version: systemInfo.osVersion,
  32. country_code: "",
  33. is_jailbreak: "0",
  34. is_notification_enable: "0",
  35. sign: "",
  36. timestamp: "",
  37. appid: systemInfo.appId,
  38. ua: systemInfo.ua
  39. };
  40. this.globalData.postHeader = postHeader;
  41. },
  42. onShow: function(options) {
  43. console.log('App Show');
  44. // setTimeout(()=>{
  45. // uni.hideTabBar()
  46. // },100)
  47. },
  48. onHide: function() {
  49. console.log('App Hide');
  50. },
  51. onAppBackground() {
  52. // 在后台继续播放音乐
  53. },
  54. methods: {
  55. }
  56. };
  57. </script>
  58. <style>
  59. /*每个页面公共css */
  60. @import 'colorui/main.css';
  61. @import 'colorui/icon.css';
  62. @import 'style/FontStyle.css';
  63. body {
  64. -webkit-text-size-adjust: none;
  65. overscroll-behavior-y: contain;
  66. -webkit-overflow-scrolling: touch;
  67. }
  68. /* 超出一行省略号 */
  69. .one-omit {
  70. white-space: nowrap;
  71. /*规定段落中的文本不进行换行*/
  72. overflow: hidden;
  73. /*内容会被修剪,并且其余内容是不可见的。*/
  74. text-overflow: ellipsis;
  75. /*显示省略号来代表被修剪的文本*/
  76. }
  77. .two-omit {
  78. display: -webkit-box;
  79. -webkit-line-clamp: 2;
  80. overflow: hidden;
  81. text-overflow: ellipsis;
  82. -webkit-box-orient: vertical;
  83. }
  84. img {
  85. width: 100%;
  86. }
  87. uni-modal {
  88. z-index: 998 !important;
  89. }
  90. .cu-modal {
  91. z-index: 997 !important;
  92. }
  93. </style>