✨ feat(销售统计): 完成销售统计100%

This commit is contained in:
xuan
2022-10-14 19:03:18 +08:00
parent 4861cc9eb9
commit 52f070adda
18 changed files with 809 additions and 438 deletions
+49 -32
View File
@@ -9,7 +9,8 @@ export type StatusParam = 0|1|2|3
type Params = {
styleObj?: React.CSSProperties
selfonScrollToLower?: () => void
hasMore?: boolean
enableLoadMoreStatus?: boolean
safeAreaInsetBottom?: boolean
moreStatus?: boolean
statusMore?: StatusParam //0:数据从无到有加载数据,1,没有任何数据, 2:下拉加载,3:下拉没有数据
children?: ReactNode
@@ -35,7 +36,8 @@ export default memo(
selfOnRefresherRefresh,
selfOnRefresherRestore,
selfOnRefresherAbort,
hasMore = true,
safeAreaInsetBottom=true,
enableLoadMoreStatus = true,
children,
lowerThresholdNum = 5,
paddingBottom = 0,
@@ -43,7 +45,7 @@ export default memo(
refresherEnabled = false,
moreStatus = true,
statusMore = 0,
enableBackToTop=true,
enableBackToTop = true,
}: Params) => {
const scrollToLower = () => {
selfonScrollToLower?.()
@@ -51,7 +53,7 @@ export default memo(
const scrollToUpper = () => {
selfOnScrollToUpper?.()
}
const scroll = (e) => {
const scroll = e => {
selfOnScroll?.(e)
}
const refresherPulling = () => {
@@ -74,32 +76,17 @@ export default memo(
}
}, [statusMore])
return (
<>
<ScrollView
style={styleObj}
className={style.scroll_main}
scrollY
onScrollToLower={() => scrollToLower()}
onScrollToUpper={() => scrollToUpper()}
onScroll={(e) => scroll(e)}
lowerThreshold={lowerThresholdNum}
refresherEnabled={refresherEnabled}
refresherTriggered={refresherTriggered}
onRefresherPulling={() => refresherPulling()}
onRefresherRefresh={() => refresherRefresh()}
onRefresherRestore={() => refresherRestore()}
onRefresherAbort={() => refresherAbort()}
refresherBackground='#F8F8F8'
enableBackToTop={enableBackToTop}
scrollTop={scrollTop}>
{(!moreStatus && (
<>
<View style={{ paddingBottom: paddingBottom + 'rpx' }} className={style.scrollViewCon}>
{children}
</View>
</>
)) || (
const component = () => {
if(enableLoadMoreStatus){
if (!moreStatus){
return (
<View style={{ paddingBottom: paddingBottom + 'rpx' }} className={style.scrollViewCon}>
{children}
</View>
)
}else{
return (
<>
{(statusMore == 2 || statusMore == 3) && (
<View style={{ paddingBottom: paddingBottom + 'rpx' }} className={style.scrollViewCon}>
@@ -117,9 +104,39 @@ export default memo(
{statusMore == 0 && <LoadingCard />}
{statusMore == 1 && <LoadingCard loadingIcon={false} title='暂无数据' />}
</>
)}
)
}
}else{
return (
<View style={{ paddingBottom: paddingBottom + 'rpx' }} className={style.scrollViewCon}>
{children}
</View>
)
}
}
<View className='common_safe_area_y'></View>
return (
<>
<ScrollView
style={styleObj}
className={style.scroll_main}
scrollY
onScrollToLower={() => scrollToLower()}
onScrollToUpper={() => scrollToUpper()}
onScroll={e => scroll(e)}
lowerThreshold={lowerThresholdNum}
refresherEnabled={refresherEnabled}
refresherTriggered={refresherTriggered}
onRefresherPulling={() => refresherPulling()}
onRefresherRefresh={() => refresherRefresh()}
onRefresherRestore={() => refresherRestore()}
onRefresherAbort={() => refresherAbort()}
refresherBackground='#F8F8F8'
enableBackToTop={enableBackToTop}
scrollTop={scrollTop}>
{component()}
{safeAreaInsetBottom && <View className='common_safe_area_y'></View>}
</ScrollView>
</>
)