From 516e3b9652d4e972b53aab8bd99b401c492f5729 Mon Sep 17 00:00:00 2001
From: Jimmy Liow <18777396951@163.com>
Date: Thu, 13 Apr 2023 11:48:16 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B8=83=E5=B1=80=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E7=95=8C=E9=9D=A2=E7=BF=BB=E8=AF=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/stores/Reservation.js | 44 ++++++++-----
src/views/App.jsx | 59 ++++--------------
src/views/reservation/Detail.jsx | 102 ++++++++++++++++--------------
src/views/reservation/Newest.jsx | 103 +++++++++++++++++--------------
4 files changed, 151 insertions(+), 157 deletions(-)
diff --git a/src/stores/Reservation.js b/src/stores/Reservation.js
index b4caacd..b0c762a 100644
--- a/src/stores/Reservation.js
+++ b/src/stores/Reservation.js
@@ -14,24 +14,33 @@ class Reservation {
this.reservationList = [
{
key: '1',
- name: '中华游111029-N111025076',
- age: 32,
- address: '5大1小',
- tags: ['nice', 'developer'],
+ id: '1',
+ referenceNumber: '中华游111029-N111025076',
+ arrivalDate: '2023-04-08',
+ pax: '5AD 1CH',
+ status: 'Confirm',
+ reservationDate: '2023-04-08 19:31',
+ guide: 'Bill',
},
{
key: '2',
- name: '中华游111030-HY110704017',
- age: 42,
- address: '2大',
- tags: ['loser'],
+ id: '3',
+ referenceNumber: '中华游111029-N111025076',
+ arrivalDate: '2023-04-08',
+ pax: '5AD 1CH',
+ status: 'Confirm',
+ reservationDate: '2023-04-08 19:31',
+ guide: 'Jim',
},
{
key: '3',
- name: '中华游111030-Y111004040',
- age: 32,
- address: '30大',
- tags: ['cool', 'teacher'],
+ id: '3',
+ referenceNumber: '中华游111029-N111025076',
+ arrivalDate: '2023-05-08',
+ pax: '3AD',
+ status: 'Confirm',
+ reservationDate: '2023-01-08 19:31',
+ guide: 'Giffigan',
},
];
});
@@ -40,10 +49,13 @@ class Reservation {
reservationList = [
{
key: '1',
- name: '-',
- age: 0,
- address: '-',
- tags: ['*'],
+ id: '1',
+ referenceNumber: '-',
+ arrivalDate: '-',
+ pax: '-',
+ status: '-',
+ reservationDate: '-',
+ guide: '-',
}
];
}
diff --git a/src/views/App.jsx b/src/views/App.jsx
index 909298b..e5a9a84 100644
--- a/src/views/App.jsx
+++ b/src/views/App.jsx
@@ -56,15 +56,13 @@ export default function App() {
}}>
-
-
-
-
-
-
-
-
- ,
- label: Jim,
- },
- {
- key: '2',
- icon: ,
- label: Bill,
- },
- ]}
- />
-
-
-
-
-
-
-
-
+
+
+
);
diff --git a/src/views/reservation/Detail.jsx b/src/views/reservation/Detail.jsx
index 5860c0e..efcec83 100644
--- a/src/views/reservation/Detail.jsx
+++ b/src/views/reservation/Detail.jsx
@@ -8,83 +8,91 @@ import { useStore } from '../../stores/StoreContext.js';
const { Title } = Typography;
-const planListColumns = [
+const dataSource = [
{
- title: 'Name',
+ key: '1',
+ name: '2',
+ age: '二',
+ address: '5月2日',
+ },
+ {
+ key: '2',
+ name: '胡彦祖',
+ age: 42,
+ address: '西湖区湖底公园1号',
+ },
+];
+
+const columns = [
+ {
+ title: '天数',
dataIndex: 'name',
key: 'name',
- render: (text) => {text},
},
{
- title: 'Age',
+ title: '星期',
dataIndex: 'age',
key: 'age',
},
{
- title: 'Address',
+ title: '日期',
+ dataIndex: 'address',
+ key: 'address',
+ },
+ {
+ title: '始发城市',
+ dataIndex: 'address',
+ key: 'address',
+ },
+ {
+ title: '抵达城市',
dataIndex: 'address',
key: 'address',
},
{
- title: 'Tags',
- key: 'tags',
- dataIndex: 'tags',
- render: (_, { tags }) => (
- <>
- {tags.map((tag) => {
- let color = tag.length > 5 ? 'geekblue' : 'green';
- if (tag === 'loser') {
- color = 'volcano';
- }
- return (
-
- {tag.toUpperCase()}
-
- );
- })}
- >
- ),
+ title: '交通',
+ dataIndex: 'address',
+ key: 'address',
+ },
+ {
+ title: '酒店',
+ dataIndex: 'address',
+ key: 'address',
},
{
- title: 'Action',
- key: 'action',
- render: (_, record) => (
-
- Invite {record.name}
- Delete
-
- ),
+ title: '餐饮 [午、晚]',
+ dataIndex: 'address',
+ key: 'address',
+ },
+ {
+ title: '景点及旅游服务安排',
+ dataIndex: 'address',
+ key: 'address',
},
];
function Detail() {
const { reservationId } = useParams();
- const { plan } = useStore();
- const { planList } = plan;
+ const { reservationStore } = useStore();
+ const { reservationList } = reservationStore;
useEffect(() => {
- console.info('Detail.useEffect: ' + planId);
- }, []);
+ console.info('Detail.useEffect: ' + reservationId);
+ }, [reservationId]);
return (
- Plan Detail
-
-
-
- Group Date:
-
-
+
+
+ Reservation Detail 中华游111029-N111025076
-
-
+
+
-
+
diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx
index 5a82d8d..e529f0b 100644
--- a/src/views/reservation/Newest.jsx
+++ b/src/views/reservation/Newest.jsx
@@ -1,59 +1,43 @@
-import { useParams } from "react-router-dom";
+import { NavLink } from "react-router-dom";
import { useEffect } from 'react';
import { observer } from "mobx-react";
import { toJS } from "mobx";
-import moment from "moment";
-import { Row, Col, Space, Button, Table, Tag, Typography, DatePicker } from 'antd';
+import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio } from 'antd';
import { useStore } from '../../stores/StoreContext.js';
const { Title } = Typography;
const reservationListColumns = [
{
- title: 'Name',
- dataIndex: 'name',
- key: 'name',
- render: (text) => {text},
+ title: 'Reference number',
+ dataIndex: 'referenceNumber',
+ key: 'Reference number',
+ render: (text, record) => {text},
},
{
- title: 'Age',
- dataIndex: 'age',
- key: 'age',
+ title: 'Arrival date',
+ dataIndex: 'arrivalDate',
+ key: 'Arrival date',
},
{
- title: 'Address',
- dataIndex: 'address',
- key: 'address',
+ title: 'Pax',
+ key: 'Pax',
+ dataIndex: 'pax'
},
{
- title: 'Tags',
- key: 'tags',
- dataIndex: 'tags',
- render: (_, { tags }) => (
- <>
- {tags.map((tag) => {
- let color = tag.length > 5 ? 'geekblue' : 'green';
- if (tag === 'loser') {
- color = 'volcano';
- }
- return (
-
- {tag.toUpperCase()}
-
- );
- })}
- >
- ),
+ title: 'Status',
+ key: 'Status',
+ dataIndex: 'status'
},
{
- title: 'Action',
- key: 'action',
- render: (_, record) => (
-
- Invite {record.name}
- Delete
-
- ),
+ title: 'Reservation date',
+ key: 'Reservation date',
+ dataIndex: 'reservationDate'
+ },
+ {
+ title: 'Guide',
+ key: 'Guide',
+ dataIndex: 'guide'
},
];
@@ -68,18 +52,41 @@ function Newest() {
return (
- Newest Plans
-
+ Newest Reservations
+
+
+
+
-
- Group Date:
-
+
+ Arrival Date
+
+
+
+
+
+ 快速选择
+
-
-
+
+