developing

This commit is contained in:
wystan_rin 2024-11-21 20:11:16 +08:00
parent ab7d4bed72
commit 6b74a12ede
4 changed files with 16 additions and 25 deletions

View File

@ -12,6 +12,6 @@
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
z-index: 1000; z-index: 1000;
opacity: 0; opacity: 0;
transition: opacity 0.3s ease-in-out; transition: opacity 1s ease-in-out;
text-align: center; text-align: center;
} }

View File

@ -152,15 +152,6 @@
</div> </div>
</div> </div>
</div> </div>
<div id="alertModal" class="modal" style="display: none;">
<div class="modal-content">
<div class="modal-header" id="alertMessage">
</div>
<div class="modal-footer">
<button onclick="closeAlertModal()">Close</button>
</div>
</div>
</div>
<div id="customAlert" class="custom-alert"></div> <div id="customAlert" class="custom-alert"></div>
<script> <script>
function copyText(text) { function copyText(text) {

View File

@ -1,6 +1,6 @@
function showCustomAlert(message) { function showCustomAlert(message) {
const alertBox = document.getElementById('customAlert'); const alertBox = document.getElementById('customAlert');
alertBox.textContent = message; alertBox.innerText = message;
alertBox.style.display = 'block'; alertBox.style.display = 'block';
alertBox.style.opacity = '1'; alertBox.style.opacity = '1';
@ -10,6 +10,6 @@ function showCustomAlert(message) {
// 等到过渡效果结束再隐藏元素 // 等到过渡效果结束再隐藏元素
setTimeout(() => { setTimeout(() => {
alertBox.style.display = 'none'; alertBox.style.display = 'none';
}, 300); // 与过渡时间一致 }, 1000); // 与过渡时间一致
}, 3000); }, 5000);
} }

View File

@ -32,7 +32,6 @@ document.addEventListener('DOMContentLoaded', () => {
}); });
const completeBtn = document.getElementById('completeBtn'); const completeBtn = document.getElementById('completeBtn');
completeBtn.addEventListener('click', () => { completeBtn.addEventListener('click', () => {
closePaymentModal();
finishOrder(); finishOrder();
}); });
@ -115,16 +114,17 @@ function closeAddressModal() {
addressList.innerHTML = ''; addressList.innerHTML = '';
} }
function closeAlertModal() { // function closeAlertModal() {
document.getElementById('alertModal').style.display = 'none'; // document.getElementById('alertModal').style.display = 'none';
const alertElement = document.getElementById("alertMessage") // const alertElement = document.getElementById("alertMessage")
alertElement.innerText = ""; // alertElement.innerText = "";
} // }
function openAlertModal(message) { function openAlertModal(message) {
document.getElementById("alertMessage").innerText = message; // document.getElementById("alertMessage").innerText = message;
document.getElementById('alertModal').style.display = 'flex'; // document.getElementById('alertModal').style.display = 'flex';
setTimeout(closeAlertModal, 5000); // setTimeout(closeAlertModal, 5000);
showCustomAlert(message)
} }
function closeModalOnClickOutside(event) { function closeModalOnClickOutside(event) {
@ -223,8 +223,11 @@ function finishOrder() {
// 订单超时, 联系客服 // 订单超时, 联系客服
openAlertModal("<h2>The order has timed out. Please contact customer support if you have any questions.</h2>"); openAlertModal("<h2>The order has timed out. Please contact customer support if you have any questions.</h2>");
} else if (data.status === 1) { } else if (data.status === 1) {
closePaymentModal();
const createOrderElement = document.getElementById('createOrder'); const createOrderElement = document.getElementById('createOrder');
createOrderElement.textContent = 'Gain More Points!!!'; createOrderElement.textContent = 'Gain More Points!!!';
} else if (data.status === 2) {
openAlertModal("<h2>\"Transaction not found. Please check your payment order or contact support for assistance.\"</h2>")
} else if (data.status === 3) { } else if (data.status === 3) {
openAlertModal("<h2>The payment amount is abnormal. Please contact customer support if you have any questions.</h2>"); openAlertModal("<h2>The payment amount is abnormal. Please contact customer support if you have any questions.</h2>");
} }
@ -242,9 +245,6 @@ function handleQuery() {
const email = document.getElementById('email').value.trim(); const email = document.getElementById('email').value.trim();
const payment_address = document.getElementById('wallet').value.trim(); const payment_address = document.getElementById('wallet').value.trim();
// 清除之前的消息
// document.getElementById('message').classList.add('hidden');
// 调用createOrder函数 // 调用createOrder函数
queryOrder(name, phone, email, payment_address); queryOrder(name, phone, email, payment_address);
} }