refactor: pc header数据改两列显示
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 4s

This commit is contained in:
2026-04-14 16:57:19 +08:00
parent d79b418310
commit 80d3aa8160
2 changed files with 49 additions and 51 deletions

View File

@@ -120,7 +120,13 @@ abstract class Common extends BaseController
}
$children = $this->toTreeAndChunk($categorys, $item['id'], $lv);
if (!empty($children)) {
$item['children'] = $item['level'] == 1 ? array_chunk($children, 2) : $children;
if ($lv == 1) {
$item['children'] = array_chunk($children, 2);
} else if ($lv == 2) {
$item['children'] = array_chunk($children, 3);
} else {
$item['children'] = $children;
}
}
$ret[] = $item;
}

View File

@@ -77,7 +77,6 @@
</div>
{else /}
<div class="header-nav-title">{$nav.name}</div>
<!-- style="display: block;" -->
<div class="header-dropdown">
<div class="header-dropdown-content1">
{volist name="nav.children" id="child"}
@@ -268,10 +267,6 @@
});
});
let searchHistory = JSON.parse(localStorage.getItem('searchHistory') || '[]');
function renderHistory ()
@@ -463,13 +458,10 @@
renderHistory();
// ========== 蒙版层功能(支持所有弹窗,包括导航悬停下拉) ==========
const mhk = document.getElementById('mhk');
const body = document.body;
// 获取滚动条宽度(防止打开弹窗时页面抖动)
function getScrollbarWidth() {
const scrollDiv = document.createElement('div');