58 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Vue
		
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			Vue
		
	
	
<script>
 | 
						||
	import toolAll from '@/jsFile/tools.js';
 | 
						||
	export default {
 | 
						||
		globalData: {
 | 
						||
			statusBarHeight: 0, //状态栏高度
 | 
						||
			navigationBarHeight: 44, //这里先默认为44,ios 导航栏高度值,安卓和ios有点差别哦
 | 
						||
		},
 | 
						||
		onLaunch: function() {
 | 
						||
			// console.log('App Launch');
 | 
						||
			let that = this;
 | 
						||
			uni.getSystemInfo({
 | 
						||
				success(res) {
 | 
						||
					that.globalData.statusBarHeight = res.statusBarHeight;
 | 
						||
					if (res.platform == 'ios') {
 | 
						||
						// console.log('ios',that.globalData.statusBarHeight);
 | 
						||
						that.globalData.navigationBarHeight == 44;
 | 
						||
					} else if (res.platform == 'android') {
 | 
						||
						// console.log('android',that.globalData.statusBarHeight);
 | 
						||
						that.globalData.navigationBarHeight = 48;
 | 
						||
					} else {
 | 
						||
						// console.log('其他',that.globalData.statusBarHeight);
 | 
						||
						that.globalData.navigationBarHeight = 44;
 | 
						||
					}
 | 
						||
				}
 | 
						||
			})
 | 
						||
			// 给底部tab加角标
 | 
						||
			// setTimeout(() => {
 | 
						||
			// 	uni.setTabBarBadge({
 | 
						||
			// 		index: 1,
 | 
						||
			// 		text: '31'
 | 
						||
			// 	});
 | 
						||
			// 	uni.showTabBarRedDot({
 | 
						||
			// 		index: 3
 | 
						||
			// 	});
 | 
						||
			// }, 1000);
 | 
						||
 | 
						||
		},
 | 
						||
		onShow: function() {
 | 
						||
			setTimeout(()=>{
 | 
						||
				toolAll.tools.guoq()
 | 
						||
			},3000)
 | 
						||
		},
 | 
						||
		onHide: function() {
 | 
						||
			// console.log('App Hide');
 | 
						||
		}
 | 
						||
	};
 | 
						||
</script>
 | 
						||
 | 
						||
<style>
 | 
						||
	/*每个页面公共css */
 | 
						||
	@import url("./commons/dengrui.css");
 | 
						||
	@import url("./commons/animate.min.css");
 | 
						||
 | 
						||
	page {
 | 
						||
		background-color: #F5F5F5;
 | 
						||
	}
 | 
						||
</style>
 |