添加 消息 页面更新
This commit is contained in:
33
src/components/EmptyState/index.scss
Normal file
33
src/components/EmptyState/index.scss
Normal file
@@ -0,0 +1,33 @@
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 124px 16px;
|
||||
min-height: 400px;
|
||||
|
||||
.empty-icon {
|
||||
width: 221px;
|
||||
height: 200px;
|
||||
position: relative;
|
||||
border-radius: 20px;
|
||||
margin-bottom: 12px;
|
||||
|
||||
.img {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-family: 'PingFang SC';
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 1.71;
|
||||
color: rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
}
|
||||
23
src/components/EmptyState/index.tsx
Normal file
23
src/components/EmptyState/index.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import "./index.scss";
|
||||
|
||||
interface EmptyStateProps {
|
||||
text?: string;
|
||||
icon?: any; // 图片资源
|
||||
}
|
||||
|
||||
const EmptyState = ({
|
||||
text = "暂无数据",
|
||||
icon = require("@/static/message/emi.svg")
|
||||
}: EmptyStateProps) => {
|
||||
return (
|
||||
<View className="empty-state">
|
||||
<View className="empty-icon">
|
||||
<Image className="img" src={icon} />
|
||||
</View>
|
||||
<Text className="empty-text">{text}</Text>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default EmptyState;
|
||||
Reference in New Issue
Block a user