body代码如下:
<body>
<div class="mui-content">
<div id="slider" class="mui-slider mui-fullscreen">
<div id="sliderSegmentedControl" class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
<a class="mui-control-item" href="#item1mobile">待处理</a>
<a class="mui-control-item" href="#item2mobile">已完成</a>
</div>
<div id="sliderProgressBar" class="mui-slider-progress-bar mui-col-xs-6"></div>
<div class="mui-slider-group">
<div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
</div>
<div id="item2mobile" class="mui-slider-item mui-control-content">
</div>
</div>
</div>
</div>
<div id="scroll1" class="mui-scroll-wrapper scrupdate">
<div class="mui-scroll">
<div class="uldiv">
</div>
</div>
</div>
</body>
JS代码如下:
function pulldownRefresh() {
setTimeout(function() {
if (type == "wait") WaitPageindex = 1;
else EndpayPageindex = 1;
getOrders(type, WaitPageindex, item1);
}, 1500);
}
function pulscallback() {
if (type == "wait") WaitPageindex = WaitPageindex + 1;
else EndpayPageindex = EndpayPageindex + 1;
setTimeout(function() {
getOrders(type, WaitPageindex, item1);
}, 500);
}
(function(mu) {
mui.init({
pullRefresh: {
container: '#scroll1',
down: {
contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容
contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容
contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容
callback: pulldownRefresh
},
up: {
contentrefresh: "正在加载...",
contentnomore: '没有更多数据了',
callback: pulscallback
}
}
});
state = app.getState();
mu('.mui-scroll-wrapper').scroll({
indicators: true //是否显示滚动条
});
item1 = document.querySelector('#scroll1');
$(item1).appendTo(document.querySelector('#item1mobile'));
setTimeout(function() {
mui(item1).pullRefresh().pullupLoading();
}, 1000);
})(mui);
document.getElementById('slider').addEventListener('slide', function(e) {
if (e.detail.slideNumber == 0) {
WaitPageindex = 1;
type = "wait";
$(item1).find(".uldiv").children().remove();
mui(item1).pullRefresh().pullupLoading();
$(item1).appendTo(document.querySelector('#item1mobile'));
}
if (e.detail.slideNumber == 1) {
EndpayPageindex = 1;
type = "end";
$(item1).find(".uldiv").children().remove();
$(item1).appendTo(document.querySelector('#item2mobile'));
mui(item1).pullRefresh().pullupLoading();
}
});
问题:将下拉设定的 <div id="scroll1" class="mui-scroll-wrapper scrupdate"> 追加至 slider的 item中 android 滚动条 有bug,还没到最低下就加载下一页的数据了。
请问 怎么解决呀
0 个回复