feat: 增加账单

This commit is contained in:
archer
2023-03-21 14:01:35 +08:00
parent dc467c26b5
commit 42c26bd155
15 changed files with 211 additions and 64 deletions

View File

@@ -68,17 +68,17 @@ const NumberSetting = () => {
<Box>{userInfo?.email}</Box>
</Flex>
</Box>
{/* <Box mt={6}>
<Box mt={6}>
<Flex alignItems={'center'}>
<Box flex={'0 0 60px'}>:</Box>
<Box>
<strong>{userInfo?.balance}</strong>
</Box>
<Button size={'sm'} w={'80px'} ml={5}>
{/* <Button size={'sm'} w={'80px'} ml={5}>
充值
</Button>
</Button> */}
</Flex>
</Box> */}
</Box>
</Card>
<Card mt={6} px={6} py={4}>
<Flex mb={5} justifyContent={'space-between'}>
@@ -148,6 +148,55 @@ const NumberSetting = () => {
</Table>
</TableContainer>
</Card>
<Card mt={6} px={6} py={4}>
<Box fontSize={'xl'} fontWeight={'bold'}>
使
</Box>
<TableContainer>
<Table>
<Thead>
<Tr>
<Th></Th>
<Th></Th>
<Th></Th>
</Tr>
</Thead>
<Tbody>
{accounts.map((item, i) => (
<Tr key={item.id}>
<Td minW={'200px'}>
<Select
{...register(`accounts.${i}.type`, {
required: '类型不能为空'
})}
>
<option value="openai">openai</option>
</Select>
</Td>
<Td minW={'200px'} whiteSpace="pre-wrap" wordBreak={'break-all'}>
<Input
{...register(`accounts.${i}.value`, {
required: '账号不能为空'
})}
></Input>
</Td>
<Td>
<IconButton
aria-label="删除账号"
icon={<DeleteIcon />}
colorScheme={'red'}
onClick={() => {
removeAccount(i);
handleSubmit(onclickSave)();
}}
/>
</Td>
</Tr>
))}
</Tbody>
</Table>
</TableContainer>
</Card>
</>
);
};