add price policy
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user