diff --git a/README.md b/README.md
index 85b2f36..27213ce 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,7 @@ dayjs https://dayjs.gitee.io/docs/zh-CN/manipulate/start-of
antd https://ant-design.antgroup.com/components/upload-cn#uploadfile
反馈表案例 https://www.chinahighlights.com/customerservice/feedback/PostTourSurveyFormToWLGH.asp?LGC=1&COLI_SN=988185&MEI_SN=954295&Email=jennroth18@hotmail.com&ToC=0&ShowType=&page_class=4&dei_sn=28&country=30,490
国内供应商平台 http://p.mycht.cn/index.aspx
+文档预览 https://github.com/cyntler/react-doc-viewer
## 阿里云OSS
Bucket 名称:global-highlights-hub
diff --git a/package.json b/package.json
index f5ed509..ba31435 100644
--- a/package.json
+++ b/package.json
@@ -9,12 +9,12 @@
"preview": "vite preview"
},
"dependencies": {
+ "@cyntler/react-doc-viewer": "^1.13.0",
"antd": "^5.4.2",
"mobx": "^6.9.0",
"mobx-react": "^7.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
- "react-file-viewer": "^1.2.1",
"react-router-dom": "^6.10.0"
},
"devDependencies": {
diff --git a/src/views/reservation/Print.jsx b/src/views/reservation/Print.jsx
index 02f85d2..f3b8ae8 100644
--- a/src/views/reservation/Print.jsx
+++ b/src/views/reservation/Print.jsx
@@ -1,164 +1,139 @@
import { useParams, useNavigate } from "react-router-dom";
-import { useEffect } from 'react';
+import { useEffect } from "react";
import { observer } from "mobx-react";
import { toJS } from "mobx";
import moment from "moment";
-import { Row, Col, Space, Table, Typography, List, Watermark } from 'antd';
-import FileViewer from 'react-file-viewer';
-import { useStore } from '../../stores/StoreContext.js';
+import { Row, Col, Space, Table, Typography, List, Watermark } from "antd";
+import DocViewer, { DocViewerRenderers } from "@cyntler/react-doc-viewer";
+import { useStore } from "../../stores/StoreContext.js";
const { Title } = Typography;
const itineraryListColumns = [
- {
- title: 'Day',
- dataIndex: 'day',
- key: 'day',
- },
- {
- title: 'Place & Transport',
- dataIndex: 'placeTransport',
- key: 'placeTransport',
- },
- {
- title: 'Today’s Activities',
- dataIndex: 'todayActivities',
- key: 'todayActivities',
- },
- {
- title: 'Accommodation',
- dataIndex: 'accommodation',
- key: 'accommodation',
- },
- {
- title: 'Meals',
- dataIndex: 'meals',
- key: 'meals',
- },
+ {
+ title: "Day",
+ dataIndex: "day",
+ key: "day",
+ },
+ {
+ title: "Place & Transport",
+ dataIndex: "placeTransport",
+ key: "placeTransport",
+ },
+ {
+ title: "Today’s Activities",
+ dataIndex: "todayActivities",
+ key: "todayActivities",
+ },
+ {
+ title: "Accommodation",
+ dataIndex: "accommodation",
+ key: "accommodation",
+ },
+ {
+ title: "Meals",
+ dataIndex: "meals",
+ key: "meals",
+ },
];
function Print() {
- const navigate = useNavigate();
- const { reservationId } = useParams();
- const { reservationStore } = useStore();
- const { itineraryList, customerList } = reservationStore;
+ const navigate = useNavigate();
+ const { reservationId } = useParams();
+ const { reservationStore } = useStore();
+ const { itineraryList, customerList } = reservationStore;
+ const docs = [{ uri: "https://www.chinahighlights.com/public/reservationW220420009.doc" }, { uri: "https://www.chinahighlights.com/public/SampleSpec.docx" }];
- useEffect(() => {
- console.info('Detail.useEffect: ' + reservationId);
- }, [reservationId]);
+ useEffect(() => {
+ console.info("Detail.useEffect: " + reservationId);
+ }, [reservationId]);
- return (
-
-
-
-
- Stream
- Error}/>
-
-
-
-
- reservationW220420009.doc
- Error}/>
-
-
-
-
- SampleSpec.docx
- Error}/>
-
-
-
-
- Booking for Mr. Prasanna Venkatesa Nathan(United States) trip
-
-
-
-
- Booking Number: 220629-W220420009
-
-
-
-
- Customer Names (Full name as it appears on passport):
-
-
-
-
- (
-
- {item.title}}
- description={item.description}
- />
-
- )}
- />
-
-
-
-
- Hotels and Room:
-
-
-
-
- Guide Language: English
-
-
-
-
- Notes:
-
-
-
-
- Itinerary Overview:
-
-
-
-
-
-
-
-
-
- Detailed Tour Itinerary
-
-
-
-
- Packaged Price Includes:
-
-
-
-
- Packaged Price Excludes:
-
-
-
-
- Asia Highlights Contact:
-
-
-
-
- );
+ return (
+
+
+
+
+ Stream
+
+
+
+
+
+
+ Booking for Mr. Prasanna Venkatesa Nathan(United States) trip
+
+
+
+
+ Booking Number: 220629-W220420009
+
+
+
+
+ Customer Names (Full name as it appears on passport):
+
+
+
+
+ (
+
+ {item.title}} description={item.description} />
+
+ )}
+ />
+
+
+
+
+ Hotels and Room:
+
+
+
+
+ Guide Language: English
+
+
+
+
+ Notes:
+
+
+
+
+ Itinerary Overview:
+
+
+
+
+
+
+
+
+
+ Detailed Tour Itinerary
+
+
+
+
+ Packaged Price Includes:
+
+
+
+
+ Packaged Price Excludes:
+
+
+
+
+ Asia Highlights Contact:
+
+
+
+
+ );
}
-export default observer(Print);
\ No newline at end of file
+export default observer(Print);