first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
li {
font-size: 20px;
margin-bottom: 20px;
}
</style>
</head>
<body>
<ul>
</ul>
</body>
<script src="./js/index.js"></script>
<script>
var page = 1;
document.querySelector("body").onscroll = function () {
// 检测高度
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
var clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
var scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
if(scrollHeight > clientHeight && scrollTop + clientHeight === scrollHeight) {
console.log("滚动到底部")
page+=1
getIndexData()
}
}
function getIndexData() {
http({
method: 'GET',
url: 'http://127.0.0.1/mcf/juhe.php',
data: {
page: page
},
success: function(res) {
console.log(res.result.data)
res.result.data.forEach((val,index) => {
document.querySelector("ul").innerHTML += `<li>${index + 1}: ${val.content}</li>`
});
},
error: function(err) {
// alert(err)
}
});
}
getIndexData()
</script>
</html>