App.vue 2.1 KB

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