index.js
1.06 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
Component({
properties: {
isShow: {
type: Boolean,
value: false,
observer: '_show'
},
menus: {
type: Array,
value: [{
type: 'share',
icon: '/static/images/share/wechat@2x.png',
name: '分享给好友'
}, {
type: 'friend',
icon: '/static/images/share/friend@2x.png',
name: '分享到朋友圈'
}]
}
},
data: {
indicatorAnimation: {},
isSwitch: false
},
methods: {
tapSheet: function(e) {
let dataset = e.currentTarget.dataset;
this.triggerEvent('tapActionSheetMenu', {dataset});
},
_show: function() {
if (this.data.isShow) {
this.setData({
isSwitch: true,
});
} else {
setTimeout(() => {
this.setData({isSwitch: false});
}, 300);
}
}
}
});