目錄
目錄X
便民咨詢內(nèi)容頁增加評論列表顯示
便民咨詢內(nèi)容頁開啟評論,評論后內(nèi)頁界面不會顯示評論列表,只在評論框右上角顯示多少條評論,需要點(diǎn)擊后才進(jìn)入到評論列表。
不和文章-內(nèi)容頁一樣,審核的評論在當(dāng)前頁顯示列表。
改造顯示同文章效果:
新增標(biāo)簽【發(fā)表評論帶評論列表.cshtml】,在咨詢評論列表頁.cshtml 標(biāo)簽基礎(chǔ)上調(diào)整。名稱自定義。
@*評論列表頁模板*@ @inject LetterCommentService LetterCommentService @inject NodeService NodeService @{ int sourceId = Param.sourceId; var service = LetterCommentService; int commentCount = service.GetAllCommentCount(sourceId); } <div class="commentForm"> <div class="tips"> <a href="nojavascript...void(0)" class="count" hidefocus="true"><span>@(commentCount)條評論</span></a> <span>文明上網(wǎng)理性發(fā)言</span> </div> <div class="comments postComment"> @Html.AntiForgeryToken() @Power.Partial("發(fā)表評論", new { commentId = 0, sourceId }) </div> <div class="hotComments"> <h3 class="title">熱門評論</h3> <div class="comments commentlist"> @Power.Partial("評論回復(fù)列表", new { sourceId, outputcount = 5, replyId = 0, usedpage = false }) </div> </div> <div class="newComments"> <h3 class="title">最新評論</h3> <div class="comments treecomment"> @Power.Partial("評論回復(fù)列表", new { sourceId, outputcount = 5, replyId = 0, usedpage = true, order = 3 }) </div> </div> </div> <input type="hidden" id="urls" data-deletecomment="@Url.Action("AjaxDeleteComment", "LetterComment")" data-addcomment="@Url.Action("AjaxAddComment", "LetterComment")" /> <input type="hidden" id="letterid" value="@sourceId" /> <input type="hidden" id="modulename" value="LetterBox" /> <input type="hidden" name="RefreshPage" /> <!-- content E --> <script src="~/content/_common/base/js/power-commentlist.js" asp-append-version="true"></script> <script src="~/content/_common/assets/scripts/jquery.validate.js" asp-append-version="true"></script> <script src="~/content/_common/assets/scripts/jquery.validate.unobtrusive.js" asp-append-version="true"></script> <script src="~/content/_common/assets/scripts/i18n/jquery.validate.locale_zh.js" asp-append-version="true"></script> <script src="~/content/_common/base/js/jquery.validate_custom.js" asp-append-version="true"></script> <script src="~/content/_common/base/js/power.ui.captcha.js" asp-append-version="true"></script>
再把命名的標(biāo)簽替換到公開咨詢內(nèi)容頁中
原來部分:
@if (commentLoginShow) { <div class="commentForm"> <h3 class="tips"> <a href="@Url.Action("Comment", "LetterComment", new { id = Model.LetterId })" class="count" hidefocus="true"><span>@(commentCount)條評論</span></a> <span>文明上網(wǎng)理性發(fā)言</span> </h3> <div class="comments postComment"> @Html.AntiForgeryToken() @Power.Partial("發(fā)表評論") </div> </div> }
修改后:
@if (commentLoginShow) { @Power.Partial("發(fā)表評論帶評論列表",new{sourceId=Model.LetterId})
可在當(dāng)前頁面顯示評論列表內(nèi)容。
用戶登錄
還沒有賬號?
立即注冊