|
|
|
@ -4,6 +4,9 @@ import {brandApi, BrandRecord} from "@/api"; |
|
|
|
|
import styles from './list.module.scss' |
|
|
|
|
import Taro, {useReachBottom} from "@tarojs/taro"; |
|
|
|
|
import Empty from "@/components/empty/empty"; |
|
|
|
|
import {AtActivityIndicator} from "taro-ui"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const BrandList: FC = () => { |
|
|
|
|
const [page, setPage] = useState(1) |
|
|
|
@ -24,7 +27,7 @@ const BrandList: FC = () => { |
|
|
|
|
|
|
|
|
|
const getData = useCallback(async () => { |
|
|
|
|
try { |
|
|
|
|
setText('加载中..') |
|
|
|
|
setText('加载中...') |
|
|
|
|
const res = await brandApi.list(page, 10) |
|
|
|
|
if(page === 1){ |
|
|
|
|
if(res.list.length < 10) { |
|
|
|
@ -69,7 +72,12 @@ const BrandList: FC = () => { |
|
|
|
|
</View> |
|
|
|
|
</View>) |
|
|
|
|
} |
|
|
|
|
<View style={{width:'750rpx',textAlign:'center',color:'#ccc'}} className="font-28 mt-3">{text}</View> |
|
|
|
|
{ text === '加载中...' ? |
|
|
|
|
<View style={{width:'710rpx',display:'flex',justifyContent:'center'}} className="mt-3"> |
|
|
|
|
<AtActivityIndicator color={'#999'} content='加载中...'></AtActivityIndicator> |
|
|
|
|
</View>: |
|
|
|
|
<View style={{width:'710rpx',textAlign:'center',color:'#999'}} className="font-28 mt-3">{text}</View> |
|
|
|
|
} |
|
|
|
|
</>: <Empty name='空空如也'/> |
|
|
|
|
} |
|
|
|
|
</View> |
|
|
|
|