添加程序选择

This commit is contained in:
张成
2025-11-23 00:24:31 +08:00
parent 17015c0cca
commit 8b3f6c5a3a
18 changed files with 1296 additions and 47 deletions

View File

@@ -3,6 +3,7 @@ import { Menu } from "@nutui/nutui-react-taro";
import { Image, View } from "@tarojs/components";
import img from "@/config/images";
import Bubble from "../Bubble";
import { useListState } from "@/store/listStore";
import "./index.scss";
const DistanceQuickFilter = (props) => {
@@ -21,6 +22,10 @@ const DistanceQuickFilter = (props) => {
const [changePosition, setChangePosition] = useState<number[]>([]);
const [isMenuOpen, setIsMenuOpen] = useState(false);
// 从 store 获取当前城市信息
const { area } = useListState();
const currentCity = area?.at(-1) || ""; // 获取省份/城市名称
// 全城筛选显示的标题
const cityTitle = cityOptions.find((item) => item.value === cityValue)?.label;
@@ -69,13 +74,16 @@ const DistanceQuickFilter = (props) => {
>
<div className="positionWrap">
<p className="title"></p>
<p className="cityName"></p>
<p className="cityName">{currentCity}</p>
</div>
<div className="distanceWrap">
<Bubble
options={cityOptions}
value={cityValue}
onChange={(name, value) => handleChange(name, value, 0)}
onChange={(name, value) => {
const singleValue = Array.isArray(value) ? value[0] : value;
handleChange(name, singleValue, 0);
}}
layout="grid"
size="small"
columns={4}