BD中心-修复列表分页问题
This commit is contained in:
@@ -90,10 +90,11 @@ $('.option_time .option').click(function () {
|
||||
})
|
||||
|
||||
var pageNo = 1;
|
||||
var pageSize = 10;
|
||||
var pageSize = 20;
|
||||
var canNext = true;
|
||||
var AgencyList = [];
|
||||
var orderBy = 1;
|
||||
var resPageLength;
|
||||
function getData() {
|
||||
showLoading();
|
||||
networkRequest({
|
||||
@@ -110,6 +111,7 @@ function getData() {
|
||||
if (res.code == 200) {
|
||||
$('.content_list .content_box').remove();
|
||||
let str = ''
|
||||
resPageLength = res.data.length
|
||||
AgencyList = [...AgencyList,...res.data]
|
||||
AgencyList.forEach((item, i) => {
|
||||
str += `<div class="content_box">
|
||||
@@ -151,7 +153,7 @@ function getData() {
|
||||
$(window).scroll(function () {
|
||||
if ($(this).scrollTop() + $(this).height() >= $(document).height() - 5) {
|
||||
console.log(canNext);
|
||||
if (canNext && AgencyList.length == pageSize) {
|
||||
if (canNext && resPageLength == pageSize) {
|
||||
canNext = false
|
||||
pageNo++;
|
||||
getData();
|
||||
|
@@ -86,10 +86,11 @@ function translateFun() {
|
||||
$('.Confirm').html(langReplace(localLang.demoModule.Confirm));
|
||||
}
|
||||
var pageNo = 1;
|
||||
var pageSize = 10;
|
||||
var pageSize = 20;
|
||||
var canNext = true;
|
||||
var AgencyList = [];
|
||||
var partitionId;
|
||||
var resPageLength;
|
||||
function getData() {
|
||||
showLoading();
|
||||
networkRequest({
|
||||
@@ -112,6 +113,7 @@ function getData() {
|
||||
$('.diamondNum').text(res.data.diamondNum);
|
||||
partitionId = res.data.partitionId;
|
||||
let str = ''
|
||||
resPageLength = res.data.guildInfoList.length
|
||||
AgencyList = [...AgencyList, ...res.data.guildInfoList]
|
||||
AgencyList.forEach((item, index) => {
|
||||
str += `<div class="content_box">
|
||||
@@ -168,7 +170,7 @@ function getData() {
|
||||
$(window).scroll(function () {
|
||||
if ($(this).scrollTop() + $(this).height() >= $(document).height() - 5) {
|
||||
console.log(canNext);
|
||||
if (canNext && AgencyList.length == pageSize) {
|
||||
if (canNext && resPageLength == pageSize) {
|
||||
canNext = false
|
||||
pageNo++;
|
||||
getData();
|
||||
|
Reference in New Issue
Block a user