diff --git a/zlt-business/file-center/src/main/resources/bootstrap.yml b/zlt-business/file-center/src/main/resources/bootstrap.yml index 005bb0d4..e15c1688 100644 --- a/zlt-business/file-center/src/main/resources/bootstrap.yml +++ b/zlt-business/file-center/src/main/resources/bootstrap.yml @@ -4,10 +4,10 @@ server: spring: application: name: file-center - cloud: - nacos: - discovery: - ip: 119.45.169.13 +# cloud: +# nacos: +# discovery: +# ip: 119.45.169.13 servlet: multipart: max-file-size: 20MB diff --git a/zlt-web/react-web/src/main/frontend/src/config/auth.ts b/zlt-web/react-web/src/main/frontend/src/config/auth.ts index 2a44cd2d..bb378a38 100644 --- a/zlt-web/react-web/src/main/frontend/src/config/auth.ts +++ b/zlt-web/react-web/src/main/frontend/src/config/auth.ts @@ -1,4 +1,4 @@ export const AUTH_CONFIG = { -// basicToken: 'Basic d2ViQXBwOndlYkFwcA==', - basicToken: 'Basic Z2ZhcHA6SWtpbmd0ZWNAMjAyMA==', // 备用token + basicToken: 'Basic d2ViQXBwOndlYkFwcA==', + // basicToken: 'Basic Z2ZhcHA6SWtpbmd0ZWNAMjAyMA==', // 备用token }; \ No newline at end of file diff --git a/zlt-web/react-web/src/main/frontend/src/pages/orders/Order/components/DetailModal.tsx b/zlt-web/react-web/src/main/frontend/src/pages/orders/Order/components/DetailModal.tsx new file mode 100644 index 00000000..1c8bc939 --- /dev/null +++ b/zlt-web/react-web/src/main/frontend/src/pages/orders/Order/components/DetailModal.tsx @@ -0,0 +1,84 @@ +import React from 'react'; +import { Modal, Descriptions, Tag, Image, Space } from 'antd'; +import { STATUS_CONFIG } from '../constants'; + +interface DetailModalProps { + visible: boolean; + onClose: () => void; + data?: API.OrderDetail; + loading?: boolean; +} + +const DetailModal: React.FC = ({ visible, onClose, data, loading }) => { + if (!data) return null; + + return ( + + + {data.orderNo} + + + {STATUS_CONFIG[data.orderStatus]?.text} + + + ¥{data.orderAmount} + {data.deviceSn} + + {data.createTime} + + + + {data.tourism.tourismName} + + + {data.tourism.tourismAddress} + + +
{data.tourism.tourismDesc}
+
+ + {(data.queueCount !== undefined || data.estimatedTime !== undefined) && ( + + {data.queueCount !== undefined && `前方排队人数:${data.queueCount} 人`} + {data.estimatedTime !== undefined && `,预计等待时间:${data.estimatedTime} 分钟`} + + )} + + {data.files && data.files.length > 0 && ( + + + {data.files.map((file, index) => ( + file.contentType.startsWith('image/') ? ( + + ) : file.contentType.startsWith('video/') ? ( + + + )} +
+
+ ); +}; + +export default DetailModal; \ No newline at end of file diff --git a/zlt-web/react-web/src/main/frontend/src/pages/orders/Order/index.tsx b/zlt-web/react-web/src/main/frontend/src/pages/orders/Order/index.tsx index 8122f7a6..8fe013e9 100644 --- a/zlt-web/react-web/src/main/frontend/src/pages/orders/Order/index.tsx +++ b/zlt-web/react-web/src/main/frontend/src/pages/orders/Order/index.tsx @@ -1,4 +1,4 @@ -import { order, updateOrder } from '@/services/orders/api'; +import { order, updateOrder, getOrderDetail } from '@/services/orders/api'; import type { ActionType, ProColumns } from '@ant-design/pro-components'; import { PageContainer, @@ -11,6 +11,7 @@ import { Typography, Space, Tag, message } from 'antd'; import React, { useRef, useState, useCallback } from 'react'; import { STATUS_CONFIG, STATUS_OPTIONS } from './constants'; import UpdateForm from './components/UpdateForm'; +import DetailModal from './components/DetailModal'; const { Link } = Typography; @@ -19,6 +20,9 @@ const TableList: React.FC = () => { const [params, setParams] = useState>({}); const [updateModalVisible, setUpdateModalVisible] = useState(false); const [currentRow, setCurrentRow] = useState(); + const [detailModalVisible, setDetailModalVisible] = useState(false); + const [detailData, setDetailData] = useState(); + const [detailLoading, setDetailLoading] = useState(false); // 渲染状态标签 const renderStatus = useCallback((status: number) => { @@ -51,6 +55,27 @@ const TableList: React.FC = () => { } }, [currentRow]); + // 获取订单详情 + const handleViewDetail = async (orderNo: string) => { + setDetailModalVisible(true); + setDetailLoading(true); + try { + const response = await getOrderDetail(orderNo); + if (response.resp_code === 0) { + setDetailData(response.data); + } else { + message.error(response.resp_msg || '获取详情失败'); + setDetailModalVisible(false); + } + } catch (error) { + console.error('获取详情错误:', error); + message.error('获取详情失败,请稍后重试'); + setDetailModalVisible(false); + } finally { + setDetailLoading(false); + } + }; + const columns: ProColumns[] = [ { dataIndex: 'index', @@ -106,9 +131,14 @@ const TableList: React.FC = () => { { title: '操作', key: 'action', - width: 80, + width: 120, render: (_, record) => ( + handleViewDetail(record.orderNo)} + > + 查看 + { setCurrentRow(record); @@ -199,6 +229,16 @@ const TableList: React.FC = () => { updateModalVisible={updateModalVisible} values={currentRow} /> + + { + setDetailModalVisible(false); + setDetailData(undefined); + }} + data={detailData} + loading={detailLoading} + /> ); }; diff --git a/zlt-web/react-web/src/main/frontend/src/services/orders/api.ts b/zlt-web/react-web/src/main/frontend/src/services/orders/api.ts index 3ccc6739..b694a546 100644 --- a/zlt-web/react-web/src/main/frontend/src/services/orders/api.ts +++ b/zlt-web/react-web/src/main/frontend/src/services/orders/api.ts @@ -165,3 +165,10 @@ export async function getTourismList(params: { }); } +/** 获取订单详情 */ +export async function getOrderDetail(orderNo: string) { + return request>(`/api-order/detail/${orderNo}`, { + method: 'GET', + }); +} + diff --git a/zlt-web/react-web/src/main/frontend/src/services/orders/typings.d.ts b/zlt-web/react-web/src/main/frontend/src/services/orders/typings.d.ts index d684e282..0c588ad0 100644 --- a/zlt-web/react-web/src/main/frontend/src/services/orders/typings.d.ts +++ b/zlt-web/react-web/src/main/frontend/src/services/orders/typings.d.ts @@ -99,12 +99,41 @@ declare namespace API { interface Tourism { id: number; name: string; + tourismName: string; + tourismAddress: string; + tourismDesc: string; // ... 其他景区相关字段 } - interface Response { + interface Response { + data: T; resp_code: number; resp_msg: string; - data: T; + } + + interface FileInfo { + url: string; + contentType: string; + viewUrl: string; + } + + interface OrderDetail { + orderNo: string; + orderStatus: number; + orderAmount: string; + createTime: string; + deviceSn: string; + tourism: { + tourismName: string; + tourismAddress: string; + tourismDesc: string; + }; + files: { + url: string; + contentType: string; + viewUrl: string; + }[]; + queueCount?: number; + estimatedTime?: number; } } \ No newline at end of file