分类筛选优化
This commit is contained in:
@@ -30,6 +30,7 @@ export default memo(({show = false, onClose}: param) => {
|
||||
console.log('执行执行')
|
||||
|
||||
useEffect(() => {
|
||||
if(!show) return
|
||||
let lists:any[] = []
|
||||
for(let i = 0; i < 20; i++) {
|
||||
lists = [...lists, {
|
||||
@@ -41,6 +42,12 @@ export default memo(({show = false, onClose}: param) => {
|
||||
}]
|
||||
}
|
||||
setList([...lists])
|
||||
}, [show])
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
setList([])
|
||||
}
|
||||
}, [])
|
||||
|
||||
const [showPopup, setShowPopup] = useState(false)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.page{
|
||||
|
||||
@@ -21,11 +21,11 @@ export default ({list = []}: params) => {
|
||||
|
||||
return (
|
||||
<View className={styles.swiper}>
|
||||
<Swiper className={styles.swiper_item} circular={true} onChange={(e) => swiperChange(e)}>
|
||||
{list.map(item => {
|
||||
return <SwiperItem>
|
||||
<Swiper className={styles.swiper_item} circular={true} onAnimationFinish={(e) => swiperChange(e)}>
|
||||
{list.map((item) => {
|
||||
return <SwiperItem key={item.id}>
|
||||
<View className={styles.image_item} >
|
||||
<Image src='https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F811%2F021315104H2%2F150213104H2-3-1200.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1651817947&t=5467a207f845ddfc7737d55934e6b26d'></Image>
|
||||
<Image mode="aspectFill" src='https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F811%2F021315104H2%2F150213104H2-3-1200.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1651817947&t=5467a207f845ddfc7737d55934e6b26d'></Image>
|
||||
</View>
|
||||
</SwiperItem>
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user