我是根据HolleMUI上面的demo来的(pullrefresh_with_tab.html);我其他的页面可以,就这个页面有问题。是css的问题还是怎么了?
我现在只能用
plus.nativeUI.toast("正在加载...");
plus.nativeUI.toast("暂时没有更多的信息了!");
做控制!
下面是上拉加载js:
//阻尼系数
var deceleration = mui.os.ios?0.003:0.0009;
$('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: false, //是否显示滚动条
deceleration:deceleration
});
$.ready(function() {
//循环初始化所有上拉加载。
$.each(document.querySelectorAll('.tse-slider-group .tse-scroll'),function(index, pullRefreshEl) {
$(pullRefreshEl).pullToRefresh({
up: {
contentrefresh : "正在加载...",//可选,正在加载状态时,上拉加载控件上显示的标题内容
contentnomore:'没有更多数据了',//可选,请求完毕若没有更多数据时显示的提醒内容;
callback: function() {
var self = this;
var ctype = '';
if(pullRefreshEl.getAttribute('title')){
ctype = pullRefreshEl.getAttribute('title');
}else{
ctype = '';
}
setTimeout(function() {
var ul = self.element.querySelector('.mui-table-view');
var length = ul.querySelectorAll('li').length;
var fragment = document.createDocumentFragment();
var li;
var htmlli = '';
mui.ajax({
url:urlCell,
type:'post',
data:{type:ctype,size:'5',offset:length},//{id:id}
dataType:'json',
timeout:10000,//超时时间设置为10秒;
success:function(result){
if(result['backStatus']!='-1'){
mui.each(result,function(index,item){
li = document.createElement('li');
li.className = 'mui-table-view-cell mui-media';
htmlli = ""+
"
htmlli += item['thumb'];
}else{
htmlli += "../images/default_photo.png";
}
htmlli +="'>";
htmlli += "
"
"+item['introduce']+"
"+"
有效期:"+item['totime']+"
"+"
主办方:"+item['company']+"
"+"
li.innerHTML = htmlli;
fragment.appendChild(li);
});
ul.appendChild(fragment);
self.endPullUpToRefresh();
plus.nativeUI.toast("正在加载...");
}else{
self.endPullUpToRefresh(true);
plus.nativeUI.toast("暂时没有更多的信息了!");
}
},
error:function(xhr,type,errorThrown){
//异常处理;
console.log(type);
}
});
}, 1000);
}
}
});
});
});