// 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" alt=""></a>\
<h5><a href="'+info.coupon_info.url+'">['+info.coupon_info.name+'] </a><a href="'+info.url+'">'+info.title+'</a></h5>\
<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);
}
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。