PageSourceSearch

https://doinhanhweb.manus.space/assets/Topup-CpLAeQjZ.js

js doinhanhweb.manus.space collected 2026-10-03 05:01:17 UTC 17,024 bytes, 1 lines download raw bytes

1import{u as q,a as I,r as h,t as m,b as i,N as C,j as e,L as U,P as W,c as b,f as T,i as L,m as M,k as F,l as _}from"./index-DRYNtDfq.js";import{U as Q,P as G,a as H}from"./PageLayout-BT1vZgiA.js";import{u as J,S as K}from"./useCatalog-CX6-P5lf.js";import"./chevron-right-C0SJQso0.js";function X(n,d){h.useEffect(()=>{if(!document.getElementById(n)){const r=document.createElement("script");r.id=n,r.type="application/ld+json",r.textContent=JSON.stringify(d),document.head.appendChild(r)}return()=>{document.getElementById(n)?.remove()}},[n])}function $(n,d){h.useEffect(()=>{if(!d.length)return;const r={"@context":"https://schema.org","@type":"FAQPage",mainEntity:d.map(f=>({"@type":"Question",name:f.q,acceptedAnswer:{"@type":"Answer",text:f.a}}))},a=document.createElement("script");return a.id=n,a.type="application/ld+json",a.textContent=JSON.stringify(r),document.head.appendChild(a),()=>{document.getElementById(n)?.remove()}},[n])}const Y=[{q:"Nạp cước tại DoiNhanh.com có chiết khấu không?",a:"Có. DoiNhanh.com cung cấp chiết khấu khi nạp cước, tỷ lệ phụ thuộc vào nhà mạng và mệnh giá. Xem bảng giá chi tiết trực tiếp trên trang."},{q:"Nạp cước cho số điện thoại nào cũng được không?",a:"Hỗ trợ tất cả số điện thoại trả trước của Viettel, Mobifone, Vinaphone, Vietnamobile, Gmobile. Không hỗ trợ số trả sau."},{q:"Bao lâu thì số điện thoại nhận được tiền sau khi nạp?",a:"Thông thường từ 1-3 phút. Giờ cao điểm hoặc sự cố mạng có thể mất đến 15 phút. Nếu quá 30 phút chưa nhận, liên hệ hỗ trợ."},{q:"Có thể nạp cước bằng số dư ví không?",a:"Có. Số dư ví DoiNhanh có thể dùng để nạp cước trực tiếp. Số dư được cộng từ việc bán thẻ cào hoặc nạp qua chuyển khoản."},{q:"Nạp cước nhưng số điện thoại không nhận được tiền thì sao?",a:"Liên hệ hỗ trợ ngay với mã giao dịch. Trường hợp lỗi do hệ thống, bạn sẽ được hoàn tiền vào ví."}],Z=[1e4,2e4,3e4,5e4,1e5,2e5,3e5,5e5];function ae(){$("faq-nap-cuoc",Y),X("service-nap-cuoc",{"@context":"https://schema.org","@type":"Service",name:"Nạp cước điện thoại",description:"Dịch vụ nạp cước điện thoại trả trước Viettel, Mobifone, Vinaphone, Vietnamobile nhanh chóng, chiết khấu cao",provider:{"@type":"Organization",name:"DoiNhanh.com",url:"https://doinhanh.com"},areaServed:"VN",url:"https://doinhanh.com/nap-cuoc",serviceType:"Nạp cước điện thoại"}),q({title:"Nạp cước điện thoại - Nạp nhanh, chiết khấu hấp dẫn",description:"Nạp cước điện thoại trả trước Viettel, Mobifone, Vinaphone, Vietnamobile nhanh chóng, chiết khấu cao. Tự động 24/7, bảo mật thông tin khách hàng.",canonical:"https://doinhanh.com/nap-cuoc",breadcrumbs:[{name:"Trang chủ",url:"/"},{name:"Nạp cước điện thoại",url:"/nap-cuoc"}]});const{isAuthenticated:n}=I(),[d,r]=h.useState(""),[a,f]=h.useState(""),[p,y]=h.useState(0),{data:E}=m.wallet.getBalance.useQuery(void 0,{enabled:n}),{data:P,isLoading:w}=m.rates.getAll.useQuery(),{data:g,isLoading:D}=m.topup.getPricing.useQuery(void 0,{staleTime:6e4,refetchInterval:12e4}),{data:u,refetch:j}=m.topup.getHistory.useQuery({limit:5,offset:0},{enabled:n}),{telcoProviders:v,getDenominations:S,isLoading:z}=J("topup"),V=h.useMemo(()=>a?S(a):Z,[a,S]),B=(t,c)=>{if(!g?.pricing||g.pricing.length===0)return 0;const o=g.pricing.find(l=>l.carrier===t.toUpperCase()&&l.amount===c);return o?o.userDiscount??0:g.pricing.find(l=>l.carrier===t.toUpperCase()&&l.amount===0)?.userDiscount??0},x=h.useRef(null),k=u?.items?.some(t=>t.status==="pending"||t.status==="processing");h.useEffect(()=>(k?x.current=setInterval(()=>{j()},5e3):x.current&&(clearInterval(x.current),x.current=null),()=>{x.current&&clearInterval(x.current)}),[k,j]);const N=m.topup.create.useMutation({onSuccess:t=>{t.status==="success"?i.success("Nạp cước thành công!"):i.info("Đang xử lý nạp cước, vui lòng chờ 1-5 phút..."),r(""),y(0),j()},onError:t=>{const c=t.message,o=c.match(/\(code:\s*(\d+)\)/);if(o){const s=Number(o[1]),l=C[s];if(l){s===102?i.error("Đối tác hết số dư, vui lòng thử lại sau."):s===106||s===118?i.error("Sản phẩm tạm hết, vui lòng thử lại sau."):s===114||s===119?i.error("Lỗi kết nối đối tác nạp cước, vui lòng liên hệ hỗ trợ."):s===116?i.error("Lỗi xác thực đối tác, vui lòng liên hệ hỗ trợ."):s===109?i.error("Mã giao dịch đã tồn tại, vui lòng thử lại."):s>=100&&s<=126?i.error(l):i.error(c);return}}c.includes("bảo trì")||c.includes("CHARGING_EXCEPTION")?i.error("Nhà mạng đang bảo trì, vui lòng thử lại sau ít phút."):c.includes("Số dư")||c.includes("balance")?i.error("Số dư ví không đủ. Vui lòng nạp thêm tiền."):c.includes("Timeout")?i.error("Hệ thống đang bận, vui lòng thử lại sau."):i.error(c||"Nạp cước thất bại, vui lòng thử lại.")}}),A=p&&a?B(a,p):0,O=p>0?Math.round(p*(100-A)/100):0,R=()=>
1{if(!n){i.info("Vui lòng đăng nhập để nạp cước"),window.location.href=L("/nap-cuoc");return}N.mutate({phoneNumber:d,carrier:a,amount:p})};return e.jsx(U,{"data-loc":"client/src/pages/Topup.tsx:197",children:e.jsxs(Q,{"data-loc":"client/src/pages/Topup.tsx:198",children:[e.jsx(G,{"data-loc":"client/src/pages/Topup.tsx:199",items:[{label:"Nạp cước"}]}),e.jsx(H,{"data-loc":"client/src/pages/Topup.tsx:200",title:"Nạp cước điện thoại",subtitle:"Nạp cước trực tiếp vào số điện thoại, chiết khấu hấp dẫn, xử lý tự động trong 1-5 phút.",icon:e.jsx(W,{"data-loc":"client/src/pages/Topup.tsx:203",style:{width:20,height:20}})}),w||z||D?e.jsx(K,{"data-loc":"client/src/pages/Topup.tsx:208"}):e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:210",className:"service-layout page-section",children:[e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:212",className:"ui-card service-main-card",children:[e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:214",className:"step-title",children:[e.jsx("span",{"data-loc":"client/src/pages/Topup.tsx:215",className:"step-circle",children:"1"}),e.jsx("h2",{"data-loc":"client/src/pages/Topup.tsx:216",className:"step-heading",children:"Thông tin nạp cước"})]}),e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:219",className:"form-grid-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:220",children:[e.jsx("label",{"data-loc":"client/src/pages/Topup.tsx:221",className:"form-label",children:"Nhà mạng"}),e.jsxs("select",{"data-loc":"client/src/pages/Topup.tsx:222",className:"form-select",value:a,onChange:t=>f(t.target.value),children:[e.jsx("option",{"data-loc":"client/src/pages/Topup.tsx:227",value:"",children:"-- Chọn nhà mạng --"}),v.map(t=>e.jsx("option",{"data-loc":"client/src/pages/Topup.tsx:229",value:t.code,children:t.name},t.code))]})]}),e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:233",children:[e.jsx("label",{"data-loc":"client/src/pages/Topup.tsx:234",className:"form-label",children:"Số điện thoại"}),e.jsx("input",{"data-loc":"client/src/pages/Topup.tsx:235",className:"form-control",type:"tel",placeholder:"Nhập số điện thoại",value:d,onChange:t=>r(t.target.value),maxLength:11})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:247",className:"step-title",style:{marginTop:28},children:[e.jsx("span",{"data-loc":"client/src/pages/Topup.tsx:248",className:"step-circle",children:"2"}),e.jsx("h2",{"data-loc":"client/src/pages/Topup.tsx:249",className:"step-heading",children:"Chọn mệnh giá"})]}),e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:252",className:"amount-grid",children:V.map(t=>e.jsxs("button",{"data-loc":"client/src/pages/Topup.tsx:254",className:`amount-btn${p===t?" is-active":""}`,onClick:()=>y(t),children:[t/1e3,"k"]},t))}),p>0&&e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:266",className:"confirm-box",children:e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:267",className:"confirm-grid",children:[e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:268",children:[e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:269",className:"confirm-item-label",children:"Nhà mạng"}),e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:270",className:"confirm-item-value",children:a?v.find(t=>t.code===a)?.name||b[a]||a:"—"})]}),e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:272",children:[e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:273",className:"confirm-item-label",children:"Mệnh giá nạp"}),e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:274",className:"confirm-item-value",children:T(p)})]}),e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:276",children:[e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:277",className:"confirm-item-label",children:"Chiết khấu"}),e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:278",className:"confirm-item-value is-discount",children:[A,"%"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:280",children:[e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:281",className:"confirm-item-label",children:"Thanh toán"}),e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:282",className:"confirm-item-value is-accent",children:T(O)})]})]})}),e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:289",className:"notice-submit-row",children:[e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:290",className:"notice-box",children:[e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:291",className:"notice-title",children:"Lưu ý quan trọng"}),e.jsxs("ul",{"data-loc":"client/src/pages/Topup.tsx:292",className:"notice-list",children:[e.jsx("li",{"data-loc":"client/src/pages/Topup.tsx:293",children:"Nạp cước trừ từ số dư"}),e.jsx("li",{"data-loc":"client/src/pages/Topup.tsx:294",children:"Thời gian xử lý: 1-5 phút"}),e.jsx("li",{"data-loc":"client/src/pages/Topup.tsx:295",children:"Kiểm tra đúng SĐT và nhà mạng"})]})]}),e.jsx("button",{"data-loc":"client/src/pages/Topup.tsx:298",className:"primary-submit-btn",disabled:!d||!a||!p||N.isPending,onClick:R,children:N.isPending?"Đang xử lý...":"Nạp cước ngay"})]}),e.jsx("p",{"data-loc":"client/src/pages/Topup.tsx:308",style:{fontSize:13,color:"#6b7280",marginTop:14},children:n?e.jsxs(e.Fragment,{children:["Số dư: ",e.jsx("strong",{"data-loc":"client/src/pages/Topup.tsx:309",style:{color:"#7c3aed"},children:T(E?.availableBalance||0)})]}):e.jsxs(e.Fragment,{children:[e.jsx("a",{"data-loc":"client/src/pages/Topup.tsx:309",href:L("/nap-cuoc"),style:{color:"#7c3aed",fontWeight:600,textDecoration:"none"},children:"Đăng nhập"})," để xem số dư"]})})]}),e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:314",className:"service-sidebar",children:[e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:316",className:"ui-card sidebar-card",children:[e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:317",className:"sidebar-title",children:[e.jsxs("svg",{"data-loc":"client/src/pages/Topup.tsx:318",width:"18",height:"18",fill:"none",stroke:"#7c3aed",strokeWidth:"2",viewBox:"0 0 24 24",children:[e.jsx("path",{"data-loc":"client/src/pages/Topup.tsx:318",d:"M12 2L2 7l10 5 10-5-10-5z"}),e.jsx("path",{"data-loc":"client/src/pages/Topup.tsx:318",d:"M2 17l10 5 10-5"}),e.jsx("path",{"data-loc":"client/src/pages/Topup.tsx:318",d:"M2 12l10 5 10-5"})]}),"Chiết khấu nạp cước"]}),e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:321",className:"discount-list",children:v.map(t=>{const c=g?.pricing?.filter(s=>s.carrier===t.code.toUpperCase());let o=0;if(c&&c.length>0)o=Math.round(c.reduce((s,l)=>s+l.userDiscount,0)/c.length*10)/10;else{const s=P?.find(l=>l.carrier===t.code&&l.service==="topup");o=s?parseFloat(s.rate):0}return e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:333",className:"discount-row",children:[e.jsx("span",{"data-loc":"client/src/pages/Topup.tsx:334",className:"discount-brand",children:t.name}),e.jsx("span",{"data-loc":"client/src/pages/Topup.tsx:335",className:"discount-percent",children:o>0?`${o}%`:"—"})]},t.code)})}),!g?.available&&e.jsx("p",{"data-loc":"client/src/pages/Topup.tsx:341",style:{fontSize:12,color:"#9ca3af",marginTop:8,fontStyle:"italic"},children:"Đang cập nhật chiết khấu từ đối tác..."})]}),n&&e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:347",className:"ui-card sidebar-card",children:[e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:348",className:"sidebar-title",children:[e.jsxs("svg",{"data-loc":"client/src/pages/Topup.tsx:349",width:"18",height:"18",fill:"none",stroke:"#7c3aed",strokeWidth:"2",viewBox:"0 0 24 24",children:[e.jsx("circle",{"data-loc":"client/src/pages/Topup.tsx:349",cx:"12",cy:"12",r:"10"}),e.jsx("path",{"data-loc":"client/src/pages/Topup.tsx:349",d:"M12 6v6l4 2"})]}),"Giao dịch gần đây"]}
1),u?.items&&u.items.length>0?e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:353",className:"mini-history-list",children:u.items.slice(0,3).map(t=>e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:355",className:"mini-history-row",children:[e.jsx("span",{"data-loc":"client/src/pages/Topup.tsx:356",className:"mini-brand",children:b[t.carrier]||t.carrier}),e.jsxs("span",{"data-loc":"client/src/pages/Topup.tsx:357",className:"mini-meta",children:[t.phoneNumber," · ",M(t.createdAt)]}),e.jsx("span",{"data-loc":"client/src/pages/Topup.tsx:358",className:"mini-amount",children:T(t.amount)})]},t.id))}):e.jsx("p",{"data-loc":"client/src/pages/Topup.tsx:363",style:{fontSize:13,color:"#9ca3af"},children:"Chưa có giao dịch nào"})]})]})]}),n&&u?.items&&u.items.length>0&&e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:373",className:"ui-card page-section",style:{padding:24},children:[e.jsxs("div",{"data-loc":"client/src/pages/Topup.tsx:374",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:18},children:[e.jsx("h2",{"data-loc":"client/src/pages/Topup.tsx:375",style:{fontSize:22,fontWeight:800,margin:0},children:"Lịch sử nạp cước"}),e.jsx("button",{"data-loc":"client/src/pages/Topup.tsx:376",className:"exchange-refresh-btn",onClick:()=>j(),children:"↻ Làm mới"})]}),e.jsx("div",{"data-loc":"client/src/pages/Topup.tsx:383",style:{overflowX:"auto"},children:e.jsxs("table",{"data-loc":"client/src/pages/Topup.tsx:384",style:{width:"100%",borderCollapse:"collapse",fontSize:14},children:[e.jsx("thead",{"data-loc":"client/src/pages/Topup.tsx:385",children:e.jsxs("tr",{"data-loc":"client/src/pages/Topup.tsx:386",style:{background:"#fafafa",borderRadius:12},children:[e.jsx("th",{"data-loc":"client/src/pages/Topup.tsx:387",style:{padding:"12px 14px",textAlign:"left",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Số ĐT"}),e.jsx("th",{"data-loc":"client/src/pages/Topup.tsx:388",style:{padding:"12px 14px",textAlign:"left",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Nhà mạng"}),e.jsx("th",{"data-loc":"client/src/pages/Topup.tsx:389",style:{padding:"12px 14px",textAlign:"right",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Mệnh giá"}),e.jsx("th",{"data-loc":"client/src/pages/Topup.tsx:390",style:{padding:"12px 14px",textAlign:"center",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Trạng thái"}),e.jsx("th",{"data-loc":"client/src/pages/Topup.tsx:391",style:{padding:"12px 14px",textAlign:"right",fontSize:13,fontWeight:800,color:"#6b7280"},children:"Thời gian"})]})}),e.jsx("tbody",{"data-loc":"client/src/pages/Topup.tsx:394",children:u.items.map(t=>e.jsxs("tr",{"data-loc":"client/src/pages/Topup.tsx:396",style:{borderBottom:"1px solid #f3f4f6"},children:[e.jsx("td",{"data-loc":"client/src/pages/Topup.tsx:397",style:{padding:"13px 14px",fontWeight:700},children:t.phoneNumber}),e.jsx("td",{"data-loc":"client/src/pages/Topup.tsx:398",style:{padding:"13px 14px"},children:b[t.carrier]||t.carrier}),e.jsx("td",{"data-loc":"client/src/pages/Topup.tsx:399",style:{padding:"13px 14px",textAlign:"right"},children:T(t.amount)}),e.jsxs("td",{"data-loc":"client/src/pages/Topup.tsx:400",style:{padding:"13px 14px",textAlign:"center"},children:[e.jsx("span",{"data-loc":"client/src/pages/Topup.tsx:401",className:`status-badge ${t.status==="success"?"status-success":t.status==="failed"?"status-failed":"status-processing"}`,children:F[t.status]||t.status}),t.status==="failed"&&t.errorMessage&&e.jsx("p",{"data-loc":"client/src/pages/Topup.tsx:405",style:{fontSize:11,color:"#ef4444",marginTop:2},children:(()=>{const c=t.errorMessage.match(/\(code:\s*(\d+)\)/);if(c){const o=Number(c[1]),s=C[o];if(s)return s}return _(t.errorMessage)})()})]}),e.jsx("td",{"data-loc":"client/src/pages/Topup.tsx:418",style:{padding:"13px 14px",textAlign:"right",fontSize:13,color:"#6b7280"},children:M(t.createdAt)})]},t.id))})]})})]})]})})}export{ae 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.