From 9b65213048848885efeab5a3d3e86306a1db4d94 Mon Sep 17 00:00:00 2001 From: yiqiu Date: Sun, 11 Jan 2026 12:18:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E7=BA=A7=E8=8F=9C=E5=8D=95UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/admin/index.html | 202 +++++++++++++----- 1 file changed, 146 insertions(+), 56 deletions(-) diff --git a/plugins/addon/theme_configurator/template/admin/index.html b/plugins/addon/theme_configurator/template/admin/index.html index 73257ec..a29b7b1 100644 --- a/plugins/addon/theme_configurator/template/admin/index.html +++ b/plugins/addon/theme_configurator/template/admin/index.html @@ -1,4 +1,31 @@ + +
@@ -194,7 +221,7 @@
- +
@@ -763,7 +790,7 @@ @@ -803,13 +830,35 @@ // 获取国家/地区代码列表(只使用方形图标) function getCountryOptions() { - // 常用国家/地区代码列表(方形图标) + // 返回带中文名称的地区选项 return [ - 'CN', 'HK', 'TW', 'MO', // 中国及特别行政区 - 'US', 'JP', 'KR', 'SG', 'GB', // 常用国家 - 'DE', 'FR', 'CA', 'AU', 'IN', // 其他常用 - 'TH', 'MY', 'ID', 'PH', 'VN', // 东南亚 - 'AE', 'RU', 'BR', 'IT', 'ES', 'NL', 'CH', 'SE' // 其他 + { code: 'CN', name: '中国' }, + { code: 'HK', name: '香港' }, + { code: 'TW', name: '台湾' }, + { code: 'MO', name: '澳门' }, + { code: 'US', name: '美国' }, + { code: 'JP', name: '日本' }, + { code: 'KR', name: '韩国' }, + { code: 'SG', name: '新加坡' }, + { code: 'GB', name: '英国' }, + { code: 'DE', name: '德国' }, + { code: 'FR', name: '法国' }, + { code: 'CA', name: '加拿大' }, + { code: 'AU', name: '澳大利亚' }, + { code: 'IN', name: '印度' }, + { code: 'TH', name: '泰国' }, + { code: 'MY', name: '马来西亚' }, + { code: 'ID', name: '印度尼西亚' }, + { code: 'PH', name: '菲律宾' }, + { code: 'VN', name: '越南' }, + { code: 'AE', name: '阿联酋' }, + { code: 'RU', name: '俄罗斯' }, + { code: 'BR', name: '巴西' }, + { code: 'IT', name: '意大利' }, + { code: 'ES', name: '西班牙' }, + { code: 'NL', name: '荷兰' }, + { code: 'CH', name: '瑞士' }, + { code: 'SE', name: '瑞典' } ]; } @@ -1021,62 +1070,103 @@ function renderFooterNav(navs) { const container = document.getElementById('footerNavList'); if (!container) return; - container.innerHTML = ''; - navs.forEach((col, index) => { - const hasChildren = Array.isArray(col.children) && col.children.length > 0; - const item = document.createElement('div'); - item.className = 'config-item'; - item.style.borderLeft = '3px solid #1890ff'; // 蓝色标识 - item.innerHTML = ` -
-

栏目 ${index + 1}: ${col.name || '(未命名)'}

-
- - -
-
-
-
- - -
- -
- `; - container.appendChild(item); - if (hasChildren) { - renderFooterNavChildren(index, col.children); + let html = ` + + + + + + + + + + + + `; + + navs.forEach((col, navIndex) => { + // 一级栏目行 + html += ` + + + + + + + + `; + + // 二级链接(默认隐藏) + if (col.children && col.children.length > 0) { + col.children.forEach((child, childIndex) => { + html += ` + + + + + + + + `; + }); } }); + + html += ` + + + + `; + + container.innerHTML = html; } function renderFooterNavChildren(navIndex, children) { - const container = document.getElementById(`footer-nav-children-list-${navIndex}`); - if (!container) return; - container.innerHTML = ''; - - children.forEach((child, childIndex) => { - const item = document.createElement('div'); - item.style.cssText = 'padding:8px; margin-bottom:8px; background:#f0f8ff; border-radius:4px; border-left:2px solid #1890ff;'; - item.innerHTML = ` -
-
- - - -
- -
- `; - container.appendChild(item); - }); + // 改为表格渲染,此函数已废弃 } + // 展开/收起底部导航的子链接 + window.toggleFooterChildren = function (navIndex) { + const navs = collectFooterNav(); + const col = navs[navIndex]; + if (!col || !col.children || col.children.length === 0) { + // 没有子链接,添加子链接 + addFooterNavChild(navIndex); + return; + } + + // 切换子链接显示状态 + col.children.forEach((_, childIndex) => { + const row = document.getElementById(`footer-child-${navIndex}-${childIndex}`); + if (row) { + row.style.display = row.style.display === 'none' ? 'table-row' : 'none'; + } + }); + }; + + // 旧函数保留兼容 + window.toggleFooterNavChildren = function (navIndex) { + toggleFooterChildren(navIndex); + }; + function collectFooterNav() { const navs = [];