<script lang="ts">
import { fetchToken } from "./api/auth";
export default <any>{
  globalData: {
    token: "",
    lastData: {},
    stations: [],
    normalCode: "",
  },
  onLaunch() {
    uni.getSystemInfo({
      success: (res) => {
        this.globalData.device = res;
      },
    });
    return fetchToken().then((cache) => {
      if (cache) {
        this.globalData.token = cache;
      }
    });
  },
  onPageNotFound() {
    uni.switchTab({
      url: "/pages/map/map",
    });
  },
};
</script>
<style lang="scss">
@import "./styles/flex.scss";
@import "./styles/font.scss";
@import "./styles/layout.scss";

view {
  box-sizing: border-box;
  --color-primary: #2d9e95;
  --color-warning: #ff9900;
  --color-sec: #f7f7f7;
}

.box-content {
  box-sizing: content-box;
}

image {
  width: 20rpx;
  height: 20rpx;
}

.relative {
  position: relative;
}

.color-fff {
  color: #fff;
}

.color-000 {
  color: #000;
}

.color-000-5 {
  color: rgba(0, 0, 0, 0.5);
}

.color-000-6 {
  color: rgba(0, 0, 0, 0.6);
}

.color-000-08 {
  color: rgba(0, 0, 0, 0.08);
}

.color-333 {
  color: #333;
}

.color-666 {
  color: #666;
}

.color-999 {
  color: #999;
}

.color-primary {
  color: var(--color-primary);
}

.color-warning {
  color: var(--color-warning);
}

.bg-fff {
  background-color: #fff;
}

.bg-666 {
  background-color: #666;
}

.bg-000-08 {
  background-color: rgba(0, 0, 0, 0.08);
}

.bg-primary {
  background-color: var(--color-primary);
}

.full-percent {
  height: 100%;
  width: 100%;
}

.absolute-top-left {
  position: absolute;
  left: 0px;
  top: 0px;
}

.absolute-full {
  position: absolute;
  left: 0px;
  top: 0px;
  width: 100%;
  height: 100%;
}

.absolute-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.transition {
  transition: all 0.3s;
}

.hover-scale {
  transition: all 0.3s;
  transform: scale(0.98);
}

.animation-loading {
  animation: animation-turn 2s linear infinite;
}

@keyframes animation-turn {
  0% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(180deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
</style>
