forked from xiongchenf/imgLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
29 lines (29 loc) · 817 Bytes
/
app.js
File metadata and controls
29 lines (29 loc) · 817 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
//app.js
const ImageLoader = require('./utils/ImageLoader.js');
const ImageSource = require('./imageSource.js');
App({
onLaunch: function() {
new ImageLoader({
base: ImageSource.BASE,
source: [ImageSource.home],
loading: res => {
// 可以做进度条
console.log(res);
},
loaded: res => {
// 可以加载完毕动画
const {
status,
sourceLoaded
} = res;
if (status) {
this.globalData.sourceLoaded = sourceLoaded;
this.sourceLoaded && this.sourceLoaded(sourceLoaded);
}
}
});
},
globalData: {
userInfo: null
}
})