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
9628bb77
Commit
9628bb77
authored
Mar 24, 2020
by
xiexiaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: change default time from 2hours to 30min
parent
cef4a859
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
23 deletions
+22
-23
app.acss
app.acss
+1
-1
doc.txt
components/meetingTimePicker/doc.txt
+1
-2
meetingTimePicker.js
components/meetingTimePicker/meetingTimePicker.js
+19
-19
index.acss
components/popup/index.acss
+1
-1
No files found.
app.acss
View file @
9628bb77
@import "./font/iconfont.acss";
@import "./
assests/
font/iconfont.acss";
page {
page {
font-family: PingFangSC-Regular;
font-family: PingFangSC-Regular;
background: #F6F6F6;
background: #F6F6F6;
...
...
components/meetingTimePicker/doc.txt
View file @
9628bb77
...
@@ -18,8 +18,7 @@
...
@@ -18,8 +18,7 @@
<------------------js------------------>
<------------------js------------------>
Page({
Page({
data: {
data: {
show:false,
show:false
startTime: new Date()
},
},
showPop(){
showPop(){
this.setData({
this.setData({
...
...
components/meetingTimePicker/meetingTimePicker.js
View file @
9628bb77
var
currentDate
=
new
Date
();
const
currentDate
=
new
Date
();
const
weekList
=
[
'周日'
,
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
];
const
weekList
=
[
'周日'
,
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
];
const
durationList
=
[{
value
:
60
,
label
:
'1小时'
},
{
value
:
120
,
label
:
'2小时'
},
{
value
:
30
,
label
:
'30分钟
'
}];
const
durationList
=
[{
value
:
30
,
label
:
'30分钟'
},
{
value
:
60
,
label
:
'1小时'
},
{
value
:
120
,
label
:
'2小时
'
}];
const
timeData
=
generateDate
(
365
);
const
timeData
=
generateDate
(
365
);
const
timeHour
=
generateTime
(
24
);
const
timeHour
=
generateTime
(
24
);
const
timeMin
=
generateTime
(
60
);
const
timeMin
=
generateTime
(
60
);
...
@@ -28,7 +28,7 @@ function generateDate(max) {
...
@@ -28,7 +28,7 @@ function generateDate(max) {
return
timeData
return
timeData
}
}
function
GetDateStr
(
AddDayCount
)
{
function
GetDateStr
(
AddDayCount
)
{
var
time
=
new
Date
();
let
time
=
new
Date
();
time
.
setDate
(
time
.
getDate
()
+
AddDayCount
);
time
.
setDate
(
time
.
getDate
()
+
AddDayCount
);
const
res
=
getYMDWHMIN
(
time
);
const
res
=
getYMDWHMIN
(
time
);
return
res
.
y
+
'年'
+
res
.
m
+
"月"
+
res
.
d
+
"日 "
+
res
.
w
;
return
res
.
y
+
'年'
+
res
.
m
+
"月"
+
res
.
d
+
"日 "
+
res
.
w
;
...
@@ -51,6 +51,11 @@ function getShowTime(date) {
...
@@ -51,6 +51,11 @@ function getShowTime(date) {
const
res
=
getYMDWHMIN
(
date
);
const
res
=
getYMDWHMIN
(
date
);
return
res
.
m
+
"月"
+
res
.
d
+
"日 "
+
res
.
h
+
':'
+
res
.
min
;
return
res
.
m
+
"月"
+
res
.
d
+
"日 "
+
res
.
h
+
':'
+
res
.
min
;
}
}
// 时间格式转化为2019/2/2 16:00
function
getPostTimeByDate
(
date
)
{
const
res
=
getYMDWHMIN
(
date
);
return
res
.
y
+
'/'
+
res
.
m
+
"/"
+
res
.
d
+
" "
+
res
.
h
+
':'
+
res
.
min
;
}
function
getPickerValue
(
date
)
{
function
getPickerValue
(
date
)
{
const
res
=
getYMDWHMIN
(
date
);
const
res
=
getYMDWHMIN
(
date
);
return
[
timeData
.
indexOf
(
res
.
y
+
"年"
+
res
.
m
+
"月"
+
res
.
d
+
"日 "
+
res
.
w
),
timeHour
.
indexOf
(
res
.
h
),
timeMin
.
indexOf
(
res
.
min
)];
return
[
timeData
.
indexOf
(
res
.
y
+
"年"
+
res
.
m
+
"月"
+
res
.
d
+
"日 "
+
res
.
w
),
timeHour
.
indexOf
(
res
.
h
),
timeMin
.
indexOf
(
res
.
min
)];
...
@@ -80,7 +85,7 @@ function getWeekDay(date) {
...
@@ -80,7 +85,7 @@ function getWeekDay(date) {
// 根据开始时间和持续时间计算结束时间 2019/2/2 16:00
// 根据开始时间和持续时间计算结束时间 2019/2/2 16:00
function
getEndTimeByDuration
(
startDate
,
duration
)
{
function
getEndTimeByDuration
(
startDate
,
duration
)
{
const
newDate
=
new
Date
(
startDate
);
//新创建一个时间对象,以免改变startDate
const
newDate
=
new
Date
(
startDate
);
//新创建一个时间对象,以免改变startDate
var
min
=
newDate
.
getMinutes
();
const
min
=
newDate
.
getMinutes
();
newDate
.
setMinutes
(
min
+
duration
);
newDate
.
setMinutes
(
min
+
duration
);
const
res
=
getYMDWHMIN
(
newDate
);
const
res
=
getYMDWHMIN
(
newDate
);
return
res
.
y
+
'/'
+
res
.
m
+
'/'
+
res
.
d
+
' '
+
res
.
h
+
':'
+
res
.
min
;
return
res
.
y
+
'/'
+
res
.
m
+
'/'
+
res
.
d
+
' '
+
res
.
h
+
':'
+
res
.
min
;
...
@@ -99,12 +104,6 @@ function getDateByPickValue(pickValue) {
...
@@ -99,12 +104,6 @@ function getDateByPickValue(pickValue) {
return
new
Date
(
newD
)
return
new
Date
(
newD
)
}
}
// 时间格式转化为2019/2/2 16:00
function
getPostTimeByDate
(
date
)
{
const
res
=
getYMDWHMIN
(
date
);
return
res
.
y
+
'/'
+
res
.
m
+
"/"
+
res
.
d
+
" "
+
res
.
h
+
':'
+
res
.
min
;
}
// 获取持续时间 {value,lable,index}
// 获取持续时间 {value,lable,index}
function
getDuration
(
startDate
,
endDate
)
{
function
getDuration
(
startDate
,
endDate
)
{
const
time
=
endDate
.
getTime
()
-
startDate
.
getTime
();
const
time
=
endDate
.
getTime
()
-
startDate
.
getTime
();
...
@@ -151,9 +150,9 @@ Component({
...
@@ -151,9 +150,9 @@ Component({
showTime
:
''
,
showTime
:
''
,
},
},
duration
:
{
duration
:
{
pickValue
:
[
1
],
pickValue
:
[
0
],
showTime
:
''
,
showTime
:
''
,
label
:
'
2小时
'
,
label
:
'
30分钟
'
,
},
},
startPostTime
:
''
,
startPostTime
:
''
,
endPostTime
:
''
,
endPostTime
:
''
,
...
@@ -171,10 +170,10 @@ Component({
...
@@ -171,10 +170,10 @@ Component({
//设置初始值
//设置初始值
setInitialValue
()
{
setInitialValue
()
{
let
startDate
=
new
Date
();
let
startDate
=
new
Date
();
//结束日期默认+
2
小时
//结束日期默认+
半
小时
let
endDate
=
new
Date
();
let
endDate
=
new
Date
();
var
hour
=
endDate
.
getHour
s
();
const
min
=
endDate
.
getMinute
s
();
endDate
.
set
Hours
(
hour
+
2
);
endDate
.
set
Minutes
(
min
+
30
);
// 赋值
// 赋值
if
(
this
.
props
.
startTime
)
{
if
(
this
.
props
.
startTime
)
{
startDate
=
new
Data
(
this
.
props
.
startTime
);
startDate
=
new
Data
(
this
.
props
.
startTime
);
...
@@ -190,7 +189,6 @@ Component({
...
@@ -190,7 +189,6 @@ Component({
});
});
// 如果持续时间不在范围内,需要改变默认显示结束时间的方式
// 如果持续时间不在范围内,需要改变默认显示结束时间的方式
const
durationData
=
getDuration
(
startDate
,
endDate
);
const
durationData
=
getDuration
(
startDate
,
endDate
);
// 在范围内
if
(
durationData
)
{
if
(
durationData
)
{
this
.
changeDuration
(
startDate
,
durationData
);
this
.
changeDuration
(
startDate
,
durationData
);
}
else
{
}
else
{
...
@@ -244,6 +242,7 @@ Component({
...
@@ -244,6 +242,7 @@ Component({
endDurationPostTime
:
getEndTimeByDuration
(
startDate
,
durationValue
)
endDurationPostTime
:
getEndTimeByDuration
(
startDate
,
durationValue
)
})
})
}
else
{
}
else
{
// 实时校验
this
.
checkValue
(
startDate
,
this
.
data
.
endPostTime
);
this
.
checkValue
(
startDate
,
this
.
data
.
endPostTime
);
}
}
}
}
...
@@ -271,10 +270,11 @@ Component({
...
@@ -271,10 +270,11 @@ Component({
return
this
.
setData
({
return
this
.
setData
({
pickValue
:
this
.
data
.
duration
.
pickValue
pickValue
:
this
.
data
.
duration
.
pickValue
});
});
}
else
{
this
.
setData
({
pickValue
:
this
.
data
[
`
${
currentTab
}
`
].
pickValue
});
}
}
this
.
setData
({
pickValue
:
this
.
data
[
`
${
currentTab
}
`
].
pickValue
});
},
},
changeWay
()
{
changeWay
()
{
this
.
setData
({
this
.
setData
({
...
...
components/popup/index.acss
View file @
9628bb77
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
}
}
.close-icon {
.close-icon {
font-size
: 64rpx;
height
: 64rpx;
text-align: center;
text-align: center;
}
}
...
...
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