字段全部必填
This commit is contained in:
parent
e74856423f
commit
fba1c4f672
|
@ -1,6 +1,6 @@
|
||||||
function showCustomAlert(message) {
|
function showCustomAlert(message) {
|
||||||
const alertBox = document.getElementById('customAlert');
|
const alertBox = document.getElementById('customAlert');
|
||||||
alertBox.innerText = message;
|
alertBox.innerHTML = message;
|
||||||
alertBox.style.display = 'block';
|
alertBox.style.display = 'block';
|
||||||
alertBox.style.opacity = '1';
|
alertBox.style.opacity = '1';
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@ function handleMultipleAddresses(walletAddresses) {
|
||||||
openAddressModal();
|
openAddressModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let paymentInterval;
|
||||||
function openPaymentModal(orderId, amount, orderCreateTimestamp, orderExpirationTime) {
|
function openPaymentModal(orderId, amount, orderCreateTimestamp, orderExpirationTime) {
|
||||||
document.getElementById('paymentModal').style.display = 'flex';
|
document.getElementById('paymentModal').style.display = 'flex';
|
||||||
|
|
||||||
|
@ -89,18 +90,25 @@ function openPaymentModal(orderId, amount, orderCreateTimestamp, orderExpiration
|
||||||
|
|
||||||
// 如果时间到了,停止更新
|
// 如果时间到了,停止更新
|
||||||
if (remainingTime <= 0) {
|
if (remainingTime <= 0) {
|
||||||
clearInterval(interval);
|
if (paymentInterval) {
|
||||||
|
clearInterval(paymentInterval);
|
||||||
|
paymentInterval = null;
|
||||||
|
}
|
||||||
orderInfoElement.innerHTML = `<p style="color: red">Order ${orderId} has expired, please place a new order.</p>`;
|
orderInfoElement.innerHTML = `<p style="color: red">Order ${orderId} has expired, please place a new order.</p>`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 开始倒计时
|
// 开始倒计时
|
||||||
const interval = setInterval(updateRemainingTime, 1000);
|
paymentInterval = setInterval(updateRemainingTime, 1000);
|
||||||
updateRemainingTime(); // 立即更新一次
|
updateRemainingTime(); // 立即更新一次
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function closePaymentModal() {
|
function closePaymentModal() {
|
||||||
|
if (paymentInterval) {
|
||||||
|
clearInterval(paymentInterval);
|
||||||
|
paymentInterval = null;
|
||||||
|
}
|
||||||
document.getElementById('paymentModal').style.display = 'none';
|
document.getElementById('paymentModal').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,11 +248,26 @@ function finishOrder() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
|
|
||||||
const name = document.getElementById('nickname').value.trim();
|
const name = document.getElementById('nickname').value.trim();
|
||||||
const phone = document.getElementById('phone').value.trim();
|
const phone = document.getElementById('phone').value.trim();
|
||||||
const email = document.getElementById('email').value.trim();
|
const email = document.getElementById('email').value.trim();
|
||||||
const walletAddress = document.getElementById('wallet').value.trim();
|
const walletAddress = document.getElementById('wallet').value.trim();
|
||||||
|
|
||||||
|
// Check if any field is empty
|
||||||
|
if (!name) {
|
||||||
|
openAlertModal("Please enter your game nickname.");
|
||||||
|
document.getElementById('nickname').focus(); // Focus on the name field
|
||||||
|
} else if (!phone) {
|
||||||
|
openAlertModal("Please enter your phone number.");
|
||||||
|
document.getElementById('phone').focus(); // Focus on the phone field
|
||||||
|
} else if (!email) {
|
||||||
|
openAlertModal("Please enter your email.");
|
||||||
|
document.getElementById('email').focus(); // Focus on the email field
|
||||||
|
} else if (!walletAddress) {
|
||||||
|
openAlertModal("Please enter your wallet address.");
|
||||||
|
document.getElementById('wallet').focus(); // Focus on the wallet field
|
||||||
|
} else {
|
||||||
const queryParams = {
|
const queryParams = {
|
||||||
name: name,
|
name: name,
|
||||||
phone: phone,
|
phone: phone,
|
||||||
|
@ -254,6 +277,7 @@ function handleQuery() {
|
||||||
sessionStorage.setItem('queryParams', JSON.stringify(queryParams));
|
sessionStorage.setItem('queryParams', JSON.stringify(queryParams));
|
||||||
window.location.href = '/orderDetails.html';
|
window.location.href = '/orderDetails.html';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function handleError(message) {
|
function handleError(message) {
|
||||||
|
|
Loading…
Reference in New Issue