下面是代码,请大神们帮忙看看
mui.init({
pullRefresh : {
container:'.box-chou',
up : {
height:50,
auto:true,
contentrefresh: "正在加载...",
contentnomore:'没有更多数据了',
callback : upshua
}
}
});
function upshua(){
var booName = decodeURI($.getUrlVar('id'));
console.log(booName)
$.ajax({
type:"POST",
url:durl+"/api/funding/class",
async:true,
data:{cat_id:booName},
success:function(data){
var htmls = '';
var html = '';
$.each(data.data.data,function(k,co){
htmls += '<img src='+dimg+co.image+' class="starimg" alt="" />';
html += '<div class="box-chou"><div class="box-chou-a">'+
'<div class="ytt">生态'+co.title+'</div><div class="jin-wai">'+
'<div class="jin-nei"></div></div><span class="wai-a"></span>'+
'<div class="chou-mm">'+
'<div><span class="zy">'+co.end_time+'</span><span>结束时间</span></div>'+
'<div><span>'+co.money+'</span><span>已筹金额</span></div>'+
'<div><span class="can">'+co.num+'</span><span>参与人数</span></div></div></div>'+
'<div class="box-chou-b"><button onclick=gong('+co.id+') type="button" class="mui-btn mui-btn-outlined">发起众筹</button></div></div>'+
'<div class="zong" style="display:none;">'+co.people+'</div>';
});
//进度条
$(".boji").html(htmls);
$(".chou").html(html);
$(function(){
var can = $('.can').html();
var zong = $('.zong').html();
var bai = $('.wai-a');
var bai = ((can / zong) * 100) + '%';
$('.jin-nei').css('width',bai);
$('.wai-a').append(bai);
})
}
});
this.endPullupToRefresh(false);
}
0 个回复