import {Avatar, Cell, Space, Tabs, Button, TabPane, Swiper} from '@nutui/nutui-react-taro' import {useEffect, useState, CSSProperties, useRef} from "react"; import {BszxPay} from "@/api/bszx/bszxPay/model"; import {InfiniteLoading} from '@nutui/nutui-react-taro' import dayjs from "dayjs"; import {pageShopOrder} from "@/api/shop/shopOrder"; import {ShopOrder} from "@/api/shop/shopOrder/model"; import {copyText} from "@/utils/common"; const InfiniteUlStyle: CSSProperties = { marginTop: '84px', height: '82vh', width: '100%', padding: '0', overflowY: 'auto', overflowX: 'hidden', } const tabs = [ { index: 0, key: '全部', title: '全部' }, { index: 1, key: '已上架', title: '已上架' }, { index: 2, key: '已下架', title: '已下架' }, { index: 3, key: '已售罄', title: '已售罄' }, { index: 4, key: '警戒库存', title: '警戒库存' }, { index: 5, key: '回收站', title: '回收站' }, ] function GoodsList(props: any) { const [list, setList] = useState([]) const [page, setPage] = useState(1) const [hasMore, setHasMore] = useState(true) const swiperRef = useRef | null>(null) const [tabIndex, setTabIndex] = useState(0) console.log(props.statusBarHeight, 'ppp') const reload = async () => { pageShopOrder({page}).then(res => { let newList: BszxPay[] | undefined = [] if (res?.list && res?.list.length > 0) { newList = list?.concat(res.list) setHasMore(true) } else { newList = res?.list setHasMore(false) } setList(newList || []); }) } const reloadMore = async () => { setPage(page + 1) reload().then(); } useEffect(() => { setPage(2) reload().then() }, []) return ( <> { swiperRef.current?.to(page) setTabIndex(page) }} > { tabs?.map((item, index) => { return }) }
{ }} onScrollToUpper={() => { }} loadingText={ <> 加载中 } loadMoreText={ <> 没有更多了 } > {list?.map(item => { return (
copyText(`${item.orderNo}`)}>{item.orderNo} 待付款
{dayjs(item.createTime).format('YYYY年MM月DD日 HH:mm:ss')}
{item.realName}
{item.totalNum}件商品
实付金额:¥{item.payPrice}
) })}
) } export default GoodsList