Spaces:
Running
Running
Add Catalogue, Contact, Cart + QR Napas VIB payment
Browse files- index.html +391 -5
index.html
CHANGED
|
@@ -212,6 +212,106 @@ img{max-width:100%;display:block}a{text-decoration:none;color:inherit}
|
|
| 212 |
}
|
| 213 |
|
| 214 |
.fade{opacity:0;transform:translateY(14px);transition:opacity .35s,transform .35s}.fade.vis{opacity:1;transform:none}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
</style>
|
| 216 |
</head>
|
| 217 |
<body>
|
|
@@ -226,9 +326,13 @@ img{max-width:100%;display:block}a{text-decoration:none;color:inherit}
|
|
| 226 |
<header class="header"><div class="container">
|
| 227 |
<div class="logo" onclick="goHome()"><div class="logo-box">M</div><div><div class="logo-name">MALL<span>OCA</span></div><div class="logo-sub">Smart Kitchen • Smart Life</div></div></div>
|
| 228 |
<div class="search-box"><i class="fas fa-search"></i><input type="text" id="q" placeholder="Tìm sản phẩm... (bếp từ, máy hút mùi, chậu rửa...)" oninput="doSearch()"><span class="search-count" id="sc"></span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
<div class="nav-icons">
|
| 230 |
-
<a href="
|
| 231 |
-
<a href="https://malloca.com/he-thong-showroom" target="_blank" title="Showroom"><i class="fas fa-location-dot"></i></a>
|
| 232 |
</div>
|
| 233 |
<button class="hamburger" onclick="document.getElementById('msb').classList.toggle('open')"><span></span><span></span><span></span></button>
|
| 234 |
</div></header>
|
|
@@ -245,7 +349,7 @@ img{max-width:100%;display:block}a{text-decoration:none;color:inherit}
|
|
| 245 |
|
| 246 |
<div class="container">
|
| 247 |
<!-- LIST VIEW -->
|
| 248 |
-
<div id="listView">
|
| 249 |
<div class="main">
|
| 250 |
<aside class="sidebar" id="sidebar">
|
| 251 |
<div class="sb-card"><h3><i class="fas fa-layer-group"></i> Danh Mục</h3><ul class="cat-list" id="cl"></ul></div>
|
|
@@ -265,17 +369,90 @@ img{max-width:100%;display:block}a{text-decoration:none;color:inherit}
|
|
| 265 |
</div>
|
| 266 |
</div>
|
| 267 |
|
|
|
|
| 268 |
<!-- DETAIL VIEW -->
|
| 269 |
<div id="detailView"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
</div>
|
| 271 |
|
| 272 |
<!-- MOBILE SIDEBAR -->
|
| 273 |
<div class="msb" id="msb">
|
| 274 |
-
<div class="msb-h"><h3 style="font-weight:700">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 275 |
<div class="sb-card"><h3><i class="fas fa-layer-group"></i> Danh Mục</h3><ul class="cat-list" id="clm"></ul></div>
|
| 276 |
<div class="sb-card"><h3><i class="fas fa-tag"></i> Khoảng Giá</h3><div class="pr" id="prm"></div></div>
|
| 277 |
</div>
|
| 278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
<footer class="footer"><div class="container">
|
| 280 |
<div class="footer-grid">
|
| 281 |
<div class="footer-brand"><div class="logo-name" style="color:#fff;font-size:1.1rem">MALL<span style="color:var(--a)">OCA</span></div><p>363 sản phẩm với dữ liệu chi tiết đầy đủ — hình ảnh, thông số kỹ thuật, mô tả, tính năng — tích hợp trực tiếp từ malloca.com.</p>
|
|
@@ -416,7 +593,8 @@ ${p.summary?`<div class="detail-summary">${p.summary}</div>`:''}
|
|
| 416 |
<div class="detail-badge"><i class="fas fa-truck-fast"></i> Miễn phí lắp đặt</div>
|
| 417 |
</div>
|
| 418 |
<div style="display:flex;gap:10px;flex-wrap:wrap">
|
| 419 |
-
<
|
|
|
|
| 420 |
</div>
|
| 421 |
</div>
|
| 422 |
</div>
|
|
@@ -462,6 +640,214 @@ function resetAll(){S={cat:'all',q:'',pmin:0,pmax:1e15,sort:'default',pg:1,view:
|
|
| 462 |
function updActive(sel,attr,val){document.querySelectorAll(sel).forEach(e=>e.classList.toggle('active',e.getAttribute(attr)===val))}
|
| 463 |
function closeMsb(){document.getElementById('msb').classList.remove('open')}
|
| 464 |
document.addEventListener('keydown',e=>{if(e.key==='Escape')goBack();if(e.key==='/'&&document.activeElement.tagName!=='INPUT'){e.preventDefault();document.getElementById('q').focus()}});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 465 |
</script>
|
| 466 |
</body>
|
| 467 |
</html>
|
|
|
|
| 212 |
}
|
| 213 |
|
| 214 |
.fade{opacity:0;transform:translateY(14px);transition:opacity .35s,transform .35s}.fade.vis{opacity:1;transform:none}
|
| 215 |
+
|
| 216 |
+
/* ===== NAV TABS ===== */
|
| 217 |
+
.nav-tabs{display:flex;gap:2px;margin-left:16px}
|
| 218 |
+
.nav-tab{padding:8px 14px;border-radius:9px;font-size:.78rem;font-weight:600;cursor:pointer;transition:var(--t);color:var(--g);position:relative}
|
| 219 |
+
.nav-tab:hover{color:var(--p);background:rgba(0,63,98,.04)}
|
| 220 |
+
.nav-tab.active{color:var(--p);background:rgba(0,63,98,.08)}
|
| 221 |
+
|
| 222 |
+
/* ===== CART BADGE ===== */
|
| 223 |
+
.cart-badge{position:relative}
|
| 224 |
+
.cart-num{position:absolute;top:-4px;right:-4px;background:var(--a);color:#fff;font-size:.55rem;font-weight:800;width:16px;height:16px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:2px solid #fff}
|
| 225 |
+
|
| 226 |
+
/* ===== PAGE SECTIONS ===== */
|
| 227 |
+
.page-section{display:none;padding:28px 0;min-height:60vh}
|
| 228 |
+
.page-section.active{display:block}
|
| 229 |
+
|
| 230 |
+
/* ===== CATALOGUE ===== */
|
| 231 |
+
.cat-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:20px;margin-top:24px}
|
| 232 |
+
.cat-card{background:#fff;border-radius:var(--r);overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.06);transition:var(--t);cursor:pointer;border:2px solid transparent}
|
| 233 |
+
.cat-card:hover{border-color:var(--p);transform:translateY(-4px);box-shadow:0 8px 24px rgba(0,0,0,.1)}
|
| 234 |
+
.cat-card img{width:100%;height:200px;object-fit:cover}
|
| 235 |
+
.cat-card-body{padding:16px;text-align:center}
|
| 236 |
+
.cat-card-body h3{font-size:.95rem;font-weight:700;color:var(--d);margin-bottom:6px}
|
| 237 |
+
.cat-card-body p{font-size:.78rem;color:var(--g)}
|
| 238 |
+
.cat-iframe-wrap{margin-top:20px;background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 2px 16px rgba(0,0,0,.06)}
|
| 239 |
+
.cat-iframe-wrap iframe{width:100%;height:80vh;border:none}
|
| 240 |
+
.cat-back{display:inline-flex;align-items:center;gap:8px;color:var(--p);font-weight:600;font-size:.85rem;cursor:pointer;padding:8px 0;margin-bottom:16px}
|
| 241 |
+
|
| 242 |
+
/* ===== CONTACT ===== */
|
| 243 |
+
.contact-grid{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin-top:24px}
|
| 244 |
+
.contact-card{background:#fff;border-radius:var(--r);padding:28px;box-shadow:0 2px 10px rgba(0,0,0,.06)}
|
| 245 |
+
.contact-card h3{font-size:1.1rem;font-weight:700;color:var(--d);margin-bottom:20px;display:flex;align-items:center;gap:10px}
|
| 246 |
+
.contact-card h3 i{color:var(--a)}
|
| 247 |
+
.contact-info{list-style:none}
|
| 248 |
+
.contact-info li{display:flex;align-items:flex-start;gap:12px;padding:12px 0;border-bottom:1px solid var(--gl);font-size:.88rem;color:var(--d)}
|
| 249 |
+
.contact-info li:last-child{border:none}
|
| 250 |
+
.contact-info li i{color:var(--p);width:20px;text-align:center;margin-top:3px}
|
| 251 |
+
.form-group{margin-bottom:16px}
|
| 252 |
+
.form-group label{display:block;font-size:.82rem;font-weight:600;color:var(--d);margin-bottom:6px}
|
| 253 |
+
.form-input{width:100%;padding:10px 14px;border:2px solid var(--gl);border-radius:10px;font-size:.85rem;font-family:inherit;outline:none;transition:var(--t)}
|
| 254 |
+
.form-input:focus{border-color:var(--p);box-shadow:0 0 0 3px rgba(0,63,98,.08)}
|
| 255 |
+
textarea.form-input{height:120px;resize:vertical}
|
| 256 |
+
.form-btn{padding:12px 28px;background:var(--p);color:#fff;border:none;border-radius:10px;font-weight:700;font-size:.88rem;cursor:pointer;font-family:inherit;transition:var(--t);width:100%}
|
| 257 |
+
.form-btn:hover{background:var(--pl)}
|
| 258 |
+
.map-wrap{margin-top:20px;border-radius:12px;overflow:hidden;height:280px}
|
| 259 |
+
.map-wrap iframe{width:100%;height:100%;border:none}
|
| 260 |
+
|
| 261 |
+
/* ===== CART DRAWER ===== */
|
| 262 |
+
.cart-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:200;backdrop-filter:blur(3px)}
|
| 263 |
+
.cart-overlay.open{display:block}
|
| 264 |
+
.cart-drawer{position:fixed;top:0;right:-420px;width:400px;max-width:90vw;height:100vh;background:#fff;z-index:201;transition:right .35s ease;display:flex;flex-direction:column;box-shadow:-4px 0 30px rgba(0,0,0,.15)}
|
| 265 |
+
.cart-drawer.open{right:0}
|
| 266 |
+
.cart-header{padding:20px;border-bottom:2px solid var(--gl);display:flex;align-items:center;justify-content:space-between}
|
| 267 |
+
.cart-header h3{font-size:1rem;font-weight:700;display:flex;align-items:center;gap:8px}
|
| 268 |
+
.cart-header h3 i{color:var(--a)}
|
| 269 |
+
.cart-close{width:34px;height:34px;border:none;background:var(--gl);border-radius:9px;cursor:pointer;font-size:.9rem}
|
| 270 |
+
.cart-items{flex:1;overflow-y:auto;padding:16px}
|
| 271 |
+
.cart-item{display:flex;gap:12px;padding:12px;background:var(--l);border-radius:12px;margin-bottom:10px}
|
| 272 |
+
.cart-item img{width:70px;height:70px;object-fit:contain;border-radius:8px;background:#fff;flex-shrink:0}
|
| 273 |
+
.cart-item-info{flex:1;min-width:0}
|
| 274 |
+
.cart-item-name{font-size:.8rem;font-weight:600;color:var(--d);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
|
| 275 |
+
.cart-item-price{font-size:.88rem;font-weight:800;color:var(--p);margin-top:4px}
|
| 276 |
+
.cart-item-qty{display:flex;align-items:center;gap:8px;margin-top:6px}
|
| 277 |
+
.qty-btn{width:26px;height:26px;border:1px solid var(--gl);border-radius:6px;background:#fff;cursor:pointer;font-size:.8rem;display:flex;align-items:center;justify-content:center}
|
| 278 |
+
.qty-val{font-size:.82rem;font-weight:700;min-width:20px;text-align:center}
|
| 279 |
+
.cart-item-del{background:none;border:none;color:#dc3545;cursor:pointer;font-size:.85rem;margin-left:auto;padding:4px}
|
| 280 |
+
.cart-empty{text-align:center;padding:40px;color:var(--g)}
|
| 281 |
+
.cart-empty i{font-size:2.5rem;opacity:.3;display:block;margin-bottom:12px}
|
| 282 |
+
.cart-footer{padding:16px 20px;border-top:2px solid var(--gl);background:#fff}
|
| 283 |
+
.cart-total{display:flex;justify-content:space-between;font-size:1rem;font-weight:800;color:var(--d);margin-bottom:14px}
|
| 284 |
+
.cart-checkout-btn{width:100%;padding:14px;background:var(--a);color:#fff;border:none;border-radius:12px;font-weight:700;font-size:.92rem;cursor:pointer;font-family:inherit;transition:var(--t);display:flex;align-items:center;justify-content:center;gap:8px}
|
| 285 |
+
.cart-checkout-btn:hover{background:var(--al);transform:translateY(-1px)}
|
| 286 |
+
|
| 287 |
+
/* ===== CHECKOUT MODAL ===== */
|
| 288 |
+
.checkout-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:300;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(4px)}
|
| 289 |
+
.checkout-overlay.open{display:flex}
|
| 290 |
+
.checkout-modal{background:#fff;border-radius:20px;max-width:550px;width:100%;max-height:92vh;overflow-y:auto;padding:32px;position:relative}
|
| 291 |
+
.checkout-close{position:absolute;top:16px;right:16px;width:34px;height:34px;border:none;background:var(--gl);border-radius:9px;cursor:pointer;font-size:.9rem}
|
| 292 |
+
.checkout-title{font-size:1.3rem;font-weight:800;color:var(--d);margin-bottom:4px}
|
| 293 |
+
.checkout-sub{font-size:.82rem;color:var(--g);margin-bottom:24px}
|
| 294 |
+
.checkout-summary{background:var(--l);border-radius:12px;padding:16px;margin-bottom:20px}
|
| 295 |
+
.checkout-summary-item{display:flex;justify-content:space-between;font-size:.82rem;padding:4px 0;color:var(--d)}
|
| 296 |
+
.checkout-summary-item.total{font-weight:800;font-size:1rem;color:var(--p);border-top:2px solid var(--gl);padding-top:10px;margin-top:8px}
|
| 297 |
+
.qr-section{text-align:center;background:var(--l);border-radius:16px;padding:24px;margin:20px 0}
|
| 298 |
+
.qr-section img{max-width:260px;margin:0 auto 16px;border-radius:12px;border:3px solid var(--gl)}
|
| 299 |
+
.qr-bank-info{font-size:.82rem;color:var(--d);line-height:1.8}
|
| 300 |
+
.qr-bank-info strong{color:var(--p)}
|
| 301 |
+
.copy-btn{display:inline-flex;align-items:center;gap:4px;background:var(--p);color:#fff;border:none;padding:4px 10px;border-radius:6px;font-size:.7rem;cursor:pointer;font-family:inherit;margin-left:6px}
|
| 302 |
+
.checkout-note{font-size:.78rem;color:var(--g);text-align:center;margin-top:16px;line-height:1.6}
|
| 303 |
+
.checkout-done-btn{width:100%;padding:14px;background:var(--p);color:#fff;border:none;border-radius:12px;font-weight:700;font-size:.92rem;cursor:pointer;font-family:inherit;margin-top:16px}
|
| 304 |
+
|
| 305 |
+
/* ADD TO CART BTN (in detail) */
|
| 306 |
+
.add-cart-btn{display:inline-flex;align-items:center;gap:8px;padding:14px 28px;background:var(--a);color:#fff;border-radius:12px;font-weight:700;font-size:.88rem;transition:var(--t);border:none;cursor:pointer;font-family:inherit}
|
| 307 |
+
.add-cart-btn:hover{background:var(--al);transform:translateY(-2px);box-shadow:0 8px 20px rgba(219,152,21,.3)}
|
| 308 |
+
|
| 309 |
+
@media(max-width:768px){
|
| 310 |
+
.nav-tabs{display:none}
|
| 311 |
+
.contact-grid{grid-template-columns:1fr}
|
| 312 |
+
.cart-drawer{width:100%;max-width:100%}
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
</style>
|
| 316 |
</head>
|
| 317 |
<body>
|
|
|
|
| 326 |
<header class="header"><div class="container">
|
| 327 |
<div class="logo" onclick="goHome()"><div class="logo-box">M</div><div><div class="logo-name">MALL<span>OCA</span></div><div class="logo-sub">Smart Kitchen • Smart Life</div></div></div>
|
| 328 |
<div class="search-box"><i class="fas fa-search"></i><input type="text" id="q" placeholder="Tìm sản phẩm... (bếp từ, máy hút mùi, chậu rửa...)" oninput="doSearch()"><span class="search-count" id="sc"></span></div>
|
| 329 |
+
<div class="nav-tabs">
|
| 330 |
+
<div class="nav-tab active" data-page="products" onclick="showPage('products')"><i class="fas fa-th-large"></i> Sản Phẩm</div>
|
| 331 |
+
<div class="nav-tab" data-page="catalogue" onclick="showPage('catalogue')"><i class="fas fa-book-open"></i> Catalogue</div>
|
| 332 |
+
<div class="nav-tab" data-page="contact" onclick="showPage('contact')"><i class="fas fa-envelope"></i> Liên Hệ</div>
|
| 333 |
+
</div>
|
| 334 |
<div class="nav-icons">
|
| 335 |
+
<a href="#" onclick="openCart();return false" title="Giỏ hàng" class="cart-badge"><i class="fas fa-shopping-cart"></i><span class="cart-num" id="cartNum" style="display:none">0</span></a>
|
|
|
|
| 336 |
</div>
|
| 337 |
<button class="hamburger" onclick="document.getElementById('msb').classList.toggle('open')"><span></span><span></span><span></span></button>
|
| 338 |
</div></header>
|
|
|
|
| 349 |
|
| 350 |
<div class="container">
|
| 351 |
<!-- LIST VIEW -->
|
| 352 |
+
<div id="page-products" class="page-section active"><div id="listView">
|
| 353 |
<div class="main">
|
| 354 |
<aside class="sidebar" id="sidebar">
|
| 355 |
<div class="sb-card"><h3><i class="fas fa-layer-group"></i> Danh Mục</h3><ul class="cat-list" id="cl"></ul></div>
|
|
|
|
| 369 |
</div>
|
| 370 |
</div>
|
| 371 |
|
| 372 |
+
</div><!-- /page-products -->
|
| 373 |
<!-- DETAIL VIEW -->
|
| 374 |
<div id="detailView"></div>
|
| 375 |
+
|
| 376 |
+
<!-- CATALOGUE PAGE -->
|
| 377 |
+
<div class="page-section" id="page-catalogue">
|
| 378 |
+
<div class="section-header" style="text-align:center;margin-bottom:10px">
|
| 379 |
+
<h2 style="font-size:1.8rem;font-weight:800;color:var(--d)"><i class="fas fa-book-open" style="color:var(--a);margin-right:10px"></i>Catalogue <span style="color:var(--a)">Malloca</span></h2>
|
| 380 |
+
<p style="color:var(--g);font-size:.9rem;max-width:500px;margin:10px auto 0">Xem catalogue sản phẩm trực tuyến — Bếp, Máy hút, Lò nướng, Chậu vòi và Bảng giá</p>
|
| 381 |
+
</div>
|
| 382 |
+
<div class="cat-grid" id="cat-list-page"></div>
|
| 383 |
+
<div id="cat-viewer" style="display:none"></div>
|
| 384 |
+
</div>
|
| 385 |
+
|
| 386 |
+
<!-- CONTACT PAGE -->
|
| 387 |
+
<div class="page-section" id="page-contact">
|
| 388 |
+
<div class="section-header" style="text-align:center;margin-bottom:10px">
|
| 389 |
+
<h2 style="font-size:1.8rem;font-weight:800;color:var(--d)"><i class="fas fa-envelope" style="color:var(--a);margin-right:10px"></i>Liên Hệ <span style="color:var(--a)">Malloca</span></h2>
|
| 390 |
+
<p style="color:var(--g);font-size:.9rem;max-width:500px;margin:10px auto 0">Liên hệ trực tiếp hoặc gửi tin nhắn — chúng tôi sẵn sàng hỗ trợ bạn</p>
|
| 391 |
+
</div>
|
| 392 |
+
<div class="contact-grid">
|
| 393 |
+
<div class="contact-card">
|
| 394 |
+
<h3><i class="fas fa-building"></i> Thông Tin Liên Hệ</h3>
|
| 395 |
+
<ul class="contact-info">
|
| 396 |
+
<li><i class="fas fa-map-marker-alt"></i><div><strong>Showroom Hà Nội</strong><br>10 Chương Dương Độ, Hoàn Kiếm, Hà Nội</div></li>
|
| 397 |
+
<li><i class="fas fa-phone"></i><div><strong>Hotline</strong><br><a href="tel:18001212" style="color:var(--p);font-weight:700">1800 1212</a> (Miễn phí)</div></li>
|
| 398 |
+
<li><i class="fas fa-envelope"></i><div><strong>Email</strong><br><a href="mailto:info@malloca.com" style="color:var(--p)">info@malloca.com</a></div></li>
|
| 399 |
+
<li><i class="fas fa-clock"></i><div><strong>Giờ làm việc</strong><br>Thứ 2 - Thứ 7: 8:00 - 17:30<br>Chủ nhật: 9:00 - 12:00</div></li>
|
| 400 |
+
<li><i class="fas fa-globe"></i><div><strong>Website</strong><br><a href="https://malloca.com" target="_blank" style="color:var(--p)">malloca.com</a></div></li>
|
| 401 |
+
</ul>
|
| 402 |
+
<div style="display:flex;gap:8px;margin-top:16px">
|
| 403 |
+
<a href="https://www.facebook.com/CongTyMalloca" target="_blank" style="padding:10px 16px;background:var(--p);color:#fff;border-radius:10px;font-size:.8rem;font-weight:600;display:flex;align-items:center;gap:6px"><i class="fab fa-facebook-f"></i> Facebook</a>
|
| 404 |
+
<a href="https://www.youtube.com/@mallocakitchenware" target="_blank" style="padding:10px 16px;background:#dc3545;color:#fff;border-radius:10px;font-size:.8rem;font-weight:600;display:flex;align-items:center;gap:6px"><i class="fab fa-youtube"></i> YouTube</a>
|
| 405 |
+
<a href="https://www.tiktok.com/@mallocavietnam" target="_blank" style="padding:10px 16px;background:#000;color:#fff;border-radius:10px;font-size:.8rem;font-weight:600;display:flex;align-items:center;gap:6px"><i class="fab fa-tiktok"></i> TikTok</a>
|
| 406 |
+
</div>
|
| 407 |
+
</div>
|
| 408 |
+
<div class="contact-card">
|
| 409 |
+
<h3><i class="fas fa-paper-plane"></i> Gửi Tin Nhắn</h3>
|
| 410 |
+
<form onsubmit="submitContact(event)">
|
| 411 |
+
<div class="form-group"><label>Họ tên *</label><input class="form-input" id="ctName" placeholder="Nhập họ tên" required></div>
|
| 412 |
+
<div class="form-group"><label>Email *</label><input class="form-input" id="ctEmail" type="email" placeholder="email@example.com" required></div>
|
| 413 |
+
<div class="form-group"><label>Số điện thoại</label><input class="form-input" id="ctPhone" placeholder="Nhập SĐT"></div>
|
| 414 |
+
<div class="form-group"><label>Nội dung *</label><textarea class="form-input" id="ctMsg" placeholder="Nhập nội dung liên hệ..." required></textarea></div>
|
| 415 |
+
<button type="submit" class="form-btn"><i class="fas fa-paper-plane"></i> Gửi Tin Nhắn</button>
|
| 416 |
+
</form>
|
| 417 |
+
</div>
|
| 418 |
+
</div>
|
| 419 |
+
</div>
|
| 420 |
+
|
| 421 |
</div>
|
| 422 |
|
| 423 |
<!-- MOBILE SIDEBAR -->
|
| 424 |
<div class="msb" id="msb">
|
| 425 |
+
<div class="msb-h"><h3 style="font-weight:700">Menu</h3><button class="msb-close" onclick="this.closest('.msb').classList.remove('open')"><i class="fas fa-times"></i></button></div>
|
| 426 |
+
<div style="display:flex;flex-direction:column;gap:4px;margin-bottom:16px;padding-bottom:16px;border-bottom:2px solid var(--gl)">
|
| 427 |
+
<div style="padding:12px;border-radius:10px;font-weight:600;cursor:pointer;font-size:.9rem" onclick="closeMsb();showPage('products')"><i class="fas fa-th-large" style="margin-right:8px;color:var(--a)"></i> Sản Phẩm</div>
|
| 428 |
+
<div style="padding:12px;border-radius:10px;font-weight:600;cursor:pointer;font-size:.9rem" onclick="closeMsb();showPage('catalogue')"><i class="fas fa-book-open" style="margin-right:8px;color:var(--a)"></i> Catalogue</div>
|
| 429 |
+
<div style="padding:12px;border-radius:10px;font-weight:600;cursor:pointer;font-size:.9rem" onclick="closeMsb();showPage('contact')"><i class="fas fa-envelope" style="margin-right:8px;color:var(--a)"></i> Liên Hệ</div>
|
| 430 |
+
<div style="padding:12px;border-radius:10px;font-weight:600;cursor:pointer;font-size:.9rem" onclick="closeMsb();openCart()"><i class="fas fa-shopping-cart" style="margin-right:8px;color:var(--a)"></i> Giỏ Hàng</div>
|
| 431 |
+
</div>
|
| 432 |
<div class="sb-card"><h3><i class="fas fa-layer-group"></i> Danh Mục</h3><ul class="cat-list" id="clm"></ul></div>
|
| 433 |
<div class="sb-card"><h3><i class="fas fa-tag"></i> Khoảng Giá</h3><div class="pr" id="prm"></div></div>
|
| 434 |
</div>
|
| 435 |
|
| 436 |
+
|
| 437 |
+
<!-- CART DRAWER -->
|
| 438 |
+
<div class="cart-overlay" id="cartOverlay" onclick="closeCart()"></div>
|
| 439 |
+
<div class="cart-drawer" id="cartDrawer">
|
| 440 |
+
<div class="cart-header"><h3><i class="fas fa-shopping-cart"></i> Giỏ Hàng</h3><button class="cart-close" onclick="closeCart()"><i class="fas fa-times"></i></button></div>
|
| 441 |
+
<div class="cart-items" id="cartItems"></div>
|
| 442 |
+
<div class="cart-footer" id="cartFooter" style="display:none">
|
| 443 |
+
<div class="cart-total"><span>Tổng cộng:</span><span id="cartTotal">0đ</span></div>
|
| 444 |
+
<button class="cart-checkout-btn" onclick="openCheckout()"><i class="fas fa-qrcode"></i> Thanh toán QR Banking</button>
|
| 445 |
+
</div>
|
| 446 |
+
</div>
|
| 447 |
+
|
| 448 |
+
<!-- CHECKOUT MODAL -->
|
| 449 |
+
<div class="checkout-overlay" id="checkoutOverlay" onclick="if(event.target===this)closeCheckout()">
|
| 450 |
+
<div class="checkout-modal">
|
| 451 |
+
<button class="checkout-close" onclick="closeCheckout()"><i class="fas fa-times"></i></button>
|
| 452 |
+
<div id="checkoutContent"></div>
|
| 453 |
+
</div>
|
| 454 |
+
</div>
|
| 455 |
+
|
| 456 |
<footer class="footer"><div class="container">
|
| 457 |
<div class="footer-grid">
|
| 458 |
<div class="footer-brand"><div class="logo-name" style="color:#fff;font-size:1.1rem">MALL<span style="color:var(--a)">OCA</span></div><p>363 sản phẩm với dữ liệu chi tiết đầy đủ — hình ảnh, thông số kỹ thuật, mô tả, tính năng — tích hợp trực tiếp từ malloca.com.</p>
|
|
|
|
| 593 |
<div class="detail-badge"><i class="fas fa-truck-fast"></i> Miễn phí lắp đặt</div>
|
| 594 |
</div>
|
| 595 |
<div style="display:flex;gap:10px;flex-wrap:wrap">
|
| 596 |
+
<button class="add-cart-btn" onclick="event.stopPropagation();addToCart(${idx})"><i class="fas fa-cart-plus"></i> Thêm vào giỏ</button>
|
| 597 |
+
<a href="${p.link}" target="_blank" class="detail-btn detail-btn-outline"><i class="fas fa-external-link-alt"></i> malloca.com</a>
|
| 598 |
</div>
|
| 599 |
</div>
|
| 600 |
</div>
|
|
|
|
| 640 |
function updActive(sel,attr,val){document.querySelectorAll(sel).forEach(e=>e.classList.toggle('active',e.getAttribute(attr)===val))}
|
| 641 |
function closeMsb(){document.getElementById('msb').classList.remove('open')}
|
| 642 |
document.addEventListener('keydown',e=>{if(e.key==='Escape')goBack();if(e.key==='/'&&document.activeElement.tagName!=='INPUT'){e.preventDefault();document.getElementById('q').focus()}});
|
| 643 |
+
|
| 644 |
+
// ===== CATALOGUE DATA =====
|
| 645 |
+
const CATALOGUES=[
|
| 646 |
+
{name:'Catalogue Bếp',img:'https://bizweb.dktcdn.net/100/567/847/themes/1041000/assets/page_catalogue_1_1.jpg?1777012815229',url:'https://catalogue.malloca.com/catalogue-bep/page/1',desc:'Bếp từ, bếp gas, bếp kết hợp'},
|
| 647 |
+
{name:'Catalogue Máy Hút',img:'https://bizweb.dktcdn.net/100/567/847/themes/1041000/assets/page_catalogue_1_3.jpg?1777012815229',url:'https://catalogue.malloca.com/catalogue-may-hut/page/1',desc:'Máy hút khói khử mùi các loại'},
|
| 648 |
+
{name:'Catalogue Lò Nướng & Vi Sóng',img:'https://bizweb.dktcdn.net/100/567/847/themes/1041000/assets/page_catalogue_2_1.jpg?1777012815229',url:'https://catalogue.malloca.com/catalogue-lo/page/1',desc:'Lò nướng, lò hấp, lò vi sóng'},
|
| 649 |
+
{name:'Catalogue Chậu & Vòi',img:'https://bizweb.dktcdn.net/100/567/847/themes/1041000/assets/page_catalogue_2_2.jpg?1777012815229',url:'https://catalogue.malloca.com/catalogue-chau-voi-royol6p8w4z4/page/1',desc:'Chậu rửa chén, vòi rửa chén'},
|
| 650 |
+
{name:'Catalogue Sản Phẩm Khác',img:'https://bizweb.dktcdn.net/100/567/847/themes/1041000/assets/page_catalogue_2_3.jpg?1777012815229',url:'https://catalogue.malloca.com/catalogue-san-pham-khac/page/1',desc:'Tủ lạnh, tủ rượu, máy rửa chén...'},
|
| 651 |
+
{name:'Bảng Giá',img:'https://bizweb.dktcdn.net/100/567/847/themes/1041000/assets/page_catalogue_3_1.jpg?1777012815229',url:'https://catalogue.malloca.com/catalogue-bang-gia/page/1',desc:'Bảng giá sản phẩm Malloca'},
|
| 652 |
+
{name:'Catalogue Master 2023',img:'https://bizweb.dktcdn.net/100/567/847/themes/1041000/assets/page_catalogue_3_3.jpg?1777012815229',url:'https://catalogue.malloca.com/malloca_catalog_master/page/1',desc:'Tổng hợp toàn bộ sản phẩm'}
|
| 653 |
+
];
|
| 654 |
+
|
| 655 |
+
// ===== NAVIGATION =====
|
| 656 |
+
let currentPage='products';
|
| 657 |
+
|
| 658 |
+
function showPage(page){
|
| 659 |
+
currentPage=page;
|
| 660 |
+
document.querySelectorAll('.page-section').forEach(s=>s.classList.remove('active'));
|
| 661 |
+
document.querySelectorAll('.nav-tab').forEach(t=>t.classList.remove('active'));
|
| 662 |
+
let el=document.getElementById('page-'+page);
|
| 663 |
+
if(el)el.classList.add('active');
|
| 664 |
+
let tab=document.querySelector(`.nav-tab[data-page="${page}"]`);
|
| 665 |
+
if(tab)tab.classList.add('active');
|
| 666 |
+
if(page==='products'){
|
| 667 |
+
document.getElementById('listView').style.display='';
|
| 668 |
+
document.querySelector('.hero').style.display='';
|
| 669 |
+
}else{
|
| 670 |
+
document.getElementById('listView').style.display='none';
|
| 671 |
+
document.getElementById('detailView').classList.remove('show');
|
| 672 |
+
document.getElementById('detailView').innerHTML='';
|
| 673 |
+
document.querySelector('.hero').style.display='none';
|
| 674 |
+
}
|
| 675 |
+
window.scrollTo({top:0,behavior:'smooth'});
|
| 676 |
+
}
|
| 677 |
+
|
| 678 |
+
function initCatalogue(){
|
| 679 |
+
let catListEl=document.getElementById('cat-list-page');
|
| 680 |
+
if(!catListEl)return;
|
| 681 |
+
catListEl.innerHTML=CATALOGUES.map((c,i)=>`<div class="cat-card" onclick="openCatalogue(${i})"><img src="${c.img}" alt="${c.name}" loading="lazy"><div class="cat-card-body"><h3>${c.name}</h3><p>${c.desc}</p></div></div>`).join('');
|
| 682 |
+
}
|
| 683 |
+
|
| 684 |
+
function openCatalogue(i){
|
| 685 |
+
let c=CATALOGUES[i];
|
| 686 |
+
let el=document.getElementById('cat-viewer');
|
| 687 |
+
let listEl=document.getElementById('cat-list-page');
|
| 688 |
+
listEl.style.display='none';
|
| 689 |
+
el.style.display='block';
|
| 690 |
+
el.innerHTML=`<div class="cat-back" onclick="closeCatalogueViewer()"><i class="fas fa-arrow-left"></i> Quay lại danh sách catalogue</div><h3 style="font-size:1.2rem;font-weight:700;margin-bottom:16px">${c.name}</h3><div class="cat-iframe-wrap"><iframe src="${c.url}" loading="lazy" allowfullscreen></iframe></div>`;
|
| 691 |
+
}
|
| 692 |
+
|
| 693 |
+
function closeCatalogueViewer(){
|
| 694 |
+
document.getElementById('cat-viewer').style.display='none';
|
| 695 |
+
document.getElementById('cat-list-page').style.display='grid';
|
| 696 |
+
}
|
| 697 |
+
|
| 698 |
+
// ===== CART =====
|
| 699 |
+
let cart=JSON.parse(localStorage.getItem('malloca_cart')||'[]');
|
| 700 |
+
|
| 701 |
+
function updateCartBadge(){
|
| 702 |
+
let n=cart.reduce((s,i)=>s+i.qty,0);
|
| 703 |
+
let badge=document.getElementById('cartNum');
|
| 704 |
+
if(badge){badge.textContent=n;badge.style.display=n>0?'flex':'none'}
|
| 705 |
+
}
|
| 706 |
+
|
| 707 |
+
function addToCart(idx){
|
| 708 |
+
let p=D[idx];
|
| 709 |
+
let exist=cart.find(c=>c.idx===idx);
|
| 710 |
+
if(exist){exist.qty++}else{cart.push({idx,name:p.name,price:p.price,priceNum:p.priceNum,image:p.image,qty:1})}
|
| 711 |
+
localStorage.setItem('malloca_cart',JSON.stringify(cart));
|
| 712 |
+
updateCartBadge();
|
| 713 |
+
openCart();
|
| 714 |
+
}
|
| 715 |
+
|
| 716 |
+
function removeFromCart(i){
|
| 717 |
+
cart.splice(i,1);
|
| 718 |
+
localStorage.setItem('malloca_cart',JSON.stringify(cart));
|
| 719 |
+
updateCartBadge();renderCart();
|
| 720 |
+
}
|
| 721 |
+
|
| 722 |
+
function changeQty(i,delta){
|
| 723 |
+
cart[i].qty+=delta;
|
| 724 |
+
if(cart[i].qty<1)cart.splice(i,1);
|
| 725 |
+
localStorage.setItem('malloca_cart',JSON.stringify(cart));
|
| 726 |
+
updateCartBadge();renderCart();
|
| 727 |
+
}
|
| 728 |
+
|
| 729 |
+
function openCart(){
|
| 730 |
+
document.getElementById('cartOverlay').classList.add('open');
|
| 731 |
+
document.getElementById('cartDrawer').classList.add('open');
|
| 732 |
+
document.body.style.overflow='hidden';
|
| 733 |
+
renderCart();
|
| 734 |
+
}
|
| 735 |
+
|
| 736 |
+
function closeCart(){
|
| 737 |
+
document.getElementById('cartOverlay').classList.remove('open');
|
| 738 |
+
document.getElementById('cartDrawer').classList.remove('open');
|
| 739 |
+
document.body.style.overflow='';
|
| 740 |
+
}
|
| 741 |
+
|
| 742 |
+
function renderCart(){
|
| 743 |
+
let el=document.getElementById('cartItems');
|
| 744 |
+
let footer=document.getElementById('cartFooter');
|
| 745 |
+
if(!cart.length){
|
| 746 |
+
el.innerHTML=`<div class="cart-empty"><i class="fas fa-shopping-bag"></i><h3>Giỏ hàng trống</h3><p style="font-size:.82rem">Thêm sản phẩm vào giỏ để đặt hàng</p></div>`;
|
| 747 |
+
footer.style.display='none';
|
| 748 |
+
return;
|
| 749 |
+
}
|
| 750 |
+
footer.style.display='block';
|
| 751 |
+
el.innerHTML=cart.map((c,i)=>`<div class="cart-item"><img src="${c.image}" alt="${c.name}"><div class="cart-item-info"><div class="cart-item-name">${c.name}</div><div class="cart-item-price">${c.price}</div><div class="cart-item-qty"><button class="qty-btn" onclick="changeQty(${i},-1)">−</button><span class="qty-val">${c.qty}</span><button class="qty-btn" onclick="changeQty(${i},1)">+</button></div></div><button class="cart-item-del" onclick="removeFromCart(${i})"><i class="fas fa-trash"></i></button></div>`).join('');
|
| 752 |
+
let total=cart.reduce((s,c)=>s+c.priceNum*c.qty,0);
|
| 753 |
+
document.getElementById('cartTotal').textContent=total.toLocaleString('vi-VN')+'đ';
|
| 754 |
+
}
|
| 755 |
+
|
| 756 |
+
// ===== CHECKOUT =====
|
| 757 |
+
function openCheckout(){
|
| 758 |
+
closeCart();
|
| 759 |
+
let overlay=document.getElementById('checkoutOverlay');
|
| 760 |
+
overlay.classList.add('open');
|
| 761 |
+
document.body.style.overflow='hidden';
|
| 762 |
+
let total=cart.reduce((s,c)=>s+c.priceNum*c.qty,0);
|
| 763 |
+
let totalStr=total.toLocaleString('vi-VN')+'đ';
|
| 764 |
+
// Build order summary
|
| 765 |
+
let itemsHtml=cart.map(c=>`<div class="checkout-summary-item"><span>${c.name} x${c.qty}</span><span style="font-weight:600">${(c.priceNum*c.qty).toLocaleString('vi-VN')}đ</span></div>`).join('');
|
| 766 |
+
// Build QR URL (VietQR standard)
|
| 767 |
+
let qrUrl=`https://img.vietqr.io/image/VIB-918258385-compact2.jpg?amount=${total}&addInfo=${encodeURIComponent('Thanh toan don hang Malloca')}&accountName=${encodeURIComponent('TRAN QUOC VUONG')}`;
|
| 768 |
+
document.getElementById('checkoutContent').innerHTML=`
|
| 769 |
+
<h2 class="checkout-title"><i class="fas fa-qrcode" style="color:var(--a)"></i> Thanh Toán Đơn Hàng</h2>
|
| 770 |
+
<p class="checkout-sub">Quét mã QR để thanh toán qua ứng dụng ngân hàng</p>
|
| 771 |
+
<div class="checkout-summary">${itemsHtml}<div class="checkout-summary-item total"><span>Tổng cộng</span><span>${totalStr}</span></div></div>
|
| 772 |
+
<div class="form-group"><label>Họ tên người nhận *</label><input class="form-input" id="coName" placeholder="Nhập họ tên"></div>
|
| 773 |
+
<div class="form-group"><label>Số điện thoại *</label><input class="form-input" id="coPhone" placeholder="Nhập SĐT"></div>
|
| 774 |
+
<div class="form-group"><label>Địa chỉ giao hàng *</label><input class="form-input" id="coAddr" placeholder="Nhập địa chỉ đầy đủ"></div>
|
| 775 |
+
<div class="form-group"><label>Ghi chú</label><textarea class="form-input" id="coNote" placeholder="Ghi chú đơn hàng (nếu có)" style="height:70px"></textarea></div>
|
| 776 |
+
<div class="qr-section">
|
| 777 |
+
<h3 style="font-size:1rem;font-weight:700;margin-bottom:14px"><i class="fas fa-university" style="color:var(--p);margin-right:6px"></i> Chuyển khoản ngân hàng</h3>
|
| 778 |
+
<img src="${qrUrl}" alt="QR Thanh toán" onerror="this.parentElement.innerHTML+='<p style=color:red>Không tải được QR. Vui lòng chuyển khoản thủ công.</p>'">
|
| 779 |
+
<div class="qr-bank-info">
|
| 780 |
+
<strong>Ngân hàng:</strong> VIB - Ngân hàng TMCP Quốc Tế Việt Nam<br>
|
| 781 |
+
<strong>Số TK:</strong> 918258385 <button class="copy-btn" onclick="copyText('918258385')"><i class="fas fa-copy"></i> Copy</button><br>
|
| 782 |
+
<strong>Chủ TK:</strong> TRẦN QUỐC VƯƠNG<br>
|
| 783 |
+
<strong>Số tiền:</strong> <span style="color:var(--p);font-weight:800">${totalStr}</span><br>
|
| 784 |
+
<strong>Nội dung CK:</strong> Thanh toan don hang Malloca <button class="copy-btn" onclick="copyText('Thanh toan don hang Malloca')"><i class="fas fa-copy"></i> Copy</button>
|
| 785 |
+
</div>
|
| 786 |
+
</div>
|
| 787 |
+
<button class="checkout-done-btn" onclick="confirmOrder()"><i class="fas fa-check-circle"></i> Xác nhận đã thanh toán</button>
|
| 788 |
+
<p class="checkout-note">Đơn hàng sẽ được xử lý sau khi xác nhận thanh toán thành công.<br>Hotline hỗ trợ: <strong>1800 1212</strong></p>`;
|
| 789 |
+
}
|
| 790 |
+
|
| 791 |
+
function closeCheckout(){
|
| 792 |
+
document.getElementById('checkoutOverlay').classList.remove('open');
|
| 793 |
+
document.body.style.overflow='';
|
| 794 |
+
}
|
| 795 |
+
|
| 796 |
+
function copyText(text){
|
| 797 |
+
navigator.clipboard.writeText(text).then(()=>{
|
| 798 |
+
let btns=document.querySelectorAll('.copy-btn');
|
| 799 |
+
btns.forEach(b=>{if(b.previousSibling&&b.previousSibling.textContent&&b.previousSibling.textContent.includes(text)){b.innerHTML='<i class="fas fa-check"></i> Đã copy';setTimeout(()=>{b.innerHTML='<i class="fas fa-copy"></i> Copy'},2000)}});
|
| 800 |
+
});
|
| 801 |
+
}
|
| 802 |
+
|
| 803 |
+
function confirmOrder(){
|
| 804 |
+
let name=document.getElementById('coName').value.trim();
|
| 805 |
+
let phone=document.getElementById('coPhone').value.trim();
|
| 806 |
+
let addr=document.getElementById('coAddr').value.trim();
|
| 807 |
+
if(!name||!phone||!addr){alert('Vui lòng điền đầy đủ Họ tên, SĐT và Địa chỉ.');return}
|
| 808 |
+
// Clear cart
|
| 809 |
+
cart=[];localStorage.setItem('malloca_cart','[]');updateCartBadge();
|
| 810 |
+
// Show success
|
| 811 |
+
document.getElementById('checkoutContent').innerHTML=`
|
| 812 |
+
<div style="text-align:center;padding:40px 0">
|
| 813 |
+
<div style="width:80px;height:80px;background:rgba(40,167,69,.1);border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 20px"><i class="fas fa-check" style="font-size:2rem;color:#28a745"></i></div>
|
| 814 |
+
<h2 style="font-size:1.4rem;font-weight:800;color:var(--d);margin-bottom:8px">Đặt hàng thành công!</h2>
|
| 815 |
+
<p style="color:var(--g);font-size:.9rem;margin-bottom:24px">Cảm ơn bạn đã đặt hàng. Chúng tôi sẽ liên hệ xác nhận trong thời gian sớm nhất.</p>
|
| 816 |
+
<div style="background:var(--l);border-radius:12px;padding:16px;text-align:left;font-size:.85rem;color:var(--d);line-height:1.8">
|
| 817 |
+
<strong>Người nhận:</strong> ${name}<br>
|
| 818 |
+
<strong>SĐT:</strong> ${phone}<br>
|
| 819 |
+
<strong>Địa chỉ:</strong> ${addr}
|
| 820 |
+
</div>
|
| 821 |
+
<button class="checkout-done-btn" onclick="closeCheckout();showPage('products')" style="margin-top:20px"><i class="fas fa-home"></i> Về trang chủ</button>
|
| 822 |
+
</div>`;
|
| 823 |
+
}
|
| 824 |
+
|
| 825 |
+
// Contact form
|
| 826 |
+
function submitContact(e){
|
| 827 |
+
e.preventDefault();
|
| 828 |
+
let form=e.target;
|
| 829 |
+
let name=form.querySelector('#ctName').value;
|
| 830 |
+
let email=form.querySelector('#ctEmail').value;
|
| 831 |
+
let msg=form.querySelector('#ctMsg').value;
|
| 832 |
+
if(!name||!email||!msg){alert('Vui lòng điền đầy đủ thông tin.');return}
|
| 833 |
+
form.innerHTML=`<div style="text-align:center;padding:30px"><i class="fas fa-check-circle" style="font-size:2.5rem;color:#28a745;margin-bottom:12px;display:block"></i><h3 style="font-size:1.1rem;font-weight:700;margin-bottom:8px">Gửi thành công!</h3><p style="color:var(--g);font-size:.88rem">Cảm ơn bạn đã liên hệ. Chúng tôi sẽ phản hồi sớm nhất có thể.</p></div>`;
|
| 834 |
+
}
|
| 835 |
+
|
| 836 |
+
// Override goHome to also handle page nav
|
| 837 |
+
let _origGoHome=goHome;
|
| 838 |
+
goHome=function(){
|
| 839 |
+
if(document.getElementById('detailView').classList.contains('show')){
|
| 840 |
+
goBack();
|
| 841 |
+
}
|
| 842 |
+
showPage('products');resetAll();
|
| 843 |
+
}
|
| 844 |
+
|
| 845 |
+
// Init on load
|
| 846 |
+
document.addEventListener('DOMContentLoaded',()=>{
|
| 847 |
+
initCatalogue();
|
| 848 |
+
updateCartBadge();
|
| 849 |
+
});
|
| 850 |
+
|
| 851 |
</script>
|
| 852 |
</body>
|
| 853 |
</html>
|