order.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. <template>
  2. <div class="hotel-order-page">
  3. <AiCrudPage
  4. ref="crudRef"
  5. :api-config="{
  6. list: 'get@/hotel/order/page',
  7. }"
  8. :search-schema="searchSchema"
  9. :columns="tableColumns"
  10. row-key="id"
  11. :hide-add="true"
  12. :hide-batch-delete="true"
  13. :show-export="false"
  14. :show-import="false"
  15. :hide-selection="true"
  16. >
  17. <!-- 工具栏:看板统计 -->
  18. <template #toolbar-start>
  19. <div class="order-dashboard">
  20. <div class="dashboard-item">
  21. <span class="dashboard-value warning">{{ dashboard.pendingCount }}</span>
  22. <span class="dashboard-label">待接单</span>
  23. </div>
  24. <div v-if="connected" class="sse-indicator" title="实时通知已连接">
  25. <span class="sse-dot" />
  26. </div>
  27. <div class="dashboard-item">
  28. <span class="dashboard-value primary">{{ dashboard.preparingCount }}</span>
  29. <span class="dashboard-label">备餐中</span>
  30. </div>
  31. <div class="dashboard-item">
  32. <span class="dashboard-value primary">{{ dashboard.deliveringCount }}</span>
  33. <span class="dashboard-label">配送中</span>
  34. </div>
  35. <div class="dashboard-divider" />
  36. <div class="dashboard-item">
  37. <span class="dashboard-value">{{ dashboard.todayTotal }}</span>
  38. <span class="dashboard-label">今日订单</span>
  39. </div>
  40. <div class="dashboard-item">
  41. <span class="dashboard-value success">¥{{ dashboard.todayRevenue }}</span>
  42. <span class="dashboard-label">今日营收</span>
  43. </div>
  44. </div>
  45. </template>
  46. </AiCrudPage>
  47. <!-- 订单详情弹窗 -->
  48. <NModal
  49. v-model:show="detailVisible"
  50. title="订单详情"
  51. preset="card"
  52. style="width: 680px;"
  53. :mask-closable="true"
  54. >
  55. <NSpin :show="detailLoading">
  56. <div v-if="detailData" class="order-detail">
  57. <!-- 基本信息 -->
  58. <div class="detail-section">
  59. <div class="detail-header">
  60. <span class="detail-order-no">{{ detailData.orderNo }}</span>
  61. <DictTag dict-type="hotel_order_status" :value="String(detailData.status)" size="small" />
  62. </div>
  63. <div class="detail-grid">
  64. <div class="detail-item">
  65. <span class="detail-label">房间号</span>
  66. <span class="detail-value">{{ detailData.roomNo }}</span>
  67. </div>
  68. <div class="detail-item">
  69. <span class="detail-label">联系人</span>
  70. <span class="detail-value">{{ detailData.contactName }}</span>
  71. </div>
  72. <div class="detail-item">
  73. <span class="detail-label">联系电话</span>
  74. <span class="detail-value">{{ detailData.contactPhone }}</span>
  75. </div>
  76. <div class="detail-item">
  77. <span class="detail-label">支付方式</span>
  78. <span class="detail-value">
  79. <DictTag v-if="detailData.payMethod" dict-type="hotel_pay_method" :value="detailData.payMethod" size="small" />
  80. </span>
  81. </div>
  82. <div class="detail-item">
  83. <span class="detail-label">配送时间</span>
  84. <span class="detail-value">
  85. <template v-if="detailData.deliveryTimeType === 'CUSTOM'">
  86. {{ detailData.customDeliveryTime }}
  87. </template>
  88. <template v-else>
  89. 立即送达
  90. </template>
  91. </span>
  92. </div>
  93. <div class="detail-item">
  94. <span class="detail-label">下单时间</span>
  95. <span class="detail-value">{{ detailData.createTime }}</span>
  96. </div>
  97. </div>
  98. <div v-if="detailData.note" class="detail-note">
  99. <span class="detail-label">备注:</span>{{ detailData.note }}
  100. </div>
  101. </div>
  102. <!-- 金额信息 -->
  103. <div class="detail-section">
  104. <div class="detail-amount-row">
  105. <span>菜品总额:<strong>¥{{ calcItemsTotal }}</strong></span>
  106. <span>配送费:<strong>¥{{ detailData.deliveryFee }}</strong></span>
  107. <span class="detail-total">合计:<strong>¥{{ detailData.totalAmount }}</strong></span>
  108. </div>
  109. </div>
  110. <!-- 时间线 -->
  111. <div v-if="hasTimeInfo" class="detail-section">
  112. <div class="detail-label" style="margin-bottom: 6px;">
  113. 时间记录
  114. </div>
  115. <div class="detail-grid">
  116. <div v-if="detailData.acceptTime" class="detail-item">
  117. <span class="detail-label">接单</span>
  118. <span class="detail-value">{{ detailData.acceptTime }}</span>
  119. </div>
  120. <div v-if="detailData.readyTime" class="detail-item">
  121. <span class="detail-label">出餐</span>
  122. <span class="detail-value">{{ detailData.readyTime }}</span>
  123. </div>
  124. <div v-if="detailData.deliverTime" class="detail-item">
  125. <span class="detail-label">配送</span>
  126. <span class="detail-value">{{ detailData.deliverTime }}</span>
  127. </div>
  128. <div v-if="detailData.completeTime" class="detail-item">
  129. <span class="detail-label">完成</span>
  130. <span class="detail-value">{{ detailData.completeTime }}</span>
  131. </div>
  132. <div v-if="detailData.refundTime" class="detail-item">
  133. <span class="detail-label">退单</span>
  134. <span class="detail-value">{{ detailData.refundTime }}</span>
  135. </div>
  136. </div>
  137. <div v-if="detailData.rejectReason" class="detail-note">
  138. <span class="detail-label">拒单原因:</span>{{ detailData.rejectReason }}
  139. </div>
  140. <div v-if="detailData.refundReason" class="detail-note">
  141. <span class="detail-label">退单原因:</span>{{ detailData.refundReason }}
  142. </div>
  143. </div>
  144. <!-- 菜品明细 -->
  145. <div class="detail-section">
  146. <div class="detail-label" style="margin-bottom: 6px;">
  147. 菜品明细
  148. </div>
  149. <NDataTable
  150. :columns="detailItemColumns"
  151. :data="detailData.items || []"
  152. :bordered="true"
  153. size="small"
  154. :pagination="false"
  155. />
  156. </div>
  157. </div>
  158. </NSpin>
  159. </NModal>
  160. <!-- 原因输入弹窗(拒单/退单审核) -->
  161. <NModal
  162. v-model:show="reasonVisible"
  163. :title="reasonTitle"
  164. preset="dialog"
  165. style="width: 420px;"
  166. :show-icon="false"
  167. :mask-closable="false"
  168. positive-text="确认"
  169. negative-text="取消"
  170. @positive-click="handleReasonConfirm"
  171. >
  172. <NInput
  173. v-model:value="reasonText"
  174. type="textarea"
  175. placeholder="请输入原因(选填)"
  176. :rows="3"
  177. />
  178. </NModal>
  179. </div>
  180. </template>
  181. <script setup>
  182. import { NDataTable, NInput, NModal, NSpin, useDialog, useMessage } from 'naive-ui'
  183. import { computed, h, onMounted, onUnmounted, ref } from 'vue'
  184. import {
  185. acceptOrder,
  186. approveRefund,
  187. completeOrder,
  188. deliverOrder,
  189. getOrderDashboard,
  190. getOrderDetail,
  191. getOrderPage,
  192. hotelRefund,
  193. prepareOrder,
  194. readyOrder,
  195. rejectOrder,
  196. rejectRefund,
  197. } from '@/api/hotel'
  198. import { AiCrudPage } from '@/components/ai-form'
  199. import DictTag from '@/components/DictTag.vue'
  200. import { useDict } from '@/composables/useDict'
  201. import { useOrderNotification } from '@/composables/useOrderNotification'
  202. defineOptions({ name: 'HotelOrder' })
  203. const message = useMessage()
  204. const dialog = useDialog()
  205. const { dict } = useDict('hotel_order_status', 'hotel_pay_method')
  206. const crudRef = ref(null)
  207. // ==================== SSE 实时通知 ====================
  208. const { connected, connect, disconnect, playSound } = useOrderNotification({
  209. onNewOrder: () => {
  210. crudRef.value?.refresh()
  211. loadDashboard()
  212. },
  213. onRefundRequest: () => {
  214. crudRef.value?.refresh()
  215. loadDashboard()
  216. },
  217. })
  218. /** 监听页面内通知事件(由 useOrderNotification 派发) */
  219. function handleHotelNotification(e) {
  220. const { type, message: msg, level } = e.detail
  221. const nType = level === 'warning' ? 'warning' : 'info'
  222. $notification[nType]({
  223. title: type === 'new-order' ? '新订单' : '退单申请',
  224. content: msg,
  225. duration: 5000,
  226. })
  227. }
  228. onMounted(() => {
  229. loadDashboard()
  230. connect()
  231. // 页面加载时,检查是否有待接单订单,如果有则触发语音通知
  232. checkPendingOrders()
  233. window.addEventListener('hotel-notification', handleHotelNotification)
  234. })
  235. onUnmounted(() => {
  236. disconnect()
  237. window.removeEventListener('hotel-notification', handleHotelNotification)
  238. })
  239. // ==================== 看板统计 ====================
  240. const dashboard = ref({
  241. pendingCount: 0,
  242. preparingCount: 0,
  243. deliveringCount: 0,
  244. todayTotal: 0,
  245. todayRevenue: '0.00',
  246. })
  247. async function loadDashboard() {
  248. try {
  249. const res = await getOrderDashboard()
  250. if (res.code === 200 && res.data) {
  251. dashboard.value = res.data
  252. }
  253. }
  254. catch (err) {
  255. // ignore
  256. void err
  257. }
  258. }
  259. /**
  260. * 页面加载时检查待接单订单,如果有则触发语音通知。
  261. * 这样刷新页面就能听到声音提醒了。
  262. */
  263. async function checkPendingOrders() {
  264. try {
  265. // 查询待接单订单(status=1)
  266. const res = await getOrderPage({
  267. pageNum: 1,
  268. pageSize: 1,
  269. status: 1, // 待接单
  270. })
  271. if (res.code === 200 && res.data?.total > 0) {
  272. console.warn('[SSE] 📢 检测到待接单订单,触发语音通知')
  273. // 播放声音
  274. playSound('new-order')
  275. // 触发一次新订单通知(显示桌面弹窗)
  276. window.dispatchEvent(new CustomEvent('hotel-notification', {
  277. detail: {
  278. type: 'new-order',
  279. message: `您有 ${res.data.total} 个待接单订单`,
  280. level: 'info',
  281. },
  282. }))
  283. }
  284. }
  285. catch (err) {
  286. console.error('[SSE] 检查待接单订单失败:', err)
  287. }
  288. }
  289. // ==================== 搜索配置 ====================
  290. const statusOptions = computed(() => {
  291. const list = dict.value.hotel_order_status || []
  292. return list.map(item => ({ label: item.label, value: Number(item.value) }))
  293. })
  294. const payMethodOptions = computed(() => dict.value.hotel_pay_method || [])
  295. const searchSchema = computed(() => [
  296. {
  297. field: 'roomNo',
  298. label: '房间号',
  299. type: 'input',
  300. props: { placeholder: '请输入房间号' },
  301. },
  302. {
  303. field: 'status',
  304. label: '订单状态',
  305. type: 'select',
  306. props: { placeholder: '请选择状态', options: statusOptions.value },
  307. },
  308. {
  309. field: 'contactName',
  310. label: '联系人',
  311. type: 'input',
  312. props: { placeholder: '请输入联系人姓名' },
  313. },
  314. {
  315. field: 'payMethod',
  316. label: '支付方式',
  317. type: 'select',
  318. props: { placeholder: '请选择支付方式', options: payMethodOptions.value },
  319. },
  320. ])
  321. // ==================== 状态标签渲染 ====================
  322. function renderStatus(status) {
  323. return h(DictTag, { dictType: 'hotel_order_status', value: String(status), size: 'small' })
  324. }
  325. // ==================== 表格列配置 ====================
  326. const tableColumns = computed(() => [
  327. { prop: 'orderNo', label: '订单号', width: 180 },
  328. { prop: 'roomNo', label: '房间号', width: 90 },
  329. { prop: 'contactName', label: '联系人', width: 90 },
  330. { prop: 'itemCount', label: '菜品数', width: 70 },
  331. {
  332. prop: 'totalAmount',
  333. label: '金额(元)',
  334. width: 100,
  335. render: row => `¥${row.totalAmount}`,
  336. },
  337. {
  338. prop: 'status',
  339. label: '状态',
  340. width: 110,
  341. render: row => renderStatus(row.status),
  342. },
  343. { prop: 'createTime', label: '下单时间', width: 172 },
  344. {
  345. label: '操作',
  346. width: 320,
  347. fixed: 'right',
  348. render: (row) => {
  349. const actions = []
  350. const s = row.status
  351. // 查看详情(所有状态)
  352. actions.push(h('a', {
  353. class: 'text-info cursor-pointer hover:opacity-80',
  354. onClick: () => openDetail(row),
  355. }, '详情'))
  356. // 接单(仅待接单)
  357. if (s === 1) {
  358. actions.push(h('a', {
  359. class: 'text-success cursor-pointer hover:opacity-80',
  360. onClick: () => handleAction('accept', row),
  361. }, '接单'))
  362. actions.push(h('a', {
  363. class: 'text-error cursor-pointer hover:opacity-80',
  364. onClick: () => handleAction('reject', row),
  365. }, '拒单'))
  366. }
  367. // 备餐(仅已接单)
  368. if (s === 2) {
  369. actions.push(h('a', {
  370. class: 'text-primary cursor-pointer hover:opacity-80',
  371. onClick: () => handleAction('prepare', row),
  372. }, '备餐'))
  373. }
  374. // 出餐(仅备餐中)
  375. if (s === 3) {
  376. actions.push(h('a', {
  377. class: 'text-success cursor-pointer hover:opacity-80',
  378. onClick: () => handleAction('ready', row),
  379. }, '出餐'))
  380. }
  381. // 配送(仅已出餐)
  382. if (s === 4) {
  383. actions.push(h('a', {
  384. class: 'text-primary cursor-pointer hover:opacity-80',
  385. onClick: () => handleAction('deliver', row),
  386. }, '配送'))
  387. }
  388. // 完成(仅配送中)
  389. if (s === 5) {
  390. actions.push(h('a', {
  391. class: 'text-success cursor-pointer hover:opacity-80',
  392. onClick: () => handleAction('complete', row),
  393. }, '完成'))
  394. }
  395. // 退单审核(仅退单待审核)
  396. if (s === 8) {
  397. actions.push(h('a', {
  398. class: 'text-success cursor-pointer hover:opacity-80',
  399. onClick: () => handleAction('approveRefund', row),
  400. }, '同意退单'))
  401. actions.push(h('a', {
  402. class: 'text-error cursor-pointer hover:opacity-80',
  403. onClick: () => handleAction('rejectRefund', row),
  404. }, '驳回'))
  405. }
  406. // 前台退单(除已完成、已退单、已拒单外)
  407. if (s !== 6 && s !== 7 && s !== 9) {
  408. actions.push(h('a', {
  409. class: 'text-warning cursor-pointer hover:opacity-80',
  410. onClick: () => handleAction('hotelRefund', row),
  411. }, '退单'))
  412. }
  413. return h('div', { class: 'flex gap-2' }, actions)
  414. },
  415. },
  416. ])
  417. // ==================== 订单操作 ====================
  418. const reasonVisible = ref(false)
  419. const reasonTitle = ref('')
  420. const reasonText = ref('')
  421. const reasonCallback = ref(null)
  422. function handleAction(action, row) {
  423. switch (action) {
  424. case 'accept':
  425. dialog.warning({
  426. title: '确认接单',
  427. content: `确认接受订单 ${row.orderNo} 吗?`,
  428. positiveText: '确认接单',
  429. negativeText: '取消',
  430. onPositiveClick: async () => {
  431. await acceptOrder(row.id)
  432. message.success('接单成功')
  433. crudRef.value?.refresh()
  434. loadDashboard()
  435. },
  436. })
  437. break
  438. case 'reject':
  439. openReasonModal('拒单', async (reason) => {
  440. await rejectOrder(row.id, reason)
  441. message.success('已拒单')
  442. crudRef.value?.refresh()
  443. loadDashboard()
  444. })
  445. break
  446. case 'prepare':
  447. dialog.warning({
  448. title: '开始备餐',
  449. content: `确认开始备餐 ${row.orderNo}?`,
  450. positiveText: '确认',
  451. negativeText: '取消',
  452. onPositiveClick: async () => {
  453. await prepareOrder(row.id)
  454. message.success('已开始备餐')
  455. crudRef.value?.refresh()
  456. loadDashboard()
  457. },
  458. })
  459. break
  460. case 'ready':
  461. dialog.warning({
  462. title: '出餐完成',
  463. content: `确认订单 ${row.orderNo} 出餐完成?`,
  464. positiveText: '确认出餐',
  465. negativeText: '取消',
  466. onPositiveClick: async () => {
  467. await readyOrder(row.id)
  468. message.success('已出餐')
  469. crudRef.value?.refresh()
  470. loadDashboard()
  471. },
  472. })
  473. break
  474. case 'deliver':
  475. dialog.warning({
  476. title: '开始配送',
  477. content: `确认开始配送订单 ${row.orderNo}?`,
  478. positiveText: '确认配送',
  479. negativeText: '取消',
  480. onPositiveClick: async () => {
  481. await deliverOrder(row.id)
  482. message.success('已开始配送')
  483. crudRef.value?.refresh()
  484. loadDashboard()
  485. },
  486. })
  487. break
  488. case 'complete':
  489. dialog.warning({
  490. title: '完成配送',
  491. content: `确认订单 ${row.orderNo} 配送完成?`,
  492. positiveText: '确认完成',
  493. negativeText: '取消',
  494. onPositiveClick: async () => {
  495. await completeOrder(row.id)
  496. message.success('订单已完成')
  497. crudRef.value?.refresh()
  498. loadDashboard()
  499. },
  500. })
  501. break
  502. case 'hotelRefund':
  503. openReasonModal('前台退单', async (reason) => {
  504. await hotelRefund(row.id, reason)
  505. message.success('退单成功')
  506. crudRef.value?.refresh()
  507. loadDashboard()
  508. })
  509. break
  510. case 'approveRefund':
  511. dialog.warning({
  512. title: '同意退单',
  513. content: `确认同意订单 ${row.orderNo} 的退单申请?`,
  514. positiveText: '同意退单',
  515. negativeText: '取消',
  516. onPositiveClick: async () => {
  517. await approveRefund(row.id)
  518. message.success('已同意退单')
  519. crudRef.value?.refresh()
  520. loadDashboard()
  521. },
  522. })
  523. break
  524. case 'rejectRefund':
  525. openReasonModal('驳回退单', async (reason) => {
  526. await rejectRefund(row.id, reason)
  527. message.success('已驳回退单申请')
  528. crudRef.value?.refresh()
  529. loadDashboard()
  530. })
  531. break
  532. }
  533. }
  534. function openReasonModal(title, callback) {
  535. reasonTitle.value = title
  536. reasonText.value = ''
  537. reasonCallback.value = callback
  538. reasonVisible.value = true
  539. }
  540. async function handleReasonConfirm() {
  541. if (reasonCallback.value) {
  542. await reasonCallback.value(reasonText.value || undefined)
  543. }
  544. }
  545. // ==================== 订单详情 ====================
  546. const detailVisible = ref(false)
  547. const detailLoading = ref(false)
  548. const detailData = ref(null)
  549. const detailItemColumns = [
  550. { title: '菜品名称', key: 'dishName', minWidth: 120 },
  551. { title: '规格', key: 'specDesc', width: 120, render: row => row.specDesc || '' },
  552. { title: '加料', key: 'additionsDesc', width: 120, render: row => row.additionsDesc || '' },
  553. { title: '数量', key: 'quantity', width: 60 },
  554. { title: '单价', key: 'unitPrice', width: 80, render: row => `¥${row.unitPrice}` },
  555. { title: '小计', key: 'subtotal', width: 80, render: row => `¥${row.subtotal}` },
  556. { title: '备注', key: 'note', width: 100, render: row => row.note || '' },
  557. ]
  558. const calcItemsTotal = computed(() => {
  559. if (!detailData.value?.items)
  560. return '0.00'
  561. const sum = detailData.value.items.reduce((acc, item) => acc + Number(item.subtotal || 0), 0)
  562. return sum.toFixed(2)
  563. })
  564. const hasTimeInfo = computed(() => {
  565. if (!detailData.value)
  566. return false
  567. const d = detailData.value
  568. return d.acceptTime || d.readyTime || d.deliverTime || d.completeTime || d.refundTime || d.rejectReason || d.refundReason
  569. })
  570. async function openDetail(row) {
  571. detailVisible.value = true
  572. detailLoading.value = true
  573. detailData.value = null
  574. try {
  575. const res = await getOrderDetail(row.id)
  576. if (res.code === 200) {
  577. detailData.value = res.data
  578. }
  579. }
  580. catch {
  581. message.error('加载订单详情失败')
  582. }
  583. finally {
  584. detailLoading.value = false
  585. }
  586. }
  587. </script>
  588. <style scoped>
  589. .hotel-order-page {
  590. height: 100%;
  591. }
  592. /* ==================== 看板统计 ==================== */
  593. .order-dashboard {
  594. display: flex;
  595. align-items: center;
  596. gap: 16px;
  597. padding: 0 4px;
  598. }
  599. .dashboard-item {
  600. display: flex;
  601. flex-direction: column;
  602. align-items: center;
  603. min-width: 56px;
  604. }
  605. .dashboard-value {
  606. font-size: 18px;
  607. font-weight: 700;
  608. line-height: 1.2;
  609. color: #333;
  610. }
  611. .dashboard-value.warning {
  612. color: #f0a020;
  613. }
  614. .dashboard-value.primary {
  615. color: #2080f0;
  616. }
  617. .dashboard-value.success {
  618. color: #18a058;
  619. }
  620. .dashboard-label {
  621. font-size: 12px;
  622. color: #999;
  623. margin-top: 2px;
  624. }
  625. .dashboard-divider {
  626. width: 1px;
  627. height: 28px;
  628. background: #e8e8e8;
  629. margin: 0 4px;
  630. }
  631. /* ==================== SSE连接指示器 ==================== */
  632. .sse-indicator {
  633. display: flex;
  634. align-items: center;
  635. margin-left: 4px;
  636. }
  637. .sse-dot {
  638. display: inline-block;
  639. width: 8px;
  640. height: 8px;
  641. border-radius: 50%;
  642. background: #18a058;
  643. animation: sse-pulse 2s ease-in-out infinite;
  644. }
  645. @keyframes sse-pulse {
  646. 0%,
  647. 100% {
  648. opacity: 1;
  649. }
  650. 50% {
  651. opacity: 0.4;
  652. }
  653. }
  654. /* ==================== 订单详情 ==================== */
  655. .order-detail {
  656. display: flex;
  657. flex-direction: column;
  658. gap: 16px;
  659. }
  660. .detail-section {
  661. padding-bottom: 12px;
  662. border-bottom: 1px solid #f0f0f0;
  663. }
  664. .detail-section:last-child {
  665. border-bottom: none;
  666. padding-bottom: 0;
  667. }
  668. .detail-header {
  669. display: flex;
  670. align-items: center;
  671. justify-content: space-between;
  672. margin-bottom: 12px;
  673. }
  674. .detail-order-no {
  675. font-size: 16px;
  676. font-weight: 700;
  677. color: #333;
  678. }
  679. .detail-grid {
  680. display: grid;
  681. grid-template-columns: repeat(3, 1fr);
  682. gap: 8px 16px;
  683. }
  684. .detail-item {
  685. display: flex;
  686. flex-direction: column;
  687. gap: 2px;
  688. }
  689. .detail-label {
  690. font-size: 12px;
  691. color: #999;
  692. }
  693. .detail-value {
  694. font-size: 14px;
  695. color: #333;
  696. }
  697. .detail-note {
  698. margin-top: 8px;
  699. font-size: 13px;
  700. color: #666;
  701. padding: 6px 10px;
  702. background: #fafafa;
  703. border-radius: 4px;
  704. }
  705. .detail-amount-row {
  706. display: flex;
  707. gap: 24px;
  708. font-size: 14px;
  709. color: #333;
  710. }
  711. .detail-total {
  712. margin-left: auto;
  713. font-size: 16px;
  714. color: #f0a020;
  715. }
  716. </style>