星级厨房:增加轮次,游戏记录优化,替换规则图片

This commit is contained in:
qf
2022-12-27 14:08:50 +08:00
parent dc18fe1855
commit 3f18ee1b3b
9 changed files with 55 additions and 32 deletions

View File

@@ -1,12 +1,12 @@
let urlPrefix = getUrlPrefix()
let browser = checkVersion()
// 获取用户的游戏记录
let recordList = []
// let recordList = []
let page = 1
let pageSize = 10
let canNext = true;
let lisIndexId = 0;
var lisIndex = 0;
const toastMsg = (content = '', time = 2) => {
layer.open({
@@ -37,11 +37,13 @@ $(function () {
if (res.data.length != 0) {
// 能够继续请求下一页
canNext = true
// recordList.push(...res.data)
renderRecord(res.data)
} else {
canNext = false
toastMsg('沒有更多啦~')
}
recordList.push(...res.data)
renderRecord(recordList)
} else {
canNext = true
toastMsg(res.message)
@@ -60,14 +62,14 @@ $(function () {
$('.record-list').hide();
$('.img').show();
} else {
$('.record-list li').remove();
// $('.record-list li').remove();
$('.record-list').show();
$('.img').hide();
console.log(recordList, 'recordList')
var drawId;
var itemUrl;
var results = [];
let lisIndexId = 0;
let str = '';
recordList.forEach((res, index) => {
@@ -84,6 +86,7 @@ $(function () {
<li style="margin-bottom: 0.8rem;">
<h3>${dateFormat(res.drawTime, 'yy-MM-dd hh:mm:ss')}</h3>
<div class="goldBox">
<span>NO.${res.roundId}</span>
<p style="display: ${res.drawStatus == 1 ? 'none' : 'block'};" class="fasle">哎呀~猜錯了 o(╥﹏╥)o</p>
<p style="display: ${res.drawStatus == 1 ? 'block' : 'none'};" class="true">厲害~猜對了 ୧(๑•̀◡•́๑)૭</p>
</div>
@@ -132,17 +135,16 @@ $(function () {
}
$(window).scroll(function () {
if ($(window).scrollTop() + $(window).height() > $(document).height() - 10) {
// 请求下一页
if (canNext) {
page++
getUserRecord()
} else {
console.log('无数据被锁定');
}
}
});
})
$(window).scroll(function () {
if ($(window).scrollTop() + $(window).height() > $(document).height() - 10) {
// 请求下一页
if (canNext) {
page++
getUserRecord()
} else {
console.log('无数据被锁定');
}
}
});