App.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <script lang="ts">
  2. import { fetchToken } from "./api/auth";
  3. export default <any>{
  4. globalData: {
  5. token: "",
  6. lastData: {},
  7. stations: [],
  8. normalCode: "",
  9. },
  10. onLaunch() {
  11. uni.getSystemInfo({
  12. success: (res) => {
  13. this.globalData.device = res;
  14. },
  15. });
  16. return fetchToken().then((cache) => {
  17. if (cache) {
  18. this.globalData.token = cache;
  19. }
  20. });
  21. },
  22. onPageNotFound() {
  23. uni.switchTab({
  24. url: "/pages/map/map",
  25. });
  26. },
  27. };
  28. </script>
  29. <style lang="scss">
  30. @import "./styles/flex.scss";
  31. @import "./styles/font.scss";
  32. @import "./styles/layout.scss";
  33. view {
  34. box-sizing: border-box;
  35. --color-primary: #2d9e95;
  36. --color-warning: #ff9900;
  37. --color-sec: #f7f7f7;
  38. }
  39. .box-content {
  40. box-sizing: content-box;
  41. }
  42. image {
  43. width: 20rpx;
  44. height: 20rpx;
  45. }
  46. .relative {
  47. position: relative;
  48. }
  49. .color-fff {
  50. color: #fff;
  51. }
  52. .color-000 {
  53. color: #000;
  54. }
  55. .color-000-5 {
  56. color: rgba(0, 0, 0, 0.5);
  57. }
  58. .color-000-6 {
  59. color: rgba(0, 0, 0, 0.6);
  60. }
  61. .color-000-08 {
  62. color: rgba(0, 0, 0, 0.08);
  63. }
  64. .color-333 {
  65. color: #333;
  66. }
  67. .color-666 {
  68. color: #666;
  69. }
  70. .color-999 {
  71. color: #999;
  72. }
  73. .color-primary {
  74. color: var(--color-primary);
  75. }
  76. .color-warning {
  77. color: var(--color-warning);
  78. }
  79. .bg-fff {
  80. background-color: #fff;
  81. }
  82. .bg-666 {
  83. background-color: #666;
  84. }
  85. .bg-000-08 {
  86. background-color: rgba(0, 0, 0, 0.08);
  87. }
  88. .bg-primary {
  89. background-color: var(--color-primary);
  90. }
  91. .full-percent {
  92. height: 100%;
  93. width: 100%;
  94. }
  95. .absolute-top-left {
  96. position: absolute;
  97. left: 0px;
  98. top: 0px;
  99. }
  100. .absolute-full {
  101. position: absolute;
  102. left: 0px;
  103. top: 0px;
  104. width: 100%;
  105. height: 100%;
  106. }
  107. .absolute-center {
  108. position: absolute;
  109. left: 50%;
  110. top: 50%;
  111. transform: translate(-50%, -50%);
  112. }
  113. .transition {
  114. transition: all 0.3s;
  115. }
  116. .hover-scale {
  117. transition: all 0.3s;
  118. transform: scale(0.98);
  119. }
  120. .animation-loading {
  121. animation: animation-turn 2s linear infinite;
  122. }
  123. @keyframes animation-turn {
  124. 0% {
  125. transform: rotate(0deg);
  126. }
  127. 50% {
  128. transform: rotate(180deg);
  129. }
  130. 100% {
  131. transform: rotate(360deg);
  132. }
  133. }
  134. </style>