Showing
2 changed files
with
49 additions
and
28 deletions
1 | App({ | 1 | App({ |
2 | globalData: { | 2 | globalData: { |
3 | - globalData: { | ||
4 | - selectedChannel: 'boy', | ||
5 | - userInfo: {}, | ||
6 | - systemInfo: null, | ||
7 | - WXThird_session: '', | ||
8 | - WXUnion_ID: '', | ||
9 | - openID: '', | ||
10 | - verifyKey: '', | ||
11 | - sessionkey: '', | ||
12 | - sid: '', | ||
13 | - udid: '', | ||
14 | - cid: '1', | ||
15 | - mobileRegisterState: '', | ||
16 | - hasReportAwakeAction: 'false', | ||
17 | - defraudurl: 'https://activity.yoho.cn/feature/45.html?title=防诈骗提醒', | ||
18 | - union_type: '', // 渠道号,大数据上传用 | ||
19 | - union_type_time: '', | ||
20 | - ch: '', | ||
21 | - networkType: '0', | ||
22 | - deviceInfo: {}, | ||
23 | - currentScene: 1001, | ||
24 | - user_union_type: '', // 用户相关unionType 要与union_type区分开 | ||
25 | - user_union_type_imageUrl: '', // 联盟图片 | ||
26 | - user_nounion_type_imageUrl: '', // 非联盟用户分享banner图片 | ||
27 | - shareId: '', | ||
28 | - shareInfo: {} | ||
29 | - }, | 3 | + selectedChannel: 'boy', |
4 | + userInfo: {}, | ||
5 | + systemInfo: null, | ||
6 | + WXThird_session: '', | ||
7 | + WXUnion_ID: '', | ||
8 | + openID: '', | ||
9 | + verifyKey: '', | ||
10 | + sessionkey: '', | ||
11 | + sid: '', | ||
12 | + udid: '', | ||
13 | + cid: '1', | ||
14 | + mobileRegisterState: '', | ||
15 | + hasReportAwakeAction: 'false', | ||
16 | + defraudurl: 'https://activity.yoho.cn/feature/45.html?title=防诈骗提醒', | ||
17 | + union_type: '', // 渠道号,大数据上传用 | ||
18 | + union_type_time: '', | ||
19 | + ch: '', | ||
20 | + networkType: '0', | ||
21 | + deviceInfo: {}, | ||
22 | + currentScene: 1001, | ||
23 | + user_union_type: '', // 用户相关unionType 要与union_type区分开 | ||
24 | + user_union_type_imageUrl: '', // 联盟图片 | ||
25 | + user_nounion_type_imageUrl: '', // 非联盟用户分享banner图片 | ||
26 | + shareId: '', | ||
27 | + shareInfo: {} | ||
30 | }, | 28 | }, |
31 | onLaunch: function () { | 29 | onLaunch: function () { |
30 | + this.getSystemInfo(); | ||
31 | + | ||
32 | + }, | ||
33 | + /** | ||
34 | + * 获取系统信息 | ||
35 | + */ | ||
36 | + getSystemInfo: function (){ | ||
37 | + let that = this; | ||
38 | + let systemInfo = this.globalData.systemInfo; | ||
39 | + | ||
40 | + if(!systemInfo || systemInfo === null){ | ||
41 | + try{ | ||
42 | + systemInfo = tt.getSystemInfoSync(); | ||
43 | + | ||
44 | + if (systemInfo) { | ||
45 | + this.globalData.systemInfo = systemInfo; | ||
46 | + } | ||
47 | + }catch(e){ | ||
48 | + | ||
49 | + } | ||
50 | + } | ||
51 | + return systemInfo; | ||
32 | 52 | ||
33 | }, | 53 | }, |
34 | getUid: function() { | 54 | getUid: function() { |
-
Please register or login to post a comment