🎈 perf(优化了搜索框与banner图):

This commit is contained in:
czm 2022-11-22 11:33:42 +08:00
parent 46b80f0700
commit cddb3b93e6
6 changed files with 115 additions and 115 deletions

View File

@ -10,7 +10,7 @@ export const BASE_URL = CURRENT_BASE_URL
// export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发 // export const BASE_URL = `http://192.168.1.9:50005/lymarket` // 发
// export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发 // export const BASE_URL = `http://192.168.1.30:50001/lymarket` // 发
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境 // export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
// export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境 // export const BASE_URL = `https://www.zzfzyc.com/lymarket` // 正式环境
// export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞 // export const BASE_URL = `http://192.168.1.5:40001/lymarket` // 王霞
// export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添 // export const BASE_URL = `http://192.168.1.7:50002/lymarket` // 添
// export const BASE_URL = `http://192.168.1.22:50002/lymarket` // 婷 // export const BASE_URL = `http://192.168.1.22:50002/lymarket` // 婷

View File

@ -1,18 +1,17 @@
.swiper_con{ .swiper_con {
padding:0 20px; padding: 0 20px;
height: 178px; height: 270px;
.xswiper { .xswiper {
height: 100% !important; height: 100% !important;
border-radius: 20px;
.image_item {
width: 100%;
height: 100%;
image {
width: 100%;
height: 100%;
border-radius: 20px; border-radius: 20px;
.image_item{ }
width: 100%;
height: 100%;
image{
width: 100%;
height: 100%;
border-radius: 20px;
}
}
} }
} }
}

View File

@ -1,69 +1,69 @@
.search_main{ .search_main {
display: flex;
align-items: center;
position: relative;
width: 100%;
z-index: 0;
.icon_a_sousuo1_self {
font-size: 40px;
color: $color_font_two;
}
.search_con {
position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
position: relative;
width: 100%; width: 100%;
z-index: 0; input {
.icon_a_sousuo1_self{ font-size: 27px;
font-size: 37px; background: #eee;
color: $color_font_two; width: 100%;
} height: 72px;
.search_con{ border-radius: 50px;
position: relative; padding: 0 60px 0 80px;
display: flex; box-sizing: border-box;
align-items: center; z-index: 0;
width: 100%; &::-webkit-input-placeholder {
input{ /* WebKit browsers */
font-size: 27px; color: #999;
background: #eee; font-size: 16px;
width: 100%; }
height: 60px;
border-radius: 50px;
padding: 0 60px;
box-sizing: border-box;
z-index:0;
&::-webkit-input-placeholder { /* WebKit browsers */
color: #999;
font-size: 16px;
}
&::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #999;
font-size: 16px;
}
&::-ms-input-placeholder { /* Internet Explorer 10+ */
color: #999;
font-size: 16px;
}
}
.search_closeBtn{
position: absolute;
right: 10px;
}
}
.btn{
width: 100px;
font-size: $font_size_medium;
color: $color_font_two;
display: flex;
justify-content: center;
align-items: center;
&::-moz-placeholder {
/* Mozilla Firefox 19+ */
color: #999;
font-size: 16px;
}
&::-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #999;
font-size: 16px;
}
} }
.icon_inner{ .search_closeBtn {
margin-right: 20px; position: absolute;
position: absolute; right: 10px;
left: 10px;
margin-right: 0;
z-index: 10;
} }
.icon_out{ }
margin-right: 10px; .btn {
} width: 100px;
.input_out{ font-size: $font_size_medium;
padding-left: 20px !important; color: $color_font_two;
} display: flex;
justify-content: center;
} align-items: center;
}
.icon_inner {
margin-right: 20px;
position: absolute;
left: 24px;
margin-right: 0;
z-index: 10;
}
.icon_out {
margin-right: 10px;
}
.input_out {
padding-left: 20px !important;
}
}

View File

@ -18,6 +18,7 @@ type Params = {
btnTitle?: string btnTitle?: string
debounceTime?: number //防抖时间,不设默认为零 debounceTime?: number //防抖时间,不设默认为零
defaultValue?: string defaultValue?: string
borderRadius?: string
} }
export default memo( export default memo(
@ -35,6 +36,7 @@ export default memo(
btnTitle = '搜索', //搜索文字 btnTitle = '搜索', //搜索文字
debounceTime = 0, //防抖时间,不设默认为零 debounceTime = 0, //防抖时间,不设默认为零
defaultValue = '', //默认值 defaultValue = '', //默认值
borderRadius = '50rpx',
}: Params, }: Params,
ref, ref,
) => { ) => {
@ -85,6 +87,7 @@ export default memo(
)}></View> )}></View>
)} )}
<Input <Input
style={{ borderRadius }}
alwaysEmbed={true} alwaysEmbed={true}
cursorSpacing={150} cursorSpacing={150}
placeholderStyle='color:#ABABAB; font-size:26rpx' placeholderStyle='color:#ABABAB; font-size:26rpx'

View File

@ -1,33 +1,33 @@
.main{ .main {
background-color: $color_bg_one; background-color: $color_bg_one;
height: 100vh; height: 100vh;
display: flex;
flex-direction: column;
.search {
width: 100%;
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
.search{ padding: 20px;
width: 100%; box-sizing: border-box;
display: flex; align-items: center;
justify-content: space-between; .search_collect {
padding: 20px 20px 30px 20px; font-size: 26px;
box-sizing: border-box; border: 2px solid #007aff;
align-items: center; color: #007aff;
.search_collect{ border-radius: 50px;
font-size: 26px; width: 132px;
border: 2px solid #007AFF; height: 44px;
color: #007AFF; text-align: center;
border-radius: 50px; line-height: 44px;
width: 132px;
height: 44px;
text-align: center;
line-height: 44px;
}
.search_input{
flex:1;
margin-left: 20px;
}
} }
.products{ .search_input {
flex:1; flex: 1;
height: 0; // margin-left: 20px;
} }
}
} .products {
flex: 1;
height: 0;
margin-top: 20px;
}
}

View File

@ -84,15 +84,13 @@ export default () => {
return ( return (
<MoveBtn onClick={() => setShowShopCart(!showShopCart)}> <MoveBtn onClick={() => setShowShopCart(!showShopCart)}>
<View className={styles.main}> <View className={styles.main}>
<Banner />
<View className={styles.search}> <View className={styles.search}>
<View className={styles.search_collect} onClick={() => goLink('/pages/collection/index')}>
</View>
<View className={styles.search_input} onClick={() => goLink('/pages/searchList/search')}> <View className={styles.search_input} onClick={() => goLink('/pages/searchList/search')}>
<Search disabled={true} style={{ width: '263rpx' }} /> <Search disabled={true} style={{ width: '263rpx' }} borderRadius='16rpx' placeholder='请输入搜索布料' />
</View> </View>
</View> </View>
<Banner />
<View className={styles.products}> <View className={styles.products}>
<SideBar <SideBar
list={kindData.list} list={kindData.list}