From 00e3512ca69976b5b9f3c30c1995bfb9c3751f72 Mon Sep 17 00:00:00 2001
From: liuleilei <234@qq.com>
Date: 星期一, 28 十月 2024 14:04:34 +0800
Subject: [PATCH] 更新

---
 h5/components/search.vue |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/h5/components/search.vue b/h5/components/search.vue
index 59e2820..5d6613b 100644
--- a/h5/components/search.vue
+++ b/h5/components/search.vue
@@ -21,7 +21,11 @@
 			</view>
 			<view class="search_box_item_xl" v-if="searchData && searchData.length > 0">
 				<view class="search_box_item_xl_item" v-for="(item, i) in searchData" :key="i">
-					<view :class="index === i ? 'search_box_item_xl_item_name active' : 'search_box_item_xl_item_name'" @click="clickItem(item, i)">{{ item.name }}</view><span v-if="item.price">锟{ item.price }}</span>
+					<view :class="index === i ? 'search_box_item_xl_item_name active' : 'search_box_item_xl_item_name'" @click="clickItem(item, i)" @mouseenter="aaa(i)" @mouseleave="bbb">
+  
+						<span :style="{color: fontColorIndex === i ? fontColor : ''}">{{item.name}}</span>
+					</view>
+					<span v-if="item.price">锟{ item.price }}</span>
 				</view>
 			</view>
 			
@@ -62,7 +66,8 @@
 				name2: '',
 				
 				index: 0,
-				focus: true
+				focus: true,
+				fontColorIndex: ''
 			}
 		},
 		props: {
@@ -85,6 +90,10 @@
 			},
 			categoryid: {
 				type: Number | String
+			},
+		 
+			fontColor:{
+				type: Number | String
 			}
 		},
 		watch: {
@@ -101,6 +110,12 @@
 			}
 		},
 		methods: {
+			aaa(index) {
+				this.fontColorIndex = index
+			},
+			bbb() {
+				this.fontColorIndex = ''
+			},
 			percentage(bgColor, alpha) {
 				let res = +(alpha * 2.55).toFixed(0)
 				return bgColor + res.toString(16)
@@ -357,9 +372,9 @@
 					// 		color: #FFF200;
 					// 	}
 					// }
-					.active {
+					  .active {
 						color: #FFF200 !important;
-					}
+					}  
 					.search_box_item_xl_item_name {
 						flex: 1;
 						height: 100%;

--
Gitblit v1.9.3