fix: 修复pc nas帮助中心bug

This commit is contained in:
2025-01-24 09:31:09 +08:00
parent 5de2667c2d
commit b5636674fe
3 changed files with 23 additions and 33 deletions

View File

@@ -469,7 +469,7 @@ class TopsNas extends BaseController
unset($val); unset($val);
$this->assign('categorys', $categorys); $this->assign('categorys', $categorys);
$this->assign('article', $article); $this->assign('article', $article);
$this->assign('cid', request()->param('cid')); $this->assign('cid', request()->param('cid', $article->cid));
} }
return $this->fetch(); return $this->fetch();

View File

@@ -34,8 +34,8 @@
} }
.narshelpCenterPc .pagetopbg .nhlp-search { .narshelpCenterPc .pagetopbg .nhlp-search {
width: 35%; width: 35%;
height: 3rem; height: 48px;
border-radius: 1.5625rem; border-radius: 24px;
background: #5299e1; background: #5299e1;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
@@ -49,8 +49,8 @@
} }
.narshelpCenterPc .pagetopbg .nhlp-search .nhlp-ipt { .narshelpCenterPc .pagetopbg .nhlp-search .nhlp-ipt {
border: none; border: none;
width: 85%; width: 86%;
height: 3rem; height: 48px;
margin-left: 5%; margin-left: 5%;
color: #fff; color: #fff;
background: transparent; background: transparent;
@@ -68,7 +68,7 @@
} }
.narshelpCenterPc .pagetopbg .nhlp-search input::placeholder { .narshelpCenterPc .pagetopbg .nhlp-search input::placeholder {
color: #fff; color: #fff;
padding-left: 20%; text-align: center;
font-size: 16px; font-size: 16px;
} }
.narshelpCenterPc .nhlppart1 { .narshelpCenterPc .nhlppart1 {
@@ -323,7 +323,7 @@
<div class="pagetopbg"> <div class="pagetopbg">
<img src="__PUBLIC__/m_web/images/nas/help/banner.jpg" class="hpbgimg" /> <img src="__PUBLIC__/m_web/images/nas/help/banner.jpg" class="hpbgimg" />
<div class='nhlp-search'> <div class='nhlp-search'>
<input class="nhlp-ipt" id="search-input" placeholder="请输入搜索关键字,如安装赛博云空间,影视库" /> <input class="nhlp-ipt" id="search-input" placeholder="请输入搜索关键字如安装赛博云空间影视库" />
<img src="__PUBLIC__/m_web/images/nas/help/nars-help-search.png" class="searchimghelp" /> <img src="__PUBLIC__/m_web/images/nas/help/nars-help-search.png" class="searchimghelp" />
</div> </div>
<!-- 下拉搜索框 --> <!-- 下拉搜索框 -->
@@ -348,11 +348,13 @@
</span> </span>
</a> </a>
{/volist} {/volist}
<a class="ckgdbt" href="{:url('tops_nas/helper_detail', ['cid'=>$vo.id, 'id'=>isset($vo.articles[0])?$vo.articles[0]['id']:0])}">查看更多 {if condition="count($vo.articles) >= 3"}
<span class="narhelpgoimg"> <a class="ckgdbt" href="{:url('tops_nas/helper_detail', ['cid'=>$vo.id, 'id'=>isset($vo.articles[0])?$vo.articles[0]['id']:0])}">查看更多
<span class="narhelpgoimg">
<img src="__PUBLIC__/m_web/images/nas/help/nars-jt.png"/> <img src="__PUBLIC__/m_web/images/nas/help/nars-jt.png"/>
</span> </span>
</a> </a>
{/if}
</div> </div>
</div> </div>
{/volist} {/volist}

View File

@@ -88,7 +88,7 @@
} }
.narshelpdetailPc .narsssmain .nars-hlp-search input::placeholder { .narshelpdetailPc .narsssmain .nars-hlp-search input::placeholder {
color: #8f9099; color: #8f9099;
padding-left: 10%; text-align: center;
font-size: 14px; font-size: 14px;
} }
.narshelpdetailPc .nars-help-content { .narshelpdetailPc .nars-help-content {
@@ -153,13 +153,14 @@
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li:first a { .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li:first a {
padding-top: 0; padding-top: 0;
} }
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li a:hover { .narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li a:hover,
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li a.active {
color: #1f2635; color: #1f2635;
border-bottom: 1px solid #1f2635; border-bottom: 1px solid #1f2635;
} }
.narshelpdetailPc .nars-help-content .nars-hlpdt-mm { .narshelpdetailPc .nars-help-content .nars-hlpdt-mm {
padding: 32px 150px; padding: 32px 150px;
max-height: 800px; max-height: 920px;
min-height: 700px; min-height: 700px;
height: auto; height: auto;
flex: 1; flex: 1;
@@ -285,7 +286,7 @@
<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>
<!-- 下拉搜索框 --> <!-- 下拉搜索框 -->
@@ -304,7 +305,9 @@
</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 data-id="{$va.id}"><a href="javascript:void(0);" style="{if condition='$key==0'}padding-top: 6px;{/if}">{$va.name}</a></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>
</li>
{/volist} {/volist}
</ul> </ul>
</div> </div>
@@ -370,25 +373,10 @@
}, 300); }, 300);
}) })
// 内容 // 内容
readerContentTitle(); // 清空标题列表
$('.sub-list li').click(function() {
var id = $(this).data('id');
$.ajax({
url: '{:url("tops_nas/helper_detail")}?id=' + id,
type: 'GET',
dataType: 'JSON',
success: function(r) {
$('#rendered-content div').html(r.data.content);
readerContentTitle();
}
})
})
});
function readerContentTitle() {
// 清空标题列表
$("#title-list ul").empty(); $("#title-list ul").empty();
// 提取 h1 标题 // 提取 h1 标题
var h1Titles = $("#rendered-content").find("h2"); var h1Titles = $("#rendered-content").find("h3");
h1Titles.each(function(index) { h1Titles.each(function(index) {
var title = $(this); var title = $(this);
var titleText = title.text(); var titleText = title.text();
@@ -397,12 +385,12 @@
var listItem = $("<li>"); var listItem = $("<li>");
var link = $("<a>", { var link = $("<a>", {
href: "#" + titleId, href: "#" + titleId,
text: (index+1+'. ')+titleText text: titleText
}); });
listItem.append(link); listItem.append(link);
$("#title-list ul").append(listItem); $("#title-list ul").append(listItem);
}); });
} });
</script> </script>
</body> </body>
</html> </html>