From 16213c0f85aa3ac8317797bf4a05fd12940e16d3 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期三, 05 三月 2025 17:29:42 +0800 Subject: [PATCH] - --- src/uni_modules/uview-plus/components/u-navbar/u-navbar.vue | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/uni_modules/uview-plus/components/u-navbar/u-navbar.vue b/src/uni_modules/uview-plus/components/u-navbar/u-navbar.vue index 6d6cdba..f16bd21 100644 --- a/src/uni_modules/uview-plus/components/u-navbar/u-navbar.vue +++ b/src/uni_modules/uview-plus/components/u-navbar/u-navbar.vue @@ -4,7 +4,7 @@ class="u-navbar__placeholder" v-if="fixed && placeholder" :style="{ - height: addUnit(getPx(height) + sys().statusBarHeight,'px'), + height: addUnit(getPx(height) + getWindowInfo().statusBarHeight,'px'), }" ></view> <view :class="[fixed && 'u-navbar--fixed']"> @@ -47,6 +47,7 @@ class="u-line-1 u-navbar__content__title" :style="[{ width: addUnit(titleWidth), + color: titleColor, }, addStyle(titleStyle)]" >{{ title }}</text> </slot> @@ -76,7 +77,8 @@ import { props } from './props'; import { mpMixin } from '../../libs/mixin/mpMixin'; import { mixin } from '../../libs/mixin/mixin'; - import { addUnit, addStyle, getPx, sys } from '../../libs/function/index'; + import config from '../../libs/config/config'; + import { addUnit, addStyle, getPx, getWindowInfo } from '../../libs/function/index'; /** * Navbar 鑷畾涔夊鑸爮 * @description 姝ょ粍浠朵竴鑸敤浜庡湪鐗规畩鎯呭喌涓嬶紝闇�瑕佽嚜瀹氫箟瀵艰埅鏍忕殑鏃跺�欑敤鍒帮紝涓�鑸缓璁娇鐢╱ni-app甯︾殑瀵艰埅鏍忋�� @@ -85,11 +87,12 @@ * @property {Boolean} placeholder 鍥哄畾鍦ㄩ《閮ㄦ椂锛屾槸鍚︾敓鎴愪竴涓瓑楂樺厓绱狅紝浠ラ槻姝㈠闄� 锛堥粯璁� false 锛� * @property {Boolean} fixed 瀵艰埅鏍忔槸鍚﹀浐瀹氬湪椤堕儴 锛堥粯璁� false 锛� * @property {Boolean} border 瀵艰埅鏍忓簳閮ㄦ槸鍚︽樉绀轰笅杈规 锛堥粯璁� false 锛� - * @property {String} leftIcon 宸﹁竟杩斿洖鍥炬爣鐨勫悕绉帮紝鍙兘涓簎View鑷甫鐨勫浘鏍� 锛堥粯璁� 'arrow-left' 锛� + * @property {String} leftIcon 宸﹁竟杩斿洖鍥炬爣鐨勫悕绉帮紝鍙兘涓簎view-pls鑷甫鐨勫浘鏍� 锛堥粯璁� 'arrow-left' 锛� * @property {String} leftText 宸﹁竟鐨勬彁绀烘枃瀛� * @property {String} rightText 鍙宠竟鐨勬彁绀烘枃瀛� - * @property {String} rightIcon 鍙宠竟杩斿洖鍥炬爣鐨勫悕绉帮紝鍙兘涓簎View鑷甫鐨勫浘鏍� + * @property {String} rightIcon 鍙宠竟杩斿洖鍥炬爣鐨勫悕绉帮紝鍙兘涓簎view-plus鑷甫鐨勫浘鏍� * @property {String} title 瀵艰埅鏍忔爣棰橈紝濡傝缃负绌哄瓧绗︼紝灏嗕細闅愯棌鏍囬鍗犱綅鍖哄煙 + * @property {String} titleColor 鏂囧瓧棰滆壊 锛堥粯璁� '' 锛� * @property {String} bgColor 瀵艰埅鏍忚儗鏅缃� 锛堥粯璁� '#ffffff' 锛� * @property {String | Number} titleWidth 瀵艰埅鏍忔爣棰樼殑鏈�澶у搴︼紝鍐呭瓒呭嚭浼氫互鐪佺暐鍙烽殣钘� 锛堥粯璁� '400rpx' 锛� * @property {String | Number} height 瀵艰埅鏍忛珮搴�(涓嶅寘鎷姸鎬佹爮楂樺害鍦ㄥ唴锛屽唴閮ㄨ嚜鍔ㄥ姞涓�)锛堥粯璁� '44px' 锛� @@ -112,14 +115,18 @@ methods: { addStyle, addUnit, - sys, + getWindowInfo, getPx, // 鐐瑰嚮宸︿晶鍖哄煙 leftClick() { // 濡傛灉閰嶇疆浜哸utoBack锛岃嚜鍔ㄨ繑鍥炰笂涓�椤� this.$emit('leftClick') - if(this.autoBack) { - uni.navigateBack() + if (config.interceptor.navbarLeftClick != null) { + config.interceptor.navbarLeftClick() + } else { + if(this.autoBack) { + uni.navigateBack() + } } }, // 鐐瑰嚮鍙充晶鍖哄煙 -- Gitblit v1.9.1