1import{u as G,b as $,aa as D,v as H,r as l,t as f,ax as J,g as y,j as e,at as v,ag as c,aw as Q,E as M,X as S,C as X,n as Y,Y as Z}from"./index-DxpMJHht.js";import{U as _}from"./upload-CBENvaWW.js";import{C as q}from"./circle-check-big-D9tIU27c.js";function K({text:a}){const[s,n]=l.useState(!1),d=()=>{navigator.clipboard.writeText(a).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})};return e.jsx("button",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:31",onClick:d,className:"ml-2 p-1 rounded hover:bg-gray-100 text-gray-400 hover:text-gray-600 transition-colors",children:s?e.jsx(Y,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:32",size:14,className:"text-green-500"}):e.jsx(Z,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:32",size:14})})}function V(a,s,n){return a==="subscription"?`å¥é¤åç´ â ${s??""} (${n==="annual"?"å¹´è²»":"æè²»"})`:"GoPoint å
å¼"}function te(){const{t:a}=G(),[,s]=$(),n=D(),d=new URLSearchParams(n),{user:x,loading:u}=H(),r=d.get("orderId")?Number(d.get("orderId")):null,[o,L]=l.useState("upload"),[m,w]=l.useState(null),[h,C]=l.useState(null),[B,I]=l.useState("image/jpeg"),[k,b]=l.useState(null),j=l.useRef(null),{data:t,isLoading:i,error:O}=f.payment.getMyOrder.useQuery({id:r},{enabled:!!r&&!!x}),U=f.useUtils(),N=f.payment.uploadReceipt.useMutation(),g=J();l.useEffect(()=>{u||x||s("/login")},[u,x,s]);const T=l.useCallback(p=>{const P=p.target.files?.[0];if(!P)return;if(P.size>10*1024*1024){y.error("åç大å°ä¸è½è¶
é 10MB");return}const z=new FileReader;z.onload=A=>{const R=A.target?.result;w(R);const F=R.split(",")[1];C(F),I(P.type||"image/jpeg")},z.readAsDataURL(P)},[]),E=async()=>{if(!h||!r){y.error("è«å
鏿è½å¸³æèåç");return}try{await N.mutateAsync({orderId:r,receiptBase64:h,mimeType:B}),await Promise.all([U.payment.getMyOrder.invalidate({id:r}),U.payment.listMyOrders.invalidate(),U.subscription.getPendingSubscriptionOrder.invalidate()]),L("done"),y.success("æèå·²ä¸å³ï¼çå¾
å¾å°å¯©æ ¸")}catch(p){y.error(p?.message??"ä¸å³å¤±æ")}};return u||!x?e.jsx("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:128",className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsx("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:129",className:"animate-spin rounded-full h-8 w-8 border-b-2 border-orange-500"})}):r?e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:148",className:"min-h-screen bg-gray-50",children:[g&&e.jsx(Q,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:150"}),!g&&e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:153",className:"sticky top-0 z-10 bg-white border-b border-gray-100 px-4 py-3 flex items-center gap-3",children:[e.jsx("button",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:154",onClick:()=>window.history.back(),className:"p-1.5 rounded-full hover:bg-gray-100",children:e.jsx(M,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:155",size:20,className:"text-gray-600"})}),e.jsx("h1",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:157",className:"font-bold text-gray-900 text-base",children:o==="done"?"æäº¤æå":"ä¸å³è½å¸³æè"})]}),g&&e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:164",className:"max-w-2xl mx-auto px-6 pt-6 pb-2 flex items-center gap-3",children:[e.jsx("button",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:165",onClick:()=>window.history.back(),className:"p-1.5 rounded-full hover:bg-gray-100",children:e.jsx(M,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:166",size:20,className:"text-gray-600"})}),e.jsx("h1",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:168",className:"font-bold text-gray-900 text-lg",children:o==="done"?"æäº¤æå":"ä¸å³è½å¸³æè"})]}),e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:174",className:g?"max-w-2xl mx-auto px-6 py-4 space-y-4":"max-w-lg mx-auto px-4 py-5 space-y-4",children:[i&&e.jsx("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:177",className:"text-center py-12 text-gray-400 text-sm",children:a("è¼å
¥ä¸...")}),!i&&(O||!t)&&e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:182",className:"text-center py-12",children:[e.jsx(v,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:183",size:40,className:"text-red-400 mx-auto mb-3"}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:184",className:"text-gray-600 text-sm",children:a("è¨å®ä¸åå¨æç¡æ³è¨ªå")}),e.jsx(c,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:185",variant:"outline",className:"mt-4",onClick:()=>s("/payment/orders"),children:a("è¿åè¨å®è¨é")})]}),!i&&t&&t.status!=="pending"&&o==="upload"&&e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:191",className:"text-center py-12",children:[e.jsx(v,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:192",size:40,className:"text-amber-400 mx-auto mb-3"}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:193",className:"text-gray-700 font-medium text-sm",children:t.status==="confirmed"?"æ¤è¨å®å·²ç¢ºèªï¼ç
1¡éåä¸å³æè":t.status==="rejected"?"æ¤è¨å®å·²è¢«æçµï¼ç¡æ³ä¸å³æè":"æ¤è¨å®å·²åæ¶ï¼ç¡æ³ä¸å³æè"}),e.jsx(c,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:198",variant:"outline",className:"mt-4",onClick:()=>s("/payment/orders"),children:a("è¿åè¨å®è¨é")})]}),!i&&t&&t.status==="pending"&&t.receiptUrl&&o==="upload"&&e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:204",className:"bg-amber-50 rounded-xl border border-amber-100 p-4",children:[e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:205",className:"text-sm font-medium text-amber-800 mb-2",children:"æ¤è¨å®å·²ä¸å³æèï¼çå¾
å¾å°å¯©æ ¸"}),e.jsx("a",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:206",href:t.receiptUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-500 underline",children:"æ¥çå·²ä¸å³æè"}),e.jsx("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:207",className:"mt-3",children:e.jsx(c,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:208",variant:"outline",size:"sm",onClick:()=>s("/payment/orders"),children:a("è¿åè¨å®è¨é")})})]}),!i&&t&&t.status==="pending"&&!t.receiptUrl&&o==="upload"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:217",className:"bg-white rounded-xl border border-gray-100 p-4 shadow-sm",children:[e.jsx("h2",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:218",className:"text-sm font-semibold text-gray-700 mb-3",children:a("è¨å®æè¦")}),e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:219",className:"space-y-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:220",className:"flex justify-between items-center",children:[e.jsx("span",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:221",className:"text-sm text-gray-500",children:a("è¨å®è")}),e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:222",className:"flex items-center",children:[e.jsx("span",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:223",className:"text-sm font-mono font-medium text-gray-800",children:t.orderNo}),e.jsx(K,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:224",text:t.orderNo})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:227",className:"flex justify-between items-center",children:[e.jsx("span",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:228",className:"text-sm text-gray-500",children:a("è¨å®é¡å")}),e.jsx("span",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:229",className:"text-sm text-gray-700",children:V(t.orderType,t.planType,t.billingCycle)})]}),e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:231",className:"flex justify-between items-center",children:[e.jsx("span",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:232",className:"text-sm text-gray-500",children:a("æä»éé¡")}),e.jsxs("span",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:233",className:"text-lg font-bold text-amber-600",children:["MOP ",Number(t.amountMop).toFixed(2)]})]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:239",className:"bg-white rounded-xl border border-gray-100 p-4 shadow-sm",children:[e.jsx("h2",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:240",className:"text-sm font-semibold text-gray-700 mb-3",children:a("ä¸å³è½å¸³æè")}),e.jsx("input",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:241",ref:j,type:"file",accept:"image/*",className:"hidden",onChange:T}),m?e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:249",className:"relative",children:[e.jsx("button",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:250",onClick:()=>b(m),children:e.jsx("img",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:251",src:m,alt:"è½å¸³æè",className:"w-full max-h-64 object-contain rounded-lg border border-gray-100"})}),e.jsx("button",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:257",onClick:()=>{w(null),C(null)},className:"absolute top-2 right-2 bg-white rounded-full p-1 shadow border border-gray-200",children:e.jsx(S,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:261",size:14,className:"text-gray-500"})}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:263",className:"text-xs text-gray-400 text-center mt-1",children:a("黿åç坿¾å¤§æ¥ç")})]}):e.jsxs("button",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:266",onClick:()=>j.current?.click(),className:"w-full border-2 border-dashed border-gray-200 rounded-xl p-8 flex flex-col items-center gap-2 hover:border-amber-300 hover:bg-amber-50 transition-colors",children:[e.jsx(_,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:270",size:28,className:"text-gray-300"}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:271",className:"text-sm text-gray-500",children:a("黿鏿åç")}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:272",className:"text-xs text-gray-400",children:a("æ¯æ JPGãPNGï¼æå¤§ 10MB")})]}),m&&e.jsx(c,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:276",variant:"outline",size:"sm",className:"mt-2 w-full",onClick:()=>j.current?.click(),children:"鿰鏿"})]}),e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:288",className:"bg-blue-50 rounded-xl border border-blue-100 p-3 text-xs text-blue-700 space-y-1",children:[e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:289",className:"font-semibold",children:a("ð æèè¦æ±")}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:290",children:a("⢠è«ç¢ºä¿æèæ¸
æ°å¯è¦ï¼å
å«è½å¸³éé¡ãæéååèè")}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:291",children:a("⢠æªåææç
§åå¯ï¼ç¢ºä¿è³è¨å®æ´")}
1),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:292",children:a("â¢ å¯©æ ¸éé徿åå°èªåééï¼ç¡é忬¡æä½")})]}),e.jsx(c,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:295",className:"w-full bg-amber-500 hover:bg-amber-600 text-white font-semibold h-12 rounded-xl",onClick:E,disabled:!h||N.isPending,children:N.isPending?"ä¸å³ä¸...":"æäº¤æè"}),e.jsx("button",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:302",onClick:()=>s("/payment/orders"),className:"w-full text-center text-sm text-gray-400 hover:text-gray-600 py-2",children:"è¿åè¨å®è¨é"})]}),o==="done"&&e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:313",className:"text-center py-8",children:[e.jsx("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:314",className:"w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(q,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:315",size:40,className:"text-green-500"})}),e.jsx("h2",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:317",className:"text-xl font-bold text-gray-900 mb-2",children:a("æèå·²æäº¤")}),e.jsxs("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:318",className:"text-gray-500 text-sm mb-1",children:[a("è¨å®èï¼"),e.jsx("span",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:318",className:"font-mono font-medium",children:t?.orderNo})]}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:319",className:"text-gray-400 text-xs mb-6",children:a("å·¥ä½äººå¡å°æ¼è¾¦å
¬æéå
§å¯©æ ¸ä¸¦ééæå")}),e.jsx("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:320",className:"bg-amber-50 rounded-xl border border-amber-100 p-4 text-left mb-6",children:e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:321",className:"flex items-start gap-2",children:[e.jsx(X,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:322",size:16,className:"text-amber-500 mt-0.5 flex-shrink-0"}),e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:323",className:"text-xs text-amber-700 space-y-1",children:[e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:324",className:"font-semibold",children:a("å¯©æ ¸æé")}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:325",children:a("é±ä¸è³é±å
10:00â18:00ï¼æ¾³éæéï¼")}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:326",children:a("ç¯åæ¥å¯è½å»¶é²ï¼è«èå¿çå")})]})]})}),e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:330",className:"space-y-3",children:[e.jsx(c,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:331",className:"w-full bg-amber-500 hover:bg-amber-600 text-white font-semibold h-11 rounded-xl",onClick:()=>s("/payment/orders"),children:"æ¥çæçè¨å®"}),e.jsx(c,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:337",variant:"outline",className:"w-full h-11 rounded-xl",onClick:()=>s("/"),children:"è¿åé¦é "})]})]})]}),k&&e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:351",className:"fixed inset-0 bg-black/80 z-50 flex items-center justify-center p-4",onClick:()=>b(null),children:[e.jsx("button",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:355",className:"absolute top-4 right-4 text-white",onClick:()=>b(null),children:e.jsx(S,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:356",size:28})}),e.jsx("img",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:358",src:k,alt:"æ¾å¤§æ¥ç",className:"max-w-full max-h-full object-contain rounded-lg",onClick:p=>p.stopPropagation()})]})]}):e.jsx("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:137",className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:e.jsxs("div",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:138",className:"text-center",children:[e.jsx(v,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:139",size:40,className:"text-red-400 mx-auto mb-3"}),e.jsx("p",{"data-loc":"client/src/pages/PaymentUploadPage.tsx:140",className:"text-gray-600",children:a("ç¡æçè¨å®åæ¸")}),e.jsx(c,{"data-loc":"client/src/pages/PaymentUploadPage.tsx:141",variant:"outline",className:"mt-4",onClick:()=>s("/payment/orders"),children:a("è¿åè¨å®è¨é")})]})})}export{te 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.