refactor: pc header数据改两列显示
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 4s
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 4s
This commit is contained in:
@@ -120,7 +120,13 @@ abstract class Common extends BaseController
|
|||||||
}
|
}
|
||||||
$children = $this->toTreeAndChunk($categorys, $item['id'], $lv);
|
$children = $this->toTreeAndChunk($categorys, $item['id'], $lv);
|
||||||
if (!empty($children)) {
|
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;
|
$ret[] = $item;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{else /}
|
{else /}
|
||||||
<div class="header-nav-title">{$nav.name}</div>
|
<div class="header-nav-title">{$nav.name}</div>
|
||||||
<!-- style="display: block;" -->
|
|
||||||
<div class="header-dropdown">
|
<div class="header-dropdown">
|
||||||
<div class="header-dropdown-content1">
|
<div class="header-dropdown-content1">
|
||||||
{volist name="nav.children" id="child"}
|
{volist name="nav.children" id="child"}
|
||||||
@@ -268,10 +267,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let searchHistory = JSON.parse(localStorage.getItem('searchHistory') || '[]');
|
let searchHistory = JSON.parse(localStorage.getItem('searchHistory') || '[]');
|
||||||
|
|
||||||
function renderHistory ()
|
function renderHistory ()
|
||||||
@@ -463,13 +458,10 @@
|
|||||||
|
|
||||||
renderHistory();
|
renderHistory();
|
||||||
|
|
||||||
|
|
||||||
// ========== 蒙版层功能(支持所有弹窗,包括导航悬停下拉) ==========
|
// ========== 蒙版层功能(支持所有弹窗,包括导航悬停下拉) ==========
|
||||||
const mhk = document.getElementById('mhk');
|
const mhk = document.getElementById('mhk');
|
||||||
const body = document.body;
|
const body = document.body;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 获取滚动条宽度(防止打开弹窗时页面抖动)
|
// 获取滚动条宽度(防止打开弹窗时页面抖动)
|
||||||
function getScrollbarWidth() {
|
function getScrollbarWidth() {
|
||||||
const scrollDiv = document.createElement('div');
|
const scrollDiv = document.createElement('div');
|
||||||
|
|||||||
Reference in New Issue
Block a user