添加程序选择
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user