feat: 使用说明&价格表

This commit is contained in:
archer
2023-03-24 10:22:08 +08:00
parent 4d64068591
commit 81e6821174
12 changed files with 54 additions and 23 deletions

View File

@@ -10,12 +10,21 @@ import {
Button,
Input,
Box,
Grid
Grid,
Table,
Thead,
Tbody,
Tr,
Th,
Td,
TableContainer
} from '@chakra-ui/react';
import { getPayCode, checkPayResult } from '@/api/user';
import { useToast } from '@/hooks/useToast';
import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router';
import { modelList } from '@/constants/model';
import { formatPrice } from '../../../utils/user';
const PayModal = ({ onClose }: { onClose: () => void }) => {
const router = useRouter();
@@ -82,9 +91,28 @@ const PayModal = ({ onClose }: { onClose: () => void }) => {
<ModalHeader></ModalHeader>
{!payId && <ModalCloseButton />}
<ModalBody>
<ModalBody py={0}>
{!payId && (
<>
{/* 价格表 */}
<TableContainer mb={4}>
<Table>
<Thead>
<Tr>
<Th></Th>
<Th>(/1000)</Th>
</Tr>
</Thead>
<Tbody>
{modelList.map((item, i) => (
<Tr key={item.model}>
<Td>{item.name}</Td>
<Td>{formatPrice(item.price) * 1000}</Td>
</Tr>
))}
</Tbody>
</Table>
</TableContainer>
<Grid gridTemplateColumns={'repeat(4,1fr)'} gridGap={5} mb={4}>
{[5, 10, 20, 50].map((item) => (
<Button