提现记录展示
body {
font-family: 'Arial', sans-serif;
background: #f5f5f5;
margin: 0;
padding: 20px;
}
.withdrawal-container {
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
padding: 20px;
max-width: 400px;
margin: 0 auto;
}
.title {
text-align: center;
color: #333;
margin-bottom: 20px;
font-size: 20px;
font-weight: bold;
}
.record-list {
list-style: none;
padding: 0;
margin: 0;
height: 180px;
overflow: hidden;
position: relative;
}
.record-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 0;
border-bottom: 1px solid #eee;
}
.record-name {
font-size: 15px;
color: #333;
}
.record-amount {
font-size: 16px;
font-weight: bold;
color: #ff4d4f;
}
.scrolling-content {
animation: scrollUp 25s linear infinite;
}
@keyframes scrollUp {
0% {
transform: translateY(0);
}
100% {
transform: translateY(-80%);
}
}
// 生成随机姓名(隐藏中间字)
function generateHiddenName() {
const surnames = ['张', '李', '王', '刘', '陈', '杨', '赵', '黄', '周', '吴'];
const names = ['伟', '芳', '娜', '秀英', '敏', '静', '丽', '强', '磊', '军', '洋', '勇', '艳', '杰', '娟', '涛', '明', '超', '秀兰', '霞'];
const surname = surnames[Math.floor(Math.random() * surnames.length)];
const name = names[Math.floor(Math.random() * names.length)];
if (name.length === 1) {
return surname + '*';
} else {
return surname + name.charAt(0) + '*' + name.slice(1);
}
}
// 生成随机金额
function generateRandomAmount() {
const amounts = [50, 88, 100, 150, 200, 250, 300, 350, 400, 450, 500, 600, 700, 800, 900, 1000];
return amounts[Math.floor(Math.random() * amounts.length)];
}
// 生成20条记录数据
function generateRecords() {
const records = [];
for (let i = 0; i < 20; i++) {
records.push({
name: generateHiddenName(),
amount: generateRandomAmount()
});
}
return records;
}
// 渲染记录列表
function renderRecords() {
const container = document.getElementById('recordsContent');
const records = generateRecords();
// 创建3条记录的DOM元素
let html = '';
for (let i = 0; i < 3; i++) {
const record = records[i];
html += `
${record.name}
¥${record.amount}
`;
}
// 复制记录以实现无缝循环
const allRecords = [...records, ...records];
for (let i = 3; i < allRecords.length; i++) {
const record = allRecords[i];
html += `
${record.name}
¥${record.amount}
`;
}
container.innerHTML = html;
}
// 页面加载时初始化
document.addEventListener('DOMContentLoaded', function() {
renderRecords();
// 每30秒刷新一次数据
setInterval(renderRecords, 30000);
});