Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
Project
Project
Details
Activity
Releases
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
zhengke
jz_Travel
Commits
bd78b251
Commit
bd78b251
authored
Apr 25, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
4686628e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
20 deletions
+20
-20
App.vue
App.vue
+0
-3
index.vue
pages/hotel/components/time/index.vue
+13
-11
list.vue
pages/hotel/list.vue
+5
-6
utils.js
plugin/utils.js
+2
-0
No files found.
App.vue
View file @
bd78b251
<
script
>
import
{
setAttatchParameter
}
from
'./plugin/utils.js'
export
default
{
data
()
{
return
{
...
...
pages/hotel/components/time/index.vue
View file @
bd78b251
...
...
@@ -43,9 +43,7 @@
:key=
"index"
class=
"day-list"
:class=
"[
line == start[0] && index == start[1]
? 'bg-orange select-style'
: '',
line == start[0] && index == start[1]? 'bg-orange select-style': '',
(line >= start[0] &&
line
<
=
end
[
0
]
&&
index
>
start[1]
&&
...
...
@@ -53,9 +51,8 @@
(
line
>
= start[0]
&&
index > start[1]
&&
line
<
end
[
0
])
||
(
line
<
=
end
[
0
]
&&
index
<
end
[
1
]
&&
line
>
start[0]) ||
(line
<
end
[
0
]
&&
line
>
start[0])
? 'bg-higlt-orange'
: '',
line == 0
&&
index + 1
<
nowDay
?
'
time-out
'
:
'',
? 'bg-higlt-orange': '',
((line==0||line==start[0])
&&
index + 1
<
nowDay
)||
res
.
month
<nowMonth
?
'
time-out
'
:
'',
isNaN
(
item
)
?
'
is-festival
'
:
'',
(
isNaN
(
item
)
&&
line =
=
start
[
0
]
&&
index =
=
start
[
1
])
||
(
isNaN
(
item
)
&&
line =
=
end
[
0
]
&&
index =
=
end
[
1
])
...
...
@@ -88,9 +85,9 @@
color: line == end[0]
&&
index == end[1] ? '#FFFFFF' : '',
}"
>
<view
style=
"padding-top: 2px; padding-bottom: 2px"
>
{{
item
}}
</view>
<view
style=
"padding-top: 2px; padding-bottom: 2px"
>
{{
item
}}
</view>
<view
class=
"select-style"
v-if=
"line == start[0] && index == start[1]"
...
...
@@ -189,6 +186,7 @@ export default {
type
:
"-"
,
//日期分隔符
date
:
[],
//日期数组对象
dayWidth
:
0
,
//日期的宽度
nowMonth
:
0
,
//当前时间的月
nowDay
:
0
,
//当前时间的日
start
:
[],
//入住时间
count
:
6
,
//显示月的数量
...
...
@@ -213,7 +211,8 @@ export default {
},
});
this
.
setDate
();
this
.
nowDay
=
new
Date
().
getDate
()
+
7
;
// this.nowDay = new Date().getDate()
/*默认入住离店日期,今日入住明日离店,此处应在setDefaultDate函数内传入vuex里保存的日期进行默认操作
*不推荐使用本地缓存,下边只是使用缓存的示例
*/
...
...
@@ -224,11 +223,14 @@ export default {
var
obj
=
JSON
.
parse
(
res
.
data
);
this
.
start
=
this
.
setDefaultDate
(
obj
.
start
);
this
.
end
=
this
.
setDefaultDate
(
obj
.
end
);
this
.
nowDay
=
this
.
$utils
.
GetDateFewFaysLater
(
obj
.
fewDays
).
dd
this
.
nowMonth
=
this
.
$utils
.
GetDateFewFaysLater
(
obj
.
fewDays
).
mm
}
},
fail
:
()
=>
{
this
.
start
=
this
.
setDefaultDate
(
this
.
getDefaultDate
(
0
));
this
.
end
=
this
.
setDefaultDate
(
this
.
getDefaultDate
(
1
));
console
.
log
(
this
.
start
,
this
.
end
)
},
});
setTimeout
(()
=>
{
...
...
@@ -448,7 +450,7 @@ export default {
//选择入住离开
selectDay
(
line
,
index
)
{
if
(
line
==
0
&&
index
+
1
<
this
.
nowDay
)
return
;
if
(
((
line
==
0
||
line
==
this
.
start
[
0
])
&&
index
+
1
<
this
.
nowDay
)
||
this
.
resDate
[
line
].
month
<
this
.
nowMonth
)
return
;
//如果有入住情况和价格则需要进行一些列的判断
if
(
this
.
priceStauts
.
length
>
0
)
{
if
(
...
...
pages/hotel/list.vue
View file @
bd78b251
...
...
@@ -37,9 +37,6 @@
import
Address
from
"./components/address/smh-address-indexed.vue"
;
import
hotelHeaders
from
"@/components/header/header"
;
import
hotelSearch
from
"./components/search.vue"
;
import
{
GetDateFewFaysLater
}
from
'@/plugin/utils.js'
export
default
{
data
()
{
return
{
...
...
@@ -89,8 +86,9 @@
uni
.
setNavigationBarTitle
({
title
:
"酒店"
,
});
let
d1
=
this
.
$utils
.
GetDateFewFaysLater
(
7
);
let
d2
=
this
.
$utils
.
GetDateFewFaysLater
(
8
);
let
fewDays
=
7
let
d1
=
this
.
$utils
.
GetDateFewFaysLater
(
fewDays
);
let
d2
=
this
.
$utils
.
GetDateFewFaysLater
(
fewDays
+
1
);
var
obj
=
{
start
:
`
${
d1
.
year
}
-
${
d1
.
month
}
-
${
d1
.
day
}
`
,
end
:
`
${
d2
.
year
}
-
${
d2
.
month
}
-
${
d2
.
day
}
`
,
...
...
@@ -100,7 +98,8 @@
startWeek
:
this
.
getWeek
(
d1
.
date
),
endWeek
:
this
.
getWeek
(
d2
.
date
),
startTime
:
`
${
d1
.
year
}
-
${
d1
.
month
}
-
${
d1
.
day
}
`
,
endTime
:
`
${
d2
.
year
}
-
${
d2
.
month
}
-
${
d2
.
day
}
`
endTime
:
`
${
d2
.
year
}
-
${
d2
.
month
}
-
${
d2
.
day
}
`
,
fewDays
:
fewDays
};
this
.
dayObj
=
obj
;
uni
.
setStorage
({
...
...
plugin/utils.js
View file @
bd78b251
...
...
@@ -196,7 +196,9 @@ function GetDateFewFaysLater(Days){
return
{
year
:
year
,
month
:
month
>
9
?
month
:
'0'
+
month
,
mm
:
month
,
day
:
day
>
9
?
day
:
'0'
+
day
,
dd
:
day
,
date
:
`
${
year
}
-
${
month
>
9
?
month
:
'0'
+
month
}
-
${
day
>
9
?
day
:
'0'
+
day
}
`
}
}
...
...
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