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
d4e6ea06
Commit
d4e6ea06
authored
Apr 16, 2020
by
xiexiaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页日程动画
parent
6d4b7eb6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
18 deletions
+41
-18
scheduleList.axml
pages/scheduleList/scheduleList.axml
+2
-2
scheduleList.js
pages/scheduleList/scheduleList.js
+39
-16
No files found.
pages/scheduleList/scheduleList.axml
View file @
d4e6ea06
...
@@ -129,9 +129,9 @@
...
@@ -129,9 +129,9 @@
<view onTap="changeTabBar" data-tabbar='1' data-title='日程'>
<view onTap="changeTabBar" data-tabbar='1' data-title='日程'>
<view class="tabBarView tabBarView2 {{$data.tabBarIndex === '1' ? 'ischooseTabBar' : ''}}">
<view class="tabBarView tabBarView2 {{$data.tabBarIndex === '1' ? 'ischooseTabBar' : ''}}">
<view class="iconfont iconicon_Calendarbox1">
<view class="iconfont iconicon_Calendarbox1">
<text a:if="{{offset == 'before'}}" class="iconfont iconicon_days iconicon_
Packup
">
<text a:if="{{offset == 'before'}}" class="iconfont iconicon_days iconicon_
open
">
</text>
</text>
<text a:elif="{{offset == 'next'}}" class="iconfont iconicon_days iconicon_
open
">
<text a:elif="{{offset == 'next'}}" class="iconfont iconicon_days iconicon_
Packup
">
</text>
</text>
<text a:else class="iconfont iconicon_days iconicon_days{{iconDay}}">
<text a:else class="iconfont iconicon_days iconicon_days{{iconDay}}">
</text>
</text>
...
...
pages/scheduleList/scheduleList.js
View file @
d4e6ea06
...
@@ -49,6 +49,7 @@ create.Page({
...
@@ -49,6 +49,7 @@ create.Page({
blankDataLengthAfter
:
0
,
blankDataLengthAfter
:
0
,
minYear
:
minYear
,
minYear
:
minYear
,
maxYear
:
maxYear
,
maxYear
:
maxYear
,
todayIndex
:
0
,
onShow
()
{
onShow
()
{
//如果是重复会议重新算
//如果是重复会议重新算
if
(
this
.
$store
.
data
.
indexNeedUpdate
)
{
if
(
this
.
$store
.
data
.
indexNeedUpdate
)
{
...
@@ -226,6 +227,7 @@ create.Page({
...
@@ -226,6 +227,7 @@ create.Page({
for
(
let
i
=
0
;
i
<
scheduleList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
scheduleList
.
length
;
i
++
)
{
if
(
scheduleList
[
i
].
dateStr
==
toLocaleDateString
(
currentDate
))
{
if
(
scheduleList
[
i
].
dateStr
==
toLocaleDateString
(
currentDate
))
{
const
centerPage
=
Math
.
floor
(
i
/
this
.
pageSize
);
const
centerPage
=
Math
.
floor
(
i
/
this
.
pageSize
);
this
.
todayIndex
=
i
;
// firstPage转为4的倍数,一次下拉加载40条
// firstPage转为4的倍数,一次下拉加载40条
const
firstPage
=
centerPage
-
2
;
const
firstPage
=
centerPage
-
2
;
this
.
firstPage
=
firstPage
%
4
==
0
?
firstPage
:
firstPage
-
firstPage
%
4
;
this
.
firstPage
=
firstPage
%
4
==
0
?
firstPage
:
firstPage
-
firstPage
%
4
;
...
@@ -483,6 +485,7 @@ create.Page({
...
@@ -483,6 +485,7 @@ create.Page({
this
.
minYear
--
;
this
.
minYear
--
;
const
yearData
=
getBlankList
(
this
.
minYear
);
const
yearData
=
getBlankList
(
this
.
minYear
);
this
.
blankDataLength
+=
yearData
.
length
;
this
.
blankDataLength
+=
yearData
.
length
;
this
.
todayIndex
+=
yearData
.
length
;
this
.
scheduleList
.
unshift
(...
yearData
);
this
.
scheduleList
.
unshift
(...
yearData
);
this
.
totalPages
=
Math
.
ceil
(
this
.
scheduleList
.
length
/
this
.
pageSize
);
this
.
totalPages
=
Math
.
ceil
(
this
.
scheduleList
.
length
/
this
.
pageSize
);
this
.
currentPage
=
Math
.
floor
(
yearData
.
length
*
2
/
this
.
pageSize
);
this
.
currentPage
=
Math
.
floor
(
yearData
.
length
*
2
/
this
.
pageSize
);
...
@@ -547,27 +550,47 @@ create.Page({
...
@@ -547,27 +550,47 @@ create.Page({
})
})
}
}
if
(
this
.
timer
)
{
//
if (this.timer) {
clearTimeout
(
this
.
timer
)
//
clearTimeout(this.timer)
}
//
}
this
.
timer
=
setTimeout
(()
=>
{
//
this.timer = setTimeout(() => {
this
.
setData
({
//
this.setData({
offset
:
'stop'
//
offset: 'stop'
})
//
})
},
500
)
//
}, 500)
//每次计算偏移值
//每次计算偏移值
const
offset
=
this
.
getScrollOffset
(
e
.
detail
.
scrollTop
);
const
offset
=
this
.
getScrollOffset
(
e
.
detail
.
scrollTop
);
if
(
this
.
data
.
offset
!==
offset
)
{
//
if (this.data.offset !== offset) {
if
(
!
this
.
resetToview
)
{
//
if (!this.resetToview) {
this
.
setData
({
//
this.setData({
offset
//
offset
});
//
});
}
//
}
this
.
resetToview
=
false
//
this.resetToview = false
}
//
}
dd
.
createSelectorQuery
().
selectAll
(
'.li'
).
boundingClientRect
().
exec
((
rect
)
=>
{
dd
.
createSelectorQuery
().
selectAll
(
'.li'
).
boundingClientRect
().
exec
((
rect
)
=>
{
if
(
rect
[
0
][
this
.
todayIndex
])
{
if
(
rect
[
0
][
this
.
todayIndex
].
top
<
50
&&
rect
[
0
][
this
.
todayIndex
].
top
>
20
)
{
if
(
this
.
data
.
offset
!==
'stop'
)
{
this
.
setData
({
offset
:
'stop'
})
}
}
else
if
(
rect
[
0
][
this
.
todayIndex
].
top
<
50
)
{
if
(
this
.
data
.
offset
!==
'next'
)
{
this
.
setData
({
offset
:
'next'
})
}
}
else
if
(
rect
[
0
][
this
.
todayIndex
].
top
>
20
)
{
if
(
this
.
data
.
offset
!==
'before'
)
{
this
.
setData
({
offset
:
'before'
})
}
}
}
else
{
if
(
this
.
data
.
offset
!==
'before'
)
{
this
.
setData
({
offset
:
'before'
})
}
}
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
)
{
...
...
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