<script lang="ts">
import { fetchToken } from "./api/auth";
export default <any>{
  globalData: {
    token: "",
    lastData: {},
    stations: [],
    normalCode: "",
  },
  onLaunch() {
    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: #347dff;
  --color-warning: #ff9900;
  --color-gray: #666666;
  --color-sec: #f7f7f7;
}

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

.relative {
  position: relative;
}

.color-fff {
  color: #fff;
}

.color-000 {
  color: #000;
}

.color-333 {
  color: #333;
}

.color-666 {
  color: #666;
}

.color-999 {
  color: #999;
}

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

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

.transition {
  transition: all 0.3s;
}
</style>
