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
76ff5e35
Commit
76ff5e35
authored
Jun 03, 2021
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/zk123/jz_travel
into master
parents
903f6510
2b5140c1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
461 additions
and
112 deletions
+461
-112
u-number-box.vue
...modules/uview-ui/components/u-number-box/u-number-box.vue
+15
-6
jz_LineDetail.vue
pages/jiuzhai/jz_LineDetail.vue
+48
-12
jz_Reserve.vue
pages/jiuzhai/jz_Reserve.vue
+398
-94
No files found.
node_modules/uview-ui/components/u-number-box/u-number-box.vue
View file @
76ff5e35
...
@@ -110,27 +110,36 @@
...
@@ -110,27 +110,36 @@
value
(
val
)
{
value
(
val
)
{
this
.
inputVal
=
+
val
;
this
.
inputVal
=
+
val
;
},
},
max
(
val
){
this
.
newMax
=
val
console
.
log
(
this
.
newMax
,
val
)
},
inputVal
(
v1
,
v2
)
{
inputVal
(
v1
,
v2
)
{
// 为了让用户能够删除所有输入值,重新输入内容,删除所有值后,内容为空字符串
// 为了让用户能够删除所有输入值,重新输入内容,删除所有值后,内容为空字符串
if
(
v1
==
''
)
return
;
if
(
v1
==
''
)
return
;
let
value
=
0
;
let
value
=
0
;
// 首先判断是否正整数,并且在min和max之间,如果不是,使用原来值
// 首先判断是否正整数,并且在min和max之间,如果不是,使用原来值
let
tmp
=
/
(
^
\d
+$
)
/
.
test
(
v1
)
&&
value
[
0
]
!=
0
;
let
tmp
=
/
(
^
\d
+$
)
/
.
test
(
v1
)
&&
value
[
0
]
!=
0
;
if
(
tmp
&&
v1
>=
this
.
min
&&
v1
<=
this
.
m
ax
)
value
=
v1
;
if
(
tmp
&&
v1
>=
this
.
min
&&
v1
<=
this
.
newM
ax
)
value
=
v1
;
else
value
=
v2
;
else
value
=
v2
;
this
.
handleChange
(
value
,
'change'
);
this
.
handleChange
(
value
,
'change'
);
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
inputVal
=
value
;
this
.
inputVal
=
value
;
})
})
}
}
,
},
},
data
()
{
data
()
{
return
{
return
{
inputVal
:
1
// 输入框中的值,不能直接使用props中的value,因为应该改变props的状态
inputVal
:
1
,
// 输入框中的值,不能直接使用props中的value,因为应该改变props的状态
newMax
:
0
};
};
},
},
created
()
{
created
()
{
this
.
inputVal
=
+
this
.
value
;
this
.
inputVal
=
+
this
.
value
;
uni
.
setNavigationBarTitle
({
title
:
"订单确认"
})
this
.
newMax
=
this
.
max
},
},
methods
:
{
methods
:
{
minus
()
{
minus
()
{
...
@@ -184,7 +193,7 @@
...
@@ -184,7 +193,7 @@
value
=
this
.
calcPlus
(
this
.
inputVal
,
this
.
step
);
value
=
this
.
calcPlus
(
this
.
inputVal
,
this
.
step
);
}
}
// 判断是否小于最小值和大于最大值
// 判断是否小于最小值和大于最大值
if
(
value
<
this
.
min
||
value
>
this
.
m
ax
)
{
if
(
value
<
this
.
min
||
value
>
this
.
newM
ax
)
{
return
;
return
;
}
}
this
.
inputVal
=
value
;
this
.
inputVal
=
value
;
...
@@ -198,8 +207,8 @@
...
@@ -198,8 +207,8 @@
// 这里不直接判断是否正整数,是因为用户传递的props min值可能为0
// 这里不直接判断是否正整数,是因为用户传递的props min值可能为0
if
(
!
/
(
^
\d
+$
)
/
.
test
(
value
)
||
value
[
0
]
==
0
)
val
=
this
.
min
;
if
(
!
/
(
^
\d
+$
)
/
.
test
(
value
)
||
value
[
0
]
==
0
)
val
=
this
.
min
;
val
=
+
value
;
val
=
+
value
;
if
(
val
>
this
.
m
ax
)
{
if
(
val
>
this
.
newM
ax
)
{
val
=
this
.
m
ax
;
val
=
this
.
newM
ax
;
}
else
if
(
val
<
this
.
min
)
{
}
else
if
(
val
<
this
.
min
)
{
val
=
this
.
min
;
val
=
this
.
min
;
}
}
...
...
pages/jiuzhai/jz_LineDetail.vue
View file @
76ff5e35
...
@@ -285,7 +285,7 @@
...
@@ -285,7 +285,7 @@
<span
style=
"width:40px;background-color: #DFBE6E;height: 6px;bottom: 2px;left: 0;right: 0;position: absolute;z-index: 1;"
></span>
<span
style=
"width:40px;background-color: #DFBE6E;height: 6px;bottom: 2px;left: 0;right: 0;position: absolute;z-index: 1;"
></span>
</span>
</span>
<view
class=
"jz_TripMain"
>
<view
class=
"jz_TripMain"
>
<rich-text
:nodes=
"dataList.feature.
important
Tip"
></rich-text>
<rich-text
:nodes=
"dataList.feature.
warm
Tip"
></rich-text>
</view>
</view>
</view>
</view>
<view
class=
"jz_TripDays"
>
<view
class=
"jz_TripDays"
>
...
@@ -316,7 +316,7 @@
...
@@ -316,7 +316,7 @@
<u-popup
v-model=
"showDateChosen"
mode=
"bottom"
border-radius=
"20"
length=
"90%"
:safe-area-inset-bottom=
"true"
>
<u-popup
v-model=
"showDateChosen"
mode=
"bottom"
border-radius=
"20"
length=
"90%"
:safe-area-inset-bottom=
"true"
>
<canlendar
@
finish=
"chosenDateResult"
:defaultDate=
"currentPrice.startDate"
:priceList=
"dataList.priceList"
></canlendar>
<canlendar
@
finish=
"chosenDateResult"
:defaultDate=
"currentPrice.startDate"
:priceList=
"dataList.priceList"
></canlendar>
</u-popup>
</u-popup>
<u-popup
v-model=
"showOrderPreviwe"
mode=
"bottom"
border-radius=
"20"
length=
"
8
0%"
:safe-area-inset-bottom=
"true"
>
<u-popup
v-model=
"showOrderPreviwe"
mode=
"bottom"
border-radius=
"20"
length=
"
9
0%"
:safe-area-inset-bottom=
"true"
>
<view
style=
"width: 100%;height: 100%;display: flex;flex-direction: column;"
>
<view
style=
"width: 100%;height: 100%;display: flex;flex-direction: column;"
>
<view
style=
"flex: 1;width: 100%;height: 1rpx;"
>
<view
style=
"flex: 1;width: 100%;height: 1rpx;"
>
<canlendar
@
finish=
"chosenDateResult"
:immediately=
"true"
:defaultDate=
"currentPrice.startDate"
:priceList=
"dataList.priceList"
title=
"确定日期和人数"
></canlendar>
<canlendar
@
finish=
"chosenDateResult"
:immediately=
"true"
:defaultDate=
"currentPrice.startDate"
:priceList=
"dataList.priceList"
title=
"确定日期和人数"
></canlendar>
...
@@ -325,17 +325,27 @@
...
@@ -325,17 +325,27 @@
<view
class=
"line-flex"
style=
"padding:30rpx;background: #FFF;"
>
<view
class=
"line-flex"
style=
"padding:30rpx;background: #FFF;"
>
<text
style=
"font-size: 28rpx;color:#111;font-weight: 500;"
>
成人
</text>
<text
style=
"font-size: 28rpx;color:#111;font-weight: 500;"
>
成人
</text>
<text
style=
"font-size:22rpx;color:#999;margin-left: 30rpx;flex:1;"
>
18周岁以上
</text>
<text
style=
"font-size:22rpx;color:#999;margin-left: 30rpx;flex:1;"
>
18周岁以上
</text>
<u-number-box
size=
"28"
:min=
"1"
:max=
"currentPrice.totalSeat-etCount"
v-model=
"crCount"
></u-number-box>
<u-number-box
size=
"28"
:min=
"1"
:max=
"currentPrice.totalSeat-etCount-etbCount"
@
change=
"crChange"
v-model=
"crCount"
></u-number-box>
</view>
<view
class=
"line-flex"
style=
"padding:30rpx;background: #FFF;"
>
<text
style=
"font-size: 28rpx;color:#111;font-weight: 500;"
>
儿童(占床)
</text>
<text
style=
"font-size:22rpx;color:#999;margin-left: 30rpx;flex:1;"
>
2-18周岁(不含)
</text>
<u-number-box
size=
"28"
:min=
"0"
:max=
"currentPrice.totalSeat-crCount-etbCount"
@
change=
"etChange"
v-model=
"etCount"
></u-number-box>
</view>
</view>
<view
class=
"line-flex"
style=
"padding:30rpx;background: #FFF;"
>
<view
class=
"line-flex"
style=
"padding:30rpx;background: #FFF;"
>
<text
style=
"font-size: 28rpx;color:#111;font-weight: 500;"
>
儿童
</text>
<text
style=
"font-size: 28rpx;color:#111;font-weight: 500;"
>
儿童
(不占床)
</text>
<text
style=
"font-size:22rpx;color:#999;margin-left: 30rpx;flex:1;"
>
2-18周岁(不含)
</text>
<text
style=
"font-size:22rpx;color:#999;margin-left: 30rpx;flex:1;"
>
2-18周岁(不含)
</text>
<u-number-box
size=
"28"
:min=
"0"
:max=
"currentPrice.totalSeat-crCount"
v-model=
"etCount"
></u-number-box>
<u-number-box
size=
"28"
:min=
"0"
:max=
"currentPrice.totalSeat-crCount-etCount"
@
change=
"etbChange"
v-model=
"etbCount"
></u-number-box>
</view>
<view
class=
"line-flex"
style=
"padding:30rpx;background: #FFF;"
>
<text
style=
"font-size: 28rpx;color:#111;font-weight: 500;"
>
婴儿
</text>
<text
style=
"font-size:22rpx;color:#999;margin-left: 30rpx;flex:1;"
>
0-2周岁(不含)
</text>
<u-number-box
size=
"28"
@
change=
"yeChange"
:min=
"0"
:max=
"crCount"
v-model=
"yeCount"
></u-number-box>
</view>
</view>
</view>
</view>
<view
class=
"jz_OrderDiv"
style=
"box-shadow: none;width: 100%;padding:20rpx;"
>
<view
class=
"jz_OrderDiv"
style=
"box-shadow: none;width: 100%;padding:20rpx;"
>
<view>
<view>
<text
style=
"font-size:24rpx;color:#111;font-weight:
400;"
>
{{currentPrice.startDate}} 出发
</text>
<text
style=
"font-size:24rpx;color:#111;font-weight:
500;"
>
{{currentPrice.startDate}} 出发 余位:{{currentPrice.totalSeat}}
</text>
</view>
</view>
<view
style=
"display:flex;align-items: center;"
>
<view
style=
"display:flex;align-items: center;"
>
<button
open-type=
"contact"
class=
"jz_ConButton"
>
<button
open-type=
"contact"
class=
"jz_ConButton"
>
...
@@ -363,6 +373,8 @@
...
@@ -363,6 +373,8 @@
showOrderPreviwe
:
false
,
showOrderPreviwe
:
false
,
crCount
:
1
,
crCount
:
1
,
etCount
:
0
,
etCount
:
0
,
yeCount
:
0
,
etbCount
:
0
,
msg
:
{
msg
:
{
pageIndex
:
1
,
pageIndex
:
1
,
pageSize
:
15
pageSize
:
15
...
@@ -387,7 +399,7 @@
...
@@ -387,7 +399,7 @@
};
};
},
},
created
()
{
created
()
{
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
if
(
option
.
tcid
&&
option
.
configId
&&
option
.
cityId
)
{
if
(
option
.
tcid
&&
option
.
configId
&&
option
.
cityId
)
{
...
@@ -413,9 +425,10 @@
...
@@ -413,9 +425,10 @@
chosenDateResult
(
result
){
chosenDateResult
(
result
){
let
price
=
this
.
dataList
.
priceList
[
result
.
priceObj
]
let
price
=
this
.
dataList
.
priceList
[
result
.
priceObj
]
this
.
currentPrice
=
price
this
.
currentPrice
=
price
if
(
this
.
crCount
+
this
.
etCount
>
this
.
currentPrice
.
totalSeat
){
if
(
this
.
crCount
+
this
.
etCount
+
this
.
etbCount
>=
this
.
currentPrice
.
totalSeat
){
this
.
crCount
=
1
,
this
.
crCount
=
1
this
.
etCount
=
0
this
.
etCount
=
0
this
.
etbCount
=
0
}
}
this
.
delMsg
.
tcid
=
price
.
tcid
this
.
delMsg
.
tcid
=
price
.
tcid
this
.
delMsg
.
configId
=
price
.
configID
;
this
.
delMsg
.
configId
=
price
.
configID
;
...
@@ -425,6 +438,18 @@
...
@@ -425,6 +438,18 @@
}
}
this
.
showDateChosen
=
false
this
.
showDateChosen
=
false
},
},
crChange
(
e
){
this
.
crCount
=
e
.
value
;
},
etChange
(
e
){
this
.
etCount
=
e
.
value
;
},
etbChange
(
e
){
this
.
etbCount
=
e
.
value
;
},
yeChange
(
e
){
this
.
yeCount
=
e
.
value
;
},
openPicture
()
{
openPicture
()
{
let
imgObj
=
JSON
.
stringify
(
this
.
dataList
.
HotelImg
);
let
imgObj
=
JSON
.
stringify
(
this
.
dataList
.
HotelImg
);
uni
.
navigateTo
({
uni
.
navigateTo
({
...
@@ -511,9 +536,10 @@
...
@@ -511,9 +536,10 @@
},
},
//点击切换
//点击切换
getDayInfo
(
item
){
getDayInfo
(
item
){
if
(
this
.
crCount
+
this
.
etCount
>
this
.
currentPrice
.
totalSeat
){
if
(
this
.
crCount
+
this
.
etCount
+
this
.
etbCount
>=
this
.
currentPrice
.
totalSeat
){
this
.
crCount
=
1
,
this
.
crCount
=
1
this
.
etCount
=
0
this
.
etCount
=
0
this
.
etbCount
=
0
}
}
this
.
delMsg
.
tcid
=
item
.
tcid
;
this
.
delMsg
.
tcid
=
item
.
tcid
;
this
.
delMsg
.
configId
=
item
.
configID
;
this
.
delMsg
.
configId
=
item
.
configID
;
...
@@ -543,8 +569,14 @@
...
@@ -543,8 +569,14 @@
}
}
let
myCurr
=
JSON
.
stringify
(
myCurrentInfo
);
let
myCurr
=
JSON
.
stringify
(
myCurrentInfo
);
console
.
log
(
myCurrentInfo
,
'myCurrentInfo'
);
console
.
log
(
myCurrentInfo
,
'myCurrentInfo'
);
let
ren
=
{
crCount
:
this
.
crCount
,
etCount
:
this
.
etCount
,
yeCount
:
this
.
yeCount
,
etbCount
:
this
.
etbCount
}
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/jiuzhai/jz_Reserve?currentPriceInfo="
+
encodeURIComponent
(
myCurr
)
url
:
"/pages/jiuzhai/jz_Reserve?currentPriceInfo="
+
encodeURIComponent
(
myCurr
)
+
"&ln="
+
this
.
dataList
.
ltName
+
"&seat="
+
encodeURIComponent
(
JSON
.
stringify
(
ren
))
+
"&tips="
+
encodeURIComponent
(
this
.
dataList
.
feature
.
importantTipText
)
});
});
}
}
},
},
...
@@ -591,6 +623,10 @@
...
@@ -591,6 +623,10 @@
height
:
100vh
;
height
:
100vh
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
}
.jz_LineDetail
rich-text
{
font-size
:
26
rpx
;
font-weight
:
500
;
}
.line-flex
{
.line-flex
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
...
pages/jiuzhai/jz_Reserve.vue
View file @
76ff5e35
This diff is collapsed.
Click to expand it.
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