优化滚动
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
import React from "react";
|
||||
|
||||
export const ParamsContext = React.createContext<any>(null)
|
||||
@@ -1,3 +1,3 @@
|
||||
export default {
|
||||
navigationBarTitleText: '修改地址',
|
||||
navigationBarTitleText: '首页',
|
||||
}
|
||||
|
||||
@@ -7,11 +7,12 @@ import MoveBtn from '@/components/moveBtn'
|
||||
import ShopCart from '@/components/shopCart'
|
||||
import { goLink } from '@/common/common'
|
||||
import styles from './index.module.scss'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import Taro, { Events, useDidShow, usePullDownRefresh, useRouter } from '@tarojs/taro'
|
||||
import {GetProductKindListApi, GetProductListApi} from '@/api/material'
|
||||
import useLogin from '@/use/useLogin'
|
||||
import LoadingCard from '@/components/loadingCard'
|
||||
import { dataLoadingStatus } from '@/common/util'
|
||||
|
||||
export default () => {
|
||||
|
||||
@@ -54,6 +55,7 @@ export default () => {
|
||||
getProductList()
|
||||
}, [filtrate])
|
||||
|
||||
|
||||
//点击面料类型
|
||||
const getProductKindId = async (e) => {
|
||||
pageNum.current.page = 1
|
||||
@@ -90,6 +92,11 @@ export default () => {
|
||||
usePullDownRefresh(() => {
|
||||
console.log('123')
|
||||
})
|
||||
|
||||
//数据加载状态
|
||||
const statusMore = useMemo(() => {
|
||||
return dataLoadingStatus({list:productData.list, total: productData.total, status: productState.loading})
|
||||
}, [productData])
|
||||
|
||||
return (
|
||||
<MoveBtn onClick={() => setShowShopCart(!showShopCart)}>
|
||||
@@ -102,9 +109,9 @@ export default () => {
|
||||
</View>
|
||||
</View>
|
||||
<View className={styles.products}>
|
||||
<SideBar list={kindData.list} height="100%" defaultValue={kindData.defaultId} hasMore={hasMore} selfOnScrolltolower={() => getScrolltolower()} sideBarOnClick={(e) => getProductKindId(e)} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}>
|
||||
<Product productList={productData.list}/>
|
||||
</SideBar>
|
||||
<SideBar list={kindData.list} height="100%" defaultValue={kindData.defaultId} hasMore={hasMore} statusMore={statusMore} selfOnScrolltolower={() => getScrolltolower()} sideBarOnClick={(e) => getProductKindId(e)} heightItem={150} refresherTriggered={refresherTriggeredStatus} selfOnRefresherRefresh={() => getRefresherRefresh()}>
|
||||
<Product productList={productData.list}/>
|
||||
</SideBar>
|
||||
</View>
|
||||
<View className='common_safe_area_y'></View>
|
||||
<ShopCart show={showShopCart} onClose={() => setShowShopCart(false)}/>
|
||||
@@ -112,3 +119,4 @@ export default () => {
|
||||
</MoveBtn>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user