<script>
	const NET = require('@/utils/request')
	const API = require('@/config/api')
	export default {
		onLaunch: function() {
			console.log('App Launch');
			// #ifdef APP-PLUS
			    var version = plus.runtime.versionCode
				console.log('版本号',version)
				NET.request(API.getAppVersion, {}, 'GET').then(res => {
					console.log('获取res')
					try {
						console.log('进入try',res)
						if (version != res.data.version) {
							console.log('判断版本号')
							plus.runtime.openURL( res.data.url) 
						}
					} catch (e) {
						console.log('版本号错误', e)
					}
				})
			// #endif
		},
		onShow: function() {
			console.log('App Show');
		},
		onHide: function() {
			console.log('App Hide');
		}
	};
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	@import './iconFont/iconfont.css';

	/* 解决头条小程序组件内引入字体不生效的问题 */
	/* #ifdef MP-TOUTIAO */
	@font-face {
		font-family: uniicons;
		src: url('/iconFont/uni.ttf');
	}

	/* #endif */
	::-webkit-scrollbar {
		display: none;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
	}
	page {
		width: 100%;
		height: 100%;
	}
</style>
