// list 是ajax请求过来的数据
// obj是你选择的对象(我这里是选择的ul 让数据在ul 里面 展示)
var loadCouponUI = function(list, obj) {
var html = ‘‘;
$.each(list.list, function(k, info){
html += ‘<li>\
<div class="coutop">\
<a href="‘+info.url+‘"><img src="‘+info.cover+‘" width="230px" height="200px" ></a>\
<h4><a href="‘+info.coupon_info.url+‘">[‘+info.coupon_info.name+‘] </a><a href="‘+info.url+‘">‘+info.title+‘</a></h4>\
<p>有效期至 <em>‘+info.end_time+‘</em></p>\
</div>\
<div class="coubottom clearfix">\
<p class="num left">\
<span class="surplus-num">剩余<em>‘+info.last_total+‘</em>份</span>\
<span class="totle-num">共<em>‘+info.total+‘</em>份</span>\
</p>‘;
if (info.coupon_status == 1) {
html += ‘<a href="javascript:void(0);" class="btn btn-danger right">立即领取</a>‘;
} else if (info.coupon_status == 2) {
htim += ‘<a href="javascript:void(0);" class="btn btn-primary right">已领完</a>‘;
} else if (info.coupon_status == 4) {
html += ‘<a href="javascript:void(0);" class="btn btn-info right">已领取</a>‘;
}
html += ‘</div>\
</li>‘;
})
obj.append(html);
}