Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[ ! ] fixed the popup standUp compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
tw93 committed Sep 7, 2018
1 parent 73e9105 commit bf95871
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions packages/wxc-popup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,57 +105,58 @@
isOverShow: true
}),
computed: {
isNeedShow () {
isNeedShow() {
setTimeout(() => {
this.appearPopup(this.show);
}, 50);
return this.show;
},
_height () {
_height() {
this.appearPopup(this.show, 150);
return this.height;
},
padStyle () {
padStyle() {
const { pos, width, height, popupColor, standOut } = this;
const stand = parseInt(standOut, 10);
let style = {
width: `${width}px`,
backgroundColor: popupColor
};
pos === 'top' && (style = {
...style,
top: `${-height + standOut}px`,
top: `${-height + stand}px`,
height: `${height}px`
});
pos === 'bottom' && (style = {
...style,
bottom: `${-height + standOut}px`,
bottom: `${-height + stand}px`,
height: `${height}px`
});
pos === 'left' && (style = {
...style,
left: `${-width + standOut}px`
left: `${-width + stand}px`
});
pos === 'right' && (style = {
...style,
right: `${-width + standOut}px`
right: `${-width + stand}px`
});
return style;
}
},
methods: {
handleTouchEnd (e) {
handleTouchEnd(e) {
// 在支付宝上面有点击穿透问题
const { platform } = weex.config.env;
platform === 'Web' && e.preventDefault && e.preventDefault();
},
hide () {
hide() {
this.appearPopup(false);
this.$refs.overlay.appearOverlay(false);
},
wxcOverlayBodyClicking () {
wxcOverlayBodyClicking() {
this.isShow && this.appearPopup(false);
},
appearPopup (bool, duration = 300) {
appearPopup(bool, duration = 300) {
this.isShow = bool;
const popupEl = this.$refs['wxc-popup'];
if (!popupEl) {
Expand All @@ -174,7 +175,7 @@
}
});
},
getTransform (pos, width, height, bool) {
getTransform(pos, width, height, bool) {
let _size = pos === 'top' || pos === 'bottom' ? height : width;
bool && (_size = 0);
let _transform;
Expand Down

0 comments on commit bf95871

Please sign in to comment.