添加程序选择

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

@@ -4,7 +4,8 @@ import { useState, useRef } from "react";
import Bubble from "../Bubble";
import { Image } from "@tarojs/components";
import img from "../../config/images";
import {DistanceFilterProps} from '../../../types/list/types'
import {DistanceFilterProps} from '../../../types/list/types';
import { useListState } from "@/store/listStore";
@@ -15,6 +16,10 @@ const MenuComponent = (props: DistanceFilterProps) => {
const [iOpen, setIsOpen] = useState(false);
const itemRef = useRef(null);
// 从 store 获取当前城市信息
const { area } = useListState();
const currentCity = area?.at(-1) || ""; // 获取省份/城市名称
const handleChange = (name: string, value: string) => {
setIsChange(true);
onChange && onChange(name, value);
@@ -59,7 +64,7 @@ const MenuComponent = (props: DistanceFilterProps) => {
>
<div className={styles.positionWrap}>
<p className={styles.title}></p>
<p className={styles.cityName}></p>
<p className={styles.cityName}>{currentCity}</p>
</div>
<div className={styles.distanceWrap}>
<Bubble