From 36fe6f0c1dc3d18bab4c3bf9e213d40171e96b08 Mon Sep 17 00:00:00 2001 From: czm <2192718639@qq.com> Date: Mon, 18 Apr 2022 13:41:17 +0800 Subject: [PATCH] 1 --- src/components/searchInput/index.module.scss | 33 ++++ src/components/searchInput/index.tsx | 45 +++++ .../searchList/hightSearchList.config.ts | 3 + .../searchList/hightSearchList.module.scss | 182 ++++++++++++++++++ src/pages/searchList/hightSearchList.tsx | 98 ++++++++++ src/pages/searchList/index.config.ts | 2 +- src/pages/searchList/search.config.ts | 3 + src/pages/searchList/search.module.scss | 72 +++++++ src/pages/searchList/search.tsx | 44 +++++ 9 files changed, 481 insertions(+), 1 deletion(-) create mode 100644 src/components/searchInput/index.module.scss create mode 100644 src/components/searchInput/index.tsx create mode 100644 src/pages/searchList/hightSearchList.config.ts create mode 100644 src/pages/searchList/hightSearchList.module.scss create mode 100644 src/pages/searchList/hightSearchList.tsx create mode 100644 src/pages/searchList/search.config.ts create mode 100644 src/pages/searchList/search.module.scss create mode 100644 src/pages/searchList/search.tsx diff --git a/src/components/searchInput/index.module.scss b/src/components/searchInput/index.module.scss new file mode 100644 index 0000000..c77b507 --- /dev/null +++ b/src/components/searchInput/index.module.scss @@ -0,0 +1,33 @@ + +.searchInput_main{ + display: flex; + align-items: center; + min-height: 62px; + padding: 10px 0; + border-bottom: 1px solid #f3f3f3; + .searchInput_title { + width: 150px; + font-size: 28px; + border-right: 1px solid #f3f3f3; + color: $color_font_on; + margin-right: 20px; + padding-left: 20px; + &::before{ + content: ""; + height: 50px; + width: 1px; + background-color: #f3f3f3; + } + } + .searchInput_con{ + flex:1; + width: 100%; + input{ + font-size: 26px; + } + } + .icon_more_self{ + font-size: 28px; + color: $color_font_two; + } +} \ No newline at end of file diff --git a/src/components/searchInput/index.tsx b/src/components/searchInput/index.tsx new file mode 100644 index 0000000..2d826fd --- /dev/null +++ b/src/components/searchInput/index.tsx @@ -0,0 +1,45 @@ +import { Input, View } from "@tarojs/components"; +import { memo, useDebugValue, useMemo } from "react"; +import styles from './index.module.scss'; + +type Params = { + showIcon?: false|true, + disabled?: false|true, + placeholder?: string, + title?: string, + showTitle?: false|true, + showBorder?: false|true, + changeOnInput?: (string) => void, + clickOnInput?: () => void + +} + +export default memo((props: Params) => { + let { + showTitle = true, + title = '标题', + showIcon = false, + disabled = false, + placeholder = '请输入', + showBorder = true, + changeOnInput, + clickOnInput + } = props + + let stylen = useMemo(() => { + if(!showBorder) { + return { borderBottom: 0 } + } + return {} + }, [showBorder]) + console.log('searchInput::') + return ( + + {showTitle&&{title}} + + clickOnInput?.()} onInput={(e) => changeOnInput?.(e.detail.value)}/> + + {showIcon&&} + + ) +}) \ No newline at end of file diff --git a/src/pages/searchList/hightSearchList.config.ts b/src/pages/searchList/hightSearchList.config.ts new file mode 100644 index 0000000..2a9c72b --- /dev/null +++ b/src/pages/searchList/hightSearchList.config.ts @@ -0,0 +1,3 @@ +export default { + navigationBarTitleText: '搜索' +} diff --git a/src/pages/searchList/hightSearchList.module.scss b/src/pages/searchList/hightSearchList.module.scss new file mode 100644 index 0000000..fe0e4de --- /dev/null +++ b/src/pages/searchList/hightSearchList.module.scss @@ -0,0 +1,182 @@ +.main{ + display: flex; + flex-direction: column; + height: 100vh; + background-color: $color_bg_one; + .search{ + padding: 20px; + } + .filter{ + .filter_all { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20px 50px; + font-size: $font_size_medium; + color: $color_font_three; + .text_zh, .text_sc{ + color: $color_main; + display: flex; + align-items: center; + .sortIcon{ + display: flex; + flex-direction: column; + position: relative; + .icon_one{ + font-size: $font_size_medium; + position: absolute; + margin:auto; + top:0; + } + } + } + .text_ss{ + position: relative; + .miconfont{ + font-size: 20px; + margin-left: 5px; + } + &::before{ + content: ''; + width: 2px; + height: 32px; + background-color: #C2C2C2; + position: absolute; + top: 0; + left: -30px; + } + } + } + .filter_btn_con{ + display: flex; + justify-content: space-between; + align-items: center; + height: 86px; + + } + .filter_scroll{ + flex:1; + width: 0; + ::-webkit-scrollbar { + display:none; + width:0; + height:0; + color:transparent; + } + } + .filter_btn{ + display: flex; + justify-content: space-between; + padding: 20px; + margin-right: 20px; + flex:1; + view{ + font-size: $font_size_medium; + background-color: #F0F0F0; + border-radius: 24px; + min-width: 126px; + height: 46.93px; + text-align: center; + line-height: 46.93px; + color: $color_font_three; + &:nth-last-child(n+2) { + margin-right: 10px; + } + &:nth-last-child(1) { + margin-right: 30px; + } + } + .selected{ + background-color: #ecf5ff; + border: 2px solid #cde5ff; + color: $color_main; + width: 122px; + height: 42.93px; + } + } + .filter_more{ + font-size: $font_size_medium; + color: $color_font_three; + padding: 0 30px 0 20px; + position: relative; + height: 100%; + line-height: 86px; + &::before{ + content: ''; + opacity: 1; + width: 30px; + height: 100%; + position: absolute; + left: -15px; + background-image: linear-gradient(to right, rgba(248, 248, 248, 0.3), rgba(248, 248, 248, 1) 60% ); + // z-index: 99; + } + .miconfont{ + font-size: 27px; + } + } + } + .list{ + flex:1; + display: flex; + flex-direction: column; + .list_num { + font-size: $font_size_min; + color:$color_font_two; + padding: 10px 38px; + + } + .list_num_shadow { + box-shadow: 0px 5px 5px #ccc; + } + .scroll{ + flex:1; + height:0; + padding-top: 3px; + } + .product_list{ + padding: 38px; + display: grid; + grid-template-columns: 321px 321px; + justify-content: space-between; + .product_item{ + width: 321px; + background-color: #fff; + border-radius: 20px; + margin-bottom: 20px; + .product_img{ + width: 100%; + height: 224px; + background: #e5ad3a; + border-radius: 20px 20px 0px 0px; + } + } + .product_info{ + padding: 20px; + .title{ + font-size: $font_size; + color: $color_font_three; + } + .tag_list{ + display: flex; + margin-top: 16px; + .tag{ + padding: 3px 10px; + background-color: #CDE5FF; + font-size: $font_size_min; + border-radius: 5px; + color: $color_main; + &:nth-child(2) { + margin-left: 10px; + } + } + } + .introduce{ + font-size: $font_size_medium; + color: $color_font_two; + margin-top: 16px; + } + } + } + } +} \ No newline at end of file diff --git a/src/pages/searchList/hightSearchList.tsx b/src/pages/searchList/hightSearchList.tsx new file mode 100644 index 0000000..762ee3a --- /dev/null +++ b/src/pages/searchList/hightSearchList.tsx @@ -0,0 +1,98 @@ +import { ScrollView, Text, View } from "@tarojs/components" +import classnames from "classnames"; +import Search from '@/components/search' +import Filter from "@/components/filter"; +import InfiniteScroll from '@/components/infiniteScroll' +import SortBtn from "@/components/sortBtn"; +import Tabs from "@/components/tabs"; +import styles from './index.module.scss' +import { useCallback, useState } from "react"; + +export default () => { + const [showFilter, setShowFilter] = useState(false) + const [selectList, setSelectList] = useState([ + {title: '系列', value:1}, + {title: '系列', value:2}, + {title: '系列', value:3}, + {title: '系列', value:4}, + {title: '系列', value:5}, + {title: '系列', value:5}, + {title: '系列', value:5}, + {title: '系列', value:5}, + {title: '系列', value:5}, + ]) + const [scrollStatus, setScrollStatus] = useState(false) + const onscroll = useCallback((e) => { + if(e.detail.scrollTop > 20) { + setScrollStatus(true) + } else { + setScrollStatus(false) + } + },[]) + return ( + + + + + + + + 综合 + + + + 收藏 + + + + 高级搜索 + + + + + + + 系列 + 幅宽 + 克重 + 克重 + 克重 + 成分 + + + setShowFilter(true)}> + 筛选 + + + + + + + 搜索结果 (2条记录) + + console.log('123123')} + selfOnScroll={(e) => onscroll(e)} + > + + {new Array(9).fill(' ').map(item => { + return + + + 0770#21S精棉平纹 + + 160cm + 110g + + 67.6%棉24%涤纶6.4%氨纶 + + + })} + + + + + setShowFilter(false)}/> + + ) +} \ No newline at end of file diff --git a/src/pages/searchList/index.config.ts b/src/pages/searchList/index.config.ts index 2a9c72b..ad889b7 100644 --- a/src/pages/searchList/index.config.ts +++ b/src/pages/searchList/index.config.ts @@ -1,3 +1,3 @@ export default { - navigationBarTitleText: '搜索' + navigationBarTitleText: '高级搜索' } diff --git a/src/pages/searchList/search.config.ts b/src/pages/searchList/search.config.ts new file mode 100644 index 0000000..2a9c72b --- /dev/null +++ b/src/pages/searchList/search.config.ts @@ -0,0 +1,3 @@ +export default { + navigationBarTitleText: '搜索' +} diff --git a/src/pages/searchList/search.module.scss b/src/pages/searchList/search.module.scss new file mode 100644 index 0000000..2e4ede6 --- /dev/null +++ b/src/pages/searchList/search.module.scss @@ -0,0 +1,72 @@ +.main{ + .search{ + display: flex; + justify-content: space-between; + padding: 20px; + padding-bottom: 50px; + } + + .hot { + padding: 0 20px; + .hot_header { + width:100%; + display: flex; + justify-content: space-between; + font-size: $font_size_medium; + .hot_header_title { + font-size: $font_size; + color: $color_font_one; + font-weight: 700; + } + .hot_header_up{ + color: $color_main; + } + } + .list{ + display: flex; + font-size: $font_size_medium; + flex-wrap: wrap; + padding: 20px 0; + .item{ + margin-right: 20px; + margin-bottom: 20px; + padding: 10px 20px; + background-color: #F0F0F0; + color: $color_font_three; + border-radius: 50px; + } + } + } + .history { + padding: 0 20px; + .history_header { + width:100%; + display: flex; + justify-content: space-between; + font-size: $font_size_medium; + .history_header_title { + font-size: $font_size; + color: $color_font_one; + font-weight: 700; + } + .miconfont{ + font-size: 30px; + color: $color_font_three; + } + } + .list{ + display: flex; + font-size: $font_size_medium; + flex-wrap: wrap; + padding: 20px 0; + .item{ + margin-right: 20px; + margin-bottom: 20px; + padding: 10px 20px; + background-color: #F0F0F0; + color: $color_font_three; + border-radius: 50px; + } + } + } +} \ No newline at end of file diff --git a/src/pages/searchList/search.tsx b/src/pages/searchList/search.tsx new file mode 100644 index 0000000..2c19f4b --- /dev/null +++ b/src/pages/searchList/search.tsx @@ -0,0 +1,44 @@ + +import { View } from '@tarojs/components' +import Search from '@/components/search' +import { goLink } from '@/common/common'; +import classnames from "classnames"; +import styles from './index.module.scss' + +export default () => { + return ( + + + goLink('/pages/searchList/index')}/> + + + + 热门面料 + 高级搜索 + + + 9265 + 全棉双卫衣 + 全棉双卫衣 + 全棉双卫衣 + 全棉双卫衣 + 26s + + + + + 历史搜索 + + + + 9265 + 全棉双卫衣 + 全棉双卫衣 + 全棉双卫衣 + 全棉双卫衣 + 26s + + + + ) +}