App.vue 1.8 KB
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1
<script>
雪洛's avatar
雪洛 已提交
2
	import initApp from '@/common/appInit.js';
3 4 5 6
	import openApp from '@/common/openApp.js';
	// #ifdef H5
		openApp() //创建在h5端全局悬浮引导用户下载app的功能
	// #endif
雪洛's avatar
雪洛 已提交
7
	import checkIsAgree from '@/pages/uni-agree/utils/uni-agree.js';
DCloud_JSON's avatar
DCloud_JSON 已提交
8
	import uniIdPageInit from '@/uni_modules/uni-id-pages/init.js';
DCloud_JSON's avatar
DCloud_JSON 已提交
9 10 11 12 13 14 15 16 17 18
	export default {
		globalData: {
			searchText: '',
			appVersion: {},
			config: {},
			$i18n: {},
			$t: {}
		},
		onLaunch: function() {
			console.log('App Launch')
雪洛's avatar
雪洛 已提交
19
			this.globalData.$i18n = this.$i18n
DCloud_JSON's avatar
DCloud_JSON 已提交
20
			this.globalData.$t = str => this.$t(str)
雪洛's avatar
雪洛 已提交
21
			
DCloud_JSON's avatar
DCloud_JSON 已提交
22 23 24 25
			console.log('uni.getPushClientId',uni.getPushClientId);
			
			initApp();
			uniIdPageInit()
26
			
DCloud_JSON's avatar
DCloud_JSON 已提交
27 28 29 30 31 32 33 34 35
			// #ifdef APP-PLUS
			//checkIsAgree(); APP端暂时先用原生默认生成的。目前,自定义方式启动vue界面时,原生层已经请求了部分权限这并不符合国家的法规
			// #endif

			// #ifdef H5
			// checkIsAgree(); // 默认不开启。目前全球,仅欧盟国家有网页端同意隐私权限的需要。如果需要可以自己去掉注视后生效
			// #endif

			// #ifdef APP-PLUS
36
			//idfa有需要的用户在应用首次启动时自己获取存储到storage中
DCloud_JSON's avatar
DCloud_JSON 已提交
37
			/*var idfa = '';
38 39 40 41 42 43 44
			var manager = plus.ios.invoke('ASIdentifierManager', 'sharedManager');
			if(plus.ios.invoke(manager, 'isAdvertisingTrackingEnabled')){
				var identifier = plus.ios.invoke(manager, 'advertisingIdentifier');
				idfa = plus.ios.invoke(identifier, 'UUIDString');
				plus.ios.deleteObject(identifier);
			}
			plus.ios.deleteObject(manager);
DCloud_JSON's avatar
DCloud_JSON 已提交
45
			console.log('idfa = '+idfa);*/
DCloud_JSON's avatar
DCloud_JSON 已提交
46 47 48 49 50 51 52 53 54 55 56 57 58
			// #endif
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
雪洛's avatar
雪洛 已提交
59
</style>