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.