<div class="search-container"> <h2>Tìm kiếm đơn hàng</h2> <input type="text" id="orderId" class="search-input" placeholder="Nhập mã đơn hàng"> <button class="search-button" onclick="searchOrder()">Tìm kiếm</button> <div id="result"></div> </div> <style> .search-container { background-color: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); text-align: center; max-width: 400px; margin: 0 auto; } .search-input { padding: 10px; width: 200px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; } .search-button { padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; margin-left: 10px; } .search-button:hover { background-color: #0056b3; } #result { margin-top: 20px; font-size: 18px; color: #333; } .error { color: red; } </style> <script> // Danh sách đơn hàng mẫu const orders = { "DH001": "Đơn hàng iPhone 13 Pro", "DH002": "Đơn hàng MacBook Air M1", "DH003": "Đơn hàng Samsung Galaxy Z Fold", "DH004": "Đơn hàng Tai nghe AirPods Pro" }; function searchOrder() { const orderId = document.getElementById("orderId").value.trim().toUpperCase(); const resultDiv = document.getElementById("result"); if (orderId === "") { resultDiv.innerHTML = '<span class="error">Vui lòng nhập mã đơn hàng!</span>'; return; } if (orders[orderId]) { resultDiv.innerHTML = `Tên đơn hàng: <strong>${orders[orderId]}</strong>`; } else { resultDiv.innerHTML = '<span class="error">Không tìm thấy đơn hàng với mã này!</span>'; } } </script>
Tra Cứu Đơn Hàng
11/04/2025
Tra Cứu Đơn Hàng
Danh mục:
Tra cứu đơn hàng
Chia sẻ:
Để lại một bình luận về bài viết này
Chưa có bình luận nào.