diff --git a/src/core/helpers/patch.js b/src/core/helpers/patch.js index be27fca8271520c993d111146d7d48825418e673..41b3eb9c3c07b203832fa8804613a9ae08141c52 100644 --- a/src/core/helpers/patch.js +++ b/src/core/helpers/patch.js @@ -34,6 +34,18 @@ export function mergeTitleNView (navigationBar, titleNView) { if (hasOwn(titleNView, 'type')) { navigationBar.type = titleNView.type } + if (hasOwn(titleNView, 'searchInput') && typeof titleNView.searchInput === 'object') { + navigationBar.searchInput = Object.assign({ + autoFocus: false, + align: 'center', + color: '#000000', + backgroundColor: 'rgba(255,255,255,0.5)', + borderRadius: '0px', + placeholder: '', + placeholderColor: '#CCCCCC', + disabled: false + }, titleNView.searchInput) + } } return navigationBar -} +} diff --git a/src/core/service/bridge/on.js b/src/core/service/bridge/on.js index cf99847dfaf6b0490393ac42193db6cb00c59e6d..1ca4f1ac6344c46a6ac2a9e6208711112eb74f52 100644 --- a/src/core/service/bridge/on.js +++ b/src/core/service/bridge/on.js @@ -69,5 +69,9 @@ export default function initOn (on) { on('onTabItemTap', createCallCurrentPageHook('onTabItemTap')) on('onNavigationBarButtonTap', createCallCurrentPageHook('onNavigationBarButtonTap')) + on('onNavigationBarSearchInputChanged', createCallCurrentPageHook('onNavigationBarSearchInputChanged')) + on('onNavigationBarSearchInputConfirmed', createCallCurrentPageHook('onNavigationBarSearchInputConfirmed')) + on('onNavigationBarSearchInputClicked', createCallCurrentPageHook('onNavigationBarSearchInputClicked')) + on('onWebInvokeAppService', onWebInvokeAppService) -} +} diff --git a/src/platforms/h5/components/page/pageHead.vue b/src/platforms/h5/components/page/pageHead.vue index ece51bb1b75602f8db65097b5fb03e4c9d2dd4b2..a2fc96914541b149f01f5d2bc1f77fdb979a9bd8 100644 --- a/src/platforms/h5/components/page/pageHead.vue +++ b/src/platforms/h5/components/page/pageHead.vue @@ -3,13 +3,16 @@
+ class="uni-page-head" + >
-
+
+ class="uni-btn-icon"> +
-
+
+ class="uni-page-head__title" + > + class="uni-loading"/> {{ titleText }}
+
+ class="uni-placeholder"/>