This commit is contained in:
eleanor.mao 2025-05-20 22:55:48 +08:00
parent fc37a612cc
commit 276107722e
2 changed files with 36 additions and 12 deletions

View File

@ -1,7 +1,7 @@
@import '@/styles/variables.less'; @import '@/styles/variables.less';
.search-city { .search-city {
background: #FFF; background: #fff;
&__position-title { &__position-title {
font-size: 24px; font-size: 24px;
@ -35,7 +35,7 @@
align-content: space-between; align-content: space-between;
width: 630px; width: 630px;
padding: 12px 90px 26px 30px; padding: 12px 90px 26px 30px;
background: #FFFFFF; background: #ffffff;
} }
&__hot-city-item { &__hot-city-item {
@ -57,7 +57,8 @@
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
} }
&__indexes-fragment {} &__indexes-fragment {
}
&__indexes-anchor { &__indexes-anchor {
height: 48px; height: 48px;
@ -117,7 +118,27 @@
text-align: center; text-align: center;
line-height: 160px; line-height: 160px;
font-size: 70px; font-size: 70px;
color: #FFFFFF; color: #ffffff;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
} }
&__search-wrapper {
&.group {
background: linear-gradient(2.75deg, #ffffff 7.9%, #f2edff 97.24%);
.search-city__search {
background-color: transparent;
.taroify-search__content--rounded {
border: @blHighlightColor 1px solid;
}
}
}
}
&__banner {
padding: 32px 24px 0;
text-align: center;
font-size: 28px;
line-height: 40px;
color: @blHighlightColor;
}
} }

View File

@ -133,12 +133,15 @@ export default function SearchCity({ onSelectCity, currentCity = '', forGroup =
return ( return (
<div className={PREFIX}> <div className={PREFIX}>
<ScrollView scrollY style={{ height: winHeight - offset }} scrollIntoView={touchAnchor}> <ScrollView scrollY style={{ height: winHeight - offset }} scrollIntoView={touchAnchor}>
<div className={`${PREFIX}__search-wrapper ${forGroup ? 'group' : ''}`}>
{forGroup && <div className={`${PREFIX}__banner`}></div>}
<Search <Search
className={`${PREFIX}__search`} className={`${PREFIX}__search`}
placeholder="输入城市名称" placeholder="输入城市名称"
shape="rounded" shape="rounded"
onChange={handleSearchChange} onChange={handleSearchChange}
/> />
</div>
{showSearchList && ( {showSearchList && (
<div className={`${PREFIX}__search-list`}> <div className={`${PREFIX}__search-list`}>
{searchResult.map(city => ( {searchResult.map(city => (
@ -202,7 +205,7 @@ export default function SearchCity({ onSelectCity, currentCity = '', forGroup =
onTouchMove={handleTouchMove} onTouchMove={handleTouchMove}
onTouchEnd={handleTouchEnd} onTouchEnd={handleTouchEnd}
onTouchCancel={handleTouchEnd} onTouchCancel={handleTouchEnd}
style={{ top: indexItemHeight * OFFSET_INDEX_SIZE }} style={{ top: indexItemHeight * OFFSET_INDEX_SIZE + offset }}
> >
{CITY_LIST.map(item => { {CITY_LIST.map(item => {
return ( return (