Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeekLearnMathWeapp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
frontend
GeekLearnMathWeapp
Commits
0866e4d0
Commit
0866e4d0
authored
Apr 27, 2023
by
hewenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
409fc789
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
index.ts
src/native-components/rank/index.ts
+6
-1
No files found.
src/native-components/rank/index.ts
View file @
0866e4d0
...
@@ -36,19 +36,25 @@ Component({
...
@@ -36,19 +36,25 @@ Component({
if
(
this
.
_loading
||
!
this
.
_hasNextPage
)
return
if
(
this
.
_loading
||
!
this
.
_hasNextPage
)
return
this
.
_loading
=
true
this
.
_loading
=
true
this
.
setData
({
loading
:
true
})
this
.
setData
({
loading
:
true
})
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
300
))
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
300
))
const
{
list
}
=
this
.
data
const
{
list
}
=
this
.
data
const
currentPage
=
this
.
_currentPage
const
currentPage
=
this
.
_currentPage
const
nextPage
=
currentPage
+
1
const
nextPage
=
currentPage
+
1
let
max
=
nextPage
*
PageSize
let
max
=
nextPage
*
PageSize
let
hasNextPage
=
true
let
hasNextPage
=
true
if
(
max
>=
list
.
length
)
{
if
(
max
>=
list
.
length
)
{
max
=
list
.
length
max
=
list
.
length
hasNextPage
=
false
hasNextPage
=
false
}
}
const
start
=
currentPage
*
PageSize
const
start
=
currentPage
*
PageSize
const
newList
=
list
.
slice
(
start
,
max
)
const
newList
=
list
.
slice
(
start
,
max
)
const
opts
=
{}
as
any
const
opts
=
{}
as
any
newList
.
forEach
((
item
,
index
)
=>
{
newList
.
forEach
((
item
,
index
)
=>
{
opts
[
`realList[
${
index
+
start
}
]`
]
=
item
opts
[
`realList[
${
index
+
start
}
]`
]
=
item
})
})
...
@@ -57,7 +63,6 @@ Component({
...
@@ -57,7 +63,6 @@ Component({
this
.
setData
(
opts
,
()
=>
{
this
.
setData
(
opts
,
()
=>
{
this
.
_loading
=
false
this
.
_loading
=
false
this
.
_currentPage
=
nextPage
this
.
_currentPage
=
nextPage
console
.
log
(
11111111
,
this
.
_loading
,
hasNextPage
)
this
.
_hasNextPage
=
hasNextPage
this
.
_hasNextPage
=
hasNextPage
})
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment