修改主页的搜索框和热词的逻辑

This commit is contained in:
赵毅 2025-08-12 16:15:42 +08:00
parent 9d5b9a86bc
commit 0cab3dd853
2 changed files with 15 additions and 13 deletions

View File

@ -3,10 +3,13 @@
}
.hot-word-container {
height: 40px;
width: auto;
height: 50rpx;
overflow: hidden;
position: relative;
flex: 1;
/* flex: 1; */
border-radius: 50rpx;
margin: 0 20rpx;
}
.hot-word-scroll {
@ -14,9 +17,9 @@
}
.hot-word-item {
height: 40px;
line-height: 40px;
padding: 0 10px;
height: 50rpx;
line-height: 50rpx;
padding: 0 15rpx;
color: #666;
}
@ -118,7 +121,6 @@ page {
display: flex;
box-sizing: border-box;
align-items: center;
padding-left: 30rpx;
padding-right: 30rpx;
font-size: 26rpx;
}
@ -699,9 +701,7 @@ page {
box-sizing: border-box;
}
.merchantList2{
}
.merchantList2 {}
.merchantItem {
display: flex;

View File

@ -37,16 +37,18 @@
<!-- 搜索框 -->
<view class="search2" v-if="isShowSearch">
<view class="searchBox2">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image>
<view class="hot-word-container">
<view class="hot-word-scroll" :style="{ transform: 'translateY(' + scrollPosition + 'px)' }">
<view class="hot-word-scroll" :style="{ transform: 'translateY(' + scrollPosition + 'rpx)' }">
<view v-for="(word, index) in hotWord" :key="index" class="hot-word-item"
@click="handleHotWordClick(word)">
{{ word }}
</view>
</view>
</view>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/com_communitySearchIcon.png"
mode="aspectFill"></image>
<input class="search_input" placeholder='输入搜索的社区名称' confirm-type='search' @input="searchInput"
@confirm="searchInput" :value="selectKeyWord" />
</view>
</view>
<!-- 轮播图 -->
@ -279,7 +281,7 @@ export default {
hotWord: [], //
scrollPosition: 0, //
scrollInterval: null, //
itemHeight: 40, //
itemHeight: 50, //
// 1广
serverLeft: '',