带下拉刷新,上拉加载更多,暂无提示,加载提示等等 继承演示代码
## html
```
<div class="" id="ea55_data_box">
</div>
<div class="ea55_footer_load">
<div class="weui-loadmore ea55_footer_load_s1">
<i class="weui-loading"></i>
<span class="weui-loadmore__tips">正在加载</span>
</div>
<div class="weui-loadmore weui-loadmore_line ea55_footer_load_s2" >
<span class="weui-loadmore__tips">暂无数据</span>
</div>
</div>
<script id="interpolationtmpl" type="text/x-dot-template">
{{?it&&it[0]}}
{{~it :value:index }}
模版循环内容
{{~}}
{{??}}
{{=$common.html_data_tishi({'title':'暂无内容'}) }}
{{?}}
</script>
```
## js
```
$common.ready(function () {
//$common.config().getInterfaceStyle
ea55_ajax_one();
});
function ea55_ajax_one(){
//下拉刷新
ea55_shuaxin(function (){
ajax_data['page']=1;
ajax_data['go']=true;
ea55_ajax_data();
});
api.addEventListener({
name:'scrolltobottom',
extra:{
threshold:0
}
}, function(ret, err){
ea55_ajax_data();
});
ea55_ajax_data();
}
//获取首页派车单列表
var ajax_data={page:1,go:true};
function ea55_ajax_data(){
if(ajax_data['go']){
ajax_data['go']=false;
var post_data={
pageNum:ajax_data['page'],
pageSize:20
};
api.cancelAjax({ tag: 'ajax_data' });
$(".weui-loadmore").hide();
$(".ea55_footer_load_s1").show();
$common.ajax({
url: 'v1/car/getBindedCarList',
app_url:true,
tag:'ajax_data',
method: 'get',
not_loading:true,
verification_token:true,
data: {
values: post_data
}
}, function(ret, err) {
if (ajax_data['page'] == 1) {
$("#interpolation").html("");
}
$(".weui-loadmore").hide();
ajax_data['go'] = true;
ea55_shuaxin_end();
if (ret && ret.code == 200) {
var interText = doT.template($("#interpolationtmpl").text());
if (ret.rows && ret.rows[0]) {
$("#interpolation").append(interText(ret.rows));
ajax_data['page']++;
} else {
$(".weui-loadmore").hide();
$(".ea55_footer_load_s2").show();
ajax_data['go'] = false;
}
console.log('列表:' + JSON.stringify(ret));
} else {
// console.log(JSON.stringify(err));
}
});
}}
```