-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.vue
71 lines (59 loc) · 1.71 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<script>
import initApp from '@/common/appInit.js';
import openApp from '@/common/openApp.js';
import checkIsAgree from '@/pages/uni-agree/utils/uni-agree.js';
import { useActions } from '@/utils/vuex/index.js';
export default {
globalData: {
searchText: '',
appVersion: {},
config: {},
$i18n: {},
$t: {},
padHeight:5
},
onLaunch: async function() {
this.globalData.$i18n = this.$i18n;
this.globalData.$t = str => this.$t(str);
initApp();
const { initEnumsAction } = useActions('enums', ['initEnumsAction']);
await initEnumsAction()
// #ifdef H5
openApp(); //创建在h5端全局悬浮引导用户下载app的功能
// #endif
// #ifdef APP-PLUS
//checkIsAgree(); APP端暂时先用原生默认生成的。目前,自定义方式启动vue界面时,原生层已经请求了部分权限这并不符合国家的法规
// #endif
// #ifdef H5
// checkIsAgree(); // 默认不开启。目前全球,仅欧盟国家有网页端同意隐私权限的需要。如果需要可以自己去掉注视后生效
// #endif
// #ifdef APP-PLUS
//idfa有需要的用户在应用首次启动时自己获取存储到storage中
//https://ask.dcloud.net.cn/article/36107
/*if(~plus.storage.getItem('idfa')){
plus.device.getInfo({//需要勾选IDFA
success:function(e){
console.log('idfa = '+JSON.stringify(e.idfa));
},
fail:function(e){
console.log('getDeviceInfo failed: '+JSON.stringify(e));
}
});
}*/
// #endif
},
onShow: function() {
console.log('App Show');
},
onHide: function() {
console.log('App Hide');
}
};
</script>
<style lang="scss">
// @import '@/uni_modules/uview-ui/index.scss';
body,
html {
height: 100%;
}
</style>