Commit 53c2fa5f authored by wildfirecode13's avatar wildfirecode13

1

parent 0219e95d
...@@ -4,7 +4,7 @@ export const homeInfo = { ...@@ -4,7 +4,7 @@ export const homeInfo = {
{ {
"canUpdateNickName": false, "canUpdateNickName": false,
"figures": [{ "figureId": "1" }, { "figureId": "2" }, { "figureId": "3" }], "figures": [{ "figureId": "1" }, { "figureId": "2" }, { "figureId": "3" }],
"newUser": 1, "newUser": 0,
"userInfo": { "figureId": "3", "joyBeans": 123456789123, "nickName": "13" } "userInfo": { "figureId": "3", "joyBeans": 123456789123, "nickName": "13" }
}, },
"message": null, "message": null,
......
...@@ -20,6 +20,7 @@ class Detail2 extends Component { ...@@ -20,6 +20,7 @@ class Detail2 extends Component {
} }
onScroll = () => { onScroll = () => {
console.log('%c onScroll function run', 'color:blue;font-size:20px;font-weight:900;')
if (!canLoading) { if (!canLoading) {
console.log('不能加载了') console.log('不能加载了')
return; return;
...@@ -27,13 +28,13 @@ class Detail2 extends Component { ...@@ -27,13 +28,13 @@ class Detail2 extends Component {
const { list } = this.state; const { list } = this.state;
const targetScrollTop = list.length * 55 * ratio - listWrapperHeight; const targetScrollTop = list.length * 55 * ratio - listWrapperHeight;
const currentScrollTop = this.refs.listref.scrollTop * ratio; const currentScrollTop = this.refs.listref.scrollTop * ratio;
if (currentScrollTop >= targetScrollTop) { if (currentScrollTop >= targetScrollTop - 300) {
console.log('加载新数据'); console.log('加载新数据');
canLoading = false; canLoading = false;
this.loadPage(); this.loadPage();
} }
// console.log(currentScrollTop, targetScrollTop) console.log(currentScrollTop, targetScrollTop)
} }
loadPage() { 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