-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpage2.js
93 lines (85 loc) · 2.22 KB
/
page2.js
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
//page2
class Page2Activity extends ActivityController {
constructor(pageName) {
super(pageName)
this.toast = null
this.loadingdialog = null
this.notification = null
this.dialog = null
this.earth = null
}
onStart() {
let view = this.view
this.dialog = view.find('#dialog')
this.notification = view.find('#notification')
this.loadingdialog = view.find('#loadingdialog')
this.toast = view.find('#toast')
this.earth = view.find('#earthshow')
view = null
}
onBindEvent() {
/**
* 多图上传组件代码
* =============
*/
let numbers = 2
let pNode = this.view.find('#componentupload')
BaseClass.Component.uploadImg(pNode, numbers, (files) => {
console.log(files)
})
/**
* 接收Page1发送的消息
* =============
*/
let handleData = BaseClass.getPageHandler('page2')
console.log(handleData)
/**
* 提示信息
* =============
*/
this.toast.bind('click', (e) => {
BaseClass.Component.toast('内容', 'warning', 5)
// BaseClass.Component.toast('内容')
})
/**
* 加载动画
* =============
*/
this.loadingdialog.bind('click', (e) => {
BaseClass.Component.loadingDailog('show', '加载中...')
})
/**
* 通知栏
* =============
*/
this.notification.bind('click', (e) => {
BaseClass.Component.notification('标题', '这里内容', 'success', () => {
console.log('关闭')
}, 'top')
// BaseClass.Component.notification('标题', '这里内容', 'success', () => {
// console.log('关闭')
// }, 'bottom')
})
this.dialog.bind('click', (e) => {
BaseClass.Component.dialog('跪求SSR...', 'success', () => {
console.log('关闭')
})
})
/**
* 地球控件
*/
this.earth.bind('click', (e) => {
let earthDiv = this.view.find('#earth').show()
BaseClass.Component.earth(earthDiv[0], (controller) => {
console.log(controller)
})
})
}
onUnBindEvent() {
this.dialog.unbind('click')
this.notification.unbind('click')
this.loadingdialog.unbind('click')
this.toast.unbind('click')
this.earth.unbind('click')
}
}