列表联调

This commit is contained in:
李瑞
2025-09-07 18:54:36 +08:00
parent 2d0d728969
commit 6feb7057af
28 changed files with 1225 additions and 740 deletions

View File

@@ -2,7 +2,13 @@ import { Image, View, Text, Button } from "@tarojs/components";
import styles from "./index.module.scss";
import img from "@/config/images";
const ListLoadError = ({ reload }: { reload: () => void }) => {
interface IProps {
reload?: () => void;
text?: string;
}
const ListLoadError = (props: IProps) => {
const { reload, text } = props;
const handleReload = () => {
reload && typeof reload === "function" && reload();
};
@@ -13,11 +19,13 @@ const ListLoadError = ({ reload }: { reload: () => void }) => {
className={styles.listLoadErrorImg}
src={img.ICON_LIST_LOAD_ERROR}
/>
<Text className={styles.listLoadErrorText}></Text>
<Button className={styles.listLoadErrorBtn} onClick={handleReload}>
<Image src={img?.ICON_LIST_RELOAD} className={styles.reloadIcon} />
</Button>
{text && <Text className={styles.listLoadErrorText}>{text}</Text>}
{reload && (
<Button className={styles.listLoadErrorBtn} onClick={handleReload}>
<Image src={img?.ICON_LIST_RELOAD} className={styles.reloadIcon} />
</Button>
)}
</View>
);
};