第65批-续3:弹窗毛玻璃化(showModal毛玻璃风格)
This commit is contained in:
@@ -2082,25 +2082,25 @@ function showModal(title, message, defaultValue, customHtml) {
|
|||||||
document.querySelectorAll('[data-modal-overlay]').forEach(el => el.remove());
|
document.querySelectorAll('[data-modal-overlay]').forEach(el => el.remove());
|
||||||
const overlay = document.createElement('div');
|
const overlay = document.createElement('div');
|
||||||
overlay.dataset.modalOverlay = '1';
|
overlay.dataset.modalOverlay = '1';
|
||||||
overlay.style.cssText = 'position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.6);display:flex;justify-content:center;align-items:center;z-index:1000';
|
overlay.style.cssText = 'position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.4);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;justify-content:center;align-items:center;z-index:1000;animation:glassFadeIn 0.2s ease';
|
||||||
if (customHtml) {
|
if (customHtml) {
|
||||||
overlay.innerHTML = `
|
overlay.innerHTML = `
|
||||||
<div style="background:var(--card);border:1px solid var(--border);border-radius:12px;padding:24px;width:400px;max-width:90%">
|
<div style="background:rgba(22,27,34,0.92);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid rgba(88,166,255,0.25);border-radius:16px;padding:24px;width:400px;max-width:90%;box-shadow:0 12px 48px rgba(0,0,0,0.5),inset 0 1px 0 rgba(255,255,255,0.05);animation:glassSlideUp 0.3s ease">
|
||||||
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px">
|
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px">
|
||||||
<h3 style="margin:0">${title}</h3>
|
<h3 style="margin:0;color:#e6edf3">${title}</h3>
|
||||||
<span class="modal-close" style="cursor:pointer;font-size:18px;color:var(--dim)" onclick="this.closest('div[style*=fixed]').remove()">✕</span>
|
<span class="modal-close" style="cursor:pointer;font-size:18px;color:#8b949e" onclick="this.closest('div[style*=fixed]').remove()">✕</span>
|
||||||
</div>
|
</div>
|
||||||
${customHtml}
|
${customHtml}
|
||||||
</div>`;
|
</div>`;
|
||||||
} else {
|
} else {
|
||||||
overlay.innerHTML = `
|
overlay.innerHTML = `
|
||||||
<div style="background:var(--card);border:1px solid var(--border);border-radius:12px;padding:24px;width:400px;max-width:90%">
|
<div style="background:rgba(22,27,34,0.92);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid rgba(88,166,255,0.25);border-radius:16px;padding:24px;width:400px;max-width:90%;box-shadow:0 12px 48px rgba(0,0,0,0.5),inset 0 1px 0 rgba(255,255,255,0.05);animation:glassSlideUp 0.3s ease">
|
||||||
<h3 style="margin-bottom:12px">${title}</h3>
|
<h3 style="margin-bottom:12px;color:#e6edf3">${title}</h3>
|
||||||
<p style="color:var(--dim);font-size:13px;margin-bottom:12px">${message}</p>
|
<p style="color:#8b949e;font-size:13px;margin-bottom:12px">${message}</p>
|
||||||
<input type="text" id="modalInput" value="${defaultValue}" style="width:100%;padding:8px 12px;background:var(--bg);border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:14px;box-sizing:border-box">
|
<input type="text" id="modalInput" value="${defaultValue}" style="width:100%;padding:8px 12px;background:rgba(13,17,23,0.8);border:1px solid rgba(88,166,255,0.3);border-radius:8px;color:#e6edf3;font-size:14px;box-sizing:border-box;outline:none;transition:border 0.2s">
|
||||||
<div style="display:flex;gap:8px;justify-content:flex-end;margin-top:16px">
|
<div style="display:flex;gap:8px;justify-content:flex-end;margin-top:16px">
|
||||||
<button class="btn" id="modalCancel">取消</button>
|
<button class="btn" id="modalCancel" style="background:rgba(255,255,255,0.08);color:#8b949e;border:none;border-radius:8px;padding:8px 16px;cursor:pointer;font-size:13px;font-weight:600">取消</button>
|
||||||
<button class="btn btn-blue" id="modalConfirm">确认</button>
|
<button class="btn btn-blue" id="modalConfirm" style="background:#58a6ff;color:#fff;border:none;border-radius:8px;padding:8px 16px;cursor:pointer;font-size:13px;font-weight:600">确认</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
@@ -3487,7 +3487,7 @@ async function loadCredit(el) {
|
|||||||
html += '</div>';
|
html += '</div>';
|
||||||
// ★ 修复阈值显示:区分低于/高于
|
// ★ 修复阈值显示:区分低于/高于
|
||||||
let thresholdText = '';
|
let thresholdText = '';
|
||||||
if (r.min_score > 0 || r.min_score < 0) {
|
if (r.min_score != 0) {
|
||||||
thresholdText = '低于 ' + r.min_score + ' 分触发';
|
thresholdText = '低于 ' + r.min_score + ' 分触发';
|
||||||
} else if (r.max_score > 0) {
|
} else if (r.max_score > 0) {
|
||||||
thresholdText = '高于 ' + r.max_score + ' 分触发';
|
thresholdText = '高于 ' + r.max_score + ' 分触发';
|
||||||
|
|||||||
+54
-1
@@ -496,7 +496,60 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
success(['synced' => count($playerData ?? []) . ' players, ' . count($recordData ?? []) . ' records'], 'Java同步推送成功');
|
// ★ 第65批修复(#341):接收 Java 端推送的规则(双向交换)
|
||||||
|
// Java 推规则时把本地完整状态推回,PHP 端按 rule_name 匹配更新
|
||||||
|
// 开关状态由 Java 端决定(Java 最后改的说了算)
|
||||||
|
$ruleData = getParam('rules', null);
|
||||||
|
if (is_string($ruleData)) $ruleData = json_decode($ruleData, true);
|
||||||
|
if (!is_array($ruleData)) $ruleData = [];
|
||||||
|
|
||||||
|
if (!empty($ruleData)) {
|
||||||
|
foreach ($ruleData as $r) {
|
||||||
|
$ruleName = $r['rule_name'] ?? '';
|
||||||
|
if (!$ruleName) continue;
|
||||||
|
$minScore = (int)($r['min_score'] ?? 0);
|
||||||
|
$maxScore = (int)($r['max_score'] ?? 0);
|
||||||
|
$restrictionType = $r['restriction_type'] ?? '';
|
||||||
|
$restrictionDuration = (int)($r['restriction_duration'] ?? 0);
|
||||||
|
$enabled = (int)($r['enabled'] ?? 0);
|
||||||
|
$description = $r['description'] ?? '';
|
||||||
|
$limitAmount = (float)($r['limit_amount'] ?? 0);
|
||||||
|
$multiplier = (float)($r['multiplier'] ?? 0);
|
||||||
|
$amount = (float)($r['amount'] ?? 0);
|
||||||
|
|
||||||
|
// 按 rule_name 匹配更新
|
||||||
|
$stmt = $db->prepare("UPDATE credit_rules SET min_score=?, max_score=?, restriction_type=?, restriction_duration=?, enabled=?, description=?, limit_amount=?, multiplier=?, amount=? WHERE rule_name=?");
|
||||||
|
$stmt->bindValue(1, $minScore, SQLITE3_INTEGER);
|
||||||
|
$stmt->bindValue(2, $maxScore, SQLITE3_INTEGER);
|
||||||
|
$stmt->bindValue(3, $restrictionType, SQLITE3_TEXT);
|
||||||
|
$stmt->bindValue(4, $restrictionDuration, SQLITE3_INTEGER);
|
||||||
|
$stmt->bindValue(5, $enabled, SQLITE3_INTEGER);
|
||||||
|
$stmt->bindValue(6, $description, SQLITE3_TEXT);
|
||||||
|
$stmt->bindValue(7, $limitAmount, SQLITE3_FLOAT);
|
||||||
|
$stmt->bindValue(8, $multiplier, SQLITE3_FLOAT);
|
||||||
|
$stmt->bindValue(9, $amount, SQLITE3_FLOAT);
|
||||||
|
$stmt->bindValue(10, $ruleName, SQLITE3_TEXT);
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
// PHP 没有的规则则插入
|
||||||
|
if ($stmt->changes() === 0) {
|
||||||
|
$stmt2 = $db->prepare("INSERT OR IGNORE INTO credit_rules (rule_name, min_score, max_score, restriction_type, restriction_duration, enabled, description, limit_amount, multiplier, amount) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
|
$stmt2->bindValue(1, $ruleName, SQLITE3_TEXT);
|
||||||
|
$stmt2->bindValue(2, $minScore, SQLITE3_INTEGER);
|
||||||
|
$stmt2->bindValue(3, $maxScore, SQLITE3_INTEGER);
|
||||||
|
$stmt2->bindValue(4, $restrictionType, SQLITE3_TEXT);
|
||||||
|
$stmt2->bindValue(5, $restrictionDuration, SQLITE3_INTEGER);
|
||||||
|
$stmt2->bindValue(6, $enabled, SQLITE3_INTEGER);
|
||||||
|
$stmt2->bindValue(7, $description, SQLITE3_TEXT);
|
||||||
|
$stmt2->bindValue(8, $limitAmount, SQLITE3_FLOAT);
|
||||||
|
$stmt2->bindValue(9, $multiplier, SQLITE3_FLOAT);
|
||||||
|
$stmt2->bindValue(10, $amount, SQLITE3_FLOAT);
|
||||||
|
$stmt2->execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
success(['synced' => count($playerData ?? []) . ' players, ' . count($recordData ?? []) . ' records, ' . count($ruleData ?? []) . ' rules'], 'Java同步推送成功');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// ====== Java 拉回同步:返回 PHP 端所有积分数据 + 规则数据 ======
|
// ====== Java 拉回同步:返回 PHP 端所有积分数据 + 规则数据 ======
|
||||||
|
|||||||
Reference in New Issue
Block a user