-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathapp.js
More file actions
executable file
·112 lines (83 loc) · 2.31 KB
/
app.js
File metadata and controls
executable file
·112 lines (83 loc) · 2.31 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//app.js
var app = getApp();
var aldstat = require("./utils/ald-stat.js");
var utils = require('./utils/utils.js');
var QQMapWX = require('./utils/qqmap-wx-jssdk.js');
App({
/**
* @brief 先检查是否还处于登录状态,如果成功直接进入主页,否则进行登录流程
*/
globalData: {
// 手机信息,屏幕宽高
windowWidth: '',
windowHeight: '',
// 身份id,对话id
openid: '',
sessionid: '',
// 位置信息
latitude: 0.0,
longitude: 0.0,
// api信息
qqmapsdk: {},
category_foreign__to_china:{
"food": 'restaurant',
"parks": 'living_service',
"travel": 'tourism',
"building": 'hotel',
"arts": 'entertainment',
"shopes": 'mall',
"nightlife" : 'nightlife'
},
rawData:{},
checkins: [],
qrcodeUrl: "",
weatherCity:"",
locationMap: {
"房产小区": "resident",
"教育学校": "school",
"酒店宾馆": "hotel",
"公司企业": "company",
"购物": "mall",
"美食": "restaurant",
"娱乐休闲": "entertainment",
"机构团体": "bureau",
"银行金融": "bank",
"生活服务": "living_service",
"旅游景点": "tourism",
"基础设施": "infra",
"医疗保健": "hospital",
"运动健身": "sports"
},
categoryDic:{},
districtDict:{},
placeDict:{},
checkinLastTimeTable: new Array(),
scores: 30,
version:-1,
activity_refresh:false,
account_refresh: false,
},
onLaunch: function () {
var that = this;
// 获取手机屏幕信息
var sysInfo = wx.getSystemInfoSync();
this.globalData.windowWidth = sysInfo.windowWidth;
this.globalData.windowHeight = sysInfo.windowHeight;
// 设置公共接口sdk
this.globalData.qqmapsdk = new QQMapWX({
key: 'A5EBZ-DCPK4-IFSU7-XIQGW-NJKPJ-2NFLM'
});
},
onShow: function (options) {
},
/**
* 当小程序从前台进入后台,会触发 onHide
*/
onHide: function () {
},
/**
* 当小程序发生脚本错误,或者 api 调用失败时,会触发 onError 并带上错误信息
*/
onError: function (msg) {
}
})