<script>
	import Vue from 'vue'
	export default {
		onLaunch: function() {
			
			//检查更新
			// #ifdef APP-PLUS
			var appUpdateData = {};
			uni.request({
				url: 'https://xrzp.haowork365.com/mainapp.php/update/index',
				data: {
					appid: plus.runtime.appid,
					version: plus.runtime.version   
				},
				method: 'GET',
				success: (res) => {
					appUpdateData = res.data.data;
					if (appUpdateData.statusAndroid===1 && plus.os.name=="Android") {  
						uni.showModal({  
							title: "更新提示",
							content: appUpdateData.updatecon,
							showCancel: false,
							success: (res) => {
								if (res.confirm) {
									plus.runtime.openURL(appUpdateData.downAndroidUrl);
								}
							}
						});
					} 
					
					if (appUpdateData.statusIos===1 && plus.os.name=="iOS") {
						uni.showModal({
							title: "更新提示",
							content: appUpdateData.updatecon,
							showCancel: false,
							success: (res) => {
								if (res.confirm) {
									plus.runtime.openURL(appUpdateData.downIosUrl);
								}
							}
						});
					}
				}
			});
			// #endif  
			
			uni.getSystemInfo({
				success: function(e) {
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
					};
					// #endif
			
					// #ifdef MP-WEIXIN
					Vue.prototype.StatusBar = e.statusBarHeight;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					// #endif		
			
					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				}
			});
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>


<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";
	@import "components/gaoyia-parse/parse.css";
	
	@import "static/uni.css";
	@import "colorui/main.css";
    @import "colorui/icon.css";
	
	

	@import "static/echoUi.css";
</style>
