-
-
-
-
diff --git a/gonghui/superadmin-center/script.js b/gonghui/superadmin-center/script.js
index eed559b..58828b1 100644
--- a/gonghui/superadmin-center/script.js
+++ b/gonghui/superadmin-center/script.js
@@ -1,8 +1,6 @@
(function () {
var query = new URLSearchParams(window.location.search);
var state = {
- activeTab: 'bd',
- inviteMode: 'bd',
inviteQuery: '',
inviteStatus: '',
inviteStatusType: '',
@@ -350,7 +348,6 @@
data.balance = mock.balance;
data.overview = mock.overview;
data.bdList = mock.bdList;
- data.agencyList = mock.agencyList;
data.history = mock.history;
data.inviteRecords = mock.inviteRecords;
}
@@ -366,9 +363,8 @@
teamRecharge: 0,
};
data.bdList = [];
- data.agencyList = [];
data.history = [];
- data.inviteRecords = { bd: [], agent: [] };
+ data.inviteRecords = { bd: [] };
}
function normalizeOverview(payload) {
@@ -468,20 +464,15 @@
return Promise.all([
centerAPI.overview(),
centerAPI.bds(50),
- centerAPI.agencies(50),
])
.then(function (results) {
var overviewPayload = results[0] || {};
var bdPayload = results[1] || {};
- var agencyPayload = results[2] || {};
var profile = overviewPayload.profile || {};
var overview = normalizeOverview(overviewPayload);
- var agencies = (agencyPayload.items || []).map(
- normalizeAgencyItem
- );
var bds = (bdPayload.items || []).map(normalizeBDItem);
if (!overview.totalHosts) {
- overview.totalHosts = agencies.reduce(function (sum, item) {
+ overview.totalHosts = bds.reduce(function (sum, item) {
return sum + Number(item.hosts || 0);
}, 0);
}
@@ -496,7 +487,6 @@
};
data.overview = overview;
data.bdList = bds;
- data.agencyList = agencies;
data.history = [
{
month: new Date().toISOString().slice(0, 7),
@@ -507,7 +497,7 @@
totalRecharge: overview.teamRecharge,
},
];
- data.inviteRecords = { bd: [], agent: [] };
+ data.inviteRecords = { bd: [] };
render();
})
.catch(function (error) {
@@ -546,40 +536,21 @@
}
function activeItems() {
- return state.activeTab === 'agency' ? data.agencyList : data.bdList;
+ return data.bdList;
}
function renderTeamSummary() {
- $('teamSummary').classList.toggle(
- 'is-two',
- state.activeTab !== 'agency'
- );
- var cells =
- state.activeTab === 'agency'
- ? [
- summaryCell(
- t('superadmin_center.agency_number', 'Agency number'),
- count(data.overview.totalAgency)
- ),
- summaryCell(
- t('superadmin_center.hosts', 'Hosts'),
- count(data.overview.totalHosts)
- ),
- summaryCell(
- t('superadmin_center.team_salary', 'Team salary'),
- '$' + compactMoney(data.overview.teamSalary)
- ),
- ]
- : [
- summaryCell(
- t('superadmin_center.bd_number', 'BD number'),
- count(data.overview.totalBD)
- ),
- summaryCell(
- t('superadmin_center.agencies', 'Agencies'),
- count(data.overview.totalAgency)
- ),
- ];
+ $('teamSummary').classList.add('is-two');
+ var cells = [
+ summaryCell(
+ t('superadmin_center.bd_number', 'BD number'),
+ count(data.overview.totalBD)
+ ),
+ summaryCell(
+ t('superadmin_center.agencies', 'Agencies'),
+ count(data.overview.totalAgency)
+ ),
+ ];
replaceChildren($('teamSummary'), cells);
}
@@ -599,13 +570,9 @@
var subText =
item.sideSub !== undefined
? item.sideSub
- : state.activeTab === 'agency'
- ? count(item.hosts) +
- ' ' +
- t('superadmin_center.hosts', 'Hosts')
- : count(item.agencies) +
- ' ' +
- t('superadmin_center.agencies', 'Agencies');
+ : count(item.agencies) +
+ ' ' +
+ t('superadmin_center.agencies', 'Agencies');
row.className = 'member-row';
main.className = 'member-main';
@@ -614,10 +581,7 @@
side.className = 'member-side';
name.textContent = item.name;
- meta.textContent =
- state.activeTab === 'agency'
- ? 'ID: ' + item.id + ' · BD: ' + item.bdId
- : 'ID: ' + item.id;
+ meta.textContent = 'ID: ' + item.id;
salary.textContent = sideValue || subText;
sub.textContent = sideValue ? subText : '';
@@ -637,12 +601,6 @@
}
function renderTeamList() {
- document.querySelectorAll('[data-team-tab]').forEach(function (button) {
- var active =
- button.getAttribute('data-team-tab') === state.activeTab;
- button.classList.toggle('is-active', active);
- button.setAttribute('aria-selected', String(active));
- });
renderTeamSummary();
replaceChildren(
$('teamList'),
@@ -717,21 +675,11 @@
)
);
}
- if (item.recharge !== null && item.recharge !== undefined) {
- summaryRows.push(
- summaryCell(
- t('superadmin_center.team_recharge', 'Team recharge'),
- '$' + money(item.recharge)
- )
- );
- }
replaceChildren($('detailsSummary'), summaryRows);
replaceChildren($('detailsList'), [
createReadonlyLine(
- state.activeTab === 'agency'
- ? t('superadmin_center.hosts', 'Hosts')
- : t('superadmin_center.agencies', 'Agencies'),
- count(state.activeTab === 'agency' ? item.hosts : item.agencies)
+ t('superadmin_center.agencies', 'Agencies'),
+ count(item.agencies)
),
]);
}
@@ -749,16 +697,14 @@
}
function inviteTitle() {
- return state.inviteMode === 'agent'
- ? t('superadmin_center.invite_agent', 'Invite Agent')
- : t('superadmin_center.invite_bd', 'Invite BD');
+ return t('superadmin_center.invite_bd', 'Invite BD');
}
function inviteRecords() {
- if (!state.inviteQuery) return data.inviteRecords[state.inviteMode] || [];
+ if (!state.inviteQuery) return data.inviteRecords.bd || [];
if (!state.isMock) return state.inviteSearchResults;
var keyword = state.inviteQuery.toLowerCase();
- return mock.searchPool[state.inviteMode].filter(function (item) {
+ return mock.searchPool.bd.filter(function (item) {
return (
item.name.toLowerCase().indexOf(keyword) >= 0 ||
item.account.indexOf(keyword) >= 0 ||
@@ -872,17 +818,10 @@
state.inviteSubmitting[targetUserID] = true;
renderInvite();
var payload = {
- command_id: commandID(state.inviteMode, targetUserID),
+ command_id: commandID('bd', targetUserID),
target_user_id: targetUserID,
};
- var request =
- state.inviteMode === 'agent'
- ? centerAPI.inviteAgency(
- Object.assign({}, payload, {
- agency_name: profile.name,
- })
- )
- : centerAPI.inviteBD(payload);
+ var request = centerAPI.inviteBD(payload);
request
.then(function () {
record.status = 'Success';
@@ -952,9 +891,7 @@
openModal('historyModal');
return;
}
- if (action === 'invite-bd' || action === 'invite-agent') {
- state.inviteMode =
- action === 'invite-agent' ? 'agent' : 'bd';
+ if (action === 'invite-bd') {
state.inviteQuery = '';
state.inviteStatus = '';
state.inviteStatusType = '';
@@ -965,12 +902,6 @@
}
});
});
- document.querySelectorAll('[data-team-tab]').forEach(function (button) {
- button.addEventListener('click', function () {
- state.activeTab = button.getAttribute('data-team-tab') || 'bd';
- renderTeamList();
- });
- });
document
.querySelectorAll('[data-close-modal]')
.forEach(function (node) {
diff --git a/gonghui/superadmin-center/style.css b/gonghui/superadmin-center/style.css
index 00ff3ed..0d1ddcf 100644
--- a/gonghui/superadmin-center/style.css
+++ b/gonghui/superadmin-center/style.css
@@ -126,32 +126,6 @@
gap: 12px;
}
-.team-tabs {
- display: grid;
- grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 6px;
- padding: 6px;
- border-radius: 8px;
- background: var(--hy-theme-primary-soft, #f4ebff);
-}
-
-.team-tab {
- display: flex;
- align-items: center;
- justify-content: center;
- min-height: 42px;
- border-radius: 7px;
- color: var(--muted);
- font-size: 15px;
- font-weight: 900;
-}
-
-.team-tab.is-active {
- background: #fff;
- color: var(--text);
- box-shadow: 0 8px 18px rgba(98, 72, 155, 0.08);
-}
-
.team-summary,
.history-summary {
display: grid;