diff --git a/src/core/view/bridge/subscribe/index.js b/src/core/view/bridge/subscribe/index.js index 2be7605d3293d77cb6bf7c0978520be84ad2e6f0..a047a87336df7504e1c616959b431db268037fd7 100644 --- a/src/core/view/bridge/subscribe/index.js +++ b/src/core/view/bridge/subscribe/index.js @@ -27,7 +27,7 @@ const passiveOptions = supportsPassive ? { function updateCssVar (vm) { if (uni.canIUse('css.var')) { const pageVm = vm.$parent.$parent - const windowTop = pageVm.showNavigationBar && pageVm.navigationBar.type !== 'transparent' && pageVm.navigationBar.type !== 'alwaysTransparent' ? (NAVBAR_HEIGHT + + const windowTop = pageVm.showNavigationBar && pageVm.navigationBar.type !== 'transparent' && pageVm.navigationBar.type !== 'float' ? (NAVBAR_HEIGHT + 'px') : '0px' const windowBottom = getApp().$children[0].showTabBar ? (TABBAR_HEIGHT + 'px') : '0px' diff --git a/src/platforms/h5/components/page/index.vue b/src/platforms/h5/components/page/index.vue index 67d789b14cda1a081bf880d0eeb1377bd553af36..1921a3cac8e73344302fba4f831e0a0905b13acc 100644 --- a/src/platforms/h5/components/page/index.vue +++ b/src/platforms/h5/components/page/index.vue @@ -146,7 +146,7 @@ export default { const titleNViewTypeList = { 'none': 'default', 'auto': 'transparent', - 'always': 'alwaysTransparent' + 'always': 'float' } const navigationBar = mergeTitleNView({ @@ -158,7 +158,8 @@ export default { titleImage: this.titleImage, duration: '0', timingFunc: '', - type: titleNViewTypeList[this.transparentTitle] + type: titleNViewTypeList[this.transparentTitle], + transparentTitle: this.transparentTitle }, this.titleNView) const showNavigationBar = this.navigationStyle === 'default' && this.titleNView diff --git a/src/platforms/h5/components/page/pageHead.vue b/src/platforms/h5/components/page/pageHead.vue index a235c2f0fc8557b5b25587ff043fbfcaa62f5edc..8127d0f5b278246bacd139679cbda96f734ec7af 100644 --- a/src/platforms/h5/components/page/pageHead.vue +++ b/src/platforms/h5/components/page/pageHead.vue @@ -96,7 +96,7 @@
@@ -335,7 +335,7 @@ export default { type: { default: 'default', validator (value) { - return ['default', 'transparent', 'alwaysTransparent'].indexOf(value) !== -1 + return ['default', 'transparent', 'float'].indexOf(value) !== -1 } }, coverage: { @@ -357,6 +357,12 @@ export default { titleImage: { type: String, default: '' + }, + transparentTitle: { + default: 'none', + validator (value) { + return ['none', 'auto', 'always'].indexOf(value) !== -1 + } } }, data () { diff --git a/src/platforms/h5/components/page/transparent.js b/src/platforms/h5/components/page/transparent.js index db48294965404593589d331a88b4b0cb261622de..b4a169affda99f413c447a3e92a4692af15e1afa 100644 --- a/src/platforms/h5/components/page/transparent.js +++ b/src/platforms/h5/components/page/transparent.js @@ -53,7 +53,7 @@ export default { borderRadiusElemStyle.backgroundColor = `rgba(${rgba})` }) }) - } else if (this.type === 'alwaysTransparent') { + } else if (this.transparentTitle === 'always') { const iconElems = this.$el.querySelectorAll('.uni-btn-icon') const iconElemsStyles = [] for (let i = 0; i < iconElems.length; i++) { @@ -71,13 +71,13 @@ export default { }, computed: { color () { - return this.type === 'transparent' || this.type === 'alwaysTransparent' ? '#fff' : this.textColor + return this.type === 'transparent' || this.transparentTitle === 'always' ? '#fff' : this.textColor }, offset () { return parseInt(this.coverage) }, bgColor () { - if (this.type === 'transparent' || this.type === 'alwaysTransparent') { + if (this.type === 'transparent' || this.transparentTitle === 'always') { const { r, g, diff --git a/src/platforms/h5/helpers/get-window-offset.js b/src/platforms/h5/helpers/get-window-offset.js index a1359d74b6d897ba2999e3cbf386540d18f27d03..b989996b0b2ff653e5ef4d940442e94e5efe1366 100644 --- a/src/platforms/h5/helpers/get-window-offset.js +++ b/src/platforms/h5/helpers/get-window-offset.js @@ -17,7 +17,7 @@ export default function getWindowOffset () { const pages = getCurrentPages() if (pages.length) { const pageVm = pages[pages.length - 1].$parent.$parent - top = pageVm.showNavigationBar && (pageVm.navigationBar.type !== 'transparent' || pageVm.navigationBar.type !== 'alwaysTransparent') ? NAVBAR_HEIGHT : 0 + top = pageVm.showNavigationBar && (pageVm.navigationBar.type !== 'transparent' || pageVm.navigationBar.type !== 'float') ? NAVBAR_HEIGHT : 0 } const app = getApp() if (app) {