2018-08-12 17:35:13 +08:00

43 lines
612 B
JavaScript

import Page from '../../common/page';
Page({
data: {
show: {
middle: false,
top: false,
bottom: false,
right: false,
right2: false
}
},
toggle(type) {
this.setData({
[`show.${type}`]: !this.data.show[type]
});
},
togglePopup() {
this.toggle('middle');
},
toggleRightPopup() {
this.toggle('right');
},
toggleRightPopup2() {
this.toggle('right2');
},
toggleBottomPopup() {
this.toggle('bottom');
},
toggleTopPopup() {
this.toggle('top');
setTimeout(() => {
this.toggle('top');
}, 2000);
}
});