File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<view wx:if="{{show}}" class="container-popup l-class" style="z-index:{{zIndex}};" catchtouchmove="doNothing">
2- <view class=" container-bg container-bg-{{status}} l-bg-class" ></view>
2+ <view class=' container-bg container-bg-{{animation ? status:"" }} l-bg-class' ></view>
33 <view class="popup-content {{ show ? contentAlign : ''}} popup-fade-{{contentAlign}}-active-{{animation ? status:''}} l-panel-class" catchtap="onPopupTap">
44 <view catchtap="doNothing">
55 <slot></slot>
Original file line number Diff line number Diff line change @@ -89,17 +89,29 @@ Component({
8989 // 点击事件
9090 onPopupTap ( ) {
9191 if ( this . data . locked !== true ) {
92+ this . _hidePopup ( ) ;
93+ }
94+
95+ eventUtil . emit ( this , 'lintap' ) ;
96+ } ,
97+
98+ _hidePopup ( ) {
99+ if ( this . data . animation ) {
92100 this . setData ( {
93101 status : 'hide'
94102 } ) ;
103+ // 延迟 300ms 等动画结束再去掉节点
95104 setTimeout ( ( ) => {
96105 this . setData ( {
97106 show : false
98107 } ) ;
99108 } , 300 ) ;
109+ } else {
110+ this . setData ( {
111+ show : false ,
112+ status : 'hide'
113+ } ) ;
100114 }
101-
102- eventUtil . emit ( this , 'lintap' ) ;
103115 } ,
104116
105117 // ================= 开放函数 ========================
@@ -127,14 +139,7 @@ Component({
127139 * 会忽略 locked 属性
128140 */
129141 linHide ( ) {
130- this . setData ( {
131- status : 'hide'
132- } ) ;
133- setTimeout ( ( ) => {
134- this . setData ( {
135- show : false
136- } ) ;
137- } , 300 ) ;
142+ this . _hidePopup ( ) ;
138143 }
139144 }
140145} ) ;
Original file line number Diff line number Diff line change 11<view wx:if="{{show}}" class='container-popup l-class'
22 style="z-index:{{zIndex}}; "
33 catchtouchmove="doNothing">
4- <view class='container-bg container-bg-{{status}} l-bg-class'></view>
4+ <view class='container-bg container-bg-{{animation ? status:"" }} l-bg-class'></view>
55 <view
66 class="popup-content {{ show ? contentAlign : ''}} popup-fade-{{contentAlign}}-active-{{animation ? status:''}} l-panel-class"
77 catchtap='onPopupTap'>
You can’t perform that action at this time.
0 commit comments