App.vue 1019 字节
Newer Older
1 2
<script>
	import uniIdPagesInit from '@/uni_modules/uni-id-pages/init.js';
DCloud_JSON's avatar
DCloud_JSON 已提交
3
	export default {
4 5 6
		 onLaunch:async function() {
			// 初始化uni身份信息管理模块
			uniIdPagesInit();
DCloud_JSON's avatar
DCloud_JSON 已提交
7
			console.log('App Launch')
8
			if(typeof(uniCloud.SSEChannel) == 'undefined' ){
DCloud_JSON's avatar
DCloud_JSON 已提交
9
				uni.showModal({
10
					content: '本项目,仅支持HBuilderX 正式版 v3.7.10 或 alpha v3.8.0及以上版本请升级',
DCloud_JSON's avatar
DCloud_JSON 已提交
11 12
					showCancel: false
				});
13
			}
14 15 16
			// #ifdef MP-WEIXIN
			uniCloud.initSecureNetworkByWeixin()
			// #endif
DCloud_JSON's avatar
DCloud_JSON 已提交
17 18 19 20 21 22 23 24 25 26
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

DCloud_JSON's avatar
DCloud_JSON 已提交
27 28 29 30 31 32 33 34 35 36 37
<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 已提交
38
	/* #endif */
DCloud_JSON's avatar
DCloud_JSON 已提交
39
</style>