|
|
|
@ -1,15 +1,12 @@ |
|
|
|
|
import {FC, useCallback, useEffect, useState} from "react"; |
|
|
|
|
import {Image, View} from "@tarojs/components"; |
|
|
|
|
import {brandApi, BrandRecord} from "@/api"; |
|
|
|
|
import { View} from "@tarojs/components"; |
|
|
|
|
import styles from './list.module.scss' |
|
|
|
|
import Taro, {useReachBottom} from "@tarojs/taro"; |
|
|
|
|
import Empty from "@/components/empty/empty"; |
|
|
|
|
import Taro, {useReachBottom, useRouter} from "@tarojs/taro"; |
|
|
|
|
import Collapse from "@/components/collapse/collapse"; |
|
|
|
|
import {illnessApi} from "@/api/illness"; |
|
|
|
|
import {apis} from "@tarojs/plugin-platform-h5/dist/dist/definition.json"; |
|
|
|
|
import setNavigationBarTitle = apis.setNavigationBarTitle; |
|
|
|
|
|
|
|
|
|
const BrandList: FC = () => { |
|
|
|
|
const params = useRouter().params as unknown as {id:number} |
|
|
|
|
const [page, setPage] = useState(1) |
|
|
|
|
const [brands, setBrands] = useState<any[]>([]) |
|
|
|
|
const [total, setTotal] = useState(0) |
|
|
|
@ -20,7 +17,7 @@ const BrandList: FC = () => { |
|
|
|
|
|
|
|
|
|
const getData = useCallback(async () => { |
|
|
|
|
try { |
|
|
|
|
const data = await illnessApi.list(22,1, 100) |
|
|
|
|
const data = await illnessApi.list(params.id,1, 100) |
|
|
|
|
setTotal(data.total) |
|
|
|
|
setBrands([ |
|
|
|
|
...data.list |
|
|
|
|