diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..0a30445 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + 1674086393783 + + + + + + + \ No newline at end of file diff --git a/src/pages/CityList/index.js b/src/pages/CityList/index.js index 01decba..91138ec 100644 --- a/src/pages/CityList/index.js +++ b/src/pages/CityList/index.js @@ -5,6 +5,7 @@ import './index.css' import axios from "axios"; import { getCurrentCity } from "../../utils"; import { List, AutoSizer } from "react-virtualized"; +import WidthUseNavigate from "../WidthUseNavigate"; // list:[{},{}] const formatCityIndex = (letter) => { switch (letter) { @@ -71,7 +72,7 @@ const back = () => { } // // ); // } -export default class CityList extends React.Component { +class CityListInner extends React.Component { constructor(props){ super(props) @@ -155,9 +156,9 @@ export default class CityList extends React.Component { } changeCity({label,value}){ if(HOUSE_CITY.indexOf(label)>-1){ - localStorage.setItem('hkzf_city',JSON.stringify({label,value})) + localStorage.setItem('local_city',JSON.stringify({label,value})) // 返回上一个页面 - + this.props.to(-1) }else{ Toast.show('该城市暂无房源数据') } @@ -181,4 +182,8 @@ export default class CityList extends React.Component { } -} \ No newline at end of file +} + +// 使用高阶组件包裹当前类组件 +const CityList = WidthUseNavigate(CityListInner); +export default CityList \ No newline at end of file