Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jijin
/
dance-pc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
56e5085f
authored
2024-05-23 13:21:29 +0800
by
zhangmeng
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
日期限制
1 parent
8db6cba7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
22 deletions
src/viewsPc/booking/hotelDetail.vue
src/viewsPc/booking/hotelDetail.vue
View file @
56e5085
...
...
@@ -69,6 +69,7 @@
:disabled-date=
"disabledDateRZ"
:placeholder=
"language==0?'选择日期':'Select date'"
format=
"YYYY-MM-DD"
:clearable=
"false"
value-format=
"YYYY-MM-DD"
/>
</span>
</li>
...
...
@@ -161,20 +162,24 @@ onMounted(() => {
formTime
.
value
=
null
}).
finally
(()
=>
{
console
.
log
(
formTime
.
value
)
getDateTime
()
getData
()
})
})
function
getDateTime
(){
if
(
formTime
.
value
){
if
(
dayjs
().
isBefore
(
dayjs
(
formTime
.
value
.
hqStart
))){
hotTime
.
value
[
0
]
=
dayjs
(
formTime
.
value
.
hqStart
).
format
(
'YYYY-MM-DD'
)
hotTime
.
value
[
1
]
=
dayjs
(
formTime
.
value
.
hqEnd
).
add
(
1
,
'day'
).
format
(
'YYYY-MM-DD'
)
hotTime
.
value
[
1
]
=
dayjs
(
formTime
.
value
.
hqStart
).
add
(
1
,
'day'
).
format
(
'YYYY-MM-DD'
)
}
else
{
hotTime
.
value
[
0
]
=
dayjs
().
format
(
'YYYY-MM-DD'
)
hotTime
.
value
[
1
]
=
dayjs
().
add
(
1
,
'day'
).
format
(
'YYYY-MM-DD'
)
}
}
getData
()
})
})
}
function
getData
()
{
loading
.
value
=
true
...
...
@@ -278,13 +283,12 @@ function goNext(room) {
})
}
function
getDaysBetween
(
e
){
console
.
log
(
hotTime
.
value
)
function
getDaysBetween
(){
if
(
hotTime
.
value
&&
hotTime
.
value
.
length
==
2
){
const
d1
=
dayjs
(
hotTime
.
value
[
0
]).
format
(
'YYYY-MM-DD'
)
const
d2
=
dayjs
(
hotTime
.
value
[
1
]).
format
(
'YYYY-MM-DD'
)
if
(
d1
==
d2
){
hotTime
.
value
=
[]
getDateTime
()
return
proxy
.
$modal
.
msgError
(
language
.
value
==
0
?
'入住时间跨度需要大于一天'
:
'The duration of the stay must be more than one day.'
)
}
else
{
getData
()
...
...
@@ -292,19 +296,19 @@ function getDaysBetween(e){
}
}
//
function disabledDateRZ(date) {
//
//判读今天大与form.value.hqStart
//
console.log(date)
//
if (formTime.value.hqStart) {
//
const today = dayjs().format('YYYY-MM-DD')
//
if (formTime.value.hqStart < today) {
//
return !((date.getTime() >= dayjs(today).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf()))
//
} else {
//
return !((date.getTime() >= dayjs(formTime.value.hqStart).valueOf())&&(date.getTime() <= dayjs(formTime.value.hqEnd).valueOf()))
//
}
//
}
//
// return true
//
}
function
disabledDateRZ
(
date
)
{
//判读今天大与form.value.hqStart
console
.
log
(
date
)
if
(
formTime
.
value
.
hqStart
)
{
const
today
=
dayjs
().
format
(
'YYYY-MM-DD'
)
if
(
formTime
.
value
.
hqStart
<
today
)
{
return
!
((
date
.
getTime
()
>=
dayjs
(
today
).
valueOf
())
&&
(
date
.
getTime
()
<=
dayjs
(
formTime
.
value
.
hqEnd
).
valueOf
()))
}
else
{
return
!
((
date
.
getTime
()
>=
dayjs
(
formTime
.
value
.
hqStart
).
valueOf
())
&&
(
date
.
getTime
()
<=
dayjs
(
formTime
.
value
.
hqEnd
).
valueOf
()))
}
}
// return true
}
function
goMap
()
{
return
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment