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
57d3b819
Commit
57d3b819
authored
Jun 01, 2021
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
b63ed354
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
242 additions
and
92 deletions
+242
-92
recommed-hotel.vue
pages/hotel/components/recommed-hotel.vue
+3
-2
room-good.vue
pages/hotel/components/room-good.vue
+1
-2
detail.vue
pages/hotel/detail.vue
+18
-34
list.vue
pages/hotel/list.vue
+2
-5
order.vue
pages/hotel/order.vue
+218
-49
No files found.
pages/hotel/components/recommed-hotel.vue
View file @
57d3b819
...
@@ -57,8 +57,9 @@
...
@@ -57,8 +57,9 @@
}
}
},
},
mounted
(){
mounted
(){
console
.
log
(
this
.
dayObj
,
'dayObj'
);
},
console
.
log
(
this
.
searchObj
,
'searchObj'
);
created
(){
},
},
methods
:{
methods
:{
goHotelDetail
(
id
){
goHotelDetail
(
id
){
...
...
pages/hotel/components/room-good.vue
View file @
57d3b819
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
<
template
v-else
>
<
template
v-else
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/default_room.jpg"
mode=
"aspectFill"
>
<image
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/default_room.jpg"
mode=
"aspectFill"
>
</image>
</image>
<view
class=
"mark"
></view>
</
template
>
</
template
>
</view>
</view>
<view
class=
"rm-right"
>
<view
class=
"rm-right"
>
...
@@ -64,7 +63,6 @@
...
@@ -64,7 +63,6 @@
},
},
methods
:
{
methods
:
{
previewOrder
(
item
)
{
previewOrder
(
item
)
{
console
.
log
(
item
,
'数据'
);
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/hotel/order?RoomInfo="
+
JSON
.
stringify
(
item
)
+
'&dayObj='
+
JSON
.
stringify
(
this
.
dayObj
)
+
'&HotelInfo='
+
JSON
.
stringify
(
this
.
hotelData
)
url
:
"/pages/hotel/order?RoomInfo="
+
JSON
.
stringify
(
item
)
+
'&dayObj='
+
JSON
.
stringify
(
this
.
dayObj
)
+
'&HotelInfo='
+
JSON
.
stringify
(
this
.
hotelData
)
})
})
...
@@ -87,6 +85,7 @@
...
@@ -87,6 +85,7 @@
.room-good
.f11
{
.room-good
.f11
{
font-size
:
22
rpx
;
font-size
:
22
rpx
;
font-weight
:
500
;
font-weight
:
500
;
margin-top
:
10
rpx
;
}
}
.room-good
.rm-right
{
.room-good
.rm-right
{
...
...
pages/hotel/detail.vue
View file @
57d3b819
...
@@ -97,13 +97,13 @@
...
@@ -97,13 +97,13 @@
</view>
</view>
<view
class=
"date-box flex"
@
click=
"showTimePopup=true"
>
<view
class=
"date-box flex"
@
click=
"showTimePopup=true"
>
<view
class=
"date"
>
<view
class=
"date"
>
<text>
{{
roomMsg
.
StartDate
}}
</text>
<text>
{{
startDay
}}
</text>
<text
class=
"date-week"
>
{{
startWeek
}}
</text>
<text
class=
"date-week"
>
{{
getWeek
(
roomMsg
.
StartDate
)
}}
</text>
</view>
</view>
<view
class=
"hr-line"
></view>
<view
class=
"hr-line"
></view>
<view
class=
"date"
>
<view
class=
"date"
>
<text>
{{
roomMsg
.
EndDate
}}
</text>
<text>
{{
endDay
}}
</text>
<text
class=
"date-week"
>
{{
endWeek
}}
</text>
<text
class=
"date-week"
>
{{
getWeek
(
roomMsg
.
EndDate
)
}}
</text>
</view>
</view>
<view
class=
"ver-line"
></view>
<view
class=
"ver-line"
></view>
<view
class=
"date"
>
<view
class=
"date"
>
...
@@ -234,8 +234,6 @@
...
@@ -234,8 +234,6 @@
StartDate
:
''
,
StartDate
:
''
,
EndDate
:
''
EndDate
:
''
},
},
startWeek
:
''
,
endWeek
:
''
,
day
:
0
,
day
:
0
,
threeLevelList
:
[{
threeLevelList
:
[{
name
:
"单人床"
,
name
:
"单人床"
,
...
@@ -269,7 +267,9 @@
...
@@ -269,7 +267,9 @@
HotelArr
:[]
,
//推荐酒店
HotelArr
:[]
,
//推荐酒店
searchObj
:{},
searchObj
:{},
dayObj
:{},
dayObj
:{},
hotelData
:{}
//传递到房间预订组件
hotelData
:{}
,
//传递到房间预订组件
startDay
:
''
,
endDay
:
''
}
}
},
},
components
:
{
components
:
{
...
@@ -301,11 +301,12 @@
...
@@ -301,11 +301,12 @@
if
(
options
.
dayObj
)
{
if
(
options
.
dayObj
)
{
console
.
log
(
options
.
dayObj
,
'options.dayObj'
);
console
.
log
(
options
.
dayObj
,
'options.dayObj'
);
var
tempDay
=
JSON
.
parse
(
options
.
dayObj
);
var
tempDay
=
JSON
.
parse
(
options
.
dayObj
);
this
.
roomMsg
.
StartDate
=
tempDay
.
StartDate
;
this
.
roomMsg
.
StartDate
=
tempDay
.
start
;
this
.
roomMsg
.
EndDate
=
tempDay
.
EndDate
;
this
.
roomMsg
.
EndDate
=
tempDay
.
end
;
this
.
startDay
=
tempDay
.
startDay
;
this
.
endDay
=
tempDay
.
endDay
;
this
.
day
=
tempDay
.
day
;
this
.
day
=
tempDay
.
day
;
this
.
startWeek
=
tempDay
.
startWeek
;
this
.
dayObj
=
tempDay
;
this
.
endWeek
=
tempDay
.
endWeek
;
}
}
if
(
options
.
searchObj
){
if
(
options
.
searchObj
){
this
.
searchObj
=
JSON
.
parse
(
options
.
searchObj
);
this
.
searchObj
=
JSON
.
parse
(
options
.
searchObj
);
...
@@ -364,13 +365,11 @@
...
@@ -364,13 +365,11 @@
chosenDateResult
(
obj
)
{
chosenDateResult
(
obj
)
{
this
.
roomMsg
.
StartDate
=
obj
.
start
;
this
.
roomMsg
.
StartDate
=
obj
.
start
;
this
.
roomMsg
.
EndDate
=
obj
.
end
;
this
.
roomMsg
.
EndDate
=
obj
.
end
;
this
.
start
Week
=
obj
.
startWeek
;
this
.
start
Day
=
obj
.
startDay
;
this
.
end
Week
=
obj
.
endWeek
;
this
.
end
Day
=
obj
.
endDay
;
this
.
day
=
obj
.
day
;
this
.
day
=
obj
.
day
;
this
.
getRoomType
();
this
.
getRoomType
();
this
.
dayObj
.
StartDate
=
obj
.
start
;
this
.
dayObj
=
obj
;
this
.
dayObj
.
EndDate
=
obj
.
end
;
this
.
dayObj
.
day
=
obj
.
day
;
this
.
showTimePopup
=
false
this
.
showTimePopup
=
false
},
},
//切换日期获取房型
//切换日期获取房型
...
@@ -402,24 +401,9 @@
...
@@ -402,24 +401,9 @@
return
d
>
9
?
d
:
"0"
+
d
return
d
>
9
?
d
:
"0"
+
d
},
},
getWeek
(
date
)
{
getWeek
(
date
)
{
console
.
log
(
date
,
'date'
);
var
weekArray
=
new
Array
(
"日"
,
"一"
,
"二"
,
"三"
,
"四"
,
"五"
,
"六"
);
let
day
=
date
.
getDay
();
var
week
=
weekArray
[
new
Date
(
date
).
getDay
()];
//注意此处必须是先new一个Date
if
(
day
===
1
)
{
return
'周'
+
week
;
var
week
=
"一"
;
}
else
if
(
day
===
2
)
{
week
=
"二"
;
}
else
if
(
day
===
3
)
{
week
=
"三"
;
}
else
if
(
day
===
4
)
{
week
=
"四"
;
}
else
if
(
day
===
5
)
{
week
=
"五"
;
}
else
if
(
day
===
6
)
{
week
=
"六"
;
}
else
if
(
day
===
7
)
{
week
=
"日"
;
}
return
"周"
+
week
},
},
changeNearbyType
(
t
)
{
changeNearbyType
(
t
)
{
this
.
nearbyType
=
t
this
.
nearbyType
=
t
...
...
pages/hotel/list.vue
View file @
57d3b819
...
@@ -185,6 +185,7 @@
...
@@ -185,6 +185,7 @@
endDay
:
`
${
d2
.
getMonth
()
+
1
}
-
${
d2
.
getDate
()}
`
,
endDay
:
`
${
d2
.
getMonth
()
+
1
}
-
${
d2
.
getDate
()}
`
,
day
:
1
day
:
1
}
}
this
.
dayObj
=
obj
;
uni
.
setStorage
({
uni
.
setStorage
({
key
:
'Time'
,
key
:
'Time'
,
data
:
JSON
.
stringify
(
obj
)
data
:
JSON
.
stringify
(
obj
)
...
@@ -232,8 +233,7 @@
...
@@ -232,8 +233,7 @@
this
.
startDay
=
obj
.
startDay
;
this
.
startDay
=
obj
.
startDay
;
this
.
endDay
=
obj
.
endDay
;
this
.
endDay
=
obj
.
endDay
;
this
.
day
=
obj
.
day
;
this
.
day
=
obj
.
day
;
this
.
dayObj
.
startWeek
=
obj
.
startWeek
;
this
.
dayObj
=
obj
;
this
.
dayObj
.
endWeek
=
obj
.
endWeek
;
this
.
getList
(
1
);
this
.
getList
(
1
);
this
.
showTimePopup
=
false
this
.
showTimePopup
=
false
},
},
...
@@ -378,9 +378,6 @@
...
@@ -378,9 +378,6 @@
//获取列表数据
//获取列表数据
getList
(
type
)
{
getList
(
type
)
{
this
.
searchObj
.
QStars
=
this
.
tempRateAndPrice
.
rate
.
toString
();
this
.
searchObj
.
QStars
=
this
.
tempRateAndPrice
.
rate
.
toString
();
this
.
dayObj
.
StartDate
=
this
.
searchObj
.
QStartDate
;
this
.
dayObj
.
EndDate
=
this
.
searchObj
.
QEndDate
;
this
.
dayObj
.
day
=
this
.
day
;
if
(
type
==
1
){
if
(
type
==
1
){
this
.
HotelList
=
[];
this
.
HotelList
=
[];
...
...
pages/hotel/order.vue
View file @
57d3b819
...
@@ -3,20 +3,23 @@
...
@@ -3,20 +3,23 @@
<view
class=
"hotel-order"
>
<view
class=
"hotel-order"
>
<view
class=
"o-head"
>
<view
class=
"o-head"
>
<view
class=
"o-timer flex"
>
<view
class=
"o-timer flex"
>
<view
class=
"time-item"
>
5月20日 周六
</view>
<view
class=
"time-item"
>
{{
getDate
(
dayObj
.
start
)
}}
{{
getWeek
(
dayObj
.
end
)
}}
</view>
<view
class=
"time-split"
>
<view
class=
"time-split"
>
<view>
1
晚
</view>
<view>
{{
dayObj
.
day
}}
晚
</view>
<image
style=
"width: 66rpx;"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1622098352000_930.png"
mode=
"widthFix"
></image>
<image
style=
"width: 66rpx;"
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1622098352000_930.png"
mode=
"widthFix"
></image>
</view>
</view>
<view
class=
"time-item"
>
5月23日 周日
</view>
<view
class=
"time-item"
>
{{
getDate
(
dayObj
.
end
)
}}
{{
getWeek
(
dayObj
.
end
)
}}
</view>
</view>
</view>
<view
class=
"room-name"
>
藏韵高级双床房
</view>
<view
class=
"room-name"
>
{{
HotelInfo
.
HotelName
}}
</view>
<view
class=
"room-remark"
>
含早 | 1.5m大床 | 24㎡ | 有窗
</view>
<view
class=
"room-remark"
>
{{
RoomInfo
.
BreakfastTypeStr
}}
|
{{
RoomInfo
.
BedTypeStr
}}
|
{{
RoomInfo
.
RoomSize
}}
㎡ |
{{
RoomInfo
.
HasWindowStr
}}
</view>
<view
class=
"big-title"
>
<view
class=
"big-title"
>
<text
class=
" f12"
>
订房必知
</text>
<text
class=
" f12"
>
订房必知
</text>
</view>
</view>
<view
class=
"rule"
>
<view
class=
"rule"
>
<text
class=
"king"
>
此房间支持免费取消,
</text>
<text
class=
"king"
>
此房间
<template
v-if=
"RoomInfo.IsCancel==0"
>
支持免费取消,
</
template
>
<
template
v-if=
"RoomInfo.IsCancel==1"
>
不可取消,
</
template
>
</text>
<text>
订单需要等待酒店或供应商确认后生效,订单确认结果我们将会通知推送到您的微信,请您在下单时同意结果订阅,以便您能正常收到消息。
</text>
<text>
订单需要等待酒店或供应商确认后生效,订单确认结果我们将会通知推送到您的微信,请您在下单时同意结果订阅,以便您能正常收到消息。
</text>
</view>
</view>
</view>
</view>
...
@@ -24,25 +27,25 @@
...
@@ -24,25 +27,25 @@
<view
class=
"form-items"
>
<view
class=
"form-items"
>
<view
class=
"label"
>
房间数量
</view>
<view
class=
"label"
>
房间数量
</view>
<view
class=
"val"
>
<view
class=
"val"
>
<u-number-box
size=
"28"
:min=
"1"
:max=
"100"
v-model=
"order.roomCount
"
></u-number-box>
<u-number-box
size=
"28"
:min=
"1"
:max=
"100"
@
change=
"getRoomNumber"
v-model=
"orderMsg.RoomNumber
"
></u-number-box>
</view>
</view>
</view>
</view>
<view
class=
"form-items"
>
<view
class=
"form-items"
>
<view
class=
"label"
>
住客姓名
</view>
<view
class=
"label"
>
住客姓名
</view>
<view
class=
"val"
>
<view
class=
"val"
>
<input
type=
"text"
v-model=
"order
.userNam
e"
placeholder=
"若是多人,输入代表人员即可"
/>
<input
type=
"text"
v-model=
"order
Msg.Consigne
e"
placeholder=
"若是多人,输入代表人员即可"
/>
</view>
</view>
</view>
</view>
<view
class=
"form-items"
>
<view
class=
"form-items"
>
<view
class=
"label"
>
联系电话
</view>
<view
class=
"label"
>
联系电话
</view>
<view
class=
"val"
>
<view
class=
"val"
>
<input
type=
"text"
v-model=
"order
.userNam
e"
placeholder=
"输入电话号码"
/>
<input
type=
"text"
v-model=
"order
Msg.ConsigneeMobil
e"
placeholder=
"输入电话号码"
/>
</view>
</view>
</view>
</view>
<view
class=
"form-items"
>
<view
class=
"form-items"
>
<view
class=
"label"
>
预计到店
</view>
<view
class=
"label"
>
预计到店
</view>
<view
class=
"val flex"
>
<view
class=
"val flex"
@
click=
"showtime=true"
>
<view
style=
"flex: 1;"
class=
"f14"
>
14:00
</view>
<view
style=
"flex: 1;"
class=
"f14"
>
{{orderMsg.ArrivalTime}}
</view>
<u-icon
name=
"arrow"
color=
"#D9D9D9"
size=
"20"
/>
<u-icon
name=
"arrow"
color=
"#D9D9D9"
size=
"20"
/>
</view>
</view>
</view>
</view>
...
@@ -58,8 +61,8 @@
...
@@ -58,8 +61,8 @@
在线支付
在线支付
</view>
</view>
<view
class=
"val f14 regular"
style=
"text-align: right;"
>
<view
class=
"val f14 regular"
style=
"text-align: right;"
>
<text
style=
"margin-right: 30rpx;"
>
2
间房
</text>
<text
style=
"margin-right: 30rpx;"
>
{{orderMsg.RoomNumber}}
间房
</text>
<text
class=
"red"
>
¥
5666
</text>
<text
class=
"red"
>
¥
{{orderMsg.Final_Price}}
</text>
</view>
</view>
</view>
</view>
<view
class=
"form-items"
style=
"border-bottom: none;"
>
<view
class=
"form-items"
style=
"border-bottom: none;"
>
...
@@ -67,19 +70,12 @@
...
@@ -67,19 +70,12 @@
房费明细
房费明细
</view>
</view>
</view>
</view>
<view
class=
"flex f12 grey"
>
<view
class=
"flex f12 grey"
style=
"margin-bottom:40rpx;"
v-for=
"(item,index) in priceList"
:key=
"index"
>
<view
style=
"flex:1"
>
<view
style=
"flex:1"
>
<text
style=
"margin-right: 30rpx;"
>
2021-05-27
</text>
<text
style=
"margin-right: 30rpx;"
>
{{item.DateStr}}
</text>
<text
>
含早
</text>
<text
v-if=
"index!=0"
>
{{item.BreakfastTypeStr}}
</text>
</view>
</view>
<view
style=
"text-align: right;"
>
2间 × ¥1416.5
</view>
<view
style=
"text-align: right;"
v-if=
"index!=priceList.length-1"
>
{{orderMsg.RoomNumber}}间 × ¥{{item.B2BPrice}}
</view>
</view>
<view
class=
"flex f12 grey"
style=
"margin-top: 40rpx;"
>
<view
style=
"flex:1"
>
<text
style=
"margin-right: 30rpx;"
>
2021-05-28
</text>
<text
class=
"red"
>
不含早
</text>
</view>
<view
style=
"text-align: right;"
>
2间 × ¥1416.5
</view>
</view>
</view>
</view>
</view>
...
@@ -89,28 +85,10 @@
...
@@ -89,28 +85,10 @@
<view
class=
"big-title"
>
<view
class=
"big-title"
>
<text>
重要提醒
</text>
<text>
重要提醒
</text>
</view>
</view>
<view
class=
"sheshi"
>
<view
class=
"sheshi"
v-for=
"(item,index) in HotelInfo.Booking"
>
<view
class=
"she-title"
>
入离时间
</view>
<view
class=
"she-title"
>
{{item.Name}}
</view>
<view
class=
"she-content"
>
<text>
入住时间:14:00以后;离店时间:12:00以前
</text>
</view>
</view>
<view
class=
"sheshi"
>
<view
class=
"she-title"
>
宠物政策
</view>
<view
class=
"she-content"
>
<text>
允许携带宠物,酒店可能收取额外费用
</text>
</view>
</view>
<view
class=
"sheshi"
>
<view
class=
"she-title"
>
酒店提示
</view>
<view
class=
"she-content"
>
<text>
疫情期间,请佩戴好口罩。住宿提供方支持中国(含港澳台)及外国客人入住
</text>
</view>
</view>
<view
class=
"sheshi"
>
<view
class=
"she-title"
>
儿童政策
</view>
<view
class=
"she-content"
>
<view
class=
"she-content"
>
<
text>
不接受18岁以下客人单独入住。每房间可有1名儿童使用现有床铺。不可加床
</text
>
<
view>
{{item.Content}}
</view
>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -119,12 +97,14 @@
...
@@ -119,12 +97,14 @@
<view
class=
"box flex"
>
<view
class=
"box flex"
>
<view
class=
"price"
>
<view
class=
"price"
>
<text
class=
"f11"
>
¥
</text>
<text
class=
"f11"
>
¥
</text>
<text>
5666
</text>
<text>
{{orderMsg.Final_Price}}
</text>
</view>
</view>
<view
class=
"sum-detail"
>
共计
2万·2
间房
</view>
<view
class=
"sum-detail"
>
共计
{{orderMsg.RoomNumber}}
间房
</view>
<u-button
:ripple=
"true"
:hair-line=
"false"
:custom-style=
"btnStyle"
>
立即购买
</u-button>
<u-button
:ripple=
"true"
:hair-line=
"false"
:custom-style=
"btnStyle"
@
click=
"buyRoom"
>
立即购买
</u-button>
</view>
</view>
</view>
</view>
<u-picker
v-model=
"showtime"
mode=
"time"
@
confirm=
'confirm'
:params=
"params"
:default-time=
'orderMsg.ArrivalTime'
></u-picker>
<u-toast
ref=
"uToast"
/>
</view>
</view>
</template>
</template>
...
@@ -145,14 +125,203 @@
...
@@ -145,14 +125,203 @@
fontSize
:
"28rpx"
,
fontSize
:
"28rpx"
,
fontWeight
:
"600"
,
fontWeight
:
"600"
,
width
:
'193rpx'
,
width
:
'193rpx'
,
},
RoomInfo
:{},
dayObj
:{},
HotelInfo
:{},
orderMsg
:{
ProductId
:
0
,
//房间id
StartDate
:
''
,
EndDate
:
''
,
RoomNumber
:
1
,
Unit_Price
:
''
,
Final_Price
:
''
,
Consignee
:
''
,
//联系人
ConsigneeMobile
:
''
,
//;联系电话
ArrivalTime
:
'14:00'
//预计到达时间
},
showtime
:
false
,
params
:
{
year
:
false
,
month
:
false
,
day
:
false
,
hour
:
true
,
minute
:
true
,
second
:
false
},
priceList
:[],
//每日价格
rMsg
:{
HotelId
:
0
,
productId
:
0
,
StartDate
:
''
,
EndDate
:
''
}
}
}
}
},
},
created
()
{
created
()
{
uni
.
setNavigationBarTitle
({
uni
.
setNavigationBarTitle
({
title
:
"九寨沟星宇国际大酒店"
,
title
:
this
.
HotelInfo
.
HotelName
});
});
},
},
onLoad
(
options
)
{
if
(
options
.
RoomInfo
){
this
.
RoomInfo
=
JSON
.
parse
(
options
.
RoomInfo
)
}
if
(
options
.
HotelInfo
){
this
.
HotelInfo
=
JSON
.
parse
(
options
.
HotelInfo
)
}
if
(
options
.
dayObj
){
this
.
dayObj
=
JSON
.
parse
(
options
.
dayObj
)
}
console
.
log
(
this
.
RoomInfo
,
'RoomInfo'
);
console
.
log
(
this
.
HotelInfo
,
'HotelInfo'
);
console
.
log
(
this
.
dayObj
,
'dayObj'
);
this
.
rMsg
.
HotelId
=
this
.
HotelInfo
.
HotelId
;
this
.
rMsg
.
productId
=
this
.
RoomInfo
.
ID
;
this
.
rMsg
.
StartDate
=
this
.
dayObj
.
start
;
this
.
rMsg
.
EndDate
=
this
.
dayObj
.
end
;
this
.
orderMsg
.
ProductId
=
this
.
RoomInfo
.
ID
;
this
.
orderMsg
.
Unit_Price
=
this
.
RoomInfo
.
B2BPrice
;
this
.
orderMsg
.
StartDate
=
this
.
dayObj
.
start
;
this
.
orderMsg
.
EndDate
=
this
.
dayObj
.
end
;
this
.
CalTotalPrice
();
this
.
getRoomPrice
();
},
methods
:{
getDate
(
date
){
if
(
date
){
let
arr
=
date
.
split
(
'-'
);
return
arr
[
1
]
+
'月'
+
arr
[
2
]
+
'日'
}
},
getWeek
(
date
)
{
var
weekArray
=
new
Array
(
"日"
,
"一"
,
"二"
,
"三"
,
"四"
,
"五"
,
"六"
);
var
week
=
weekArray
[
new
Date
(
date
).
getDay
()];
//注意此处必须是先new一个Date
return
'周'
+
week
;
},
//选择时间
confirm
(
val
){
console
.
log
(
val
,
'val'
);
this
.
orderMsg
.
ArrivalTime
=
val
.
hour
+
':'
+
val
.
minute
;
},
//改变房间数量
getRoomNumber
(
val
){
this
.
orderMsg
.
RoomNumber
=
val
.
value
;
console
.
log
(
val
,
'房间数'
);
this
.
CalTotalPrice
();
},
//获取房型报价
getRoomPrice
(){
this
.
request2
({
url
:
'/api/Hotel/GetHotelRoomPrice'
,
data
:
this
.
rMsg
},
res
=>
{
if
(
res
.
resultCode
==
1
)
{
console
.
log
(
res
,
'房型报价'
);
this
.
priceList
=
res
.
data
;
this
.
CalTotalPrice
();
}
}
);
},
//计算总价
CalTotalPrice
(){
this
.
orderMsg
.
Final_Price
=
0
;
this
.
priceList
.
forEach
(
x
=>
{
this
.
orderMsg
.
Final_Price
+=
parseInt
(
this
.
orderMsg
.
RoomNumber
)
*
x
.
B2BPrice
;
})
console
.
log
(
this
.
orderMsg
.
Final_Price
,
'this.orderMsg.Final_Price'
);
},
//立即购买
buyRoom
(){
let
that
=
this
;
if
(
that
.
orderMsg
.
Consignee
==
''
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'请输入住客姓名!'
,
type
:
'warning'
});
return
;
}
if
(
that
.
orderMsg
.
ConsigneeMobile
==
''
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'请输入联系电话!'
,
type
:
'warning'
});
return
;
}
var
tempObj
=
uni
.
getStorageSync
(
'basedata'
).
mall
.
wechatmessage
;
var
tmplIds
=
''
;
if
(
tempObj
&&
tempObj
.
length
>
0
){
tmplIds
=
tempObj
[
0
].
MessageId
;
}
uni
.
requestSubscribeMessage
({
tmplIds
:
tmplIds
,
complete
(
res
)
{
that
.
request2
({
url
:
'/api/Hotel/SetAppletHotelOrder'
,
data
:
that
.
orderMsg
},
res
=>
{
if
(
res
.
resultCode
==
1
)
{
console
.
log
(
res
,
'数据'
);
that
.
queren
(
res
.
data
)
}
}
);
}
})
},
queren
(
OrderId
){
let
url
=
'/api/WeChatPay/GetDmcPayInfo'
let
GoodsName
=
this
.
RoomInfo
.
RoomName
;
GoodsName
=
GoodsName
.
slice
(
0
,
10
)
this
.
request2
({
url
:
url
,
data
:
{
OrderId
:
OrderId
,
GoodsName
:
GoodsName
,
OrderPayType
:
1
,
OpenId
:
uni
.
getStorageSync
(
'mall_UserInfo'
).
OpenId
,
}
},
res
=>
{
this
.
orderInfo
=
JSON
.
parse
(
res
.
data
);
console
.
log
(
171
,
this
.
orderInfo
)
this
.
Pay
()
}
);
},
Pay
(){
let
that
=
this
;
uni
.
requestPayment
({
provider
:
'wxpay'
,
timeStamp
:
this
.
orderInfo
.
timeStamp
,
nonceStr
:
this
.
orderInfo
.
nonceStr
,
package
:
this
.
orderInfo
.
package
,
signType
:
this
.
orderInfo
.
signType
,
paySign
:
this
.
orderInfo
.
sign
,
success
:
function
(
res
)
{
console
.
log
(
'success'
,
res
);
uni
.
showToast
({
title
:
"支付成功"
})
setTimeout
(()
=>
{
uni
.
redirectTo
({
url
:
'/pages/jiuzhai/allorderList'
});
},
100
)
},
fail
:
function
(
err
)
{
console
.
log
(
'fail:'
,
err
);
uni
.
showToast
({
title
:
"支付失败"
})
}
});
},
}
}
}
</
script
>
</
script
>
...
...
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