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
a84092d2
Commit
a84092d2
authored
Apr 23, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
儿童年龄
parent
01b636ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
34 deletions
+90
-34
search.vue
pages/hotel/components/search.vue
+2
-1
date.vue
pages/hotel/components/time/date.vue
+44
-5
order.vue
pages/hotel/order.vue
+44
-28
No files found.
pages/hotel/components/search.vue
View file @
a84092d2
...
@@ -226,7 +226,8 @@
...
@@ -226,7 +226,8 @@
roomNum
:
1
,
roomNum
:
1
,
numberOfAdults
:
2
,
numberOfAdults
:
2
,
numberOfChildren
:
0
,
numberOfChildren
:
0
,
ChildAgeDetails
:
null
ChildAgeDetails
:
null
,
ChildAgeTexts
:
[],
}],
}],
},
},
day
:
0
,
day
:
0
,
...
...
pages/hotel/components/time/date.vue
View file @
a84092d2
...
@@ -68,12 +68,17 @@
...
@@ -68,12 +68,17 @@
@
change=
"(e)=>
{ageChange(e,index)}"
@
change=
"(e)=>
{ageChange(e,index)}"
style="margin-left: 10rpx;"
style="margin-left: 10rpx;"
>
</u-number-box>
-->
>
</u-number-box>
-->
<text
v-for=
"(items,indexs) in item.ChildAgeTexts"
:key=
"indexs"
@
click=
"eitAge(index,indexs)"
>
{{
items
}}
岁
<template
v-if=
"indexs!=(item.ChildAgeTexts.length-1)"
>
,
</
template
>
</text>
<uni-section
title=
""
type=
"line"
>
<uni-section
title=
""
type=
"line"
>
<uni-data-select
<uni-data-select
:ref=
"`select_${index}`"
placeholder=
"
请选择年龄
"
placeholder=
"
年龄(多儿童需选多次)
"
v-model=
"item.ChildAgeDetails"
v-model=
"item.ChildAgeDetails"
:localdata=
"TypeList"
:localdata=
"TypeList"
:clear=
"false"
:clear=
"false"
@
change=
"(e)=>{ageChange(e,index)}"
></uni-data-select>
></uni-data-select>
</uni-section>
</uni-section>
<u-icon
name=
"arrow"
:size=
"32"
color=
"#ccc"
style=
"position: relative;top: -9rpx;"
></u-icon>
<u-icon
name=
"arrow"
:size=
"32"
color=
"#ccc"
style=
"position: relative;top: -9rpx;"
></u-icon>
...
@@ -116,6 +121,7 @@ export default {
...
@@ -116,6 +121,7 @@ export default {
peoples
:
2
,
peoples
:
2
,
},
},
TypeList
:
[],
TypeList
:
[],
current
:
-
1
,
}
}
},
},
watch
:{
watch
:{
...
@@ -129,7 +135,7 @@ export default {
...
@@ -129,7 +135,7 @@ export default {
},
},
},
},
created
(){
created
(){
for
(
let
i
=
1
;
i
<=
1
4
;
i
++
){
for
(
let
i
=
1
;
i
<=
1
8
;
i
++
){
this
.
TypeList
.
push
({
this
.
TypeList
.
push
({
text
:
i
+
'岁'
,
text
:
i
+
'岁'
,
value
:
i
value
:
i
...
@@ -144,7 +150,8 @@ export default {
...
@@ -144,7 +150,8 @@ export default {
roomNum
:
e
.
value
,
roomNum
:
e
.
value
,
numberOfAdults
:
1
,
numberOfAdults
:
1
,
numberOfChildren
:
0
,
numberOfChildren
:
0
,
ChildAgeDetails
:
null
ChildAgeDetails
:
null
,
ChildAgeTexts
:
[],
})
})
}
}
if
(
e
.
value
<
this
.
parameters
.
rooms
){
if
(
e
.
value
<
this
.
parameters
.
rooms
){
...
@@ -154,11 +161,33 @@ export default {
...
@@ -154,11 +161,33 @@ export default {
this
.
peopleChange
()
this
.
peopleChange
()
}
}
},
},
eitAge
(
index
,
indexs
){
this
.
current
=
indexs
this
.
$refs
[
`select_
${
index
}
`
][
0
].
toggleSelector
();
},
ageChange
(
e
,
index
){
ageChange
(
e
,
index
){
this
.
parameters
.
searchroomGroup
[
index
].
ChildAgeDetails
=
e
.
value
;
let
list
=
this
.
parameters
.
searchroomGroup
[
index
].
ChildAgeTexts
if
(
this
.
current
>=
0
){
this
.
parameters
.
searchroomGroup
[
index
].
ChildAgeTexts
[
this
.
current
]
=
e
this
.
current
=
-
1
}
else
{
if
(
list
.
length
==
0
||
list
.
length
<
this
.
parameters
.
searchroomGroup
[
index
].
numberOfChildren
){
this
.
parameters
.
searchroomGroup
[
index
].
ChildAgeTexts
.
push
(
e
)
}
else
{
this
.
parameters
.
searchroomGroup
[
index
].
ChildAgeTexts
[
list
.
length
-
1
]
=
e
}
}
this
.
parameters
.
searchroomGroup
[
index
].
ChildAgeDetails
=
e
;
},
},
etChange
(
e
,
index
){
etChange
(
e
,
index
){
this
.
parameters
.
searchroomGroup
[
index
].
numberOfChildren
=
e
.
value
;
this
.
parameters
.
searchroomGroup
[
index
].
numberOfChildren
=
e
.
value
;
if
(
e
.
value
<
this
.
parameters
.
searchroomGroup
[
index
].
ChildAgeTexts
.
length
){
let
num
=
this
.
parameters
.
searchroomGroup
[
index
].
ChildAgeTexts
.
length
-
e
.
value
for
(
let
i
=
0
;
i
<
num
;
i
++
){
this
.
parameters
.
searchroomGroup
[
index
].
ChildAgeTexts
.
splice
(
i
,
1
)
}
}
this
.
peopleChange
()
this
.
peopleChange
()
},
},
crChange
(
e
,
index
){
crChange
(
e
,
index
){
...
@@ -176,6 +205,16 @@ export default {
...
@@ -176,6 +205,16 @@ export default {
})
})
},
},
chosenDateResult
(
obj
)
{
chosenDateResult
(
obj
)
{
for
(
let
i
=
0
;
i
<
this
.
parameters
.
searchroomGroup
.
length
;
i
++
){
let
list
=
this
.
parameters
.
searchroomGroup
[
i
]
if
(
list
.
numberOfChildren
>
list
.
ChildAgeTexts
.
length
){
return
uni
.
showToast
({
title
:
`请选择房间
${
i
+
1
}
儿童年龄`
,
icon
:
'none'
,
duration
:
2000
})
}
}
this
.
showTimePopup
=
false
;
this
.
showTimePopup
=
false
;
this
.
$emit
(
'chosenDateResult'
,
this
.
parameters
,
obj
)
this
.
$emit
(
'chosenDateResult'
,
this
.
parameters
,
obj
)
},
},
...
...
pages/hotel/order.vue
View file @
a84092d2
...
@@ -51,20 +51,22 @@
...
@@ -51,20 +51,22 @@
</view>
-->
</view>
-->
</view>
</view>
<view
class=
"row-sbas-n items-center"
>
<view
class=
"row-sbas-n items-center"
>
<!--
<view
class=
"addPnum addPnumL"
@
click=
"orderMsg.RoomCount>1?editNum(1):''"
>
<view
class=
"addPnum addPnumL"
@
click=
"orderMsg.RoomCount>1?editNum(1):''"
>
<image
v-if=
"orderMsg.RoomCount>1"
style=
"width: 27rpx;height: 27rpx;display: block;"
<image
v-if=
"orderMsg.RoomCount>1"
style=
"width: 27rpx;height: 27rpx;display: block;"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245939665786.png"
/>
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245939665786.png"
/>
<image
v-else
style=
"width: 27rpx;height: 27rpx;display: block;"
<image
v-else
style=
"width: 27rpx;height: 27rpx;display: block;"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638755711218891689.png"
/>
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638755711218891689.png"
/>
</view>
</view>
-->
<view
class=
"col row items-center textCenter visaProductTetx"
>
<view
class=
"col row items-center textCenter visaProductTetx"
>
{{
orderMsg
.
RoomCount
}}
{{
orderMsg
.
RoomCount
}}
间
间
</view>
</view>
<!--
<view
class=
"addPnum addPnumR"
@
click=
"editNum()"
>
<view
class=
"addPnum addPnumR"
@
click=
"editNum()"
>
<image
style=
"width: 27rpx;height: 27rpx;display: block;"
<image
style=
"width: 27rpx;height: 27rpx;display: block;"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245974558349.png"
/>
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245974558349.png"
/>
</view>
</view>
-->
</view>
</view>
</view>
</view>
<view>
<view>
...
@@ -74,9 +76,9 @@
...
@@ -74,9 +76,9 @@
<
/view
>
<
/view
>
<
view
class
=
"LastNameBox column val"
style
=
"width: 1px;flex: 1;"
>
<
view
class
=
"LastNameBox column val"
style
=
"width: 1px;flex: 1;"
>
<
view
class
=
"row items-center"
v
-
for
=
"(sItem,i) in item.GuestInfo"
:
key
=
"i"
>
<
view
class
=
"row items-center"
v
-
for
=
"(sItem,i) in item.GuestInfo"
:
key
=
"i"
>
<
input
type
=
"text"
v
-
model
=
"sItem.LastName"
:
placeholder
=
"`
住客
${i+1
}
姓`"
/>
<
input
type
=
"text"
v
-
model
=
"sItem.LastName"
:
placeholder
=
"`
${sItem.IsAdult?'住客':'儿童'
}
${i+1
}
姓`"
/>
<
input
type
=
"text"
v
-
model
=
"sItem.FirstName"
:
placeholder
=
"`
住客
${i+1
}
名`"
/>
<
input
type
=
"text"
v
-
model
=
"sItem.FirstName"
:
placeholder
=
"`
${sItem.IsAdult?'住客':'儿童'
}
${i+1
}
名`"
/>
<
view
class
=
"row"
style
=
"margin-left:20rpx;"
>
<
!--
<
view
class
=
"row"
style
=
"margin-left:20rpx;"
>
<
image
v
-
if
=
"item.GuestInfo.length>1"
<
image
v
-
if
=
"item.GuestInfo.length>1"
style
=
"width: 27rpx;height: 27rpx;display: block;"
style
=
"width: 27rpx;height: 27rpx;display: block;"
@
click
=
"deleteGuest(index,i)"
@
click
=
"deleteGuest(index,i)"
...
@@ -86,7 +88,7 @@
...
@@ -86,7 +88,7 @@
<
image
style
=
"width: 27rpx;height: 27rpx;display: block;margin-left:20rpx;"
<
image
style
=
"width: 27rpx;height: 27rpx;display: block;margin-left:20rpx;"
@
click
=
"addGuest(index)"
@
click
=
"addGuest(index)"
src
=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245974558349.png"
/>
src
=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638751245974558349.png"
/>
<
/view
>
<
/view>
--
>
<
/view
>
<
/view
>
<
/view
>
<
/view
>
<
/view
>
<
/view
>
...
@@ -415,28 +417,9 @@
...
@@ -415,28 +417,9 @@
this
.
orderMsg
.
CheckInDate
=
this
.
dayObj
.
start
;
this
.
orderMsg
.
CheckInDate
=
this
.
dayObj
.
start
;
this
.
orderMsg
.
CheckOutDate
=
this
.
dayObj
.
end
;
this
.
orderMsg
.
CheckOutDate
=
this
.
dayObj
.
end
;
this
.
orderMsg
.
RoomCount
=
this
.
searchObj
.
rooms
this
.
orderMsg
.
RoomCount
=
this
.
searchObj
.
rooms
this
.
orderMsg
.
GuestList
=
[];
this
.
searchObj
.
searchroomGroup
.
forEach
((
item
,
index
)
=>
{
this
.
getGroupData
()
var
guestInfoList
=
[];
let
allprople
=
Number
(
item
.
numberOfAdults
)
+
Number
(
item
.
numberOfChildren
)
for
(
let
i
=
1
;
i
<=
allprople
;
i
++
)
{
let
obj
=
{
LastName
:
""
,
FirstName
:
""
,
Age
:
""
}
;
guestInfoList
.
push
(
obj
);
}
console
.
log
(
item
.
ChildAgeDetails
,
'-------'
)
var
obj
=
{
RoomNum
:
index
+
1
,
numberOfAdults
:
item
.
numberOfAdults
,
numberOfChildren
:
item
.
numberOfChildren
,
ChildAgeDetails
:
item
.
ChildAgeDetails
!=
''
?
item
.
ChildAgeDetails
:
1
,
GuestInfo
:
guestInfoList
}
;
this
.
orderMsg
.
GuestList
.
push
(
obj
);
}
);
this
.
params
=
{
this
.
params
=
{
sort
:
1
,
sort
:
1
,
displayFrom
:
1
,
displayFrom
:
1
,
...
@@ -457,6 +440,39 @@
...
@@ -457,6 +440,39 @@
this
.
initHotel
()
this
.
initHotel
()
}
,
}
,
methods
:
{
methods
:
{
getGroupData
(){
this
.
orderMsg
.
GuestList
=
[];
this
.
searchObj
.
searchroomGroup
.
forEach
((
item
,
index
)
=>
{
var
guestInfoList
=
[];
let
allprople
=
Number
(
item
.
numberOfAdults
)
+
Number
(
item
.
numberOfChildren
)
for
(
let
i
=
0
;
i
<=
Number
(
item
.
numberOfAdults
)
-
1
;
i
++
)
{
let
obj
=
{
IsAdult
:
1
,
LastName
:
""
,
FirstName
:
""
,
Age
:
""
}
;
guestInfoList
.
push
(
obj
);
}
for
(
let
i
=
0
;
i
<=
Number
(
item
.
numberOfChildren
)
-
1
;
i
++
)
{
let
obj
=
{
IsAdult
:
0
,
LastName
:
""
,
FirstName
:
""
,
Age
:
item
.
ChildAgeTexts
[
i
]
}
;
guestInfoList
.
push
(
obj
);
}
var
obj
=
{
RoomNum
:
index
+
1
,
numberOfAdults
:
item
.
numberOfAdults
,
numberOfChildren
:
item
.
numberOfChildren
,
ChildAgeDetails
:
item
.
ChildAgeDetails
!=
''
?
item
.
ChildAgeDetails
:
1
,
GuestInfo
:
guestInfoList
}
;
this
.
orderMsg
.
GuestList
.
push
(
obj
);
}
);
}
,
getWeek
(
date
)
{
getWeek
(
date
)
{
var
weekArray
=
new
Array
(
"日"
,
"一"
,
"二"
,
"三"
,
"四"
,
"五"
,
"六"
);
var
weekArray
=
new
Array
(
"日"
,
"一"
,
"二"
,
"三"
,
"四"
,
"五"
,
"六"
);
var
week
=
weekArray
[
new
Date
(
date
).
getDay
()];
//注意此处必须是先new一个Date
var
week
=
weekArray
[
new
Date
(
date
).
getDay
()];
//注意此处必须是先new一个Date
...
...
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