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