<script>
	import {
		checkUpdateApp
	} from './common/downApp.js';
	// 燃气瓶app
	export default {
		onLaunch: function() {
			var token = this.$cache.getToken()
			if (token) {
				uni.redirectTo({
					url: '/pages/indexRouter',
					success: () => {
						//跳转完页面后再关闭启动页
						// #ifdef APP-PLUS 
						plus.navigator.closeSplashscreen();
						// #endif
					}
				})
			}
			// console.log('App Launch')
		},
		onShow: function() {
			// #ifdef APP-PLUS 
			uni.getSystemInfo({
				success: (res) => {
					var that = this;
					//检测当前平台，如果是安卓则启动安卓更新  
					if (res.platform == "android") {
						checkUpdateApp();
					}
				}
			})
			// #endif
			setTimeout(() => {
				// #ifdef APP-PLUS 
				plus.navigator.closeSplashscreen()
				// #endif
			}, 2000)
			// console.log('App Show')
		},
		onHide: function() {
			// console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "uview-ui/index.scss";
	@import "common/index.scss";
	@import url(@/static/fonts/iconfont.css);
</style>