✨ feat(邀请码): 完成邀请码模块
This commit is contained in:
@@ -7,3 +7,6 @@
|
||||
color: $color_font_three;
|
||||
padding: 24px 0;
|
||||
}
|
||||
.empty{
|
||||
padding: 100px;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import Iconfont from '../iconfont/iconfont'
|
||||
import LoadingCard from '../loadingCard/index'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
export type LoadMoreStatus = 'more' | 'loading' | 'noMore'
|
||||
export type LoadMoreStatus = 'more' | 'loading' | 'noMore' | 'empty'
|
||||
|
||||
interface LoadMoreEvent {
|
||||
onClick?: () => void
|
||||
@@ -15,10 +15,11 @@ interface LoadMorePropsType extends LoadMoreEvent {
|
||||
moreText?: string
|
||||
loadingText?: string
|
||||
noMoreText?: string
|
||||
emptyText?: string
|
||||
}
|
||||
|
||||
const LoadMore: FC<LoadMorePropsType> = (props) => {
|
||||
const { status, moreText = '查看更多', loadingText = '加载中', noMoreText = '没有更多', onClick } = props
|
||||
const { status, moreText = '查看更多', loadingText = '加载中', noMoreText = '没有更多', emptyText = '暂无数据', onClick } = props
|
||||
|
||||
const handleShowMore = () => {
|
||||
onClick && onClick()
|
||||
@@ -36,6 +37,13 @@ const LoadMore: FC<LoadMorePropsType> = (props) => {
|
||||
</View>
|
||||
)
|
||||
}
|
||||
else if (status === 'empty') {
|
||||
component = (
|
||||
<View className={styles.empty}>
|
||||
<Text>{emptyText}</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
else {
|
||||
component = <Text>{noMoreText}</Text>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user