主题 : 评论 回复功能无法使用 点击回复没有任务反应 |
级别: 版主
|
44# 发表于:2019-01-14 14:55:26 IP:117.115.*.*
<section class="comments">
<h1>评论<span>已有<a class="count" href="${base}/comment.jspx?contentId=${content.id}"> ${content.commentsCheckedNum!} </a>条</span> </h1> [#if content.channel.commentControl==0 || ((content.channel.commentControl==1||content.channel.commentControl==3) && user??)] <form id="commentForm" action="${base}/comment.jspx" method="post"> <textarea name="text" placeholder="发表你此时的观点和想法 ……" class="comments-text" id="comments-text"></textarea> [#if user??&&user.group.needCaptcha||!user??] <div class="plfr1 clearfix"> <div style="float:left;"> <input name="captcha" type="text" placeholder="验证码" id="captcha" vld="{required:true}" class="plcode"/> </div> <div style="float:left;"> <img id="commentCaptcha" src="${base}/captcha.svl" onclick="this.src='${base}/captcha.svl?d='+new Date()*1"/> </div> <div class="down clearfix"> <input type="hidden" name="contentId" value="${content.id}"/> <input type="hidden" name="sessionId" id="sessionId" /> <input type="submit" value="提交评论" class="submit-on"> </div> </div> [/#if] </form> <script type="text/javascript"> $(function() { //文本输入时改变 $('#comments-text').keyup(function(){ if(!$(this).val()==''){ $('.submit-on').attr("class", "submit-out"); }else{ $(".submit-out").attr("class", "submit-on"); } }); $("#sessionId").val($.cookie("JSESSIONID")); Cms.comment(function(data) { if(data.status==0) { alert("评论成功"); location.href=location.href; } else if(data.status==1) { alert("验证码错误"); $("#commentCaptcha").click(); } else if(data.status==2) { alert("内容不存在"); $("#commentCaptcha").click(); } else if(data.status==3) { alert("评论关闭"); $("#commentCaptcha").click(); } else if(data.status==4) { alert("需要登录评论"); $("#commentCaptcha").click(); }else if(data.status==5) { alert("已经评论过,不能重复评论"); $("#commentCaptcha").click(); } else if(data.status==100) { alert("内容不存在"); $("#commentCaptcha").click(); } else if(data.status==101) { alert("评论不能为空"); $("#commentCaptcha").click(); } else if(data.status==10) { alert("内容含有敏感词,不允许发表!"); $("#commentCaptchaCsi").click(); } else if(data.status==6) { alert("超过今日发表评论限制!"); $("#commentCaptchaCsi").click(); } else { alert("评论失败"); $("#commentCaptcha").click(); } }); }); </script> [#elseif (content.channel.commentControl==1||content.channel.commentControl==3) && !user??] [#--登录评论,且未登录--] <div class="down clearfix"> <img src="/${res}/images/userImg.png" class="userImg"><span> <a href="${base}/login.jspx?returnUrl=/">登录</a>之后才能发表评论</span> </div> [#else] [#--不允许评论--] [/#if] </section> inc_comment_input.html页面 |
||
---|---|---|---|
级别: 版主
|
45# 发表于:2019-01-14 14:55:56 IP:117.115.*.*
<div id="commentListContainer"></div>
<script type="text/javascript"> $(function(){ Cms.commentList("${base}","commentListContainer",{contentId:${content.id},orderBy:0,count:5,checked:1}); }); </script> inc_comment_list.html页面 |
||
---|---|---|---|