Commit 53c2fa5f authored by wildfirecode13's avatar wildfirecode13

1

parent 0219e95d
......@@ -4,7 +4,7 @@ export const homeInfo = {
{
"canUpdateNickName": false,
"figures": [{ "figureId": "1" }, { "figureId": "2" }, { "figureId": "3" }],
"newUser": 1,
"newUser": 0,
"userInfo": { "figureId": "3", "joyBeans": 123456789123, "nickName": "13" }
},
"message": null,
......
......@@ -20,6 +20,7 @@ class Detail2 extends Component {
}
onScroll = () => {
console.log('%c onScroll function run', 'color:blue;font-size:20px;font-weight:900;')
if (!canLoading) {
console.log('不能加载了')
return;
......@@ -27,13 +28,13 @@ class Detail2 extends Component {
const { list } = this.state;
const targetScrollTop = list.length * 55 * ratio - listWrapperHeight;
const currentScrollTop = this.refs.listref.scrollTop * ratio;
if (currentScrollTop >= targetScrollTop) {
if (currentScrollTop >= targetScrollTop - 300) {
console.log('加载新数据');
canLoading = false;
this.loadPage();
}
// console.log(currentScrollTop, targetScrollTop)
console.log(currentScrollTop, targetScrollTop)
}
loadPage() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment