diff --git a/src/components/Bubble/bubbleItem.module.scss b/src/components/Bubble/bubbleItem.module.scss index 8c032ea..a56297d 100644 --- a/src/components/Bubble/bubbleItem.module.scss +++ b/src/components/Bubble/bubbleItem.module.scss @@ -4,7 +4,6 @@ outline: none; // 移除浏览器默认的outline background: #ffffff; color: #333333; - font-size: 14px; font-weight: 400; text-align: center; cursor: pointer; @@ -12,9 +11,8 @@ display: flex; align-items: center; justify-content: center; - gap: 8px; white-space: nowrap; - font-size: 14px; + font-size: 12px; border-radius: 28px; margin: 0; width: 116px; diff --git a/src/components/Bubble/index.module.scss b/src/components/Bubble/index.module.scss index 52b676d..8a46b7b 100644 --- a/src/components/Bubble/index.module.scss +++ b/src/components/Bubble/index.module.scss @@ -20,5 +20,8 @@ .bubbleGrid { display: grid; width: 100%; + .bubbleOption { + width: 100%; + } } } diff --git a/src/components/Bubble/index.tsx b/src/components/Bubble/index.tsx index fe56b6d..264de4e 100644 --- a/src/components/Bubble/index.tsx +++ b/src/components/Bubble/index.tsx @@ -122,7 +122,7 @@ const Bubble: React.FC = ({ className={styles.bubbleGrid} style={{ gridTemplateColumns: `repeat(${columns}, 1fr)`, - gap: size === "small" ? "8px" : size === "large" ? "16px" : "12px", + gap: size === "small" ? "6px" : size === "large" ? "16px" : "12px", }} > {options.map((option) => ( @@ -133,7 +133,7 @@ const Bubble: React.FC = ({ size={size} disabled={disabled} onClick={handleOptionClick} - itemClassName={itemClassName} + itemClassName={itemClassName || styles.bubbleOption} /> ))} diff --git a/src/components/CityFilter/index.module.scss b/src/components/CityFilter/index.module.scss index 2be87e2..aa8442f 100644 --- a/src/components/CityFilter/index.module.scss +++ b/src/components/CityFilter/index.module.scss @@ -48,6 +48,7 @@ .cityName { font-size: 13px; font-weight: 400; + color: #3C3C43; } .distanceWrap { margin-bottom: 16px; diff --git a/src/components/Range/index.tsx b/src/components/Range/index.tsx index b1ddbf6..84fe4b1 100644 --- a/src/components/Range/index.tsx +++ b/src/components/Range/index.tsx @@ -1,6 +1,7 @@ import React, { useState, useEffect, useMemo } from "react"; import { Range } from "@nutui/nutui-react-taro"; import styles from "./index.module.scss"; +import TitleComponent from "../Title"; interface RangeProps { min?: number; @@ -9,6 +10,7 @@ interface RangeProps { value?: [number, number]; onChange?: (value: [number, number]) => void; disabled?: boolean; + className?: string; } const NtrpRange: React.FC = ({ @@ -18,15 +20,15 @@ const NtrpRange: React.FC = ({ value = [min, max], onChange, disabled = false, + className, }) => { const [currentValue, setCurrentValue] = useState<[number, number]>(value); useEffect(() => { - setCurrentValue(value); - }, [value]); + value && setCurrentValue(value); + }, [JSON.stringify(value || [])]); const handleChange = (val: [number, number]) => { - console.log("Range value changed:", val); setCurrentValue(val); onChange?.(val); }; @@ -41,32 +43,33 @@ const NtrpRange: React.FC = ({ const rangContent = useMemo(() => { const [start, end] = currentValue || []; - if (start === min && end === max) { + if (Number(start) === Number(min) && Number(end) === Number(max)) { return "不限"; } return `${start.toFixed(1)} - ${end.toFixed(1)}之间`; - }, [currentValue, min, max]); + }, [JSON.stringify(currentValue || []), min, max]); return ( -
+
-
+ {/*
icon

NTRP水平区间

-
+
*/} +

{rangContent}

- {min} + {min.toFixed(1)} = ({ minDescription={null} currentDescription={null} marks={marks} - style={{ color: "gold" }} /> - {max} + {max.toFixed(1)}
- - {/* 调试信息 */} -
- 当前值: {currentValue[0].toFixed(1)} - {currentValue[1].toFixed(1)} -
); }; diff --git a/src/components/SearchBar/index.module.scss b/src/components/SearchBar/index.module.scss new file mode 100644 index 0000000..b376efc --- /dev/null +++ b/src/components/SearchBar/index.module.scss @@ -0,0 +1,23 @@ +.searchBar { + --nutui-searchbar-padding: 10px 15px; + --nutui-searchbar-font-size: 16px; + --nutui-searchbar-input-height: 44px; + --nutui-searchbar-content-border-radius: 44px; + --nutui-searchbar-input-text-color: #000000; + --nutui-searchbar-input-padding: 0 0 0 10px; + --nutui-searchbar-padding:0 15px; + // --nutui-searchbar-background: #ffffff; + :global(.nut-searchbar-content) { + box-shadow: 0 4px 48px #00000014; + } + .searchBarRight { + width: 44px; + height: 44px; + border-radius: 50%; + border: 1px solid #0000000F; + background-color: #ffffff; + display: flex; + align-items: center; + justify-content: center; + } +} \ No newline at end of file diff --git a/src/components/SearchBar/index.tsx b/src/components/SearchBar/index.tsx new file mode 100644 index 0000000..60fd06f --- /dev/null +++ b/src/components/SearchBar/index.tsx @@ -0,0 +1,22 @@ + +import { SearchBar } from '@nutui/nutui-react-taro' +import styles from './index.module.scss' + +const SearchBarComponent = () => { + return ( + <> + 123
+ // } + right={ +
+ } + className={styles.searchBar} + placeholder='搜索上海的球局和场地' + /> + + ) +} + +export default SearchBarComponent \ No newline at end of file diff --git a/src/components/Title/index.module.scss b/src/components/Title/index.module.scss new file mode 100644 index 0000000..a731606 --- /dev/null +++ b/src/components/Title/index.module.scss @@ -0,0 +1,11 @@ +.titleContainer { + display: flex; + align-items: center; + margin-bottom: 10px; + gap: 6px; +} +.title { + font-weight: 600; + font-size: 16px; + line-height: 20px; +} diff --git a/src/components/Title/index.tsx b/src/components/Title/index.tsx new file mode 100644 index 0000000..2eca985 --- /dev/null +++ b/src/components/Title/index.tsx @@ -0,0 +1,19 @@ +import styles from "./index.module.scss"; +interface IProps { + title: string; + className?: string; +} +const TitleComponent = (props: IProps) => { + const { title, className } = props; + return ( + <> +
+
+

{title}

+
+ + ); +}; +export default TitleComponent; diff --git a/src/pages/list/FilterPopup.tsx b/src/pages/list/FilterPopup.tsx new file mode 100644 index 0000000..1e31276 --- /dev/null +++ b/src/pages/list/FilterPopup.tsx @@ -0,0 +1,72 @@ +import { Popup } from "@nutui/nutui-react-taro"; +import Range from "../../components/Range"; +import Bubble, { BubbleOption } from "../../components/Bubble"; +import styles from "./filterPopup.module.scss"; +import TitleComponent from "src/components/Title"; + +const timeOptions: BubbleOption[] = [ + { id: 1, label: "晨间 6:00-10:00", value: "morning" }, + { id: 2, label: "上午 10:00-12:00", value: "forenoon" }, + { id: 3, label: "中午 12:00-14:00", value: "noon" }, + { id: 4, label: "下午 14:00-18:00", value: "afternoon" }, + { id: 5, label: "晚上 18:00-22:00", value: "evening" }, + { id: 6, label: "夜间 22:00-24:00", value: "night" }, +]; + +const locationOptions: BubbleOption[] = [ + { id: 1, label: "室内", value: "1" }, + { id: 2, label: "室外", value: "2" }, + { id: 3, label: "半室外", value: "3" }, +]; + +const FilterPopup = () => { + return ( + <> + { + // setShowTop(false) + }} + > +
+ {/* 时间气泡选项 */} + {}} + onChange={(value) => {}} + layout="grid" + size="small" + columns={3} + /> + + {/* 范围选择 */} + + + {/* 场次气泡选项 */} +
+ + {}} + onChange={(value) => {}} + layout="grid" + size="small" + columns={3} + /> +
+
+
+ + ); +}; + +export default FilterPopup; diff --git a/src/pages/list/filterPopup.module.scss b/src/pages/list/filterPopup.module.scss new file mode 100644 index 0000000..c1e834a --- /dev/null +++ b/src/pages/list/filterPopup.module.scss @@ -0,0 +1,8 @@ +.filterPopupWrapper { + $m18: 18px; + padding: $m18; + .filterPopupRange { + margin-top: $m18; + margin-bottom: $m18; + } +} \ No newline at end of file diff --git a/src/pages/list/index.config.ts b/src/pages/list/index.config.ts index 5c5ad16..17f6db0 100644 --- a/src/pages/list/index.config.ts +++ b/src/pages/list/index.config.ts @@ -1,5 +1,5 @@ export default definePageConfig({ - navigationBarTitleText: '列表', + navigationBarTitleText: '', enablePullDownRefresh: true, backgroundTextStyle: 'dark' }) diff --git a/src/pages/list/index.tsx b/src/pages/list/index.tsx index bc5f426..7587ed3 100644 --- a/src/pages/list/index.tsx +++ b/src/pages/list/index.tsx @@ -4,6 +4,8 @@ import Bubble from "../../components/Bubble/example"; import Range from "../../components/Range/example"; import Menu from "../../components/Menu/example"; import CityFilter from "../../components/CityFilter/example"; +import SearchBar from "../../components/SearchBar"; +import FilterPopup from "./FilterPopup"; import "./index.scss"; import { useEffect } from "react"; import Taro from "@tarojs/taro"; @@ -146,33 +148,20 @@ const ListPage = () => { return (
- {/* 状态信息栏 */} - {lastRefreshTime && ( -
- 最后更新: {formatRefreshTime(lastRefreshTime)} | 共 {matches.length}{" "} - 场比赛 -
- )} + + {/* 综合筛选 */} +
+ +
+ {/* 筛选 */} +
+ {/* 全城筛选 */} + + {/* 智能排序 */} + +
- {/* 全城筛选 */} - - - {/* 菜单 */} - - - {/* 范围选择 */} - - - {/* 气泡 */} - + {/* 列表内容 */}