| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- // #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")
- }
- )
- },
- }
- }
|