import { PageContainer, ProTable } from "@ant-design/pro-components"
import { columns } from "./tableConfig"
import { useAjax } from "@/Hook/useAjax"
import { bookCoinList } from "@/services/miniApp/consume"
import { useModel } from "@umijs/max"

const Page: React.FC = () => {
    let { initialState } = useModel("@@initialState")
    let getList = useAjax((params) => bookCoinList(params), { type: 'table' })
    return <PageContainer
        tabProps={{ type: 'card' }}
    >
        <ProTable<any, any>
            params={{
                miniappId: initialState?.selectApp?.id || "",
                distributorId: initialState?.currentUser?.distributorId,
                appType: initialState?.selectApp?.appType || ""
            }}
            headerTitle={"消费订单列表"}
            rowKey={(r) => r.id}
            search={{
                labelWidth: 120,
            }}
            request={async (params) => {
                return await getList.run(params)
            }}
            columns={columns()}
        // bordered
        />
    </PageContainer>

}
export default Page