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 47237eac2776868000c3fc8a7b23918d16d9519b..32b483c54b3a5f63d4a22e7080a00e9de7d11842 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 0d5318cc229eb529c58e376831edc9ee6bb3c17e..d3cfa15a38e0d461aebaf02249987c9defb74482 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 -} +}