Commit c150b2a5da707fac54e65558802964bab3ef4eb8
1 parent
cf7acf34
调用原生webView页面滑动禁用属性
Showing
1 changed file
with
27 additions
and
0 deletions
src/pages/myGiftBox/myGiftBox.vue
| ... | ... | @@ -103,6 +103,8 @@ export default { |
| 103 | 103 | this.orderGiftContent(); |
| 104 | 104 | // 取消订单原因获取 |
| 105 | 105 | this.cancelPayment(); |
| 106 | + // 是否禁用滑动webview(none隐藏,block显示) | |
| 107 | + this.CNDSWebScrollEnabled(); | |
| 106 | 108 | }, |
| 107 | 109 | mounted() { |
| 108 | 110 | // 配合原生回调 |
| ... | ... | @@ -183,6 +185,31 @@ export default { |
| 183 | 185 | } |
| 184 | 186 | }, |
| 185 | 187 | /** |
| 188 | + * 是否禁用滑动webview(none隐藏,block显示) | |
| 189 | + */ | |
| 190 | + CNDSWebScrollEnabled(itme) { | |
| 191 | + // App内 | |
| 192 | + if (this.isCNLive.value) { | |
| 193 | + // 调用App,返回按键 | |
| 194 | + if ( | |
| 195 | + window.webkit && | |
| 196 | + window.webkit.messageHandlers && | |
| 197 | + window.webkit.messageHandlers.CNDSWebScrollEnabled | |
| 198 | + ) { | |
| 199 | + // App内,iOS销毁WebView | |
| 200 | + window.webkit.messageHandlers.CNDSWebScrollEnabled.postMessage( | |
| 201 | + { body: { display: 'none' } } | |
| 202 | + ); | |
| 203 | + } else if ( | |
| 204 | + window.obj && | |
| 205 | + window.obj.setGiftBottomVisibleBySwitchTab | |
| 206 | + ) { | |
| 207 | + // App内,Android销毁WebView | |
| 208 | + window.obj.CNDSWebScrollEnabled('none'); | |
| 209 | + } | |
| 210 | + } | |
| 211 | + }, | |
| 212 | + /** | |
| 186 | 213 | * 获取收礼礼物列表 |
| 187 | 214 | */ |
| 188 | 215 | getorderGiftList() { | ... | ... |