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
a0cac04c
Commit
a0cac04c
authored
Apr 09, 2020
by
xiexiaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scheduleList add page data
parent
dcfdfa55
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
18 deletions
+65
-18
scheduleList.axml
pages/scheduleList/scheduleList.axml
+2
-2
scheduleList.js
pages/scheduleList/scheduleList.js
+63
-16
No files found.
pages/scheduleList/scheduleList.axml
View file @
a0cac04c
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
</view>
</view>
</view>
</view>
</view>
</view>
<scroll-view class="indexScrollView" scroll-y="{{true}}" style="background: #FFFFFF" lower-threshold="100
0" onScrollToLower="low
er" scroll-into-view="{{todayStr}}">
<scroll-view class="indexScrollView" scroll-y="{{true}}" style="background: #FFFFFF" lower-threshold="100
" onScrollToLower="lower" onScrollToUpper="upp
er" scroll-into-view="{{todayStr}}">
<block a:for="{{scheduleList}}" key="{{item.dateStr}}">
<block a:for="{{scheduleList}}" key="{{item.dateStr}}">
<!-- 年 -->
<!-- 年 -->
<block a:if="{{item.type == 'year'}}">
<block a:if="{{item.type == 'year'}}">
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
</block>
</block>
<!-- 周 -->
<!-- 周 -->
<block a:elif="{{item.type == 'week'}}">
<block a:elif="{{item.type == 'week'}}">
<view class="week" id="{{item.da
y
Str}}">
<view class="week" id="{{item.da
te
Str}}">
{{item.value}}
{{item.value}}
</view>
</view>
</block>
</block>
...
...
pages/scheduleList/scheduleList.js
View file @
a0cac04c
...
@@ -6,6 +6,7 @@ import {
...
@@ -6,6 +6,7 @@ import {
getCurrentMonthLast
,
getCurrentMonthLast
,
throttle
throttle
}
from
"../../utils/utils"
;
}
from
"../../utils/utils"
;
const
currentDate
=
new
Date
().
toLocaleDateString
();
import
create
from
"dd-store"
;
import
create
from
"dd-store"
;
create
.
Page
({
create
.
Page
({
data
:
{
data
:
{
...
@@ -26,6 +27,7 @@ create.Page({
...
@@ -26,6 +27,7 @@ create.Page({
loading
:
true
loading
:
true
},
},
onLoad
()
{
onLoad
()
{
this
.
resetPagination
();
this
.
getDate
();
this
.
getDate
();
this
.
setData
({
this
.
setData
({
userMsg
:
{
userMsg
:
{
...
@@ -37,7 +39,25 @@ create.Page({
...
@@ -37,7 +39,25 @@ create.Page({
this
.
locationScheduleList
();
this
.
locationScheduleList
();
};
};
},
},
getDate
:
throttle
(
function
(
e
)
{
resetPagination
()
{
this
.
pageSize
=
20
;
this
.
totalPages
=
1
;
this
.
currentPage
=
1
;
this
.
firstPage
=
1
;
this
.
scheduleList
=
[];
},
getPagination
(
scheduleList
=
[])
{
this
.
scheduleList
=
scheduleList
;
this
.
totalPages
=
Math
.
ceil
(
scheduleList
.
length
/
this
.
pageSize
);
for
(
let
i
=
0
;
i
<
scheduleList
.
length
;
i
++
)
{
if
(
scheduleList
[
i
].
dateStr
==
currentDate
)
{
this
.
firstPage
=
Math
.
floor
(
i
/
this
.
pageSize
);
this
.
currentPage
=
this
.
firstPage
+
1
;
break
}
}
},
getDate
:
throttle
(
function
(
e
)
{
let
data
=
{
let
data
=
{
startTime
:
"2020-01-01 00:00:00"
,
startTime
:
"2020-01-01 00:00:00"
,
endTime
:
"2025-12-30 23:59:59"
endTime
:
"2025-12-30 23:59:59"
...
@@ -52,21 +72,23 @@ create.Page({
...
@@ -52,21 +72,23 @@ create.Page({
let
now
=
new
Date
();
let
now
=
new
Date
();
let
year
=
now
.
getFullYear
();
let
year
=
now
.
getFullYear
();
let
scheduleList
=
[];
let
scheduleList
=
[];
for
(
let
i
=
0
;
i
<=
year
-
20
2
0
;
i
++
)
{
for
(
let
i
=
0
;
i
<=
year
-
20
0
0
;
i
++
)
{
scheduleList
.
push
.
apply
(
scheduleList
.
push
.
apply
(
scheduleList
,
scheduleList
,
that
.
returnScheduleList
(
20
2
0
+
i
)
that
.
returnScheduleList
(
20
0
0
+
i
)
);
);
}
}
this
.
getPagination
(
scheduleList
);
// 第一次加载
// 第一次加载
console
.
log
(
scheduleList
);
console
.
log
(
scheduleList
);
const
finalDate
=
new
Date
();
that
.
setData
({
that
.
setData
({
scheduleList
:
scheduleList
,
scheduleList
:
scheduleList
.
slice
(
this
.
firstPage
*
this
.
pageSize
,
this
.
currentPage
*
this
.
pageSize
)
,
todayStr
:
finalDate
.
toLocaleDateString
()
,
todayStr
:
currentDate
,
thisYear
:
year
,
thisYear
:
year
,
maxYear
:
year
maxYear
:
year
});
});
console
.
log
(
this
.
data
.
scheduleList
)
}
}
);
);
that
.
setData
({
that
.
setData
({
...
@@ -74,7 +96,7 @@ create.Page({
...
@@ -74,7 +96,7 @@ create.Page({
});
});
});
});
},
1000
),
},
1000
),
nextDetail
:
throttle
(
function
(
e
)
{
nextDetail
:
throttle
(
function
(
e
)
{
let
item
=
e
.
target
.
dataset
.
item
;
let
item
=
e
.
target
.
dataset
.
item
;
dd
.
navigateTo
({
dd
.
navigateTo
({
url
:
`./../meetingDetail/meetingDetail?scheduleItem=
${
JSON
.
stringify
(
url
:
`./../meetingDetail/meetingDetail?scheduleItem=
${
JSON
.
stringify
(
...
@@ -237,7 +259,7 @@ create.Page({
...
@@ -237,7 +259,7 @@ create.Page({
);
);
}
}
});
});
scheduleMap
.
forEach
(
function
(
value
,
key
,
map
)
{
scheduleMap
.
forEach
(
function
(
value
,
key
,
map
)
{
scheduleList
.
push
(
value
);
scheduleList
.
push
(
value
);
});
});
return
scheduleList
;
return
scheduleList
;
...
@@ -309,7 +331,7 @@ create.Page({
...
@@ -309,7 +331,7 @@ create.Page({
// 第一个月的第一天
// 第一个月的第一天
let
listWeek
=
new
Date
(
year
,
0
,
1
).
getDay
()
===
0
?
1
:
2
;
let
listWeek
=
new
Date
(
year
,
0
,
1
).
getDay
()
===
0
?
1
:
2
;
let
thisDay
=
new
Date
().
toLocaleDateString
();
let
thisDay
=
new
Date
().
toLocaleDateString
();
DateMap
.
forEach
(
function
(
value
,
key
,
map
)
{
DateMap
.
forEach
(
function
(
value
,
key
,
map
)
{
const
keyDate
=
new
Date
(
key
);
const
keyDate
=
new
Date
(
key
);
if
(
keyDate
.
getMonth
()
===
0
&&
keyDate
.
getDate
()
===
1
)
{
if
(
keyDate
.
getMonth
()
===
0
&&
keyDate
.
getDate
()
===
1
)
{
DateList
.
push
({
DateList
.
push
({
...
@@ -337,7 +359,7 @@ create.Page({
...
@@ -337,7 +359,7 @@ create.Page({
value
:
`第
${
listWeek
}
周,
${
rangeMonth1
+
1
}
月
${
rangeDay1
}
日 -
${
value
:
`第
${
listWeek
}
周,
${
rangeMonth1
+
1
}
月
${
rangeDay1
}
日 -
${
rangeMonth2
==
rangeMonth1
?
""
:
rangeMonth2
+
1
+
"月"
rangeMonth2
==
rangeMonth1
?
""
:
rangeMonth2
+
1
+
"月"
}${
rangeDay2
}
日`
,
}${
rangeDay2
}
日`
,
da
y
Str
:
`
${
keyDate
.
getFullYear
()}
/
${
rangeMonth1
+
da
te
Str
:
`
${
keyDate
.
getFullYear
()}
/
${
rangeMonth1
+
1
}
/
${
rangeDay1
}
-week`
1
}
/
${
rangeDay1
}
-week`
});
});
listWeek
+=
1
;
listWeek
+=
1
;
...
@@ -413,15 +435,40 @@ create.Page({
...
@@ -413,15 +435,40 @@ create.Page({
return
date
;
return
date
;
},
},
lower
()
{
lower
()
{
let
year
=
this
.
data
.
maxYear
+
1
;
// let year = this.data.maxYear + 1;
let
DateList
=
this
.
returnScheduleList
(
year
);
// let DateList = this.returnScheduleList(year);
let
scheduleList
=
this
.
data
.
scheduleList
;
// let scheduleList = this.data.scheduleList;
scheduleList
.
push
.
apply
(
DateList
);
// scheduleList.push.apply(DateList);
// this.setData({
// scheduleList,
// maxYear: year
// });
if
(
this
.
currentPage
<
this
.
totalPages
)
{
this
.
currentPage
++
;
this
.
setData
({
this
.
setData
({
scheduleList
,
scheduleList
:
this
.
scheduleList
.
slice
(
this
.
firstPage
*
this
.
pageSize
,
this
.
currentPage
*
this
.
pageSize
)
maxYear
:
year
});
});
console
.
log
(
this
.
data
.
scheduleList
)
}
},
},
upper
:
throttle
(
function
()
{
console
.
log
(
this
.
firstPage
);
if
(
this
.
firstPage
>
0
)
{
this
.
firstPage
--
;
this
.
setData
({
scheduleList
:
this
.
scheduleList
.
slice
(
this
.
firstPage
*
this
.
pageSize
,
this
.
currentPage
*
this
.
pageSize
)
});
this
.
setData
({
todayStr
:
''
},
()
=>
{
this
.
setData
({
todayStr
:
this
.
scheduleList
[(
this
.
firstPage
+
1
)
*
this
.
pageSize
-
(
this
.
pageSize
/
2
)].
dateStr
})
})
console
.
log
(
this
.
scheduleList
[
this
.
firstPage
*
this
.
pageSize
-
(
this
.
pageSize
/
2
)].
dateStr
)
console
.
log
(
this
.
data
.
scheduleList
)
}
}),
nextPage
()
{
nextPage
()
{
dd
.
navigateTo
({
url
:
"./../createMeeting/createMeeting"
});
dd
.
navigateTo
({
url
:
"./../createMeeting/createMeeting"
});
},
},
...
...
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