add price policy

This commit is contained in:
Phuoc Nguyen
2025-11-03 11:20:09 +07:00
parent c0527a086c
commit 21c1c3372c
53 changed files with 7160 additions and 2361 deletions

View File

@@ -54,8 +54,8 @@
<div class="text-center mt-3">
<p class="text-small text-muted">
Không nhận được mã?
<a href="#" class="text-primary" style="text-decoration: none; font-weight: 500;">
Gửi lại (60s)
<a href="#" id="resendLink" class="text-muted" style="text-decoration: none; font-weight: 500; cursor: not-allowed;">
Gửi lại (<span id="countdown">60</span>s)
</a>
</p>
</div>
@@ -91,6 +91,47 @@
}
});
});
// Countdown timer for resend OTP
let countdown = 60;
const countdownElement = document.getElementById('countdown');
const resendLink = document.getElementById('resendLink');
function startCountdown() {
const timer = setInterval(() => {
countdown--;
countdownElement.textContent = countdown;
if (countdown <= 0) {
clearInterval(timer);
// Enable resend button
resendLink.textContent = 'Gửi lại';
resendLink.className = 'text-primary';
resendLink.style.cursor = 'pointer';
resendLink.addEventListener('click', handleResendOTP);
}
}, 1000);
}
function handleResendOTP(e) {
e.preventDefault();
// Reset countdown
countdown = 60;
countdownElement.textContent = countdown;
resendLink.textContent = 'Gửi lại (' + countdown + 's)';
resendLink.className = 'text-muted';
resendLink.style.cursor = 'not-allowed';
resendLink.removeEventListener('click', handleResendOTP);
// Simulate sending OTP
alert('Mã OTP mới đã được gửi!');
// Restart countdown
startCountdown();
}
// Start countdown when page loads
document.addEventListener('DOMContentLoaded', startCountdown);
</script>
</body>
</html>