app.js
911 Bytes
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
//app.js
let fetchApi = require('./http/fetch-api.js');
let api = require('./http/api');
let config = require('./config');
let router = require('./router/index');
let store = require('./utils/stroage');
require('./http/mock-data');
App({
get: fetchApi.fetch,
post: (params) => {
params.method = 'post';
return fetchApi.fetch(params);
},
api: api,
config: config,
router: router,
store: store,
onLaunch: function () {},
globalData: {
indexInfo: null,
userInfo: null,
wxcode: store.getItem("wxcode"),
tlMemberCode: ""
},
// 获取用户基本信息
queryIndex() {
return new Promise((resolve, reject) => {
this.post({
url: this.api.index,
data: {},
loading: true,
}).then((result) => {
this.globalData.indexInfo = result;
resolve(result)
}).catch((err) => {
reject();
});
});
}
})