From 80f529c6f2b5f85f9419c7dbc56330e7aac7bca8 Mon Sep 17 00:00:00 2001 From: zhx Date: Wed, 24 Jun 2026 15:39:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=8F=E7=90=86=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- h5/hyapp/manager-center/index.html | 4 ++-- h5/hyapp/manager-center/locales/ar.json | 1 + h5/hyapp/manager-center/locales/en.json | 1 + h5/hyapp/manager-center/locales/id.json | 1 + h5/hyapp/manager-center/locales/tr.json | 1 + h5/hyapp/manager-center/script.js | 28 +++++++++++++++++++------ 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/h5/hyapp/manager-center/index.html b/h5/hyapp/manager-center/index.html index 2c36780..c3b2f73 100644 --- a/h5/hyapp/manager-center/index.html +++ b/h5/hyapp/manager-center/index.html @@ -4,7 +4,7 @@ Manager Center - +
@@ -280,6 +280,6 @@
- + diff --git a/h5/hyapp/manager-center/locales/ar.json b/h5/hyapp/manager-center/locales/ar.json index a09b05c..832cc91 100644 --- a/h5/hyapp/manager-center/locales/ar.json +++ b/h5/hyapp/manager-center/locales/ar.json @@ -13,6 +13,7 @@ "target_user": "المستخدم المستهدف", "current_country": "Current country", "change_country": "Change Country", + "change_country_disabled": "Change Country disabled", "select_country": "Select country", "changing_country": "Changing...", "country_changed": "Country changed", diff --git a/h5/hyapp/manager-center/locales/en.json b/h5/hyapp/manager-center/locales/en.json index 274b861..8a5f48d 100644 --- a/h5/hyapp/manager-center/locales/en.json +++ b/h5/hyapp/manager-center/locales/en.json @@ -13,6 +13,7 @@ "target_user": "Target User", "current_country": "Current country", "change_country": "Change Country", + "change_country_disabled": "Change Country disabled", "select_country": "Select country", "changing_country": "Changing...", "country_changed": "Country changed", diff --git a/h5/hyapp/manager-center/locales/id.json b/h5/hyapp/manager-center/locales/id.json index ee27341..d158290 100644 --- a/h5/hyapp/manager-center/locales/id.json +++ b/h5/hyapp/manager-center/locales/id.json @@ -13,6 +13,7 @@ "target_user": "Pengguna Target", "current_country": "Current country", "change_country": "Change Country", + "change_country_disabled": "Change Country disabled", "select_country": "Select country", "changing_country": "Changing...", "country_changed": "Country changed", diff --git a/h5/hyapp/manager-center/locales/tr.json b/h5/hyapp/manager-center/locales/tr.json index dde896b..03fcdcd 100644 --- a/h5/hyapp/manager-center/locales/tr.json +++ b/h5/hyapp/manager-center/locales/tr.json @@ -13,6 +13,7 @@ "target_user": "Hedef Kullanıcı", "current_country": "Current country", "change_country": "Change Country", + "change_country_disabled": "Change Country disabled", "select_country": "Select country", "changing_country": "Changing...", "country_changed": "Country changed", diff --git a/h5/hyapp/manager-center/script.js b/h5/hyapp/manager-center/script.js index 2c1301d..0358942 100644 --- a/h5/hyapp/manager-center/script.js +++ b/h5/hyapp/manager-center/script.js @@ -27,6 +27,7 @@ target_user: "Target User", current_country: "Current country", change_country: "Change Country", + change_country_disabled: "Change Country disabled", select_country: "Select country", changing_country: "Changing...", country_changed: "Country changed", @@ -109,6 +110,7 @@ target_user: "المستخدم المستهدف", current_country: "Current country", change_country: "Change Country", + change_country_disabled: "Change Country disabled", select_country: "Select country", changing_country: "Changing...", country_changed: "Country changed", @@ -191,6 +193,7 @@ target_user: "Hedef Kullanıcı", current_country: "Current country", change_country: "Change Country", + change_country_disabled: "Change Country disabled", select_country: "Select country", changing_country: "Changing...", country_changed: "Country changed", @@ -273,6 +276,7 @@ target_user: "Pengguna Target", current_country: "Current country", change_country: "Change Country", + change_country_disabled: "Change Country disabled", select_country: "Select country", changing_country: "Changing...", country_changed: "Country changed", @@ -410,7 +414,7 @@ if (window.location.protocol === "file:") return fallbackMessages[normalizedLang]; try { - const response = await fetch(`./locales/${normalizedLang}.json?v=20260622-0100`, { cache: "no-store" }); + const response = await fetch(`./locales/${normalizedLang}.json?v=20260624-0100`, { cache: "no-store" }); if (response.ok) return await response.json(); } catch (error) { return fallbackMessages[normalizedLang]; @@ -754,6 +758,10 @@ } async function openCountryModal() { + if (!featureEnabled("changeCountry")) { + showToast(message("change_country_disabled")); + return; + } if (!state.target) { showToast(message("enter_user")); return; @@ -868,7 +876,8 @@ addBdLeader: true, giftProps: true, banUser: true, - unbanUser: true + unbanUser: true, + changeCountry: true }; } @@ -877,7 +886,8 @@ addBdLeader: features?.addBdLeader !== false, giftProps: features?.giftProps !== false, banUser: features?.banUser !== false, - unbanUser: features?.unbanUser !== false + unbanUser: features?.unbanUser !== false, + changeCountry: features?.changeCountry !== false }; } @@ -1152,9 +1162,11 @@ if (title) title.textContent = disabledByFeature ? message("gift_props_disabled") : message("gift_props"); } if (countryEntryButton) { - countryEntryButton.disabled = !state.target || state.countriesLoading || state.changingCountry; + const disabledByFeature = !featureEnabled("changeCountry"); + countryEntryButton.disabled = disabledByFeature || !state.target || state.countriesLoading || state.changingCountry; + countryEntryButton.classList.toggle("is-feature-disabled", disabledByFeature); const title = countryEntryButton.querySelector(".action-item-title"); - if (title) title.textContent = message("change_country"); + if (title) title.textContent = disabledByFeature ? message("change_country_disabled") : message("change_country"); } if (banEntryButton) { const disabledByFeature = !featureEnabled("banUser"); @@ -1174,7 +1186,7 @@ if (sendButton) sendButton.disabled = !featureEnabled("giftProps") || !state.target || !state.selectedPropsId; if (changeCountryButton) { const currentID = String(state.target?.countryId || matchingCountryId(state.target) || ""); - changeCountryButton.disabled = !state.target || state.countriesLoading || state.changingCountry || !state.selectedCountryId || state.selectedCountryId === currentID; + changeCountryButton.disabled = !featureEnabled("changeCountry") || !state.target || state.countriesLoading || state.changingCountry || !state.selectedCountryId || state.selectedCountryId === currentID; changeCountryButton.textContent = state.changingCountry ? message("changing_country") : message("change_country"); } if (banButton) banButton.disabled = !featureEnabled("banUser") || !canBanTarget(state.target); @@ -1381,6 +1393,10 @@ async function changeUserCountry() { if (!state.target) return; + if (!featureEnabled("changeCountry")) { + setStatus($("#countryStatus"), message("change_country_disabled"), "error"); + return; + } if (!state.selectedCountryId) { setStatus($("#countryStatus"), message("country_required"), "error"); return;