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
bb81785e
Commit
bb81785e
authored
Mar 31, 2020
by
liang ce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新字段
parent
f5f88d00
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
131 deletions
+97
-131
scheduleList.js
PageComponents/scheduleList/scheduleList.js
+72
-110
index.axml
pages/index/index.axml
+17
-18
index.js
pages/index/index.js
+6
-2
meetingRoomList.js
pages/meetingRoomList/meetingRoomList.js
+0
-1
exampleStore.js
stores/exampleStore.js
+2
-0
No files found.
PageComponents/scheduleList/scheduleList.js
View file @
bb81785e
...
@@ -27,100 +27,55 @@ Component({
...
@@ -27,100 +27,55 @@ Component({
},
},
props
:
{},
props
:
{},
didMount
()
{
didMount
()
{
// let that = this;
this
.
getDate
();
// let now = new Date();
},
// let year = now.getFullYear();
didUpdate
()
{
// let month = now.getMonth() + 1;
if
(
this
.
props
.
update
)
{
// let day = now.getDate();
this
.
getDate
();
// let parmsStartDate = this.returnMonthActionAndEndDate(year, month - 2, day)
}
// .startDay;
// let parmsEndDate = this.returnMonthActionAndEndDate(year, month + 2, day)
// .endDay;
// let startTime = getFormatDate(
// new Date(year, month - 12, parmsStartDate),
// "yyyyMMdd",
// "-"
// );
// let endTime = getFormatDate(
// new Date(year, month + 12, parmsEndDate),
// "yyyyMMdd",
// "-"
// );
// let data = {
// startTime: `${startTime} 00:00:00`,
// endTime: `${endTime} 23:59:59`
// };
// getHomeUserSchedule1(data).then(res => {
// this.setData(
// {
// response: res.data.data
// },
// () => {
// let scheduleList = [];
// for (let i = -12; i <= 12; i++) {
// let forDate = new Date(2024, month + i, 1);
// scheduleList.push(
// that.returnScheduleList(forDate.toLocaleDateString())
// );
// }
// this.setData({
// scheduleList: scheduleList,
// pageStartTime: new Date(year, month - 13, 1).toLocaleDateString(),
// pageEndTime: new Date(year, month + 12, 1).toLocaleDateString()
// });
// }
// );
// });
// 页面显示
let
data
=
{
startTime
:
"2020-01-01 00:00:00"
,
endTime
:
"2025-12-30 23:59:59"
};
let
that
=
this
;
getHomeUserSchedule1
(
data
).
then
(
res
=>
{
that
.
setData
(
{
response
:
res
.
data
.
data
},
()
=>
{
let
now
=
new
Date
();
let
year
=
now
.
getFullYear
();
let
scheduleList
=
[];
for
(
let
i
=
0
;
i
<=
year
-
2019
;
i
++
)
{
scheduleList
.
push
(
that
.
returnScheduleList
(
2019
+
i
));
}
// 第一次加载
if
(
this
.
data
.
isFirstLoad
)
{
const
today
=
new
Date
();
// finalDate 是用来定位到今天的
const
finalDate
=
new
Date
(
today
);
// finalDate.setDate(today.getDate() - today.getDay())
that
.
setData
({
scheduleList
:
scheduleList
,
todayStr
:
finalDate
.
toLocaleDateString
(),
thisYear
:
year
,
maxYear
:
year
,
canClick
:
true
,
startPageOnShow
:
true
,
isFirstLoad
:
false
});
}
else
{
that
.
setData
({
scheduleList
:
scheduleList
,
thisYear
:
year
,
maxYear
:
year
,
canClick
:
true
,
startPageOnShow
:
true
});
}
}
);
});
},
},
didUpdate
()
{
},
didUnmount
()
{},
didUnmount
()
{
},
methods
:
{
methods
:
{
nextDetail
:
throttle
(
function
(
e
)
{
getDate
()
{
// 页面显示
let
data
=
{
startTime
:
"2020-01-01 00:00:00"
,
endTime
:
"2025-12-30 23:59:59"
};
let
that
=
this
;
getHomeUserSchedule1
(
data
).
then
(
res
=>
{
that
.
setData
(
{
response
:
res
.
data
.
data
},
()
=>
{
let
now
=
new
Date
();
let
year
=
now
.
getFullYear
();
let
scheduleList
=
[];
for
(
let
i
=
0
;
i
<=
year
-
2019
;
i
++
)
{
scheduleList
.
push
(
that
.
returnScheduleList
(
2019
+
i
));
}
// 第一次加载
if
(
this
.
data
.
isFirstLoad
)
{
const
today
=
new
Date
();
// finalDate 是用来定位到今天的
const
finalDate
=
new
Date
(
today
);
// finalDate.setDate(today.getDate() - today.getDay())
that
.
setData
({
scheduleList
:
scheduleList
,
todayStr
:
finalDate
.
toLocaleDateString
(),
thisYear
:
year
,
maxYear
:
year
,
canClick
:
true
,
startPageOnShow
:
true
,
isFirstLoad
:
false
});
}
}
);
});
},
nextDetail
:
throttle
(
function
(
e
)
{
let
item
=
e
.
target
.
dataset
.
item
;
let
item
=
e
.
target
.
dataset
.
item
;
dd
.
navigateTo
({
dd
.
navigateTo
({
url
:
`./../editMeeting/editMeeting?scheduleItem=
${
JSON
.
stringify
(
item
)}
`
url
:
`./../editMeeting/editMeeting?scheduleItem=
${
JSON
.
stringify
(
item
)}
`
...
@@ -185,9 +140,16 @@ Component({
...
@@ -185,9 +140,16 @@ Component({
);
);
rule
.
all
().
map
(
item2
=>
{
rule
.
all
().
map
(
item2
=>
{
let
excludeDate
=
getFormatDate
(
item2
,
"yyyyMMdd"
);
let
excludeDate
=
getFormatDate
(
item2
,
"yyyyMMdd"
);
let
hasExclude
=
excludeDateList
.
scheduleList
.
indexOf
(
excludeDate
)
===
-
1
;
let
hasExclude
=
if
(
new
Date
(
item2
).
getTime
()
<
excludeDateList
.
templateList
&&
hasExclude
)
{
excludeDateList
.
scheduleList
.
indexOf
(
excludeDate
)
===
-
1
;
let
startTime
=
getFormatDate
(
item2
,
"yyyyMMdd"
)
+
" "
+
item
.
recurrenceModel
.
startTime
;
if
(
new
Date
(
item2
).
getTime
()
<
excludeDateList
.
templateList
&&
hasExclude
)
{
let
startTime
=
getFormatDate
(
item2
,
"yyyyMMdd"
)
+
" "
+
item
.
recurrenceModel
.
startTime
;
let
endTime
=
new
Date
(
startTime
);
let
endTime
=
new
Date
(
startTime
);
endTime
.
setMinutes
(
endTime
.
setMinutes
(
endTime
.
getMinutes
()
+
item
.
recurrenceModel
.
duration
endTime
.
getMinutes
()
+
item
.
recurrenceModel
.
duration
...
@@ -201,7 +163,7 @@ Component({
...
@@ -201,7 +163,7 @@ Component({
scheduleTemplateId
:
item
.
id
,
scheduleTemplateId
:
item
.
id
,
startTime
:
startTime
,
startTime
:
startTime
,
title
:
item
.
title
,
title
:
item
.
title
,
planDate
:
getFormatDate
(
item2
,
"yyyyMMdd"
,
'-'
)
planDate
:
getFormatDate
(
item2
,
"yyyyMMdd"
,
"-"
)
}
}
);
);
}
}
...
@@ -214,8 +176,8 @@ Component({
...
@@ -214,8 +176,8 @@ Component({
item
.
recurrenceModel
.
startTime
;
item
.
recurrenceModel
.
startTime
;
let
endTime
=
new
Date
(
let
endTime
=
new
Date
(
getFormatDate
(
item2
,
"yyyyMMdd"
)
+
getFormatDate
(
item2
,
"yyyyMMdd"
)
+
" "
+
" "
+
item
.
recurrenceModel
.
startTime
item
.
recurrenceModel
.
startTime
);
);
endTime
.
setMinutes
(
endTime
.
setMinutes
(
endTime
.
getMinutes
()
+
item
.
recurrenceModel
.
duration
endTime
.
getMinutes
()
+
item
.
recurrenceModel
.
duration
...
@@ -228,7 +190,7 @@ Component({
...
@@ -228,7 +190,7 @@ Component({
scheduleTemplateId
:
item
.
id
,
scheduleTemplateId
:
item
.
id
,
startTime
:
startTime
,
startTime
:
startTime
,
title
:
item
.
title
,
title
:
item
.
title
,
planDate
:
getFormatDate
(
item2
,
"yyyyMMdd"
,
'-'
)
planDate
:
getFormatDate
(
item2
,
"yyyyMMdd"
,
"-"
)
}
}
);
);
});
});
...
@@ -250,7 +212,7 @@ Component({
...
@@ -250,7 +212,7 @@ Component({
);
);
}
}
});
});
scheduleMap
.
forEach
(
function
(
value
,
key
,
map
)
{
scheduleMap
.
forEach
(
function
(
value
,
key
,
map
)
{
scheduleList
.
push
(
value
);
scheduleList
.
push
(
value
);
});
});
return
scheduleList
;
return
scheduleList
;
...
@@ -332,9 +294,9 @@ Component({
...
@@ -332,9 +294,9 @@ Component({
thisDayEndTime
:
AllScheduleList
[
y
].
endTime
.
slice
(
11
,
16
),
thisDayEndTime
:
AllScheduleList
[
y
].
endTime
.
slice
(
11
,
16
),
isBeOverdue
:
isBeOverdue
:
new
Date
().
getTime
()
>
new
Date
().
getTime
()
>
new
Date
(
new
Date
(
AllScheduleList
[
y
].
endTime
.
replace
(
/-/g
,
"/"
)
AllScheduleList
[
y
].
endTime
.
replace
(
/-/g
,
"/"
)
).
getTime
()
).
getTime
()
?
true
?
true
:
false
:
false
});
});
...
@@ -369,9 +331,9 @@ Component({
...
@@ -369,9 +331,9 @@ Component({
duration
:
count
+
1
,
duration
:
count
+
1
,
isBeOverdue
:
isBeOverdue
:
new
Date
().
getTime
()
>
new
Date
().
getTime
()
>
new
Date
(
new
Date
(
AllScheduleList
[
y
].
endTime
.
replace
(
/-/g
,
"/"
)
AllScheduleList
[
y
].
endTime
.
replace
(
/-/g
,
"/"
)
).
getTime
()
).
getTime
()
?
true
?
true
:
false
:
false
});
});
...
@@ -388,7 +350,7 @@ Component({
...
@@ -388,7 +350,7 @@ Component({
value
:
year
value
:
year
});
});
let
thisDay
=
new
Date
().
toLocaleDateString
();
let
thisDay
=
new
Date
().
toLocaleDateString
();
DateMap
.
forEach
(
function
(
value
,
key
,
map
)
{
DateMap
.
forEach
(
function
(
value
,
key
,
map
)
{
if
(
if
(
new
Date
(
key
).
getDay
()
===
0
&&
new
Date
(
key
).
getDay
()
===
0
&&
that
.
count
(
that
.
count
(
...
@@ -414,7 +376,7 @@ Component({
...
@@ -414,7 +376,7 @@ Component({
type
:
"week"
,
type
:
"week"
,
value
:
`第
${
listWeek
}
周,
${
rangeMonth1
+
1
}
月
${
rangeDay1
}
日 -
${
value
:
`第
${
listWeek
}
周,
${
rangeMonth1
+
1
}
月
${
rangeDay1
}
日 -
${
rangeMonth2
==
rangeMonth1
?
""
:
rangeMonth2
+
1
+
"月"
rangeMonth2
==
rangeMonth1
?
""
:
rangeMonth2
+
1
+
"月"
}${
rangeDay2
}
日`
,
}${
rangeDay2
}
日`
,
dayStr
:
key
dayStr
:
key
});
});
}
}
...
@@ -430,7 +392,7 @@ Component({
...
@@ -430,7 +392,7 @@ Component({
type
:
"week"
,
type
:
"week"
,
value
:
`第
${
listWeek
}
周,
${
rangeMonth1
+
1
}
月
${
rangeDay1
}
日 -
${
value
:
`第
${
listWeek
}
周,
${
rangeMonth1
+
1
}
月
${
rangeDay1
}
日 -
${
rangeMonth2
==
rangeMonth1
?
""
:
rangeMonth2
+
1
+
"月"
rangeMonth2
==
rangeMonth1
?
""
:
rangeMonth2
+
1
+
"月"
}${
rangeDay2
}
日`
,
}${
rangeDay2
}
日`
,
dayStr
:
key
dayStr
:
key
});
});
}
}
...
@@ -452,7 +414,7 @@ Component({
...
@@ -452,7 +414,7 @@ Component({
type
:
"week"
,
type
:
"week"
,
value
:
`第
${
listWeek
}
周,
${
rangeMonth1
+
1
}
月
${
rangeDay1
}
日 -
${
value
:
`第
${
listWeek
}
周,
${
rangeMonth1
+
1
}
月
${
rangeDay1
}
日 -
${
rangeMonth2
==
rangeMonth1
?
""
:
rangeMonth2
+
1
+
"月"
rangeMonth2
==
rangeMonth1
?
""
:
rangeMonth2
+
1
+
"月"
}${
rangeDay2
}
日`
,
}${
rangeDay2
}
日`
,
dayStr
:
key
dayStr
:
key
});
});
}
}
...
...
pages/index/index.axml
View file @
bb81785e
<view a:if="{{tabBarIndex === '0'}}">
<view a:if="{{tabBarIndex === '0'}}">
<my-dynamic>
<my-dynamic>
</my-dynamic>
</my-dynamic>
</view>
</view>
<view a:if="{{tabBarIndex === '1'}}">
<view a:if="{{tabBarIndex === '1'}}">
<my-schedule
>
<my-schedule update="{{indexNeedUpdate}}"
>
</my-schedule>
</my-schedule>
</view>
</view>
<view class="tabBar">
<view class="tabBar">
<view onTap="changeTabBar" data-tabbar='0'>
<view onTap="changeTabBar" data-tabbar='0'>
<view class="tabBarView {{tabBarIndex === '0' ? 'ischooseTabBar' : ''}}">
<view class="tabBarView {{tabBarIndex === '0' ? 'ischooseTabBar' : ''}}">
<text class="iconfont iconicon_dynamic"></text>
<text class="iconfont iconicon_dynamic"></text>
<text>动态</text>
<text>动态</text>
</view>
</view>
</view>
</view>
<view onTap="changeTabBar" data-tabbar='1'>
<view onTap="changeTabBar" data-tabbar='1'>
<view class="tabBarView {{tabBarIndex === '1' ? 'ischooseTabBar' : ''}}">
<view class="tabBarView {{tabBarIndex === '1' ? 'ischooseTabBar' : ''}}">
<text class="iconfont iconicon_Calendarbox1"></text>
<text class="iconfont iconicon_Calendarbox1"></text>
<text>日程</text>
<text>日程</text>
</view>
</view>
<view class="createMeeting" onTap="createMeeting">
<text class="iconfont iconicon_add1"></text>
</view>
</view>
</view>
<view class="createMeeting" onTap="createMeeting">
<text class="iconfont iconicon_add1"></text>
</view>
</view>
</view>
\ No newline at end of file
pages/index/index.js
View file @
bb81785e
import
{
getFormatDate
}
from
'../../utils/utils'
import
{
getFormatDate
}
from
'../../utils/utils'
Page
({
import
create
from
'dd-store'
import
exampleStore
from
'/stores/exampleStore'
create
.
Page
({
store
:
exampleStore
,
useAll
:
true
,
data
:
{
data
:
{
tabBarIndex
:
'1'
tabBarIndex
:
'1'
,
},
},
onLoad
()
{
onLoad
()
{
...
...
pages/meetingRoomList/meetingRoomList.js
View file @
bb81785e
import
{
getMeetingRoom
,
getLabelTree
,
myMeetingPage
,
getReserveRoomList
,
getAllScheduleWithMeetingRoomByTime
}
from
'../../api/request'
import
{
getMeetingRoom
,
getLabelTree
,
myMeetingPage
,
getReserveRoomList
,
getAllScheduleWithMeetingRoomByTime
}
from
'../../api/request'
import
{
EEXIST
}
from
'constants'
import
{
EEXIST
}
from
'constants'
import
{
resolve
}
from
'url'
import
create
from
'dd-store'
import
create
from
'dd-store'
import
exampleStore
from
'/stores/exampleStore'
import
exampleStore
from
'/stores/exampleStore'
create
.
Page
({
create
.
Page
({
...
...
stores/exampleStore.js
View file @
bb81785e
...
@@ -28,6 +28,7 @@ class Store {
...
@@ -28,6 +28,7 @@ class Store {
originUsers
:
[],
originUsers
:
[],
originUsersId
:
[],
originUsersId
:
[],
originalData
:
null
,
originalData
:
null
,
indexNeedUpdate
:
false
,
}
}
}
}
export
default
new
Store
()
export
default
new
Store
()
\ No newline at end of file
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