fix: 修复pc nas帮助中心bug
This commit is contained in:
@@ -469,7 +469,7 @@ class TopsNas extends BaseController
|
||||
unset($val);
|
||||
$this->assign('categorys', $categorys);
|
||||
$this->assign('article', $article);
|
||||
$this->assign('cid', request()->param('cid'));
|
||||
$this->assign('cid', request()->param('cid', $article->cid));
|
||||
}
|
||||
|
||||
return $this->fetch();
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
}
|
||||
.narshelpCenterPc .pagetopbg .nhlp-search {
|
||||
width: 35%;
|
||||
height: 3rem;
|
||||
border-radius: 1.5625rem;
|
||||
height: 48px;
|
||||
border-radius: 24px;
|
||||
background: #5299e1;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
@@ -49,8 +49,8 @@
|
||||
}
|
||||
.narshelpCenterPc .pagetopbg .nhlp-search .nhlp-ipt {
|
||||
border: none;
|
||||
width: 85%;
|
||||
height: 3rem;
|
||||
width: 86%;
|
||||
height: 48px;
|
||||
margin-left: 5%;
|
||||
color: #fff;
|
||||
background: transparent;
|
||||
@@ -68,7 +68,7 @@
|
||||
}
|
||||
.narshelpCenterPc .pagetopbg .nhlp-search input::placeholder {
|
||||
color: #fff;
|
||||
padding-left: 20%;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
.narshelpCenterPc .nhlppart1 {
|
||||
@@ -323,7 +323,7 @@
|
||||
<div class="pagetopbg">
|
||||
<img src="__PUBLIC__/m_web/images/nas/help/banner.jpg" class="hpbgimg" />
|
||||
<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" />
|
||||
</div>
|
||||
<!-- 下拉搜索框 -->
|
||||
@@ -348,11 +348,13 @@
|
||||
</span>
|
||||
</a>
|
||||
{/volist}
|
||||
<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">
|
||||
{if condition="count($vo.articles) >= 3"}
|
||||
<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"/>
|
||||
</span>
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
}
|
||||
.narshelpdetailPc .narsssmain .nars-hlp-search input::placeholder {
|
||||
color: #8f9099;
|
||||
padding-left: 10%;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
.narshelpdetailPc .nars-help-content {
|
||||
@@ -153,13 +153,14 @@
|
||||
.narshelpdetailPc .nars-help-content .nars-hlpdt-ml .sub-list li:first a {
|
||||
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;
|
||||
border-bottom: 1px solid #1f2635;
|
||||
}
|
||||
.narshelpdetailPc .nars-help-content .nars-hlpdt-mm {
|
||||
padding: 32px 150px;
|
||||
max-height: 800px;
|
||||
max-height: 920px;
|
||||
min-height: 700px;
|
||||
height: auto;
|
||||
flex: 1;
|
||||
@@ -285,7 +286,7 @@
|
||||
<div class="narsssmain">
|
||||
<div class="ml">帮助中心 / 使用教程</div>
|
||||
<div class="nars-hlp-search">
|
||||
<input placeholder="请输入搜索关键字,如安装赛博云空间,影视库" />
|
||||
<input placeholder="请输入搜索关键字,如安装赛博云空间、影视库" />
|
||||
<img src="__PUBLIC__/m_web/images/nas/help/nhlp-ssico.png" class="ssimg">
|
||||
</div>
|
||||
<!-- 下拉搜索框 -->
|
||||
@@ -304,7 +305,9 @@
|
||||
</div>
|
||||
<ul class="sub-list" {if condition="$cid == $vo.id"}style="display: block;"{/if}>
|
||||
{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}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -370,25 +373,10 @@
|
||||
}, 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();
|
||||
// 提取 h1 标题
|
||||
var h1Titles = $("#rendered-content").find("h2");
|
||||
var h1Titles = $("#rendered-content").find("h3");
|
||||
h1Titles.each(function(index) {
|
||||
var title = $(this);
|
||||
var titleText = title.text();
|
||||
@@ -397,12 +385,12 @@
|
||||
var listItem = $("<li>");
|
||||
var link = $("<a>", {
|
||||
href: "#" + titleId,
|
||||
text: (index+1+'. ')+titleText
|
||||
text: titleText
|
||||
});
|
||||
listItem.append(link);
|
||||
$("#title-list ul").append(listItem);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user