如下所示:
""))}">\
\
\
\
\
';
function getList() {
if (mark) {
return false;
}
mark = 1;
var requestUrl = url.replace(/d%/,page);
$("#page-loader").show();
$.get(requestUrl,function(json){
if (json.num > 0) {
render(json.list);
$("#page-loader").hide();
page = page + 1;
} else if(json.num <= 0 && page == 1) {
$(".order-list").html(emptyTpl);
}
if (json.num >= size) {
mark = 0;
}
$("#page-loader").hide();
},'json');
}
function render(data){
for (var i=0,item; item=data[i++];) {
var html = template;
if (item['comment_status'] == 0 && item['order_status'] == 1) {
item['comment_tpl'] = commentTpl.replace(new RegExp('""))}">\
\
';
var emptyTpl = ' \
\
\
\
\
\
\
\
\
function comment(e){
e = e || window.event;
e.stopPropagation();
e.preventDefault();
var oid = $("button").attr("data-oid");
location.href = "{pigcms{:U('User/comment')}&order_id="+oid;
}
$(document).ready(function(){
var WindowHeight = $(document).height;
$(window).scroll(function(){
var top = $(document).scrollTop();
var height = $(document).height() - $(window).height() - 10;
if (top >= height) {
getList();
}
});
});