<script>
	export default {
		onLaunch: function() {
			console.log('App Launch');
			//默认语言
			var lan = 'en'
			
			// var lan = 'zh'
			 try {
				const res = uni.getSystemInfoSync();
				lan = res.language
			} catch (e) {
				console.log('error='+e)
			}
			console.log('lan='+lan); 
			 if(lan == 'en') {
				 this._i18n.locale = 'en-US'
			 }
			 if(lan == 'zh-Hans-CN' || lan=='zh' || lan=='zh-CN') {
				 this._i18n.locale = 'zh-CN'
			 }
			 uni.setTabBarItem({ index: 0,text: this.$t('tabs.tab1')});
			 uni.setTabBarItem({ index: 1,text: this.$t('tabs.tab2')});
			 uni.setTabBarItem({ index: 2,text: this.$t('tabs.tab3')});
			 uni.setTabBarItem({ index: 3,text: this.$t('tabs.tab4')});
			 uni.setTabBarItem({ index: 4,text: this.$t('tabs.tab5')});
		},
		// onShow: function() {
		// 	console.log('App Show');
		// },
		// onHide: function() {
		// 	console.log('返回上一页');
		// 	uni.navigateTo({
		// 	    url: 'pages/User/user'
		// 	});
		// },
		// onBackPress: function(){
		// 	console.log('返回上一页2');
		// }
	}
</script>
<style>
	/*每个页面公共css */
	/* uni.css - 通用组件、模板样式库，可以当作一套ui库应用 */
	@import './common/uni.css';
	/* icon图标 */
	@font-face {
	  font-family: 'iconfont';  /* project id 1095188 */
	  src: url('https://at.alicdn.com/t/font_1095188_lvwtknkk16s.eot');
	  src: url('https://at.alicdn.com/t/font_1095188_lvwtknkk16s.eot?#iefix') format('embedded-opentype'),
	  url('https://at.alicdn.com/t/font_1095188_lvwtknkk16s.woff2') format('woff2'),
	  url('https://at.alicdn.com/t/font_1095188_lvwtknkk16s.woff') format('woff'),
	  url('https://at.alicdn.com/t/font_1095188_lvwtknkk16s.ttf') format('truetype'),
	  url('https://at.alicdn.com/t/font_1095188_lvwtknkk16s.svg#iconfont') format('svg');
	}
	.icon {
	  font-size: 24upx;
	  color: #000000;
	  font-family: iconfont;
	}
	.icon-warning:before { 
		content: '\e604';
		font-size: 48upx;
	}
</style>
