From 8ed31fd4188ce6bea283c135075d2341a78cf543 Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 10 Oct 2019 22:55:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20app=20=E7=AB=AF=20s?= =?UTF-8?q?ubNvue=20=E9=81=AE=E7=BD=A9=E6=97=A0=E6=B3=95=E9=81=AE=E6=8C=A1?= =?UTF-8?q?=20tabBar=20=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app-plus-nvue/services/api/sub-nvue.js | 12 +++++++++--- src/platforms/app-plus/runtime/api/sub-nvue.js | 13 ++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/platforms/app-plus-nvue/services/api/sub-nvue.js b/src/platforms/app-plus-nvue/services/api/sub-nvue.js index 47237eac27..32b483c54b 100644 --- a/src/platforms/app-plus-nvue/services/api/sub-nvue.js +++ b/src/platforms/app-plus-nvue/services/api/sub-nvue.js @@ -71,8 +71,14 @@ export function initSubNVue (nvue, plus, BroadcastChannel) { const maskColor = webview.__uniapp_mask - let maskWebview = plus.webview.getWebviewById(webview.__uniapp_mask_id) - maskWebview = maskWebview.parent() || maskWebview // 再次检测父 + let maskWebview = webview.__uniapp_mask_id === '0' ? { + setStyle ({ mask }) { + nvue.requireModule('uni-tabview').setMask({ + color: mask + }) + } + } : plus.webview.getWebviewById(webview.__uniapp_mask_id) + const oldShow = webview.show const oldHide = webview.hide const oldClose = webview.close @@ -115,4 +121,4 @@ export function initSubNVue (nvue, plus, BroadcastChannel) { return getSubNVueById(plus.webview.currentWebview().id) } } -} +} diff --git a/src/platforms/app-plus/runtime/api/sub-nvue.js b/src/platforms/app-plus/runtime/api/sub-nvue.js index 0d5318cc22..d3cfa15a38 100644 --- a/src/platforms/app-plus/runtime/api/sub-nvue.js +++ b/src/platforms/app-plus/runtime/api/sub-nvue.js @@ -1,3 +1,5 @@ +import { requireNativePlugin } from './index' + function wrapper (webview) { webview.$processed = true @@ -19,8 +21,13 @@ function wrapper (webview) { return } const maskColor = webview.__uniapp_mask - let maskWebview = plus.webview.getWebviewById(webview.__uniapp_mask_id) - maskWebview = maskWebview.parent() || maskWebview// 再次检测父 + let maskWebview = webview.__uniapp_mask_id === '0' ? { + setStyle ({ mask }) { + requireNativePlugin('uni-tabview').setMask({ + color: mask + }) + } + } : plus.webview.getWebviewById(webview.__uniapp_mask_id) const oldShow = webview.show const oldHide = webview.hide const oldClose = webview.close @@ -56,4 +63,4 @@ export function getSubNVueById (id) { wrapper(webview) } return webview -} +} -- GitLab