Authored by 王水玲

已开通分期商品不能翻页

1 -<div class="installment-page installment-result-page"> 1 +<div class="installment-page installment-result-page yoho-page">
2 {{# review}} 2 {{# review}}
3 <i class="review-icon"></i> 3 <i class="review-icon"></i>
4 <p class="font-b">审核中</p> 4 <p class="font-b">审核中</p>
1 -<div class="repayment-list-page" data-pos-id="{{posId}}"> 1 +<div class="repayment-list-page yoho-page" data-pos-id="{{posId}}">
2 <ul class="record-list"></ul> 2 <ul class="record-list"></ul>
3 <div class="no-result" style="display: none;"> 3 <div class="no-result" style="display: none;">
4 <i class="result-icon"></i> 4 <i class="result-icon"></i>
@@ -14,12 +14,12 @@ var ListData = function(opt) { @@ -14,12 +14,12 @@ var ListData = function(opt) {
14 var self = this; 14 var self = this;
15 15
16 var _scrollHandler = function() { 16 var _scrollHandler = function() {
17 - var curScrollTop = $(window).scrollTop(); 17 + var curScrollTop = this.opt.y || $(window).scrollTop();
18 18
19 // 当scroll到1/4$repayList高度后继续请求下一页数据 19 // 当scroll到1/4$repayList高度后继续请求下一页数据
20 if (curScrollTop > this.opt.previousScrollTop && 20 if (curScrollTop > this.opt.previousScrollTop &&
21 (curScrollTop + this.opt.winH > 21 (curScrollTop + this.opt.winH >
22 - $(document).height() - 0.25 * this.opt.boxArea.height() - 50)) { 22 + this.opt.docH - 0.25 * this.opt.boxArea.height() - 50)) {
23 this.getListData(); 23 this.getListData();
24 } 24 }
25 25
@@ -32,7 +32,18 @@ var ListData = function(opt) { @@ -32,7 +32,18 @@ var ListData = function(opt) {
32 previousScrollTop: 0 32 previousScrollTop: 0
33 }, opt); 33 }, opt);
34 34
35 - $(window).scroll(function() { 35 + $(window).scroll(function(event, y, docH, starIScroll) {
  36 + if (!y && $('.is-open').val() === 'true') {
  37 + return;
  38 + }
  39 +
  40 + if (y) {
  41 + self.opt.y = Math.abs(y);
  42 + self.opt.starIScroll = starIScroll;
  43 + }
  44 +
  45 + self.opt.docH = docH ? docH : $(document).height();
  46 +
36 window.requestAnimationFrame(_scrollHandler.bind(self)); 47 window.requestAnimationFrame(_scrollHandler.bind(self));
37 }); 48 });
38 }; 49 };
@@ -103,6 +114,10 @@ ListData.prototype.getListData = function(page) { @@ -103,6 +114,10 @@ ListData.prototype.getListData = function(page) {
103 }); 114 });
104 } 115 }
105 116
  117 + if (self.opt.starIScroll) {
  118 + self.opt.starIScroll.iScroll.refresh();
  119 + }
  120 +
106 loading.hideLoadingMask(); 121 loading.hideLoadingMask();
107 }, 122 },
108 error: function() { 123 error: function() {
@@ -146,16 +146,20 @@ var installment = { @@ -146,16 +146,20 @@ var installment = {
146 }); 146 });
147 147
148 // 解决部分安卓手机不识别calc(100vh)的问题 148 // 解决部分安卓手机不识别calc(100vh)的问题
149 - $('.installment-main').css({height: $(window).height()});  
150 -  
151 - starIScroll.iScroll.on('scroll', function() {  
152 - $(window).trigger('scroll');  
153 - }); 149 + $('.installment-main').css({height: parseInt($(window).height()) + 5});
154 150
155 $('img').on('load', function() { 151 $('img').on('load', function() {
156 starIScroll && starIScroll.iScroll.refresh(); 152 starIScroll && starIScroll.iScroll.refresh();
157 }); 153 });
158 154
  155 + starIScroll.iScroll.on('scroll', function() {
  156 + if ($('.usable').is(':hidden')) {
  157 + return;
  158 + }
  159 +
  160 + $(window).trigger('scroll', [this.y, $('.main-content').height(), starIScroll]);
  161 + });
  162 +
159 this.starIScroll = starIScroll; 163 this.starIScroll = starIScroll;
160 }, 164 },
161 paramsInit: function() { 165 paramsInit: function() {