refactor: 修改pc nas帮助文章详情

This commit is contained in:
2025-04-14 14:04:33 +08:00
parent 9052b70816
commit ca5ac6d523

View File

@@ -1,402 +1,452 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>帮助中心</title> <title>帮助中心</title>
{include file='include/head-nas' /} {include file='include/head-nas' /}
<style> <style>
[class*=' icon-'] { [class*=' icon-'] {
color: #000; color: #000;
} }
.narshelpdetailPc {
display: flex; .narshelpdetailPc {
flex-direction: column; display: flex;
background: #f9f9f9; flex-direction: column;
} background: #f9f9f9;
.narshelpdetailPc .narsssmain { }
width: 100%;
display: flex; .narshelpdetailPc .narsssmain {
flex-direction: row; width: 100%;
border-top: 1px solid #ccc; display: flex;
border-bottom: 1px solid #ccc; flex-direction: row;
padding: 21px 0; border-top: 1px solid #ccc;
top: 0; border-bottom: 1px solid #ccc;
align-items: center; padding: 21px 0;
background: #fff; top: 0;
z-index: 2; align-items: center;
} background: #fff;
.narshelpdetailPc .narsssmain .dropdown { z-index: 2;
display: none; }
position: absolute;
top: 124px; .narshelpdetailPc .narsssmain .dropdown {
left: 0; display: none;
width: 435px; position: absolute;
border-top: none; top: 124px;
background-color: #fff; left: 0;
border-bottom-left-radius: 4px; width: 435px;
border-bottom-right-radius: 4px; border-top: none;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); background-color: #fff;
margin: 0 auto; border-bottom-left-radius: 4px;
right: 0; border-bottom-right-radius: 4px;
max-height: 18.75rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
min-height: 3.125rem; margin: 0 auto;
overflow-y: auto; right: 0;
} max-height: 18.75rem;
.narshelpdetailPc .narsssmain .dropdown ul { min-height: 3.125rem;
list-style-type: none; overflow-y: auto;
padding: 0; }
margin: 0;
} .narshelpdetailPc .narsssmain .dropdown ul {
.narshelpdetailPc .narsssmain .dropdown ul li { list-style-type: none;
padding: 10px; padding: 0;
cursor: pointer; margin: 0;
} }
.narshelpdetailPc .narsssmain .dropdown ul li:hover {
background-color: #f4f4f4; .narshelpdetailPc .narsssmain .dropdown ul li {
} padding: 10px;
.narshelpdetailPc .narsssmain .ml { cursor: pointer;
font-size: 14px; }
padding-left: 25px;
padding-top: 37px; .narshelpdetailPc .narsssmain .dropdown ul li:hover {
padding-bottom: 31px; background-color: #f4f4f4;
color: #8f9099; }
position: absolute;
} .narshelpdetailPc .narsssmain .ml {
.narshelpdetailPc .narsssmain .nars-hlp-search { font-size: 14px;
width: 440px; padding-left: 25px;
height: 42px; padding-top: 37px;
border-radius: 1.3125rem; padding-bottom: 31px;
font-size: 14px; color: #8f9099;
display: flex; position: absolute;
flex-direction: row; }
align-items: center;
color: #8f9099; .narshelpdetailPc .narsssmain .nars-hlp-search {
border: 1px solid #cdcedb; width: 440px;
margin: 0 auto; height: 42px;
} border-radius: 1.3125rem;
.narshelpdetailPc .narsssmain .nars-hlp-search .ssimg { font-size: 14px;
width: 1.6rem; display: flex;
height: 1.6rem; flex-direction: row;
margin-right: 3%; align-items: center;
} color: #8f9099;
.narshelpdetailPc .narsssmain .nars-hlp-search input { border: 1px solid #cdcedb;
font-size: 14px; margin: 0 auto;
border: none; }
padding: 0 15px;
outline: none; .narshelpdetailPc .narsssmain .nars-hlp-search .ssimg {
flex: 1; width: 1.6rem;
margin-right: 2%; height: 1.6rem;
margin-left: 2%; margin-right: 3%;
} }
.narshelpdetailPc .narsssmain .nars-hlp-search input::placeholder {
color: #8f9099; .narshelpdetailPc .narsssmain .nars-hlp-search input {
text-align: center; font-size: 14px;
font-size: 14px; border: none;
} padding: 0 15px;
.narshelpdetailPc .nars-help-content { outline: none;
display: flex; flex: 1;
flex-direction: row; margin-right: 2%;
} margin-left: 2%;
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml { }
width: 252px;
overflow-y: auto; .narshelpdetailPc .narsssmain .nars-hlp-search input::placeholder {
border-right: 1px solid #ccc; color: #8f9099;
} text-align: center;
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .nav-tree { font-size: 14px;
max-height: 800px; }
overflow-y: auto;
} .narshelpdetailPc .nars-help-content {
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .category { display: flex;
margin-bottom: 5px; flex-direction: row;
} }
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .category-title {
display: block; .narshelpdetailPc .nars-help-content .nars-hlpdt-ml {
padding: 10px; width: 252px;
cursor: pointer; overflow-y: auto;
position: relative; border-right: 1px solid #ccc;
display: flex; }
flex-direction: row;
align-items: center; .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .nav-tree {
font-size: 14px; max-height: 800px;
font-weight: bold; overflow-y: auto;
margin-left: 10px; }
color: #1f2635;
} .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .category {
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .arrow { margin-bottom: 5px;
margin-right: 2px; }
transform: rotate(0deg);
display: flex; .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .category-title {
justify-content: center; display: block;
} padding: 10px;
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .arrow .nars-jt { cursor: pointer;
width: 16px; position: relative;
height: 16px; display: flex;
} flex-direction: row;
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .rotate { align-items: center;
transform: rotate(45deg); font-size: 14px;
} font-weight: bold;
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list { margin-left: 10px;
display: none; color: #1f2635;
list-style: none; }
padding: 0;
margin: 0; .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .arrow {
} margin-right: 2px;
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li a { transform: rotate(0deg);
width: fit-content; display: flex;
display: block; justify-content: center;
margin: 0 10px; }
padding-top: 22px;
text-decoration: none; .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .arrow .nars-jt {
color: #333; width: 16px;
margin-left: 41px; height: 16px;
font-size: 12px; }
color: #8f9099;
} .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .rotate {
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li:first a { transform: rotate(45deg);
padding-top: 0; }
}
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li a:hover, .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list {
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li a.active { display: none;
color: #1f2635; list-style: none;
border-bottom: 1px solid #1f2635; padding: 0;
} margin: 0;
.narshelpdetailPc .nars-help-content .nars-hlpdt-mm { }
padding: 32px 150px;
max-height: 920px; .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li a {
min-height: 700px; width: fit-content;
height: auto; display: block;
flex: 1; margin: 0 10px;
overflow-y: auto; padding-top: 22px;
position: relative; text-decoration: none;
} color: #333;
.narshelpdetailPc .nars-help-content .nars-hlpdt-mm img{ margin-left: 41px;
max-width: 100%; font-size: 12px;
} color: #8f9099;
/* .narshelpdetailPc .nars-help-content .nars-hlpdt-mm img{*/ }
/* width: -webkit-fill-available;*/
/*}*/ .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li:first a {
.narshelpdetailPc .nars-help-content .nars-hlpdt-mr { padding-top: 0;
width: 252px; }
overflow-y: auto;
border-left: 1px solid #ccc; .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li a:hover,
overflow-y: auto; .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li a.active {
display: flex; color: #1f2635;
} border-bottom: 1px solid #1f2635;
.narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list { }
padding: 0 20px;
float: right; .narshelpdetailPc .nars-help-content .nars-hlpdt-mm {
max-height: 800px; padding: 32px 150px;
min-height: 700px; max-height: 920px;
overflow-y: auto; min-height: 700px;
} height: auto;
.narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list .tt { flex: 1;
font-size: 14px; overflow-y: auto;
padding-top: 33px; position: relative;
padding-bottom: 1rem; }
margin: 0;
} .narshelpdetailPc .nars-help-content .nars-hlpdt-mm img {
.narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list ul { max-width: 100%;
list-style-type: none; }
padding: 0;
} /* .narshelpdetailPc .nars-help-content .nars-hlpdt-mm img{*/
.narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list ul li { /* width: -webkit-fill-available;*/
margin-bottom: 23px; /*}*/
} .narshelpdetailPc .nars-help-content .nars-hlpdt-mr {
.narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list ul li a { width: 252px;
text-decoration: none; overflow-y: auto;
font-size: 12px; border-left: 1px solid #ccc;
color: #1f2635; overflow-y: auto;
} display: flex;
.narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list ul li a:hover { }
color: #1f2635;
border-bottom: 1px solid #1f2635; .narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list {
} padding: 0 20px;
float: right;
.nav-tree .category:nth-child(1) .category-title { max-height: 800px;
padding-top: 33px; min-height: 700px;
} overflow-y: auto;
}
/* 修改垂直滚动条 */
::-webkit-scrollbar { .narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list .tt {
width: 6px; /* 修改宽度 */ font-size: 14px;
} padding-top: 33px;
padding-bottom: 1rem;
/* 修改滚动条轨道背景色 */ margin: 0;
::-webkit-scrollbar-track { }
background-color: transparent;
} .narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list ul {
list-style-type: none;
/* 修改滚动条滑块颜色 */ padding: 0;
::-webkit-scrollbar-thumb { }
background-color: #ccc;
} .narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list ul li {
margin-bottom: 23px;
/* 修改滚动条滑块悬停时的颜色 */ }
::-webkit-scrollbar-thumb:hover {
background-color: #D8DFE8; .narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list ul li a {
} text-decoration: none;
font-size: 12px;
/* 修改滚动条滑块移动时的颜色 */ color: #1f2635;
::-webkit-scrollbar-thumb:active { }
background-color: #D8DFE8;
} .narshelpdetailPc .nars-help-content .nars-hlpdt-mr #title-list ul li a:hover {
color: #1f2635;
/* 修改滚动条滑块的圆角 */ border-bottom: 1px solid #1f2635;
::-webkit-scrollbar-thumb { }
border-radius: 5px;
} .nav-tree .category:nth-child(1) .category-title {
/* 整体滚动条 */ padding-top: 33px;
* { }
scrollbar-width: thin; /* 滚动条宽度 */
scrollbar-color: #D8DBE6 transparent; /* 滚动条颜色(滑块颜色 轨道颜色) */ /* 修改垂直滚动条 */
} ::-webkit-scrollbar {
width: 6px;
/* 滚动条轨道 */ /* 修改宽度 */
*::-moz-scrollbar-track { }
background-color: #f0f0f0;
} /* 修改滚动条轨道背景色 */
::-webkit-scrollbar-track {
/* 滚动条滑块 */ background-color: transparent;
*::-moz-scrollbar-thumb { }
background-color: #D8DBE6;
border-radius: 5px; /* 滑块的圆角 */ /* 修改滚动条滑块颜色 */
} ::-webkit-scrollbar-thumb {
background-color: #ccc;
/* 滚动条的上下箭头 */ }
*::-moz-scrollbar-button {
display: none; /* 隐藏上下箭头 */ /* 修改滚动条滑块悬停时的颜色 */
} ::-webkit-scrollbar-thumb:hover {
background-color: #D8DFE8;
/* 滚动条的上下箭头:向上箭头 */ }
*::-moz-scrollbar-button:vertical:decrement {
display: none; /* 修改滚动条滑块移动时的颜色 */
} ::-webkit-scrollbar-thumb:active {
background-color: #D8DFE8;
/* 滚动条的上下箭头:向下箭头 */ }
*::-moz-scrollbar-button:vertical:increment {
display: none; /* 修改滚动条滑块的圆角 */
} ::-webkit-scrollbar-thumb {
h1, h2, h3, h4, h5, h6 { border-radius: 5px;
margin: 0; }
all: revert; /* 将所有属性设置为初始值 */
/* 或者使用 all: revert; 恢复到浏览器默认样式,但该属性兼容性不如 initial */ /* 整体滚动条 */
} * {
</style> scrollbar-width: thin;
/* 滚动条宽度 */
scrollbar-color: #D8DBE6 transparent;
/* 滚动条颜色(滑块颜色 轨道颜色) */
}
/* 滚动条轨道 */
*::-moz-scrollbar-track {
background-color: #f0f0f0;
}
/* 滚动条滑块 */
*::-moz-scrollbar-thumb {
background-color: #D8DBE6;
border-radius: 5px;
/* 滑块的圆角 */
}
/* 滚动条的上下箭头 */
*::-moz-scrollbar-button {
display: none;
/* 隐藏上下箭头 */
}
/* 滚动条的上下箭头:向上箭头 */
*::-moz-scrollbar-button:vertical:decrement {
display: none;
}
/* 滚动条的上下箭头:向下箭头 */
*::-moz-scrollbar-button:vertical:increment {
display: none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
all: revert;
/* 将所有属性设置为初始值 */
/* 或者使用 all: revert; 恢复到浏览器默认样式,但该属性兼容性不如 initial */
}
</style>
</head> </head>
<body> <body>
<!-- 顶部导航 --> <!-- 顶部导航 -->
{include file='include/top-header-nas'/} {include file='include/top-header-nas'/}
<div class="narshelpdetailPc"> <div class="narshelpdetailPc">
<!-- top 搜索--> <!-- top 搜索-->
<div class="narsssmain"> <div class="narsssmain">
<div class="ml">帮助中心 / 使用教程</div> <div class="ml">帮助中心 / 使用教程</div>
<div class="nars-hlp-search"> <div class="nars-hlp-search">
<input placeholder="请输入搜索关键字,如安装赛博云空间、影视库" /> <input placeholder="请输入搜索关键字,如安装赛博云空间、影视库" />
<img src="__PUBLIC__/m_web/images/nas/help/nhlp-ssico.png" class="ssimg"> <img src="__PUBLIC__/m_web/images/nas/help/nhlp-ssico.png" class="ssimg">
</div> </div>
<!-- 下拉搜索框 --> <!-- 下拉搜索框 -->
<div class="dropdown" id="dropdown"></div> <div class="dropdown" id="dropdown"></div>
</div> </div>
<!-- 目录-文章详情-锚点定位---> <!-- 目录-文章详情-锚点定位--->
<div class="nars-help-content"> <div class="nars-help-content">
<!--目录 --> <!--目录 -->
<div class="nars-hlpdt-ml"> <div class="nars-hlpdt-ml">
<div class="nav-tree"> <div class="nav-tree">
{volist name="categorys" id="vo"} {volist name="categorys" id="vo"}
<div class="category"> <div class="category">
<div class="category-title"> <div class="category-title">
<div class="arrow {if condition='$cid == $vo.id'}rotate{/if}"><img src="__PUBLIC__/m_web/images/nas/help/nars-jt.png" class="arrow {if condition='$cid == $vo.id'}rotate{/if}"/></div> <div class="arrow {if condition='$cid == $vo.id'}rotate{/if}"><img src="__PUBLIC__/m_web/images/nas/help/nars-jt.png" class="arrow {if condition='$cid == $vo.id'}rotate{/if}" /></div>
<span>{$vo.name}</span> <span>{$vo.name}</span>
</div> </div>
<ul class="sub-list" {if condition="$cid == $vo.id"}style="display: block;"{/if}> <ul class="sub-list" {if condition="$cid == $vo.id" }style="display: block;" {/if}>
{volist name="vo.articles" id="va"} {volist name="vo.articles" id="va"}
<li> <li>
<a href="{:url('tops_nas/helper_detail', ['id' => $va.id])}" class="{if condition='$Request.param.id == $va.id'}active{/if}" style="{if condition='$key==0'}padding-top: 6px;{/if}">{$va.name}</a> <a href="{:url('tops_nas/helper_detail', ['id' => $va.id])}" class="{if condition='$Request.param.id == $va.id'}active{/if}" {if condition='$key==0' }style="padding-top: 6px;"{/if}>{$va.name}</a>
</li> </li>
{/volist} {/volist}
</ul> </ul>
</div> </div>
{/volist} {/volist}
</div> </div>
</div> </div>
<!--文章详情 --> <!--文章详情 -->
<div class="nars-hlpdt-mm" id="rendered-content"> <div class="nars-hlpdt-mm" id="rendered-content">
<div>{$article.content|default=''}</div> <div>{$article.content|default=''}</div>
</div> </div>
<!--锚点定位 --> <!--锚点定位 -->
<div class="nars-hlpdt-mr"> <div class="nars-hlpdt-mr">
<div id="title-list"> <div id="title-list">
<h2 class="tt">目录</h2> <h2 class="tt">目录</h2>
<ul></ul> <ul></ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{include file='include/bottom2023'/} {include file='include/bottom2023'/}
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('.category-title').click(function() { $('.category-title').click(function() {
$(this).next('.sub-list').slideToggle(); $(this).next('.sub-list').slideToggle();
$(this).find('.arrow').toggleClass('rotate'); $(this).find('.arrow').toggleClass('rotate');
}); });
// 搜索 // 搜索
$(document).on('click', function(e) { $(document).on('click', function(e) {
var target = $(e.target); var target = $(e.target);
if (!target.closest('.nhlp-search').length) { if (!target.closest('.nhlp-search').length) {
$('#dropdown').hide(); $('#dropdown').hide();
} }
}); });
var timeout = null; var timeout = null;
$('.nars-hlp-search input').on('focus input', function() { $('.nars-hlp-search input').on('focus input', function() {
clearTimeout(timeout); clearTimeout(timeout);
var _this = this; var _this = this;
timeout = setTimeout(function () { timeout = setTimeout(function() {
var keywords = $(_this).val(); var keywords = $(_this).val();
if (keywords == '') { if (keywords == '') {
$('#dropdown').hide().html(''); $('#dropdown').hide().html('');
return; return;
} }
$.ajax({ $.ajax({
url: "{:url('tops_nas/helper_search')}", url: "{:url('tops_nas/helper_search')}",
type: 'POST', type: 'POST',
data: {keywords: keywords}, data: {
dataType: 'JSON', keywords: keywords
success: function(r) { },
var html = ''; dataType: 'JSON',
if (r.code == 0) { success: function(r) {
html = '<ul>' var html = '';
$.each(r.data, function(k, v) { if (r.code == 0) {
html += '<li><a href="{:url(\'tops_nas/helper_detail\')}?id=' + v.id + '">' + v.name + '</a></li>' html = '<ul>'
}) $.each(r.data, function(k, v) {
html += '</ul>' html += '<li><a href="{:url(\'tops_nas/helper_detail\')}?id=' + v.id + '">' + v.name + '</a></li>'
} })
$('#dropdown').show().html(html); html += '</ul>'
} }
}) $('#dropdown').show().html(html);
}, 300); }
}) })
// 内容 }, 300);
// 清空标题列表 })
$("#title-list ul").empty(); // 内容
// 提取 h1 标题 // 清空标题列表
var h1Titles = $("#rendered-content").find("h3"); $("#title-list ul").empty();
h1Titles.each(function(index) { // 提取 h1 标题
var title = $(this); var h1Titles = $("#rendered-content").find("h3");
var titleText = title.text(); h1Titles.each(function(index) {
var titleId = "title-" + index; var title = $(this);
title.attr("id", titleId); var titleText = title.text();
var listItem = $("<li>"); var titleId = "title-" + index;
var link = $("<a>", { title.attr("id", titleId);
href: "#" + titleId, var listItem = $("<li>");
text: titleText var link = $("<a>", {
}); href: "#" + titleId,
listItem.append(link); text: titleText
$("#title-list ul").append(listItem); });
}); listItem.append(link);
}); $("#title-list ul").append(listItem);
</script> });
</body> });
</script>
</body>
</html> </html>