PageSourceSearch

https://logisticspoe-6xbwz3cw.manus.space/assets/OrderHistory-5FO0ShDJ.js

js logisticspoe-6xbwz3cw.manus.space collected 2026-10-03 05:03:13 UTC 7,102 bytes, 1 lines download raw bytes

1import{c as m,r as n,t as x,j as s,B as o,I as p,P as u,D as g}from"./index-BSDW1oXO.js";import{A as y}from"./AppLayout-Cygsc5g6.js";import{R as h}from"./RoleGuard-BhEJLJgD.js";import{S as f}from"./StatusBadge-C7hIoFtr.js";import{P as j}from"./badge-C9VVw_VW.js";import{S as H}from"./search-D9fK1HFq.js";import{M as i}from"./map-pin-a9tmEue6.js";import{C as O}from"./chevron-right-DYXrKHZe.js";import"./DriverOfflineQueueContext-BEufZpdi.js";import"./index-kDhvbWGq.js";import"./textarea-Dt-aCe2h.js";import"./select--Ol-BrhX.js";import"./chevron-down-BLn-uhAC.js";import"./settings-CGT12rKW.js";import"./wrench-Bpj9hFtT.js";import"./index-Byu38Y_L.js";import"./progress-CzQR2Smy.js";import"./eye-DF0rd5JS.js";import"./arrow-left-BZi9p_2F.js";import"./truck-BwipagV7.js";import"./users-DBgza2Az.js";import"./chart-column-B79fz39p.js";import"./phone-C9TJVbMn.js";function J(){const[,r]=m(),[t,l]=n.useState(""),{data:a,isLoading:d}=x.orders.myOrders.useQuery(),c=a?.filter(e=>e.orderNo.toLowerCase().includes(t.toLowerCase())||e.pickupAddress.toLowerCase().includes(t.toLowerCase())||(e.deliveryAddress??"").toLowerCase().includes(t.toLowerCase()))??[];return s.jsx(h,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:24",allowedRoles:["clerk","admin"],children:s.jsx(y,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:25",title:"我的工單",children:s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:26",className:"max-w-3xl mx-auto space-y-5",children:[s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:28",className:"flex items-center justify-between",children:[s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:29",children:[s.jsx("h1",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:30",className:"font-display text-2xl font-semibold text-foreground",children:"我的工單"}),s.jsxs("p",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:31",className:"text-muted-foreground text-sm mt-0.5",children:["共 ",a?.length??0," 筆工單"]})]}),s.jsxs(o,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:33",onClick:()=>r("/customer/new-order"),className:"bg-brand-gradient text-white shadow-sm hover:opacity-90 transition-opacity gap-2",children:[s.jsx(j,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:37",size:16}),"新增訂單"]})]}),s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:43",className:"relative",children:[s.jsx(H,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:44",size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),s.jsx(p,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:45",value:t,onChange:e=>l(e.target.value),placeholder:"搜尋工單編號或地址...",className:"pl-9 h-10"})]}),d?s.jsx("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:55",className:"space-y-3",children:[1,2,3].map(e=>s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:57",className:"card-elegant p-5 animate-pulse",children:[s.jsx("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:58",className:"h-4 bg-muted rounded w-1/3 mb-3"}),s.jsx("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:59",className:"h-3 bg-muted rounded w-2/3 mb-2"}),s.jsx("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:60",className:"h-3 bg-muted rounded w-1/2"})]},e))}):c.length===0?s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:65",className:"card-elegant p-12 text-center",children:[s.jsx("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:66",className:"w-16 h-16 rounded-2xl bg-muted/60 flex items-center justify-center mx-auto mb-4",children:s.jsx(u,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:67",size:28,className:"text-muted-foreground"})}),s.jsx("h3",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:69",className:"font-display font-semibold text-foreground mb-1",children:"尚無訂單"}),s.jsx("p",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:70",className:"text-muted-foreground text-sm mb-5",children:"立即建立您的第一筆派送訂單"}),s.jsx(o,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:71",onClick:()=>r("/customer/new-order"),className:"bg-brand-gradient text-white hover:opacity-90 transition-opacity",children:"立即下單"})]}):s.jsx("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:79",className:"space-y-3",children:c.map(e=>s.jsx("button",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:81",onClick:()=>r(`/customer/orders/${e.id}`),className:"card-elegant p-5 w-full text-left group",children:s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:86",className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:87",className:"flex-1 min-w-0",children:[s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:88",className:"flex items-center gap-3 mb-2",children:[s.jsx("span",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:89",className:"font-mono text-sm font-semibold text-primary",children:e.orderNo}),s.jsx(f,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:90",status:e.status,size:"sm"})]}),s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:92",className:"space-y-1.5",children:[s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:93",className:"flex items-start gap-2",children:[s.jsx(i,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:94",size:13,className:"text-muted-foreground mt-0.5 shrink-0"}),s.jsx("p",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:95",className:"text-sm text-muted-foreground truncate",children:e.pickupAddress})]}),s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:97",className:"flex items-start gap-2",children:[s.jsx(i,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:98",size:13,className:"text-primary mt-0.5 shrink-0"}),s.jsx("p",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:99",className:"text-sm text-foreground truncate",children:e.deliveryAddress})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:102",className:"flex items-center gap-1.5 mt-2.5",children:[s.jsx(g,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:103",size:12,className:"text-muted-foreground"}),s.jsx("span",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:104",className:"text-xs text-muted-foreground",children:new Date(e.createdAt).toLocaleStr
1ing("zh-HK")}),e.finalFee&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:109",className:"text-muted-foreground/40 mx-1",children:"·"}),s.jsxs("span",{"data-loc":"client/src/pages/customer/OrderHistory.tsx:110",className:"text-xs font-semibold text-accent",children:["HKD ",e.finalFee]})]})]})]}),s.jsx(O,{"data-loc":"client/src/pages/customer/OrderHistory.tsx:115",size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0 mt-1"})]})},e.id))})]})})})}export{J as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.