Browse Source

标题背景图设置

msx 11 months ago
parent
commit
fef66f7282

+ 3 - 2
pages/home/detail/autodoor/autodoor.vue

@@ -1,8 +1,8 @@
 <template>
 	<view class="container">
 			<!-- 建议放在外层 -->
-		<u-navbar :title="name"  @leftClick="backPage" class="top-nav">
-			<view class="u-nav-slot top-nav" slot="left">
+		<u-navbar :title="name"  @leftClick="backPage" :bgImage="backPic" >
+			<view class="u-nav-slot" slot="left">
 				<u-icon name="arrow-left" size="20" >
 				</u-icon>
 			</view>
@@ -50,6 +50,7 @@
 				name: '' ,// 初始化 name
 				TabCur: "gate",
 				checked: [],
+				backPic:"url(../../../../static/topnavbar.png)",
 			};
 		},
 		onLoad(query) {

+ 5 - 0
uni_modules/uview-ui/components/u-avatar/props.js

@@ -30,6 +30,11 @@ export default {
             type: String,
             default: uni.$u.props.avatar.bgColor
         },
+        // 背景色
+        bgImage: {
+            type: String,
+            default: ''
+        },
         // 文字颜色
         color: {
             type: String,

+ 5 - 0
uni_modules/uview-ui/components/u-navbar/props.js

@@ -50,6 +50,11 @@ export default {
 			type: String,
 			default: uni.$u.props.navbar.bgColor
 		},
+		// 背景颜色
+		bgImage: {
+			type: String,
+			default: ''
+		},
 		// 标题的宽度
 		titleWidth: {
 			type: [String, Number],

+ 2 - 0
uni_modules/uview-ui/components/u-navbar/u-navbar.vue

@@ -11,6 +11,7 @@
 			<u-status-bar
 				v-if="safeAreaInsetTop"
 				:bgColor="bgColor"
+				:bgImage="bgImage"
 			></u-status-bar>
 			<view
 				class="u-navbar__content"
@@ -18,6 +19,7 @@
 				:style="{
 					height: $u.addUnit(height),
 					backgroundColor: bgColor,
+					backgroundImage: bgImage,
 				}"
 			>
 				<view