App.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <script>
  2. import initConfig from '@/initConfig.js';
  3. export default {
  4. onLaunch: function (e) {
  5. // 只有小程序执行
  6. // #ifdef MP-WEIXIN
  7. initConfig();
  8. // getCdnUrl();
  9. // #endif
  10. },
  11. onShow: function (res) {
  12. console.log('App Show', res);
  13. // 是否是从被打开的小程序返回
  14. const { appId, extraData } = res.referrerInfo;
  15. if (appId && extraData) {
  16. uni.$emit('listener:ArBack', res.referrerInfo);
  17. }
  18. },
  19. onHide: function () {
  20. console.log('App Hide');
  21. }
  22. };
  23. </script>
  24. <style lang="scss">
  25. view,
  26. image,
  27. label {
  28. box-sizing: border-box;
  29. word-break: break-all;
  30. }
  31. image {
  32. height: auto;
  33. width: auto;
  34. }
  35. /* #ifndef APP-NVUE */
  36. // 设置整个项目的背景色
  37. page {
  38. background-color: #f7f9fa;
  39. }
  40. /* #endif */
  41. // 弹性盒子
  42. .flex {
  43. display: flex;
  44. &-none {
  45. flex: none;
  46. }
  47. &-1 {
  48. flex: 1;
  49. }
  50. &-y {
  51. flex-direction: column;
  52. }
  53. &-top {
  54. align-items: flex-start !important;
  55. }
  56. // 顶部对齐
  57. &-bottom {
  58. align-items: flex-end;
  59. }
  60. // 底部对齐
  61. &-content-end {
  62. justify-content: flex-end;
  63. }
  64. // 水平靠右 || 垂直靠下对齐
  65. &-center {
  66. align-items: center;
  67. }
  68. // 水平居中对齐
  69. &-center-center {
  70. align-items: center;
  71. justify-content: center;
  72. }
  73. // 水平垂直居中
  74. &-between {
  75. justify-content: space-between;
  76. }
  77. // 两端不留间隙对齐
  78. &-around {
  79. justify-content: space-around;
  80. }
  81. // 两端留间隙对齐
  82. &-wrap {
  83. flex-wrap: wrap;
  84. }
  85. // 允许换行
  86. }
  87. .w-0 {
  88. width: 0;
  89. }
  90. .h-0 {
  91. height: 0;
  92. }
  93. // 隐藏显示多少行
  94. .ellipsis {
  95. overflow: hidden;
  96. text-overflow: ellipsis;
  97. display: -webkit-box;
  98. -webkit-box-orient: vertical;
  99. -webkit-line-clamp: 1;
  100. word-break: break-all;
  101. @for $i from 2 through 10 {
  102. &.ellipsis-#{$i} {
  103. -webkit-line-clamp: $i;
  104. }
  105. }
  106. &-no {
  107. display: block;
  108. }
  109. }
  110. // 点击时的透明度
  111. .hover-active {
  112. opacity: 0.8 !important;
  113. }
  114. // 底部安全区
  115. .safe-area {
  116. padding-bottom: constant(safe-area-inset-bottom);
  117. /* 兼容 iOS < 11.2 */
  118. padding-bottom: env(safe-area-inset-bottom);
  119. /* 兼容 iOS >= 11.2 */
  120. }
  121. .ql-editor.ql-blank:before {
  122. color: #999999;
  123. font-size: 28rpx;
  124. font-style: normal;
  125. }
  126. </style>