<script>
	import soket from "/utils/soket.js"
	export default {
		onLaunch: function() {
			// 生成设备唯一码
			let _Android =uni.getStorageSync('cid') || new Date().getTime()
			// #ifdef APP
			// 获取设备码
			function getAndroidId() {
				plus.android.importClass("android.provider.Settings");
				const context = plus.android.runtimeMainActivity().getApplicationContext();
				const androidId = plus.android.invoke("android.provider.Settings$Secure", "getString",
					context.getContentResolver(), "android_id");
				return androidId;
			}
			_Android = getAndroidId() || plus.device.getOAID() || uni.getSystemInfoSync().deviceId;
			// #endif
			uni.setStorageSync('cid', _Android)
			if (uni.getStorageSync('token')) {
				soket()
				uni.reLaunch({
					url: "/pages/index"
				})
			} else {
				uni.reLaunch({
					url: "/pages/signIn"
				})
			}
			// #ifdef APP-PLUS
			setTimeout(() => {
				plus.navigator.setFullscreen(true)
			}, 500)
			// #endif
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	view {

		box-sizing: border-box;
		color: #667085;
		font-size: 14rpx;
	}
	
	.numcolor1{
		background: #3336E0;
		color: #fff;
	}
	.numcolor2{
		background: #07C688;
		color: #fff;
	}
	.numcolor3{
		background: #FF9521;
		color: #fff;
	}
	.numcolor4{
		background: #333333;
		color: #fff;
	}
	/* :root{  

	  font-size: calc(100vw / 960px * 32px) !important;  
	} */
</style>