张延森 il y a 3 ans
Parent
révision
7d0b877591
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4
    2
      src/pages/index/brandList/index.jsx

+ 4
- 2
src/pages/index/brandList/index.jsx Voir le fichier

@@ -7,7 +7,9 @@ import { getImgURL } from '@/utils/image';
7 7
 import '@/assets/css/iconfont.css';
8 8
 import './index.scss';
9 9
 
10
-export default withLayout(() => {
10
+export default withLayout((props) => {
11
+  const { city } = props
12
+
11 13
   const [list, setList] = useState({});
12 14
 
13 15
   useEffect(() => {
@@ -15,7 +17,7 @@ export default withLayout(() => {
15 17
   }, [])
16 18
 
17 19
   function initData () {
18
-    queryBrandList({ pageSize: 500 }).then((res) => {
20
+    queryBrandList({ pageSize: 500, cityId: city?.id }).then((res) => {
19 21
       const { records } = res
20 22
       const lst = (records || []).reduce((prev, cur) => {
21 23
         if (prev[cur.indexLetter]) {