From add52699adfbfd6d842fa041d57304478bd42e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Fri, 11 Jul 2025 15:34:22 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E5=88=B0=E5=AE=B6=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=20=E6=90=9C=E7=B4=A2=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/homeServer/index/index.css | 24 ++- packages/homeServer/index/index.vue | 27 ++- packages/homeServer/search/index.css | 276 +++++++++++++++++++++++++++ packages/homeServer/search/index.vue | 257 ++++++++++++++++++++++--- 4 files changed, 547 insertions(+), 37 deletions(-) diff --git a/packages/homeServer/index/index.css b/packages/homeServer/index/index.css index b1b7a004..e60cc3db 100644 --- a/packages/homeServer/index/index.css +++ b/packages/homeServer/index/index.css @@ -2,7 +2,6 @@ margin-top: 87rpx; padding: 0 15rpx; background-color: whte; - min-height: 100vh; } /* 头部样式 */ @@ -265,6 +264,7 @@ /* 热门服务样式 */ .hot-services { padding: 20rpx; + border: 1rpx solid #e8e8e8; } .section-header { @@ -346,7 +346,6 @@ .service-tag { display: inline-block; - /* background-color: #f5f5f5; */ color: #e1ca9b; font-size: 22rpx; padding: 2rpx 16rpx; @@ -361,12 +360,6 @@ line-height: 1.5; } -.service-footer { - /* display: flex; - justify-content: space-between; - align-items: center; */ -} - .service-count { font-size: 24rpx; color: #999; @@ -379,4 +372,19 @@ font-size: 26rpx; padding: 12rpx 36rpx; border-radius: 60rpx; +} + +/* 回到顶部 */ +.toUp { + width: 100rpx; + height: 100rpx; + position: fixed; + right: 33rpx; + bottom: 250rpx; + z-index: 10; +} + +.toUp image { + width: 100%; + height: 100%; } \ No newline at end of file diff --git a/packages/homeServer/index/index.vue b/packages/homeServer/index/index.vue index 61d3920c..a3d60d2c 100644 --- a/packages/homeServer/index/index.vue +++ b/packages/homeServer/index/index.vue @@ -9,7 +9,8 @@ {{ currentLocation }} - + + + + +
+ + +
@@ -186,8 +200,7 @@ export default { { id: 1, name: "空调清洗", - image: - "", + image: "", badge: "推荐", tag: "平台保障", description: "专业保洁团队,全屋深度清洁,去除顽固污渍,还您清新居所", @@ -234,6 +247,14 @@ export default { // 实际项目中应该调用定位API获取真实位置 console.log("获取当前位置信息"); }, + + // 回到顶部 + scrollToTop() { + uni.pageScrollTo({ + scrollTop: 0, + duration: 300, + }); + }, }, onLoad() { this.getCurrentLocation(); diff --git a/packages/homeServer/search/index.css b/packages/homeServer/search/index.css index e69de29b..3982efd8 100644 --- a/packages/homeServer/search/index.css +++ b/packages/homeServer/search/index.css @@ -0,0 +1,276 @@ +.container { + margin-top: 81rpx; + padding: 0 15rpx; + background-color: whte; +} + +/* 搜索栏样式 */ +.search-bar { + width: 520rpx; + display: flex; + align-items: center; + padding: 16rpx 20rpx; + background-color: #fff; + border-bottom: 1rpx solid #f5f5f5; +} + +.search-input-container { + flex: 1; + display: flex; + align-items: center; + background-color: #f5f7fb; + border-radius: 60rpx; + padding: 14rpx 24rpx; +} + +.search-icon { + width: 28rpx; + height: 28rpx; + margin-right: 16rpx; +} + +.search-input { + flex: 1; + font-size: 26rpx; + font-weight: 300; + background: transparent; +} + +.cancel-btn { + font-size: 28rpx; + color: #333; + margin-left: 20rpx; +} + +/* 加载状态样式 */ +.loading-container { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 999; +} + +.loading-spinner { + width: 80rpx; + height: 80rpx; + border: 8rpx solid #949494; + border-radius: 50%; + border-top-color: #333; + animation: spin 1s ease-in-out infinite; + margin-bottom: 20rpx; +} + +.loading-text { + font-size: 32rpx; + color: #949494; +} + +@keyframes spin { + to { + transform: rotate(360deg); + } +} + +/* 搜索指定内容 */ +.specifiedContent { + min-height: 30rpx; + margin: 20rpx 10rpx 40rpx 10rpx; +} + +.specifiedContent-title { + font-size: 26rpx; + font-weight: bold; + color: #333; + margin-bottom: 20rpx; +} + +.specifiedContent-list { + display: flex; + gap: 20rpx; + flex-wrap: wrap; +} + +.specifiedContent-item { + display: flex; + align-items: center; + font-size: 23rpx; + font-weight: 500; + background-color: #f5f7fb; + padding: 10rpx 20rpx; + border-radius: 8rpx; +} + +.specifiedContent-img { + width: 26rpx; + height: 26rpx; + margin-right: 10rpx; +} + +.search-history { + min-height: 30rpx; + margin: 20rpx 10rpx; +} + +.history-header { + display: flex; + justify-content: space-between; + align-items: center; + /* margin-bottom: 10rpx; */ +} + +/* 搜索历史 */ +.history-title { + font-size: 26rpx; + font-weight: bold; + color: #333; + margin-bottom: 20rpx; +} + +.history-list { + display: flex; + gap: 20rpx; + flex-wrap: wrap; +} + +.history-item { + display: flex; + align-items: center; + font-size: 23rpx; + font-weight: 500; + background-color: #f5f7fb; + padding: 10rpx 20rpx; + border-radius: 8rpx; +} + +/* 有数据 */ +.hot-services { + margin: 20rpx; + border: 1rpx solid #e8e8e8; +} + +.section-header { + display: flex; + justify-content: center; + align-items: center; + margin-bottom: 20rpx; +} + +.section-title { + font-size: 32rpx; + font-weight: bold; + color: #333; +} + +.section-arrow { + width: 32rpx; + height: 32rpx; + margin-right: 10rpx; +} + +.service-list { + display: flex; + flex-direction: column; + gap: 20rpx; +} + +.service-card { + background-color: #fff; + border-radius: 16rpx; + overflow: hidden; +} + +.service-info { + display: flex; + align-items: flex-end; + width: 100%; + padding: 20rpx; +} + +.service-info-left { + width: 60%; +} + +.service-info-right { + width: 35%; + display: flex; + justify-content: flex-end; +} + +.service-footer { + align-items: center; + gap: 15rpx; +} + +.service-image { + width: 100%; + height: 240rpx; +} + +.service-badge { + position: absolute; + top: 20rpx; + left: 20rpx; + background-color: #FF512A; + color: #fff; + font-size: 24rpx; + padding: 4rpx 16rpx; + border-radius: 20rpx; +} + +.service-name { + font-size: 30rpx; + font-weight: bold; + color: #333; + margin-bottom: 8rpx; +} + +.service-tag { + display: inline-block; + color: #e1ca9b; + font-size: 22rpx; + padding: 2rpx 16rpx; + border-radius: 20rpx; + margin-bottom: 16rpx; +} + +.service-desc { + font-size: 24rpx; + color: #666; + margin-bottom: 20rpx; + line-height: 1.5; +} + +.service-count { + font-size: 24rpx; + color: #999; + margin-left: 15rpx; +} + +.service-button { + background-color: #FF512A; + color: #fff; + font-size: 26rpx; + padding: 12rpx 36rpx; + border-radius: 60rpx; +} + +/* 回到顶部 */ +.toUp { + width: 100rpx; + height: 100rpx; + position: fixed; + right: 33rpx; + bottom: 250rpx; + z-index: 10; +} + +.toUp image { + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/packages/homeServer/search/index.vue b/packages/homeServer/search/index.vue index dc343d9e..a424bf1f 100644 --- a/packages/homeServer/search/index.vue +++ b/packages/homeServer/search/index.vue @@ -1,44 +1,249 @@