animationControl.js
1.84 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
// #ifdef APP-PLUS
const animation = weex.requireModule('animation')
// #endif
export default {
methods: {
/**
* 显示面板
*/
panelShow() {
let that = this;
let sys = uni.getSystemInfoSync();
animation.transition(
that.$refs.mask,
{
styles: {
opacity: 1,
height: sys.windowHeight + 'px'
},
duration: 200, //ms
timingFunction: 'linear',
delay: 0 //ms
}
)
let height = Math.ceil(sys.windowHeight * 0.8);
animation.transition(
that.$refs.panel,
{
styles: {
opacity: 1,
transform: `transform: translate(0px,${height}px)`
},
duration: 1, //ms
timingFunction: 'linear',
delay: 0 //ms
},
(res) => {
animation.transition(
that.$refs.panel,
{
styles: {
transform: `transform: translate(0px,0px)`
},
duration: 200, //ms
timingFunction: 'linear',
delay: 0 //ms
}
)
}
)
},
/**
* 关闭面板
*/
panelHide() {
let that = this;
animation.transition(
that.$refs.mask,
{
styles: {
opacity: 0,
},
duration: 200, //ms
timingFunction: 'linear',
delay: 0 //ms
}
)
let height = uni.upx2px(1000);
animation.transition(
that.$refs.panel,
{
styles: {
transform: `transform: translate(0px,${height}px)`
},
duration: 200, //ms
timingFunction: 'linear',
delay: 0 //ms
},
() => {
uni.$emit("devTools_panelHideSuccess")
}
)
},
}
}