增加可更新币商联系方式

This commit is contained in:
zhx 2026-05-19 21:54:32 +08:00
parent 53fdaa24e8
commit 30a06840f8
3 changed files with 42 additions and 7 deletions

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<title>Recharge Center</title>
<link rel="stylesheet" href="./style.css?v=20260511-0100" />
<link rel="stylesheet" href="./style.css?v=20260519-0100" />
</head>
<body>
<div class="recharge-center" aria-label="Recharge Center" data-i18n-aria="page_label" data-loading="true">
@ -43,7 +43,7 @@
<path d="M9.4 8.4c.3-.3.8-.3 1 .1l.7 1.2c.2.4.1.8-.2 1.1l-.4.3c.5 1 1.4 1.8 2.4 2.3l.4-.5c.3-.3.7-.4 1.1-.2l1.2.7c.4.2.5.7.2 1-.5.8-1.2 1.1-2.1.9-2.8-.6-5.1-2.8-5.8-5.6-.2-.8.2-1.5 1.5-1.3Z" />
</svg>
</span>
<span id="selfWhatsappText"></span>
<button class="whatsapp-value-button" id="selfWhatsappText" type="button" data-whatsapp-open hidden></button>
<button class="whatsapp-add-button" id="addWhatsappButton" type="button" data-whatsapp-open data-i18n="add_whatsapp">+ add whatsapp</button>
</div>
</div>
@ -238,6 +238,6 @@
<div class="toast" id="toast" role="status" aria-live="polite" hidden></div>
</div>
<script src="./script.js?v=20260511-0100" defer></script>
<script src="./script.js?v=20260519-0100" defer></script>
</body>
</html>

View File

@ -23,6 +23,8 @@
whatsapp_label: "WhatsApp:",
add_whatsapp: "+ add whatsapp",
add_whatsapp_title: "Add WhatsApp",
edit_whatsapp: "Edit",
edit_whatsapp_title: "Edit WhatsApp",
whatsapp_placeholder: "Enter WhatsApp",
whatsapp_required: "Please enter WhatsApp",
whatsapp_too_long: "WhatsApp cannot exceed 64 characters",
@ -103,6 +105,8 @@
whatsapp_label: "WhatsApp:",
add_whatsapp: "+ إضافة واتساب",
add_whatsapp_title: "إضافة واتساب",
edit_whatsapp: "تعديل",
edit_whatsapp_title: "تعديل واتساب",
whatsapp_placeholder: "أدخل واتساب",
whatsapp_required: "يرجى إدخال واتساب",
whatsapp_too_long: "لا يمكن أن يتجاوز واتساب 64 حرفا",
@ -183,6 +187,8 @@
whatsapp_label: "WhatsApp:",
add_whatsapp: "+ WhatsApp ekle",
add_whatsapp_title: "WhatsApp ekle",
edit_whatsapp: "Duzenle",
edit_whatsapp_title: "WhatsApp duzenle",
whatsapp_placeholder: "WhatsApp gir",
whatsapp_required: "Lutfen WhatsApp girin",
whatsapp_too_long: "WhatsApp 64 karakteri gecemez",
@ -263,6 +269,8 @@
whatsapp_label: "WhatsApp:",
add_whatsapp: "+ tambah whatsapp",
add_whatsapp_title: "Tambah WhatsApp",
edit_whatsapp: "Ubah",
edit_whatsapp_title: "Ubah WhatsApp",
whatsapp_placeholder: "Masukkan WhatsApp",
whatsapp_required: "Masukkan WhatsApp",
whatsapp_too_long: "WhatsApp tidak boleh lebih dari 64 karakter",
@ -835,10 +843,16 @@
if (text) {
text.textContent = whatsapp;
text.hidden = !whatsapp;
text.disabled = !whatsapp;
if (whatsapp) {
text.setAttribute("aria-label", `${message("edit_whatsapp")}: ${whatsapp}`);
} else {
text.removeAttribute("aria-label");
}
}
if (button) {
button.hidden = Boolean(whatsapp);
button.textContent = message("add_whatsapp");
button.hidden = false;
button.textContent = whatsapp ? message("edit_whatsapp") : message("add_whatsapp");
}
}
@ -1020,9 +1034,11 @@
function renderWhatsappModal() {
const modal = document.querySelector("#whatsappModal");
const title = document.querySelector("#whatsappTitle");
const input = document.querySelector("#whatsappInput");
const button = document.querySelector("#saveWhatsappButton");
if (modal) modal.hidden = !state.whatsappOpen;
if (title) title.textContent = state.whatsapp ? message("edit_whatsapp_title") : message("add_whatsapp_title");
if (input && document.activeElement !== input) input.value = state.whatsappDraft;
if (button) {
button.disabled = state.whatsappSaving || !String(state.whatsappDraft || "").trim();
@ -1988,7 +2004,9 @@
document.querySelector("[data-change-target]")?.addEventListener("click", changeTarget);
document.querySelector("[data-help-open]")?.addEventListener("click", () => setModalOpen("#helpModal", true));
document.querySelector("[data-history-open]")?.addEventListener("click", () => openHistoryModal());
document.querySelector("[data-whatsapp-open]")?.addEventListener("click", openWhatsappModal);
document.querySelectorAll("[data-whatsapp-open]").forEach((node) => {
node.addEventListener("click", openWhatsappModal);
});
document.querySelector("#whatsappInput")?.addEventListener("input", (event) => {
state.whatsappDraft = String(event.target.value || "");
if (state.whatsappStatusText) setWhatsappStatus("");

View File

@ -622,7 +622,8 @@ button {
gap: 8px;
}
.whatsapp-meta span {
.whatsapp-meta span,
.whatsapp-value-button {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
@ -655,11 +656,27 @@ button {
.whatsapp-add-button {
color: #0aa397;
cursor: pointer;
font-size: 13px;
font-weight: 950;
line-height: 1.2;
}
.whatsapp-value-button {
max-width: 160px;
color: var(--muted);
cursor: pointer;
font-size: 13px;
font-weight: 750;
line-height: 1.2;
text-align: left;
}
.whatsapp-value-button:active,
.whatsapp-add-button:active {
color: #087f76;
}
.mini-action {
min-width: 78px;
min-height: 36px;