下拉刷新
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/mui.css">
|
<link rel="stylesheet" href="css/mui.min.css">
|
||||||
<link rel="stylesheet" href="css/main.css">
|
<link rel="stylesheet" href="css/main.css">
|
||||||
<style>
|
<style>
|
||||||
.mui-bar-tab{background:#fff;box-shadow:none;}
|
.mui-bar-tab{background:#fff;box-shadow:none;}
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
.cardInfo:first-child{border-top:none;}
|
.cardInfo:first-child{border-top:none;}
|
||||||
.info-container input{float:none;width:100%;}
|
.info-container input{float:none;width:100%;}
|
||||||
.picker-item{padding:0 5rem;font-size:18px;}
|
.picker-item{padding:0 5rem;font-size:18px;}
|
||||||
|
.pull-to-refresh-layer .preloader{visibility: visible; }
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@@ -42,7 +44,13 @@
|
|||||||
<input id="address" name = "address" type="hidden"/>
|
<input id="address" name = "address" type="hidden"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content infinite-scroll infinite-scroll-bottom pstion" data-distance="50">
|
<div class="content infinite-scroll infinite-scroll-bottom pstion pull-to-refresh-content" data-distance="50" data-ptr-distance="30">
|
||||||
|
<!-- 默认的下拉刷新层 -->
|
||||||
|
<div class="pull-to-refresh-layer dn">
|
||||||
|
<div class="preloader"></div>
|
||||||
|
<!--<div class="pull-to-refresh-arrow"></div>-->
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="card cardPrice" id="baseInfo" v-cloak>
|
<div class="card cardPrice" id="baseInfo" v-cloak>
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<span>{{topMonth}}月份均价</span>
|
<span>{{topMonth}}月份均价</span>
|
||||||
@@ -114,6 +122,8 @@
|
|||||||
<div id="newsList">
|
<div id="newsList">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="infinite-scroll-preloader">
|
<div class="infinite-scroll-preloader">
|
||||||
<div class="preloader"></div>
|
<div class="preloader"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1550,6 +1560,9 @@ function initNews(page){
|
|||||||
lastIndex = $('.cardInfo').length;
|
lastIndex = $('.cardInfo').length;
|
||||||
itemsPerLoad = response.data.data.list.length;
|
itemsPerLoad = response.data.data.list.length;
|
||||||
addItems(itemsPerLoad, lastIndex);
|
addItems(itemsPerLoad, lastIndex);
|
||||||
|
|
||||||
|
|
||||||
|
$(".pull-to-refresh-layer").addClass("dn");
|
||||||
/*if(dataObj.length>5){
|
/*if(dataObj.length>5){
|
||||||
$(".infinite-scroll-preloader").show();
|
$(".infinite-scroll-preloader").show();
|
||||||
}else{
|
}else{
|
||||||
@@ -2001,6 +2014,23 @@ $(document).on('infinite', '.infinite-scroll-bottom',function() {
|
|||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 添加'refresh'监听器
|
||||||
|
$(document).on('refresh', '.pull-to-refresh-content',function(e) {
|
||||||
|
if($("#input_city").text()=="上海"){
|
||||||
|
$(".pull-to-refresh-layer").removeClass("dn");
|
||||||
|
page = 1;
|
||||||
|
dataObj = [];
|
||||||
|
$("#newsList").html("");
|
||||||
|
initNews(page);
|
||||||
|
// 加载完毕需要重置
|
||||||
|
$.pullToRefreshDone('.pull-to-refresh-content');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function regionChange(region){
|
function regionChange(region){
|
||||||
var text = region;
|
var text = region;
|
||||||
var length = region.length;
|
var length = region.length;
|
||||||
@@ -2664,6 +2694,9 @@ $("body").delegate("#hotList ul li", "click", function () {
|
|||||||
//clicked(url, true);
|
//clicked(url, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user