App.vue 1.6 KB
Newer Older
1
<script>
2
	import initApp from '@/common/appInit.js';
3 4 5 6
	import openApp from '@/common/openApp.js';
	// #ifdef H5
		openApp() //创建在h5端全局悬浮引导用户下载app的功能
	// #endif
7
	import checkIsAgree from '@/pages/uni-agree/utils/uni-agree.js';
8 9 10
	export default {
		globalData: {
			searchText: '',
DCloud_JSON's avatar
DCloud_JSON 已提交
11
			appVersion: {},
12 13 14
			config: {},
			$i18n: {},
			$t: {}
15
		},
16
		onLaunch: function() {
DCloud_JSON's avatar
DCloud_JSON 已提交
17
			console.log('App Launch')
18 19 20
			this.globalData.$i18n = this.$i18n
			this.globalData.$t = str => this.$t(str)

21 22
			initApp();
			
23
			
DCloud_JSON's avatar
DCloud_JSON 已提交
24
			// #ifdef APP-PLUS
25
			//checkIsAgree(); APP端暂时先用原生默认生成的。目前,自定义方式启动vue界面时,原生层已经请求了部分权限这并不符合国家的法规
26
			// #endif
27

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

32
			// #ifdef APP-PLUS
33
			//idfa有需要的用户在应用首次启动时自己获取存储到storage中
DCloud_JSON's avatar
DCloud_JSON 已提交
34
			/*var idfa = '';
35 36 37 38 39 40 41
			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 已提交
42
			console.log('idfa = '+idfa);*/
43
			// #endif
44 45
		},
		onShow: function() {
46
			console.log('App Show')
47 48 49 50 51 52 53 54 55
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
56
</style>