Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
Overview
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
fengzhaoyu
schedule
Commits
e9f2e85e
Commit
e9f2e85e
authored
Apr 17, 2020
by
xiexiaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 下拉数据过长时点击回到今天不重置数据
parent
34fc0056
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
scheduleList.js
pages/scheduleList/scheduleList.js
+7
-10
No files found.
pages/scheduleList/scheduleList.js
View file @
e9f2e85e
...
@@ -572,7 +572,9 @@ create.Page({
...
@@ -572,7 +572,9 @@ create.Page({
const
offset
=
this
.
getScrollOffset
(
e
.
detail
.
scrollTop
);
const
offset
=
this
.
getScrollOffset
(
e
.
detail
.
scrollTop
);
dd
.
createSelectorQuery
().
selectAll
(
'.li'
).
boundingClientRect
().
exec
((
rect
)
=>
{
dd
.
createSelectorQuery
().
selectAll
(
'.li'
).
boundingClientRect
().
exec
((
rect
)
=>
{
//日程的上下箭头
//日程的上下箭头
this
.
setScrollOffset
(
rect
);
if
(
rect
[
0
])
{
this
.
setScrollOffset
(
rect
);
}
if
(
offset
==
'next'
)
{
if
(
offset
==
'next'
)
{
for
(
let
i
=
this
.
data
.
currentDataIndex
;
i
<
rect
[
0
].
length
;
i
++
)
{
for
(
let
i
=
this
.
data
.
currentDataIndex
;
i
<
rect
[
0
].
length
;
i
++
)
{
if
(
rect
[
0
][
i
].
top
>
0
)
{
if
(
rect
[
0
][
i
].
top
>
0
)
{
...
@@ -658,11 +660,9 @@ create.Page({
...
@@ -658,11 +660,9 @@ create.Page({
},
1000
),
},
1000
),
backToToday
(
type
)
{
backToToday
(
type
)
{
if
(
!
type
)
{
if
(
!
type
)
{
//如果当前的日期还没加载出来点击无效,下拉积累数据过长可以去掉
//如果当前的日期还没加载出来点击无效
const
isFindArr
=
this
.
data
.
scheduleList
.
filter
(
const
isFindArr
=
this
.
data
.
scheduleList
.
filter
(
it
=>
it
.
dateStr
==
toLocaleDateString
(
currentDate
));
it
=>
it
.
dateStr
==
toLocaleDateString
(
currentDate
)
if
(
isFindArr
.
length
==
0
)
{
);
if
(
isFindArr
.
length
==
0
||
this
.
data
.
scheduleList
.
length
>
100
)
{
//去掉头部空数据
//去掉头部空数据
if
(
this
.
minYear
<
minYear
)
{
if
(
this
.
minYear
<
minYear
)
{
this
.
scheduleList
.
splice
(
0
,
this
.
blankDataLength
);
this
.
scheduleList
.
splice
(
0
,
this
.
blankDataLength
);
...
@@ -675,10 +675,7 @@ create.Page({
...
@@ -675,10 +675,7 @@ create.Page({
}
}
this
.
getPagination
(
this
.
scheduleList
);
this
.
getPagination
(
this
.
scheduleList
);
this
.
setData
({
this
.
setData
({
scheduleList
:
this
.
scheduleList
.
slice
(
scheduleList
:
this
.
scheduleList
.
slice
(
this
.
firstPage
*
this
.
pageSize
,
this
.
currentPage
*
this
.
pageSize
)
this
.
firstPage
*
this
.
pageSize
,
this
.
currentPage
*
this
.
pageSize
)
});
});
}
}
}
}
...
...
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