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

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