星级厨房:榜单改为只展示前20位

This commit is contained in:
qf
2022-12-12 18:47:29 +08:00
committed by Dragon
parent 6dfb3df3ed
commit 5c530716a5

View File

@@ -641,7 +641,7 @@ const sendUserDrawInfo = (itemId, num) => {
// 榜單類型1是鉆石榜2是歐皇榜
let type = 1
let pageSize = 10
let pageSize = 20
// 鉆石榜單
let pageD = 1
@@ -1039,57 +1039,57 @@ $(function () {
e.stopPropagation()
})
// 監聽滾動
$('.other-rank').on('scroll', function () {
let scrollTop = $(this).scrollTop();//這是已經卷進去滾動條的的高度
let scrollHeight = $('.other-rank')[0].scrollHeight;//這個是other-rank包含滾動條的總高度
let ulHeight = $(this).innerHeight();//這個是other-rank的高度
// $('.other-rank').on('scroll', function () {
// let scrollTop = $(this).scrollTop();//這是已經卷進去滾動條的的高度
// let scrollHeight = $('.other-rank')[0].scrollHeight;//這個是other-rank包含滾動條的總高度
// let ulHeight = $(this).innerHeight();//這個是other-rank的高度
//這樣距離到底還有一段距離就請求,但是會導致重復請求,所以要加鎖限製
if (scrollTop + ulHeight + 100 >= scrollHeight) {
if (type === 1) {
if (isLockD) {
isLockD = false
pageD++
if (pageSize * pageD > 30) {
toastMsg('沒有更多數據啦~')
} else {
if (canRequsetNextPageD) {
getListRank(type, pageD);
} else {
toastMsg('沒有更多數據啦~')
}
}
} else {
if (scrollTop + ulHeight >= scrollHeight) {
if (pageSize * pageD > 30) {
toastMsg('沒有更多數據啦~')
}
}
}
// //這樣距離到底還有一段距離就請求,但是會導致重復請求,所以要加鎖限製
// if (scrollTop + ulHeight + 100 >= scrollHeight) {
// if (type === 1) {
// if (isLockD) {
// isLockD = false
// pageD++
// if (pageSize * pageD > 30) {
// toastMsg('沒有更多數據啦~')
// } else {
// if (canRequsetNextPageD) {
// getListRank(type, pageD);
// } else {
// toastMsg('沒有更多數據啦~')
// }
// }
// } else {
// if (scrollTop + ulHeight >= scrollHeight) {
// if (pageSize * pageD > 30) {
// toastMsg('沒有更多數據啦~')
// }
// }
// }
} else {
if (isLockN) {
isLockN = false
pageN++
if (pageSize * pageN > 30) {
toastMsg('沒有更多數據啦~')
} else {
if (canRequsetNextPageN) {
getListRank(type, pageN);
} else {
toastMsg('沒有更多數據啦')
}
}
} else {
if (scrollTop + ulHeight >= scrollHeight) {
if (pageSize * pageN > 30) {
toastMsg('沒有更多數據啦~')
}
}
}
}
}
})
// } else {
// if (isLockN) {
// isLockN = false
// pageN++
// if (pageSize * pageN > 30) {
// toastMsg('沒有更多數據啦~')
// } else {
// if (canRequsetNextPageN) {
// getListRank(type, pageN);
// } else {
// toastMsg('沒有更多數據啦')
// }
// }
// } else {
// if (scrollTop + ulHeight >= scrollHeight) {
// if (pageSize * pageN > 30) {
// toastMsg('沒有更多數據啦~')
// }
// }
// }
// }
// }
// })
// 播放3s動畫
// let player1 = new SVGA.Player('.draw-time');