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.
210 lines
8.7 KiB
210 lines
8.7 KiB
{layout name="public/layout" /}
|
|
<div class="mybbs">
|
|
<div class="head weui-media-box weui-media-box_appmsg">
|
|
<div class="weui-media-box__hd">
|
|
<img class="weui-media-box__thumb img-circle" src="{$member_list_headpic|get_imgurl=1}" οnerrοr="javascript:this.src='{$yf_theme_path}public/img/user.png';" style="max-width:120px;"/>
|
|
</div>
|
|
<div class="weui-media-box__bd">
|
|
<h4 class="weui-media-box__title">{$member_list_nickname|default=$member_list_username}</h4>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<div class="page__bd page__bd_spacing menu">
|
|
<div class="navs">
|
|
<a href="javascript:void(0);" class="active" >发布</a>
|
|
<a href="javascript:void(0);">回复</a>
|
|
<a href="{:url('bbs/msg')}">私信</a>
|
|
</div>
|
|
<div class="showwraper">
|
|
<div class="showlists">
|
|
<div class="showlist lists active">
|
|
<div class="showlistwraper">
|
|
|
|
</div>
|
|
</div>
|
|
<div class="showlist comments">
|
|
<div class="commentswraper">
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<link rel="stylesheet" href="{$yf_theme_path}public/css/dropload.css">
|
|
<script src="{$yf_theme_path}public/js/dropload.js"></script>
|
|
<script src="__PUBLIC__/layer/layer_home.js" type="text/javascript"></script>
|
|
<script>
|
|
function ajaxLog(pagenum){
|
|
// 页数
|
|
var page =0;
|
|
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='';
|
|
var open=1;
|
|
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_theme_path}public/img/user.png';\"/></div>";
|
|
}else{
|
|
html+="<div class='poster'><img src='{$yf_theme_path}public/img/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>';
|
|
if(typeof item.parent.uname!='undefined'){
|
|
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"> <div class="comt edit"><i class="fa fa-edit"></i></div> <div class="comt del"><i class="fa fa-trash-o"></i></div>';
|
|
html+='</div></div></div></div>';
|
|
}
|
|
});
|
|
// 如果没有数据
|
|
}else{
|
|
// 锁定
|
|
me.lock();
|
|
// 无数据
|
|
me.noData();
|
|
}
|
|
$(".comments .commentswraper").append(html);
|
|
me.resetload();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
function ajaxContent(){
|
|
// 页数
|
|
var page =0;
|
|
if(typeof pagenum!='undefined')page=pagenum;
|
|
// 每页展示5个
|
|
var size = 5;
|
|
// dropload
|
|
$('.lists').dropload({
|
|
scrollArea : window,
|
|
loadDownFn : function(me){
|
|
page++;
|
|
// 拼接HTML
|
|
var result = '';
|
|
var params={};
|
|
params.page=page;
|
|
var url='{:url("ajaxlist")}';
|
|
if(typeof keyword!='undefined'&&keyword)params.keyword=keyword;
|
|
$.post(url,params,function(res){
|
|
console.log(res);
|
|
var list=res.data;
|
|
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='item' >";
|
|
if(item.poster){
|
|
html+="<div class='user'><div class='img'> <img src="+item.poster+" width='100%' οnerrοr=\"javascript:this.src='{$yf_theme_path}public/img/user.png';\"/></div>";
|
|
}else{
|
|
html+="<div class='user'><div class='img'> <img src='{$yf_theme_path}public/img/user.png' width='100%' /></div>";
|
|
}
|
|
|
|
html+='<div class="detail" onclick="window.location.href="/member/bbs/detail/id/'+item.id+'.html""><div class="name">'+item.uname+'</div></div></div>';
|
|
html+='<div class="title">'+item.name+'</div>';
|
|
html+='<div class="tool"><div class="time">'+item.create_time+'</div><div class="comment"><i class="fa fa-commenting-o"></i> '+item.comment+'</div><div class="comment" onclick="window.location.href=\'{:url("bbs/article")}?id='+item.id+'\'"> <i class="fa fa-edit"></i></div></div></div>';
|
|
}
|
|
});
|
|
// 如果没有数据
|
|
}else{
|
|
// 锁定
|
|
me.lock();
|
|
// 无数据
|
|
me.noData();
|
|
}
|
|
$(".lists .showlistwraper").append(html);
|
|
me.resetload();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
$(function(){
|
|
ajaxContent(0);
|
|
ajaxLog(0);
|
|
$("body").on('click','.comment .del',function(){
|
|
var parent=$(this).parents(".comment");
|
|
layer.confirm('确定要删除该留言吗?',{btn: ['确定', '取消'],title:"提示"}, function(){
|
|
var id=parent.data('id');
|
|
var url="{:url('delcom')}";
|
|
$.post(url,{id:id},function(res){
|
|
layer.msg(res.msg);
|
|
if(res.code){
|
|
parent.remove();
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
$("body").on('click','.comment .edit',function(){
|
|
var parent=$(this).parents(".comment");
|
|
var obj=parent.find(".txt");
|
|
var txt=obj.html();
|
|
obj.html("<textarea rows='3'>"+txt+"</textarea><button>更新</button>");
|
|
/*
|
|
var id=parent.data('id');
|
|
var url="{:url('savecom')}";
|
|
$.post(url,{id:id},function(res){
|
|
layer.msg(res.msg);
|
|
if(res.code){
|
|
parent.remove();
|
|
}
|
|
});
|
|
*/
|
|
});
|
|
$("body").on('click','.comment button',function(){
|
|
var parent=$(this).parents(".comment");
|
|
var obj=parent.find("textarea");
|
|
var box=parent.find(".txt");
|
|
var txt=obj.val();
|
|
var id=parent.data('id');
|
|
var url="{:url('savecom')}";
|
|
$.post(url,{id:id,content:txt},function(res){
|
|
layer.msg(res.msg);
|
|
if(res.code){
|
|
box.html(txt);
|
|
}
|
|
});
|
|
});
|
|
$(".navs a").click(function(){
|
|
$(".navs a").removeClass('active');
|
|
$(this).addClass('active');
|
|
var index=$(".navs .active").index();
|
|
$(".showlist").removeClass('active');
|
|
$(".showlist").eq(index).addClass('active');
|
|
});
|
|
});
|
|
</script>
|