51 lines
1.6 KiB
JavaScript
Executable File
51 lines
1.6 KiB
JavaScript
Executable File
function queryByPage(p){
|
|
$('#list').html('<img src="'+WST.conf.ROOT+'/hyhproject/home/view/default/img/loading.gif">正在加载数据...');
|
|
var params = {};
|
|
params = WST.getParams('.s-query');
|
|
params.page = p;
|
|
$.post(WST.U('home/goodsconsult/pageQuery'),params,function(data,textStatus){
|
|
var json = WST.toJson(data);
|
|
$('#list').empty();
|
|
if(json.status==1){
|
|
json = json.data;
|
|
var gettpl = document.getElementById('tblist').innerHTML;
|
|
laytpl(gettpl).render(json.Rows, function(html){
|
|
$('#list').html(html);
|
|
$('.gImg').lazyload({ effect: "fadeIn",failurelimit : 10,skip_invisible : false,threshold: 200,placeholder:window.conf.IMGURL+'/'+window.conf.GOODS_LOGO});
|
|
});
|
|
laypage({
|
|
cont: 'pager',
|
|
pages:json.TotalPage,
|
|
curr: json.CurrentPage,
|
|
skin: '#e23e3d',
|
|
groups: 3,
|
|
jump: function(e, first){
|
|
if(!first){
|
|
queryByPage(e.curr);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function reply(t,id){
|
|
var params = {};
|
|
if($('#reply-'+id).val()==''){
|
|
WST.msg('回复内容不能为空',{icon:2});
|
|
return false;
|
|
}
|
|
params.reply = $('#reply-'+id).val();
|
|
params.id=id;
|
|
$.post(WST.U('home/goodsconsult/reply'),params,function(data){
|
|
var json = WST.toJson(data);
|
|
if(json.status==1){
|
|
var today = new Date();
|
|
var Myd = today.toLocaleDateString();
|
|
var His = today.toLocaleTimeString();
|
|
var html = '<p class="reply-content">'+params.reply+'【'+Myd+' '+His+'】</p>'
|
|
$(t).parent().html(html);
|
|
}
|
|
});
|
|
}
|