App.vue 1.1 KB
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1 2 3
<script>
	export default {
		onLaunch: function() {
DCloud_JSON's avatar
DCloud_JSON 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
			console.log('App Launch')
			let version = uni.getSystemInfoSync().uniRuntimeVersion
			function toNum(a){
			    const c = a.toString().split('.');
			    const num_place = ["", "0", "00", "000", "0000"],
			        r = num_place.reverse();
			    for (let i = 0; i < c.length; i++){
			        const len=c[i].length;
			        c[i]=r[len]+c[i];
			    }
			    return c.join('');
			}
			if(toNum(version) < toNum("3.8.0")){
				uni.showModal({
					content: '本示例的HBuilderX版本不得低于3.8.0,请升级',
					showCancel: false
				});
			}
DCloud_JSON's avatar
DCloud_JSON 已提交
22 23 24 25 26 27 28 29 30 31
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

DCloud_JSON's avatar
DCloud_JSON 已提交
32 33 34 35 36 37 38 39 40 41 42 43
<style lang="scss">
	/*每个页面公共css */
	
	/* #ifdef H5 */
	@media screen and (min-width:650px){
		/* pc宽屏 隐藏会话页面头部 && 全局底部导航 以下兼容了Vue2和3两种模式的样式*/
			uni-page[data-page="pages/chat/chat"] uni-page-head,
			{
				display: none !important;
				background-color: red !important;
			}
	}
DCloud_JSON's avatar
DCloud_JSON 已提交
44
	/* #endif */
DCloud_JSON's avatar
DCloud_JSON 已提交
45
</style>