<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>圣遗物属性发送 - 逍遥网络</title>
<style>
:root {
--primary-color: #4CAF50;
--primary-hover: #45a049;
--secondary-color: #f8f9fa;
--text-color: #333;
--light-text: #6c757d;
--border-color: #ced4da;
--box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
--transition: all 0.3s ease;
--error-color: #dc3545;
--warning-color: #ffc107;
--info-color: #17a2b8;
--purple-color: #6f42c1;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, rgba(245, 247, 250, 0.9) 0%, rgba(195, 207, 226, 0.9) 100%);
color: var(--text-color);
line-height: 1.6;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.container {
width: 100%;
max-width: 1100px;
background-color: rgba(255, 255, 255, 0.95);
border-radius: 10px;
box-shadow: var(--box-shadow);
padding: 20px;
}
.header {
text-align: center;
margin-bottom: 20px;
}
h1 {
color: var(--text-color);
margin-bottom: 10px;
font-weight: 600;
text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}
.nav-tabs {
display: flex;
background: var(--secondary-color);
border-radius: 8px;
padding: 5px;
margin-bottom: 20px;
flex-wrap: wrap;
}
.nav-tab {
flex: 1;
padding: 12px 20px;
text-align: center;
background: none;
border: none;
cursor: pointer;
border-radius: 6px;
transition: var(--transition);
font-weight: 500;
min-width: 120px;
}
.nav-tab.active {
background: var(--primary-color);
color: white;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
form {
background-color: rgba(255, 255, 255, 0.9);
padding: 30px;
border-radius: 10px;
box-shadow: var(--box-shadow);
transition: var(--transition);
}
form:hover {
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: 500;
color: var(--text-color);
}
input[type="text"],
input[type="password"],
input[type="number"],
select {
width: 100%;
padding: 12px 15px;
border: 1px solid var(--border-color);
border-radius: 6px;
font-size: 16px;
transition: var(--transition);
background-color: var(--secondary-color);
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}
.attribute_entry {
background-color: rgba(248, 249, 250, 0.8);
padding: 15px;
border-radius: 6px;
margin-bottom: 15px;
border: 1px dashed var(--border-color);
position: relative;
}
.attribute_entry label {
display: inline-block;
margin-right: 10px;
margin-bottom: 0;
}
.attribute_entry select,
.attribute_entry input[type="number"] {
width: auto;
min-width: 200px;
margin-right: 10px;
}
.remove_attribute {
background-color: var(--error-color);
color: white;
border: none;
padding: 8px 12px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: var(--transition);
}
.remove_attribute:hover {
background-color: #c82333;
}
.btn {
padding: 12px 24px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 16px;
transition: var(--transition);
font-weight: 500;
margin: 5px;
}
.btn-primary {
background-color: var(--primary-color);
color: white;
}
.btn-primary:hover {
background-color: var(--primary-hover);
}
.btn-info {
background-color: var(--info-color);
color: white;
}
.btn-info:hover {
background-color: #138496;
}
.btn-warning {
background-color: var(--warning-color);
color: var(--text-color);
}
.btn-warning:hover {
background-color: #e0a800;
}
.btn-purple {
background-color: var(--purple-color);
color: white;
}
.btn-purple:hover {
background-color: #5a359a;
}
input[type="submit"] {
width: 100%;
padding: 15px;
background-color: var(--primary-color);
color: white;
border: none;
border-radius: 6px;
font-size: 18px;
font-weight: 500;
cursor: pointer;
transition: var(--transition);
margin-top: 20px;
}
input[type="submit"]:hover {
background-color: var(--primary-hover);
transform: translateY(-2px);
}
.inputBox {
text-align: center;
margin-top: 20px;
}
.inputBox a {
color: var(--primary-color);
text-decoration: none;
font-weight: 500;
transition: var(--transition);
}
.inputBox a:hover {
text-decoration: underline;
color: var(--primary-hover);
}
#divMsg {
text-align: center;
margin-top: 15px;
color: var(--light-text);
font-size: 14px;
}
.note {
font-size: 14px;
color: var(--light-text);
margin-top: 5px;
font-style: italic;
}
.sdk-result {
margin-top: 20px;
padding: 15px;
border-radius: 6px;
text-align: center;
display: none;
}
.sdk-result.success {
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.sdk-result.error {
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.sdk-code {
font-family: 'Courier New', monospace;
font-size: 18px;
font-weight: bold;
background: #2c3e50;
color: white;
padding: 10px;
border-radius: 4px;
margin: 10px 0;
letter-spacing: 1px;
}
.sdk-codes-list {
max-height: 300px;
overflow-y: auto;
margin: 15px 0;
padding: 10px;
background: #f8f9fa;
border-radius: 6px;
border: 1px solid var(--border-color);
}
.sdk-code-item {
padding: 8px;
margin: 5px 0;
background: white;
border-radius: 4px;
border-left: 4px solid var(--primary-color);
}
.table-container {
overflow-x: auto;
margin-top: 20px;
background: white;
border-radius: 8px;
box-shadow: var(--box-shadow);
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 12px;
text-align: left;
border-bottom: 1px solid var(--border-color);
}
th {
background: var(--secondary-color);
font-weight: 600;
}
.status-used {
color: var(--error-color);
font-weight: bold;
}
.status-unused {
color: var(--primary-color);
font-weight: bold;
}
.batch-controls {
display: flex;
gap: 10px;
align-items: center;
margin-bottom: 20px;
}
.batch-count {
width: 100px;
}
.form-actions {
display: flex;
gap: 10px;
margin-top: 20px;
}
.form-actions .btn {
flex: 1;
}
@media (max-width: 768px) {
form {
padding: 20px;
}
.nav-tab {
min-width: 100px;
padding: 10px 15px;
font-size: 14px;
}
.attribute_entry select,
.attribute_entry input[type="number"] {
width: 100%;
margin-bottom: 10px;
}
.attribute_entry label {
display: block;
margin-bottom: 5px;
}
.form-actions {
flex-direction: column;
}
.batch-controls {
flex-direction: column;
align-items: stretch;
}
.batch-count {
width: 100%;
}
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>圣遗物兑换系统</h1>
<div class="inputBox">
</div>
</div>
<!-- 兑换CDK标签页 -->
<div id="sdk" class="tab-content active">
<form id="redeemForm">
<div class="form-group">
<label for="redeem_uid">UID:</label>
<input type="text" id="redeem_uid" name="uid" required placeholder="请输入您的UID">
</div>
<div class="form-group">
<label for="sdk_code">CDK兑换码:</label>
<input type="text" id="sdk_code" name="sdk_code" required placeholder="请输入12位CDK兑换码">
<div class="note">请输入12位大写字母和数字组成的CDK码</div>
</div>
<input type="hidden" name="action" value="redeem_sdk">
<input type="submit" value="兑换装备" class="btn btn-primary">
</form>
<div id="divMsg">BY 逍遥网络 2025</div>
<div id="redeemResult" class="sdk-result"></div>
</div>
</div>
<script>
// 标签页切换
function switchTab(tabName) {
// 隐藏所有标签内容
document.querySelectorAll('.tab-content').forEach(tab => {
tab.classList.remove('active');
});
// 移除所有标签的激活状态
document.querySelectorAll('.nav-tab').forEach(tab => {
tab.classList.remove('active');
});
// 显示选中的标签内容
document.getElementById(tabName).classList.add('active');
// 激活选中的标签
event.target.classList.add('active');
// 如果是管理标签页,自动加载SDK列表
if (tabName === 'manage') {
loadSDKList();
}
}
// 加载物品数据
function loadItems() {
fetch('syxywl.cn-syw.txt')
.then(response => response.text())
.then(data => {
const lines = data.split('\n');
const selects = document.querySelectorAll('#item_id, #sdk_item_id, #batch_item_id');
selects.forEach(select => {
// 清空现有选项(保留第一个提示选项)
while (select.options.length > 1) {
select.remove(1);
}
lines.forEach(line => {
if (line.trim() !== '') {
const [value, text] = line.split(':');
const option = document.createElement('option');
option.value = value;
option.textContent = text;
select.appendChild(option);
}
});
});
})
.catch(error => console.error('加载物品数据失败:', error));
}
// 加载主属性数据
function loadMainProps() {
fetch('sx1-zsx.txt')
.then(response => response.text())
.then(data => {
const lines = data.split('\n');
const selects = document.querySelectorAll('#mainPropId, #sdk_mainPropId, #batch_mainPropId');
selects.forEach(select => {
// 清空现有选项(保留第一个提示选项)
while (select.options.length > 1) {
select.remove(1);
}
lines.forEach(line => {
if (line.trim() !== '') {
const [value, text] = line.split(':');
const option = document.createElement('option');
option.value = value;
option.textContent = text;
select.appendChild(option);
}
});
});
})
.catch(error => console.error('加载主属性数据失败:', error));
}
// 加载属性数据
function loadAttributes() {
fetch('sx2-fsx.txt')
.then(response => response.text())
.then(data => {
const lines = data.split('\n');
const selects = document.querySelectorAll('.attr-select');
selects.forEach(select => {
// 清空现有选项(保留第一个提示选项)
while (select.options.length > 1) {
select.remove(1);
}
lines.forEach(line => {
if (line.trim() !== '') {
const [value, text] = line.split(':');
const option = document.createElement('option');
option.value = value;
option.textContent = text;
select.appendChild(option);
}
});
});
})
.catch(error => console.error('加载属性数据失败:', error));
}
// 页面加载完成后初始化数据
document.addEventListener('DOMContentLoaded', function() {
loadItems();
loadMainProps();
loadAttributes();
// 绑定表单提交事件
document.getElementById('redeemForm').addEventListener('submit', handleRedeemSubmit);
});
// 处理兑换SDK表单提交
function handleRedeemSubmit(e) {
e.preventDefault();
const formData = new FormData(this);
fetch('send_item.php', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
const resultDiv = document.getElementById('redeemResult');
resultDiv.className = 'sdk-result ' + (data.success ? 'success' : 'error');
resultDiv.textContent = data.message;
resultDiv.style.display = 'block';
if (data.success) {
this.reset();
setTimeout(() => {
resultDiv.style.display = 'none';
}, 5000);
}
})
.catch(error => {
console.error('Error:', error);
const resultDiv = document.getElementById('redeemResult');
resultDiv.className = 'sdk-result error';
resultDiv.textContent = '网络错误,请重试';
resultDiv.style.display = 'block';
});
}
</script>
</body>
</html>
优化显示UI 适配手机电脑平板
最新发布