616 lines
23 KiB
HTML
616 lines
23 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="vi">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Lịch sử Thanh toán - EuroTile Worker</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<link rel="stylesheet" href="assets/css/style.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<style>
|
|
.transactions-container {
|
|
max-width: 480px;
|
|
margin: 0 auto;
|
|
background: #f8fafc;
|
|
min-height: calc(100vh - 120px);
|
|
}
|
|
|
|
.tab-filters {
|
|
background: white;
|
|
display: flex;
|
|
position: sticky;
|
|
top: 60px;
|
|
z-index: 40;
|
|
border-bottom: 1px solid #e2e8f0;
|
|
}
|
|
|
|
.filter-tab {
|
|
flex: 1;
|
|
padding: 14px 8px;
|
|
text-align: center;
|
|
background: none;
|
|
border: none;
|
|
font-weight: 600;
|
|
color: #64748b;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
border-bottom: 3px solid transparent;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.filter-tab.active {
|
|
color: #2563eb;
|
|
border-bottom-color: #2563eb;
|
|
}
|
|
|
|
.transactions-list {
|
|
padding: 20px;
|
|
}
|
|
|
|
.transaction-card {
|
|
background: white;
|
|
border-radius: 12px;
|
|
padding: 16px;
|
|
margin-bottom: 12px;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.transaction-card:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 16px rgba(0,0,0,0.12);
|
|
}
|
|
|
|
.transaction-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.transaction-id {
|
|
font-weight: 700;
|
|
color: #1f2937;
|
|
font-size: 15px;
|
|
}
|
|
|
|
.transaction-datetime {
|
|
font-size: 12px;
|
|
color: #9ca3af;
|
|
}
|
|
|
|
.transaction-type {
|
|
font-size: 13px;
|
|
color: #6b7280;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.transaction-description {
|
|
font-size: 13px;
|
|
color: #6b7280;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.transaction-footer {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding-top: 8px;
|
|
border-top: 1px solid #f3f4f6;
|
|
}
|
|
|
|
.transaction-method {
|
|
font-size: 12px;
|
|
color: #6b7280;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
|
|
.transaction-amount {
|
|
font-weight: 700;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.amount-out {
|
|
color: #dc2626;
|
|
}
|
|
|
|
.amount-in {
|
|
color: #059669;
|
|
}
|
|
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 80px 20px;
|
|
color: #9ca3af;
|
|
}
|
|
|
|
.empty-state i {
|
|
font-size: 64px;
|
|
margin-bottom: 20px;
|
|
color: #d1d5db;
|
|
}
|
|
|
|
.empty-state h3 {
|
|
font-size: 18px;
|
|
font-weight: 600;
|
|
color: #374151;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.empty-state p {
|
|
font-size: 14px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
/* Payment Modal Styles */
|
|
.payment-modal {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
z-index: 1000;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 20px;
|
|
}
|
|
|
|
.payment-modal.active {
|
|
display: flex;
|
|
}
|
|
|
|
.payment-modal-content {
|
|
background: white;
|
|
border-radius: 16px;
|
|
max-width: 500px;
|
|
width: 100%;
|
|
max-height: 90vh;
|
|
overflow-y: auto;
|
|
animation: slideUp 0.3s ease;
|
|
}
|
|
|
|
@keyframes slideUp {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(20px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
.payment-modal-header {
|
|
padding: 20px;
|
|
border-bottom: 1px solid #e5e7eb;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.payment-modal-header h3 {
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
color: #1f2937;
|
|
margin: 0;
|
|
}
|
|
|
|
.payment-modal-close {
|
|
width: 32px;
|
|
height: 32px;
|
|
border-radius: 50%;
|
|
background: #f3f4f6;
|
|
border: none;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.payment-modal-close:hover {
|
|
background: #e5e7eb;
|
|
}
|
|
|
|
.payment-modal-body {
|
|
padding: 20px;
|
|
}
|
|
|
|
.payment-detail-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 12px 0;
|
|
border-bottom: 1px solid #f3f4f6;
|
|
}
|
|
|
|
.payment-detail-row:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.payment-detail-label {
|
|
color: #6b7280;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.payment-detail-value {
|
|
color: #1f2937;
|
|
font-weight: 600;
|
|
font-size: 14px;
|
|
text-align: right;
|
|
}
|
|
|
|
.payment-detail-value.amount {
|
|
font-size: 20px;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.payment-detail-value.amount-out {
|
|
color: #dc2626;
|
|
}
|
|
|
|
.payment-detail-value.amount-in {
|
|
color: #059669;
|
|
}
|
|
|
|
.payment-receipt-image {
|
|
margin-top: 20px;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
border: 1px solid #e5e7eb;
|
|
}
|
|
|
|
.payment-receipt-image img {
|
|
width: 100%;
|
|
height: auto;
|
|
display: block;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.transactions-list {
|
|
padding: 15px;
|
|
}
|
|
|
|
.transaction-card {
|
|
padding: 14px;
|
|
}
|
|
|
|
.payment-modal-content {
|
|
margin: 20px;
|
|
max-height: calc(100vh - 40px);
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="page-wrapper">
|
|
<!-- Header -->
|
|
<div class="header">
|
|
<a href="account.html" class="back-button">
|
|
<i class="fas fa-arrow-left"></i>
|
|
</a>
|
|
<h1 class="header-title">Lịch sử Thanh toán</h1>
|
|
<div style="width: 32px;"></div>
|
|
</div>
|
|
|
|
<div class="transactions-container">
|
|
<!-- Tab Filters -->
|
|
<!--<div class="tab-filters">
|
|
<button class="filter-tab active" onclick="filterTransactions('all')">
|
|
Tất cả
|
|
</button>
|
|
<button class="filter-tab" onclick="filterTransactions('in')">
|
|
Tiền vào
|
|
</button>
|
|
<button class="filter-tab" onclick="filterTransactions('out')">
|
|
Tiền ra
|
|
</button>
|
|
</div>-->
|
|
|
|
<!-- Transactions List -->
|
|
<div class="transactions-list" id="transactions-list">
|
|
<!-- Transaction 1 - Payment Out -->
|
|
<div class="transaction-card" data-type="out" onclick="openTransactionModal('PAY20240001', 'out', '6.385.500đ', 'Chuyển khoản', '03/08/2024 - 14:30', 'Thanh toán cho Đơn hàng #DH001234', 'TK20241020001', 'https://placehold.co/600x400/E8F4FD/005B9A/png?text=Bi%C3%AAn+lai+thanh+to%C3%A1n')">
|
|
<div class="transaction-header">
|
|
<span class="transaction-id">#PAY20240001</span>
|
|
<span class="transaction-datetime">03/08/2024 - 14:30</span>
|
|
</div>
|
|
<!--<div class="transaction-type">Thanh toán</div>-->
|
|
<div class="transaction-description">Thanh toán cho Đơn hàng #DH001234</div>
|
|
<div class="transaction-footer">
|
|
<div class="transaction-method">
|
|
<i class="fas fa-university"></i>
|
|
<span>Chuyển khoản</span>
|
|
</div>
|
|
<div class="transaction-amount amount-out">6.385.500đ</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Transaction 2 - Payment Out -->
|
|
<div class="transaction-card" data-type="out" onclick="openTransactionModal('PAY20240002', 'out', '6.385.500đ', 'Tiền mặt', '05/08/2024 - 09:15', 'Thanh toán cho Đơn hàng #DH001234', 'CASH-20240805-001', '')">
|
|
<div class="transaction-header">
|
|
<span class="transaction-id">#PAY20240002</span>
|
|
<span class="transaction-datetime">05/08/2024 - 09:15</span>
|
|
</div>
|
|
<!--<div class="transaction-type">Thanh toán</div>-->
|
|
<div class="transaction-description">Thanh toán cho Đơn hàng #DH001234</div>
|
|
<div class="transaction-footer">
|
|
<div class="transaction-method">
|
|
<i class="fas fa-money-bill-wave"></i>
|
|
<span>Tiền mặt</span>
|
|
</div>
|
|
<div class="transaction-amount amount-out">6.385.500đ</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Transaction 3 - Refund In -->
|
|
<!--<div class="transaction-card" data-type="in" onclick="openTransactionModal('REF20240001', 'in', '850.000đ', 'Chuyển khoản', '12/07/2024 - 16:20', 'Hoàn tiền từ Đơn hàng #DH000987', 'REF-20240712-001', '')">
|
|
<div class="transaction-header">
|
|
<span class="transaction-id">#REF20240001</span>
|
|
<span class="transaction-datetime">12/07/2024 - 16:20</span>
|
|
</div>
|
|
<div class="transaction-type">Hoàn tiền</div>
|
|
<div class="transaction-description">Hoàn tiền từ Đơn hàng #DH000987</div>
|
|
<div class="transaction-footer">
|
|
<div class="transaction-method">
|
|
<i class="fas fa-university"></i>
|
|
<span>Chuyển khoản</span>
|
|
</div>
|
|
<div class="transaction-amount amount-in">+850.000đ</div>
|
|
</div>
|
|
</div>-->
|
|
|
|
<!-- Transaction 4 - Payment Out -->
|
|
<div class="transaction-card" data-type="out" onclick="openTransactionModal('PAY20240003', 'out', '42.500.000đ', 'Chuyển khoản', '25/06/2024 - 10:45', 'Thanh toán cho Đơn hàng #DH000856', 'TK20240625002', 'https://placehold.co/600x400/E8F4FD/005B9A/png?text=Bi%C3%AAn+lai+TT')">
|
|
<div class="transaction-header">
|
|
<span class="transaction-id">#PAY20240003</span>
|
|
<span class="transaction-datetime">25/06/2024 - 10:45</span>
|
|
</div>
|
|
<!--<div class="transaction-type">Thanh toán</div>-->
|
|
<div class="transaction-description">Thanh toán cho Đơn hàng #DH000856</div>
|
|
<div class="transaction-footer">
|
|
<div class="transaction-method">
|
|
<i class="fas fa-university"></i>
|
|
<span>Chuyển khoản</span>
|
|
</div>
|
|
<div class="transaction-amount amount-out">42.500.000đ</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Transaction 5 - Payment Out -->
|
|
<div class="transaction-card" data-type="out" onclick="openTransactionModal('PAY20240004', 'out', '15.200.000đ', 'Tiền mặt', '10/06/2024 - 14:00', 'Thanh toán cho Đơn hàng #DH000745', 'CASH-20240610-002', '')">
|
|
<div class="transaction-header">
|
|
<span class="transaction-id">#PAY20240004</span>
|
|
<span class="transaction-datetime">10/06/2024 - 14:00</span>
|
|
</div>
|
|
<!--<div class="transaction-type">Thanh toán</div>-->
|
|
<div class="transaction-description">Thanh toán cho Đơn hàng #DH000745</div>
|
|
<div class="transaction-footer">
|
|
<div class="transaction-method">
|
|
<i class="fas fa-money-bill-wave"></i>
|
|
<span>Tiền mặt</span>
|
|
</div>
|
|
<div class="transaction-amount amount-out">15.200.000đ</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Transaction 6 - Refund In -->
|
|
<!--<div class="transaction-card" data-type="in" onclick="openTransactionModal('REF20240002', 'in', '3.200.000đ', 'Chuyển khoản', '28/05/2024 - 11:30', 'Hoàn tiền từ Đơn hàng #DH000621', 'REF-20240528-001', '')">
|
|
<div class="transaction-header">
|
|
<span class="transaction-id">#REF20240002</span>
|
|
<span class="transaction-datetime">28/05/2024 - 11:30</span>
|
|
</div>
|
|
<div class="transaction-type">Hoàn tiền</div>
|
|
<div class="transaction-description">Hoàn tiền từ Đơn hàng #DH000621</div>
|
|
<div class="transaction-footer">
|
|
<div class="transaction-method">
|
|
<i class="fas fa-university"></i>
|
|
<span>Chuyển khoản</span>
|
|
</div>
|
|
<div class="transaction-amount amount-in">+3.200.000đ</div>
|
|
</div>
|
|
</div>-->
|
|
|
|
<!-- Transaction 7 - Payment Out -->
|
|
<div class="transaction-card" data-type="out" onclick="openTransactionModal('PAY20240005', 'out', '28.750.000đ', 'Chuyển khoản', '15/05/2024 - 09:20', 'Thanh toán cho Đơn hàng #DH000589', 'TK20240515003', 'https://placehold.co/600x400/E8F4FD/005B9A/png?text=Bi%C3%AAn+lai')">
|
|
<div class="transaction-header">
|
|
<span class="transaction-id">#PAY20240005</span>
|
|
<span class="transaction-datetime">15/05/2024 - 09:20</span>
|
|
</div>
|
|
<!--<div class="transaction-type">Thanh toán</div>-->
|
|
<div class="transaction-description">Thanh toán cho Đơn hàng #DH000589</div>
|
|
<div class="transaction-footer">
|
|
<div class="transaction-method">
|
|
<i class="fas fa-university"></i>
|
|
<span>Chuyển khoản</span>
|
|
</div>
|
|
<div class="transaction-amount amount-out">28.750.000đ</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Payment Detail Modal -->
|
|
<div id="paymentModal" class="payment-modal">
|
|
<div class="payment-modal-content">
|
|
<div class="payment-modal-header">
|
|
<h3>Chi tiết giao dịch</h3>
|
|
<button class="payment-modal-close" onclick="closePaymentModal()">
|
|
<i class="fas fa-times"></i>
|
|
</button>
|
|
</div>
|
|
<div class="payment-modal-body">
|
|
<div class="payment-detail-row">
|
|
<span class="payment-detail-label">Mã giao dịch:</span>
|
|
<span class="payment-detail-value" id="modal-transaction-id"></span>
|
|
</div>
|
|
<div class="payment-detail-row">
|
|
<span class="payment-detail-label">Loại giao dịch:</span>
|
|
<span class="payment-detail-value" id="modal-transaction-type"></span>
|
|
</div>
|
|
<div class="payment-detail-row">
|
|
<span class="payment-detail-label">Thời gian:</span>
|
|
<span class="payment-detail-value" id="modal-datetime"></span>
|
|
</div>
|
|
<div class="payment-detail-row">
|
|
<span class="payment-detail-label">Phương thức:</span>
|
|
<span class="payment-detail-value" id="modal-method"></span>
|
|
</div>
|
|
<div class="payment-detail-row">
|
|
<span class="payment-detail-label">Mô tả:</span>
|
|
<span class="payment-detail-value" id="modal-description"></span>
|
|
</div>
|
|
<div class="payment-detail-row">
|
|
<span class="payment-detail-label">Mã tham chiếu:</span>
|
|
<span class="payment-detail-value" id="modal-reference"></span>
|
|
</div>
|
|
<div class="payment-detail-row">
|
|
<span class="payment-detail-label">Số tiền:</span>
|
|
<span class="payment-detail-value amount" id="modal-amount"></span>
|
|
</div>
|
|
<!--<div id="modal-receipt-container" class="payment-receipt-image" style="display: none;">
|
|
<img id="modal-receipt-image" src="" alt="Biên lai thanh toán">
|
|
</div>-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function filterTransactions(type) {
|
|
// Update active tab
|
|
document.querySelectorAll('.filter-tab').forEach(tab => {
|
|
tab.classList.remove('active');
|
|
});
|
|
event.target.classList.add('active');
|
|
|
|
// Filter transaction cards
|
|
const cards = document.querySelectorAll('.transaction-card');
|
|
let visibleCount = 0;
|
|
|
|
cards.forEach(card => {
|
|
const cardType = card.getAttribute('data-type');
|
|
|
|
if (type === 'all') {
|
|
card.style.display = 'block';
|
|
visibleCount++;
|
|
} else {
|
|
if (cardType === type) {
|
|
card.style.display = 'block';
|
|
visibleCount++;
|
|
} else {
|
|
card.style.display = 'none';
|
|
}
|
|
}
|
|
});
|
|
|
|
// Show empty state if no results
|
|
if (visibleCount === 0) {
|
|
showEmptyState(type);
|
|
} else {
|
|
hideEmptyState();
|
|
}
|
|
}
|
|
|
|
function showEmptyState(filterType) {
|
|
const existingEmptyState = document.querySelector('.empty-state');
|
|
if (existingEmptyState) {
|
|
existingEmptyState.remove();
|
|
}
|
|
|
|
const transactionsList = document.getElementById('transactions-list');
|
|
const emptyState = document.createElement('div');
|
|
emptyState.className = 'empty-state';
|
|
|
|
let message = '';
|
|
switch(filterType) {
|
|
case 'in':
|
|
message = 'Không có giao dịch tiền vào';
|
|
break;
|
|
case 'out':
|
|
message = 'Không có giao dịch tiền ra';
|
|
break;
|
|
default:
|
|
message = 'Không có giao dịch nào';
|
|
}
|
|
|
|
emptyState.innerHTML = `
|
|
<i class="fas fa-receipt"></i>
|
|
<h3>${message}</h3>
|
|
<p>Hiện tại không có giao dịch nào trong danh mục này</p>
|
|
`;
|
|
|
|
transactionsList.appendChild(emptyState);
|
|
}
|
|
|
|
function hideEmptyState() {
|
|
const existingEmptyState = document.querySelector('.empty-state');
|
|
if (existingEmptyState) {
|
|
existingEmptyState.remove();
|
|
}
|
|
}
|
|
|
|
function openTransactionModal(transactionId, type, amount, method, datetime, description, reference, receiptImage) {
|
|
document.getElementById('modal-transaction-id').textContent = transactionId;
|
|
|
|
const transactionTypeElement = document.getElementById('modal-transaction-type');
|
|
transactionTypeElement.textContent = type === 'in' ? 'Tiền vào (Hoàn tiền)' : 'Tiền ra (Thanh toán)';
|
|
|
|
const amountElement = document.getElementById('modal-amount');
|
|
amountElement.textContent = (type === 'out' ? '-' : '+') + amount;
|
|
amountElement.className = 'payment-detail-value amount ' + (type === 'out' ? 'amount-out' : 'amount-in');
|
|
|
|
document.getElementById('modal-method').textContent = method;
|
|
document.getElementById('modal-datetime').textContent = datetime;
|
|
document.getElementById('modal-description').textContent = description;
|
|
document.getElementById('modal-reference').textContent = reference;
|
|
|
|
const receiptContainer = document.getElementById('modal-receipt-container');
|
|
const receiptImg = document.getElementById('modal-receipt-image');
|
|
|
|
if (receiptImage && receiptImage !== '') {
|
|
receiptImg.src = receiptImage;
|
|
receiptContainer.style.display = 'block';
|
|
} else {
|
|
receiptContainer.style.display = 'none';
|
|
}
|
|
|
|
document.getElementById('paymentModal').classList.add('active');
|
|
document.body.style.overflow = 'hidden';
|
|
}
|
|
|
|
function closePaymentModal() {
|
|
document.getElementById('paymentModal').classList.remove('active');
|
|
document.body.style.overflow = 'auto';
|
|
}
|
|
|
|
// Close modal when clicking outside
|
|
document.getElementById('paymentModal')?.addEventListener('click', function(e) {
|
|
if (e.target === this) {
|
|
closePaymentModal();
|
|
}
|
|
});
|
|
|
|
// Initialize page
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Add animation to cards
|
|
const cards = document.querySelectorAll('.transaction-card');
|
|
cards.forEach((card, index) => {
|
|
card.style.opacity = '0';
|
|
card.style.transform = 'translateY(20px)';
|
|
card.style.transition = 'all 0.5s ease';
|
|
|
|
setTimeout(() => {
|
|
card.style.opacity = '1';
|
|
card.style.transform = 'translateY(0)';
|
|
}, index * 50);
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |