分类筛选优化

This commit is contained in:
2022-04-15 13:50:38 +08:00
parent 9e969c496f
commit 8291ab49d7
8 changed files with 38 additions and 16 deletions
+2 -1
View File
@@ -40,7 +40,8 @@
}
}
.con{
padding:30px 20px 100px 0;
padding:30px;
padding-bottom: 0;
box-sizing: border-box;
flex:1;
height: 0;
+8 -1
View File
@@ -23,6 +23,7 @@ export default ({show = false, onClose}: param) => {
const [loading, setLoading] = useState(false)
useEffect(() => {
if(!show) return
let lists:any[] = []
for(let i = 0; i < 20; i++) {
lists = [...lists, {
@@ -33,6 +34,12 @@ export default ({show = false, onClose}: param) => {
}]
}
setList([...lists])
}, [show])
useEffect(() => {
return () => {
setList([])
}
}, [])
const [showPopup, setShowPopup] = useState(false)
@@ -104,7 +111,7 @@ export default ({show = false, onClose}: param) => {
</View>
<View className={styles.con}>
{loading&&<LoadingCard/>}
{!loading&&list.length > 0&&<InfiniteScroll selfonScrollToLower={() => {console.log('触底了')}}>
{!loading&&list.length > 0&&<InfiniteScroll selfonScrollToLower={() => {console.log('触底了')}} paddingBottom={100}>
<View className={styles.product_list}>
{list.map((item, index) => {
return <View key={index} className={styles.product_item}>