帖子功能加入[发布/更新/评论/置顶/加精/删除]
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
</fieldset>
|
||||
|
||||
<ul class="jieda" id="jieda">
|
||||
#for(x : comments.rows??)
|
||||
#for(x : comments.list??)
|
||||
<li data-id="#(x.commentId)" class="jieda-daan">
|
||||
<a name="item-1111111111"></a>
|
||||
<div class="detail-about detail-about-reply">
|
||||
@@ -89,8 +89,8 @@
|
||||
<div class="fly-detail-user">
|
||||
<a href="" class="fly-link">
|
||||
<cite>#(x.nickname)</cite>
|
||||
<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
<i class="layui-badge fly-badge-vip">VIP3</i>
|
||||
<!--<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
<i class="layui-badge fly-badge-vip">VIP3</i>-->
|
||||
</a>
|
||||
#if(x.userId == bean.userId??)
|
||||
<span>(楼主)</span>
|
||||
@@ -102,7 +102,7 @@
|
||||
-->
|
||||
</div>
|
||||
|
||||
<div class="detail-hits"><span>#(x.createTime??)</span></div>
|
||||
<div class="detail-hits"><span>#@dateFmt(x.createTime)</span></div>
|
||||
#if(1>2)
|
||||
<i class="iconfont icon-caina" title="最佳答案"></i>
|
||||
#end
|
||||
|
||||
@@ -75,12 +75,10 @@ layui.define(['fly','laypage'], function(exports){
|
||||
gather.jieAdmin = {
|
||||
//删求解
|
||||
del: function(div){
|
||||
layer.confirm('确认删除该求解么?', function(index){
|
||||
layer.confirm('确认删除该帖子吗?', function(index){
|
||||
layer.close(index);
|
||||
fly.json('/content/set', {
|
||||
id: div.data('id')
|
||||
,v: -1
|
||||
,field:"status"
|
||||
fly.json('/jie/del', {
|
||||
contentId: div.data('id')
|
||||
}, function(res){
|
||||
location.href= "/";
|
||||
});
|
||||
@@ -90,7 +88,7 @@ layui.define(['fly','laypage'], function(exports){
|
||||
//设置置顶、状态
|
||||
,set: function(div){
|
||||
var othis = $(this);
|
||||
fly.json('/content/set', {
|
||||
fly.json('/jie/set', {
|
||||
id: div.data('id')
|
||||
,v: othis.attr('v')
|
||||
,field: othis.attr('field')
|
||||
@@ -102,7 +100,7 @@ layui.define(['fly','laypage'], function(exports){
|
||||
//收藏
|
||||
,collect: function(div){
|
||||
var othis = $(this), type = othis.data('type');
|
||||
fly.json('/content/collect', {
|
||||
fly.json('/jie/collect', {
|
||||
contentId: div.data('id')
|
||||
,ok: type === 'add'? 1:-1
|
||||
}, function(res){
|
||||
@@ -139,7 +137,7 @@ layui.define(['fly','laypage'], function(exports){
|
||||
gather.jiedaActive = {
|
||||
zan: function(li){ //赞
|
||||
var othis = $(this), ok = othis.hasClass('zanok');
|
||||
fly.json('/os/comment/support', {
|
||||
fly.json('/comment/support', {
|
||||
commentId: li.data('id')
|
||||
,ok: ok?-1:1
|
||||
}, function(res){
|
||||
@@ -243,13 +241,10 @@ layui.define(['fly','laypage'], function(exports){
|
||||
form.on('submit(jie-reply)', function(data){
|
||||
var bean = {};
|
||||
["contentId","pid", "content"].forEach(function (value) {
|
||||
bean[value] = data.field[value];
|
||||
bean["comment."+value] = data.field[value];
|
||||
});
|
||||
console.log(bean);
|
||||
|
||||
fly.json("/comment/save",{
|
||||
bean:JSON.stringify(bean)
|
||||
},function (res) {
|
||||
fly.json("/comment/save",bean,function (res) {
|
||||
layer.msg("回复成功",{time:2000},function () {
|
||||
//location.href = "/";
|
||||
location.reload();
|
||||
|
||||
Reference in New Issue
Block a user