You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
293 lines
12 KiB
293 lines
12 KiB
{layout name="layout" /}
|
|
<div class="boxwraper">
|
|
<div class="leftwraper">
|
|
<div class="contentwraper">
|
|
<div class="navs">
|
|
<a href="{:url('index')}" class="active"><i class="fa fa-angle-left"></i> 返回上一页</a>
|
|
</div>
|
|
<div class="content">
|
|
<div class="title">{:isset($list['typename'])?'【'.$list['typename'].'】':''}{$list.name|RemoveXSS}</div>
|
|
<div class="user">
|
|
<div class="img">
|
|
{if condition="empty($list['poster'])"}
|
|
<img src="{$yf_home_path}public/images/user.png" width="100%"/>
|
|
{else}
|
|
<img src="{$list.poster}" width="100%" οnerrοr="javascript:this.src='{$yf_home_path}public/images/user.png';"/>
|
|
{/if}
|
|
</div>
|
|
<div class="detail">
|
|
<div class="name">{$list.uname}</div>
|
|
<div class="date">{$list.create_time|date="Y-m-d H:i",###}</div>
|
|
</div>
|
|
</div>
|
|
<div class="info">{$list.content|htmlspecialchars_decode|RemoveXSS}</div>
|
|
</div>
|
|
<div class="comwraper">
|
|
<div class="title">全部评论</div>
|
|
<div class="comments">
|
|
<div class="commentswraper">
|
|
{volist name="comments" id="vo"}
|
|
<div class="comment" data-id="{$vo.id}" data-uid="{$vo.mid}">
|
|
<div class="poster">
|
|
{if condition="empty($vo['poster'])"}
|
|
<img src="{$yf_home_path}public/images/user.png" width="100%"/>
|
|
{else}
|
|
<img src="{$vo.poster}" width="100%" οnerrοr="javascript:this.src='{$yf_home_path}public/images/user.png';"/>
|
|
{/if}
|
|
</div>
|
|
<div class="showcom">
|
|
<div class="uname">{$vo.uname} {if condition="$vo['top']"} <span style="color:red">(精华)</span>{/if}<i class="fa fa-ellipsis-h"></i></div>
|
|
<div class="txt">{$vo.content|htmlspecialchars_decode|strip_tags|RemoveXSS}</div>
|
|
{if condition="count($vo['parent'])"}
|
|
<div class="replay"><span class="red">{$vo.parent.uname}:</span> {$vo.parent.content|htmlspecialchars_decode|RemoveXSS}</div>
|
|
{/if}
|
|
<div class="tool">
|
|
<div class="date">{$vo.create_time|date="Y-m-d H:i",###}</div>
|
|
<div class="btns">
|
|
{if condition="$list['open'] and $vo['mid'] neq $mid"}<div class="comt"><i class="fa fa-commenting-o"></i></div>{/if}
|
|
<div class="love"><i class="fa fa-thumbs-o-up"></i><span> {$vo.love}</span></div>
|
|
{if condition="$vo['mid'] neq $mid"}<div class="comt chat"><a href="javascript:void(0);" title="私信"> <i class="fa fa-comments-o"></i></a></div>{/if}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/volist}
|
|
</div>
|
|
<div class="col-xs-12 text-center list-page" align="center">
|
|
<ul class="pagination"></ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{if condition="$list['open']"}
|
|
<div class="inputwraper">
|
|
<div class="replay"><span class="txt"></span><span class="ic"><i class="fa fa-close"></i></span></div>
|
|
<input type="hidden" name="id" value="{$list.id}" />
|
|
<input type="hidden" name="pid" value="0" />
|
|
<div class="input">
|
|
<div class="top"><span class="ic"><i class="fa fa-edit"></i></span><span class="txt">发表回复</span></div>
|
|
<div class="word">
|
|
<textarea name="word" id="word" style="min-height:300px;width:100%;" ></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="btns">
|
|
<div class="comt">发表</div>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
<div class="rightwraper">
|
|
<div class="hots">
|
|
<div class="title">讨论最热帖子</div>
|
|
<div class="wraper">
|
|
{volist name="hots" id="vo"}
|
|
<div class="ritem">
|
|
<a href="{:url('detail',['id'=>$vo['id']])}" >{$vo.name|RemoveXSS}</a>
|
|
</div>
|
|
{/volist}
|
|
</div>
|
|
</div>
|
|
<div class="interested">
|
|
<div class="title">你可能最感兴趣的帖子</div>
|
|
<div class="wraper">
|
|
{volist name="marrows" id="vo"}
|
|
<div class="ritem">
|
|
<a href="{:url('detail',['id'=>$vo['id']])}" >{$vo.name|RemoveXSS}</a>
|
|
</div>
|
|
{/volist}
|
|
</div>
|
|
</div>
|
|
<div class="postbtn">
|
|
<a href="{:url('article')}" target="__blank"><img src="{$yf_home_path}public/images/postbtn.png" class="wid100"></a>
|
|
<a href="{:url('home/center/mybbs')}" target="__blank"><img src="{$yf_home_path}public/images/userbtn.png" class="wid100"></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<link rel="stylesheet" href="{$yf_home_path}public/css/dropload.css">
|
|
<script src="{$yf_home_path}public/js/dropload.js"></script>
|
|
<script src="{$yf_home_path}public/js/jquery.page.js"></script>
|
|
<script src="{:SITE_PATH}__PUBLIC__/kindeditor/kindeditor-all-min.js" type="text/javascript"></script>
|
|
<script>
|
|
function propage(meta){
|
|
var per_page=meta['per_page'];
|
|
var total=parseInt(meta['total']);
|
|
var current_page=parseInt(meta['current_page']);
|
|
var pages=Math.ceil(total/per_page);
|
|
var total=parseInt(meta['total']);
|
|
if(pages>1){
|
|
$("#propage").remove();
|
|
$(".list-page").append('<ul id="propage" class="pagination"></ul>');
|
|
$("#propage").createPage({
|
|
pageCount:pages,
|
|
current:current_page,
|
|
backFn:function(p){
|
|
ajaxContent(p);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
function ajaxContent(pagenum){
|
|
var len=$('.comments .comment').length;
|
|
if(!len)return false;
|
|
// 页数
|
|
var page ={$page};
|
|
if(typeof pagenum!='undefined')page=pagenum;
|
|
// 每页展示5个
|
|
var size =10;
|
|
// dropload
|
|
/*
|
|
$('.comments').dropload({
|
|
scrollArea : window,
|
|
loadDownFn : function(me){
|
|
*/
|
|
//page++;
|
|
// 拼接HTML
|
|
var result = '';
|
|
var pid=$("[name='id']").val();
|
|
var url='{:url("ajaxlog")}';
|
|
var params={};
|
|
params.pid=pid;
|
|
params.page=page;
|
|
$.post(url,params,function(res){
|
|
console.log(res);
|
|
var list=res.data;
|
|
var mid="{$mid}";
|
|
mid=parseInt(mid);
|
|
var open={$list.open};
|
|
if(typeof list.data!='undefined'){
|
|
var data=list.data;
|
|
var arrLen = data.length;
|
|
var html='';
|
|
if(arrLen > 0){
|
|
$.each(data,function(key,item){
|
|
if(typeof item.id!='undefined'){
|
|
html+='<div class="comment" data-id="'+item.id+'">';
|
|
if(item.poster){
|
|
html+="<div class='poster'><img src="+item.poster+" width='100%' οnerrοr=\"javascript:this.src='{$yf_home_path}public/images/user.png';\"/></div>";
|
|
}else{
|
|
html+="<div class='poster'><img src='{$yf_home_path}public/images/user.png' width='100%' /></div>";
|
|
}
|
|
html+=' <div class="showcom"><div class="uname">'+item.uname;
|
|
if(item.top){
|
|
html+='<span style="color:red">(精华)</span>';
|
|
}
|
|
html+='<i class="fa fa-ellipsis-h"></i></div>';
|
|
html+='<div class="txt">'+item.content+'</div>';
|
|
console.log(item.parent);
|
|
if(typeof item.parent!='undefined'&&item.parent!=null&&typeof item.parent.uname!='undefined'&&item.parent.uname!=null){
|
|
html+='<div class="replay"><span class="red">'+item.parent.uname+':</span> '+item.parent.content+'</div>';
|
|
}
|
|
html+='<div class="tool"><div class="date">'+item.create_time+'</div>';
|
|
html+='<div class="btns">';
|
|
|
|
if(open&&item.mid!=mid){
|
|
html+='<div class="comt"><i class="fa fa-commenting-o"></i></div>';
|
|
}
|
|
|
|
html+='<div class="love "><i class="fa fa-thumbs-o-up"></i><span> '+item.love+'</span></div>';
|
|
if(item.mid!=mid){
|
|
html+='<div class="comt chat"><a href="javascript:void(0);" title="私信"> <i class="fa fa-comments-o" ></i></a></div>';
|
|
}
|
|
html+='</div></div></div></div>';
|
|
}
|
|
});
|
|
// 如果没有数据
|
|
}else{
|
|
// 锁定
|
|
// me.lock();
|
|
// 无数据
|
|
// me.noData();
|
|
}
|
|
$(".commentswraper").html(html);
|
|
// me.resetload();
|
|
}
|
|
});
|
|
// }
|
|
// });
|
|
}
|
|
var editor;
|
|
KindEditor.ready(function(K) {
|
|
editor=K.create('#word', {
|
|
items:['bold','italic','image','emoticons'],
|
|
noDisableItems : ['bold','italic','image','emoticons'],
|
|
allowFileManager : true
|
|
});
|
|
|
|
});
|
|
$(function(){
|
|
propage({$pages|json_encode});
|
|
var pid={$list.parent_id};
|
|
//ajaxContent(1);
|
|
$(".navs a").click(function(){
|
|
$(".navs a").removeClass('active');
|
|
$(this).addClass('active');
|
|
});
|
|
$(".navs a").each(function(k,item){
|
|
var id=$(item).data('id');
|
|
if(id==pid&&k!=0){
|
|
$(".navs a").eq(k).trigger('click');
|
|
}
|
|
});
|
|
|
|
$("body").on('click','.comment .chat',function(event){
|
|
event.stopPropagation();
|
|
event.preventDefault();
|
|
var parent=$(this).parents(".comment");
|
|
var id=parent.data('uid');
|
|
var url="{:url('chatroom')}?uid="+id;
|
|
window.location.href=url;
|
|
});
|
|
$("body").on('click','.comment .love',function(){
|
|
var parent=$(this).parents(".comment");
|
|
var hasClass=$(this).hasClass("disabled");
|
|
if(hasClass)return false;
|
|
var id=parent.data('id');
|
|
var pid=$("[name='id']").val();
|
|
var url="{:url('love')}";
|
|
var love=$(this).find("span").html();
|
|
var obj=this;
|
|
love=parseInt(love);
|
|
$.post(url,{id:id,pid:pid},function(res){
|
|
console.log(res);
|
|
layer.msg(res.msg);
|
|
if(res.code){
|
|
$(obj).find("span").html(' '+(love+1));
|
|
$(obj).addClass("disabled");
|
|
}
|
|
});
|
|
});
|
|
|
|
{if condition="$list['open']"}
|
|
$("body").on('click','.comment .comt',function(){
|
|
var parent=$(this).parents(".comment");
|
|
var txt=parent.find(".txt").html();
|
|
var id=parent.data('id');
|
|
console.log(txt);
|
|
$("[name='pid']").val(id);
|
|
$(".replay .txt").html("回复:"+txt);
|
|
$(".inputwraper .replay").show();
|
|
});
|
|
$(".replay .fa-close").click(function(){
|
|
$(".inputwraper .replay").hide();
|
|
$(".replay .txt").html("");
|
|
});
|
|
$(".inputwraper .comt").click(function(){
|
|
editor.sync();
|
|
var id=$("[name='id']").val();
|
|
var pid=$("[name='pid']").val();
|
|
var url="{:url('comment')}";
|
|
var word=$("[name='word']").val();
|
|
if(typeof word=='undefined'||word==''){
|
|
layer.msg("请输入您的观点");
|
|
return false;
|
|
}
|
|
$.post(url,{id:id,pid:pid,content:word},function(res){
|
|
layer.msg(res.msg);
|
|
if(res.code){
|
|
editor.html("");
|
|
}
|
|
});
|
|
});
|
|
{/if}
|
|
});
|
|
</script>
|
|
|