<script>
	export default {
		onLaunch: function() {
			console.log('App onLaunch')
			var _this = this;
			if(!uni.getStorageSync('isLogin')){
				this.$store.dispatch('login_verified',).then((res)=>{
					this.$isResolve()
				}).catch(()=>{
					this.$store.dispatch('login_first').then(()=>{
						this.$isResolve()
					}).catch(()=>{
						uni.redirectTo({
							url:'/pages/subPackages/login/login'
						})
					})
				})
			}else{
				this.$isResolve()
			}
			//获取系统信息
			uni.getSystemInfo({
			    success: function (res) {
					var data = res;
					let modelmes = res.model; //手机品牌
					if (modelmes.indexOf('iPhone X') != -1 || modelmes.indexOf('iPhone XS') != -1 || modelmes.indexOf('iPhone XR') != -1 || modelmes.indexOf('iPhone XS Max') != -1 || modelmes.indexOf('iPhone 11') != -1 || modelmes.indexOf('iPhone 11 Pro') != -1 || modelmes.indexOf('iPhone 11 Pro Max') != -1) {
					  data.isIpx = true
					}
					data.safeAreaTop = data.statusBarHeight + 40;//statusBarHeight为状态栏的高度，safeAreaTop为内容区距离顶部位置
					_this.$store.commit('setSystemInfo',data)
			    }
			});
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	page{
		background: #F2F2F2;
	}
	.tabbar-container{
		padding-bottom: 150rpx;
	}
</style>
