Commit 29563a15 authored by youjie's avatar youjie

酒店订单

parent 7801c501
...@@ -207,11 +207,14 @@ ...@@ -207,11 +207,14 @@
goDetails(item) { goDetails(item) {
let url = null let url = null
let msg = null let msg = null
// #ifdef MP-DI // #ifdef MP-DI
console.log(item.goodsType,'===========')
msg = `OrderNo=${item.orderNo}` msg = `OrderNo=${item.orderNo}`
if (item.goodsType > 0 && item.goodsType < 4) url = `jiuzhai/jz_SureOrder?` //线路 if (item.goodsType > 0 && item.goodsType < 4) url = `jiuzhai/jz_SureOrder?` //线路
else if (item.goodsType > 3 && item.goodsType < 8) { //景点门票 else if (item.goodsType > 3 && item.goodsType < 8) { //景点门票
} else if (item.goodsType > 7 && item.goodsType < 12) { //酒店住宿 } else if (item.goodsType > 7 && item.goodsType < 12) { //酒店住宿
url = `hotel/orderdetails?`
} else if (item.goodsType > 11 && item.goodsType < 15) { //目的地用车 } else if (item.goodsType > 11 && item.goodsType < 15) { //目的地用车
} else if (item.goodsType == 15) url = `visa/visa_SureOrder?` //签证 } else if (item.goodsType == 15) url = `visa/visa_SureOrder?` //签证
else if (item.goodsType == 16) url = `airTicket/airTicketOrderDetail?` //机票 else if (item.goodsType == 16) url = `airTicket/airTicketOrderDetail?` //机票
...@@ -221,6 +224,10 @@ ...@@ -221,6 +224,10 @@
if (item.goodsType == 2) url = `jiuzhai/jz_SureOrder?` //线路 if (item.goodsType == 2) url = `jiuzhai/jz_SureOrder?` //线路
else if (item.goodsType == 4) { //景点门票 else if (item.goodsType == 4) { //景点门票
} else if (item.goodsType == 3) { //酒店住宿 } else if (item.goodsType == 3) { //酒店住宿
} else if (item.goodsType == 7) { //酒店住宿
url = `hotel/orderdetails?`
} else if (item.goodsType == 5) { //目的地用车 } else if (item.goodsType == 5) { //目的地用车
} else if (item.goodsType == 6) url = `visa/visa_SureOrder?` //签证 } else if (item.goodsType == 6) url = `visa/visa_SureOrder?` //签证
else if (item.goodsType == 1) { //机票 else if (item.goodsType == 1) { //机票
......
...@@ -293,9 +293,7 @@ ...@@ -293,9 +293,7 @@
this.optionsTitle[2] = `价格/星级 ${num}`; this.optionsTitle[2] = `价格/星级 ${num}`;
this.tempRateAndPrice.rate = val.QStarRating this.tempRateAndPrice.rate = val.QStarRating
} }
if(this.MapType){
this.research()
}
} }
}, },
deep: true, deep: true,
...@@ -309,6 +307,13 @@ ...@@ -309,6 +307,13 @@
}, },
deep: true, deep: true,
immediate: true, immediate: true,
},
MapType: {
handler(val, oldval) {
if (val) {
this.research(2)
}
},
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -343,12 +348,12 @@ ...@@ -343,12 +348,12 @@
this.parameters.CityCode2 = this.PopularCities[0].CityList[0].CityCode this.parameters.CityCode2 = this.PopularCities[0].CityList[0].CityCode
this.parameters.CityCode = this.PopularCities[0].CityList[0].CityCode this.parameters.CityCode = this.PopularCities[0].CityList[0].CityCode
this.parameters.KeyWords2= '' this.parameters.KeyWords2= ''
this.research() this.research(1)
}, },
searchClose() { searchClose() {
this.showSearchCity = false this.showSearchCity = false
this.showCityList = false this.showCityList = false
this.research() this.research(2)
}, },
searchKey(type, key, City) { searchKey(type, key, City) {
if (type == 1) { if (type == 1) {
...@@ -404,18 +409,18 @@ ...@@ -404,18 +409,18 @@
this.parameters.CityCode = this.parameters.CityCode2 = msg.CityCode2 this.parameters.CityCode = this.parameters.CityCode2 = msg.CityCode2
this.getRegion() this.getRegion()
this.city = this.parameters.CityName = msg.CityName this.city = this.parameters.CityName = msg.CityName
this.research() this.research(3)
} }
}, },
// 筛选排序 // 筛选排序
sureFilter() { sureFilter() {
this.$forceUpdate(); this.$forceUpdate();
this.closeDropdown(); this.closeDropdown();
this.research(); this.research(4);
}, },
resetFilter() { resetFilter() {
this.closeDropdown() this.closeDropdown()
this.research(); this.research(5);
}, },
// 位置排序 // 位置排序
sureRegion() { sureRegion() {
...@@ -425,7 +430,7 @@ ...@@ -425,7 +430,7 @@
this.city = this.parameters.CityName this.city = this.parameters.CityName
this.parameters.CityCode = this.parameters.regionCode ? this.parameters.regionCode : this.parameters this.parameters.CityCode = this.parameters.regionCode ? this.parameters.regionCode : this.parameters
.CityCode2 .CityCode2
this.research(); this.research(6);
}, },
resetRegion() { resetRegion() {
this.cityList = this.cityListAll this.cityList = this.cityListAll
...@@ -435,7 +440,7 @@ ...@@ -435,7 +440,7 @@
this.regionKeyWords = '' this.regionKeyWords = ''
if (this.parameters.CityCode != this.parameters.CityCode2) { if (this.parameters.CityCode != this.parameters.CityCode2) {
this.parameters.CityCode = this.parameters.CityCode2 this.parameters.CityCode = this.parameters.CityCode2
this.research(); this.research(7);
} }
}, },
showCity() { showCity() {
...@@ -453,7 +458,7 @@ ...@@ -453,7 +458,7 @@
if (this.tempRateAndPrice.priceId > 0) num++ if (this.tempRateAndPrice.priceId > 0) num++
if (num) this.optionsTitle[2] = `价格/星级 ${num}`; if (num) this.optionsTitle[2] = `价格/星级 ${num}`;
this.closeDropdown(); this.closeDropdown();
this.research(); this.research(8);
}, },
resetPrice() { resetPrice() {
this.optionsTitle[2] = "价格/星级"; this.optionsTitle[2] = "价格/星级";
...@@ -476,7 +481,7 @@ ...@@ -476,7 +481,7 @@
this.parameters.EndPrice = this.MaximumDatas.maxPrice; this.parameters.EndPrice = this.MaximumDatas.maxPrice;
this.parameters.QStarRating = [] this.parameters.QStarRating = []
this.closeDropdown(); this.closeDropdown();
this.research(); this.research(9);
}, },
rangechange(e) { rangechange(e) {
this.parameters.StartPrice = e.minValue this.parameters.StartPrice = e.minValue
...@@ -498,7 +503,7 @@ ...@@ -498,7 +503,7 @@
setTimeout(() => { setTimeout(() => {
this.closeDropdown() this.closeDropdown()
}, 300); }, 300);
this.research(); this.research(10);
}, },
// 星际级 // 星际级
setHotelRate(rateId) { setHotelRate(rateId) {
...@@ -525,7 +530,9 @@ ...@@ -525,7 +530,9 @@
closeDropdown() { closeDropdown() {
this.$refs.uDropdown.close(); this.$refs.uDropdown.close();
}, },
research() { research(type) {
this.parameters.pageIndex = 1;
// console.log(type,'-==--')
this.$emit('change', this.parameters); this.$emit('change', this.parameters);
}, },
//获取查询条件 //获取查询条件
...@@ -595,7 +602,7 @@ ...@@ -595,7 +602,7 @@
} }
this.getRegion() this.getRegion()
} }
if(!this.MapType)this.research() if(!this.MapType)this.research(1)
} }
}, },
(err) => {} (err) => {}
......
...@@ -190,7 +190,6 @@ ...@@ -190,7 +190,6 @@
this.day = this.dayObj.day; this.day = this.dayObj.day;
} }
this.MapType = options.MapType?options.MapType:0; this.MapType = options.MapType?options.MapType:0;
console.log(this.dayObj,'--------')
}, },
created() { created() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
...@@ -200,10 +199,7 @@ ...@@ -200,10 +199,7 @@
}, },
methods: { methods: {
getItem(parameters,obj) { getItem(parameters,obj) {
this.searchObj = { this.searchObj = parameters
...this.searchObj,
...parameters
}
this.dayObj = { this.dayObj = {
...obj, ...obj,
startTime: `${obj.year}-${obj.startDay}`, startTime: `${obj.year}-${obj.startDay}`,
...@@ -212,7 +208,11 @@ ...@@ -212,7 +208,11 @@
}, },
handleCalloutClick(marker) { handleCalloutClick(marker) {
console.log('点击了标记:', marker.detail); console.log('点击了标记:', marker.detail);
this.current = marker.detail.markerId-1 for (let i = 0; i < this.markers.length; i++) {
if(this.markers[i].id==marker.detail.markerId){
this.current = i
}
}
console.log(this.current,'----') console.log(this.current,'----')
this.setNewMarkers() this.setNewMarkers()
}, },
...@@ -262,20 +262,23 @@ ...@@ -262,20 +262,23 @@
}); });
}, },
changeCurrent(e) { changeCurrent(e) {
// console.log(e.detail.current,'--------',this.HotelList.length-1)
this.prevCurrent = this.current this.prevCurrent = this.current
this.current = e.detail.current; this.current = e.detail.current;
this.setNewMarkers() this.setNewMarkers()
if(this.HotelList.length-1==this.current&&this.searchObj.pageIndex < this.page_count){
let length = this.HotelList.length this.lower()
if((length-1)==this.current){ }else{
this.nextCurrent = 0 let length = this.HotelList.length
}else this.nextCurrent = this.current+1 if((length-1)==this.current){
this.nextCurrent = 0
}else this.nextCurrent = this.current+1
}
}, },
research() { research() {
this.searchObj.pageIndex = 1;
this.getList(1); this.getList(1);
}, },
lower(e) { lower() {
// TODO: 滚动到了底部,实现翻页加载 // TODO: 滚动到了底部,实现翻页加载
if (this.searchObj.pageIndex < this.page_count) { if (this.searchObj.pageIndex < this.page_count) {
this.status = "loading"; this.status = "loading";
...@@ -286,12 +289,11 @@ ...@@ -286,12 +289,11 @@
} }
}, },
change(item) { change(item) {
this.searchObj ={ this.searchObj = {
...this.searchObj,
...item, ...item,
} }
if(item.CityName) this.pageTitle = item.CityName if(item.CityName) this.pageTitle = item.CityName
this.research(); this.getList();
}, },
//获取列表数据 //获取列表数据
getList(type) { getList(type) {
...@@ -301,27 +303,32 @@ ...@@ -301,27 +303,32 @@
this.searchObj.QStars = this.tempRateAndPrice.rate.toString(); this.searchObj.QStars = this.tempRateAndPrice.rate.toString();
if (type == 1) { if (type == 1) {
this.HotelList = []; this.HotelList = [];
this.markers = []
this.includePoints.points = []
this.points = []
} }
this.markers = []
this.includePoints.points = []
this.points = []
this.apipost( "dmc_post_B2BAndB2CGetDidaHotelPage", this.searchObj, this.apipost( "dmc_post_B2BAndB2CGetDidaHotelPage", this.searchObj,
(res) => { (res) => {
uni.hideLoading()
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.showLoading = false this.showLoading = false
uni.hideLoading()
let length = 0
if (this.searchObj.pageIndex === 1) { if (this.searchObj.pageIndex === 1) {
this.HotelList = res.data.pageData; this.HotelList = res.data.pageData;
length = this.HotelList.length
} else { } else {
this.HotelList = this.HotelList.concat(res.data.pageData); this.HotelList = this.HotelList.concat(res.data.pageData);
length = this.HotelList.length
} }
this.setMarkers() this.setMarkers(res.data.pageData)
let length = this.HotelList.length
this.page_count = res.data.pageCount;
this.prevCurrent = length-1 this.prevCurrent = length-1
if((length-1)==this.current){ if((length-1)==this.current){
this.nextCurrent = 0 this.nextCurrent = 0
}else this.nextCurrent = this.current+1 }else this.nextCurrent = this.current+1
this.page_count = res.data.pageCount;
} }
}, },
(err) => { (err) => {
...@@ -330,8 +337,7 @@ ...@@ -330,8 +337,7 @@
} }
); );
}, },
setMarkers(){ setMarkers(pageData){
let pageData = this.HotelList
if(pageData.length==0)return if(pageData.length==0)return
for (let i = 0; i < pageData.length; i++) { for (let i = 0; i < pageData.length; i++) {
this.includePoints.points.push({ this.includePoints.points.push({
...@@ -345,7 +351,7 @@ ...@@ -345,7 +351,7 @@
let obj = JSON.parse(JSON.stringify(this.markersObj)) let obj = JSON.parse(JSON.stringify(this.markersObj))
obj = { obj = {
...obj, ...obj,
id: i+1, id: pageData[i].hotelid,
latitude: pageData[i].latitude, latitude: pageData[i].latitude,
longitude: pageData[i].longitude, longitude: pageData[i].longitude,
callout:{ callout:{
...@@ -354,7 +360,7 @@ ...@@ -354,7 +360,7 @@
...this.editCallout2 ...this.editCallout2
} }
} }
if(i==0){ if(i==0&&this.searchObj.pageIndex===1){
obj.callout = { obj.callout = {
...obj.callout, ...obj.callout,
...this.editCallout1 ...this.editCallout1
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<view class="row-sb-n"> <view class="row-sb-n">
<view class="row items-center"> <view class="row items-center">
<view class="time-item">{{getDate(dayObj.start)?getDate(dayObj.start):''}} <view class="time-item">{{getDate(dayObj.start)?getDate(dayObj.start):''}}
<text>今天</text> <text>{{ getWeek(dayObj.start) }}</text>
</view> </view>
<view class="time-itemZhi"><text>-</text></view> <view class="time-itemZhi"><text>-</text></view>
<view class="time-item">{{getDate(dayObj.end)}}</view> <view class="time-item">{{getDate(dayObj.end)}}</view>
...@@ -91,19 +91,11 @@ ...@@ -91,19 +91,11 @@
<view class="label"> <view class="label">
联系姓名 联系姓名
</view> </view>
<view class="val"> <view class="val row">
<input type="text" v-model="orderMsg.guestLastName" placeholder="请输入联系人姓名" /> <input type="text" v-model="orderMsg.SurName" placeholder="请输入姓" />
<input type="text" v-model="orderMsg.Name" placeholder="请输入名" />
</view> </view>
</view> </view>
<!--
<view class="form-items">
<view class="label">
联系人名
</view>
<view class="val">
<input type="text" v-model="orderMsg.guestFirstName" placeholder="请输入联系人名" />
</view>
</view> -->
<view class="form-items"> <view class="form-items">
<view class="label">联系电话</view> <view class="label">联系电话</view>
<view class="form-itemsL row" @click="showCountry=true"> <view class="form-itemsL row" @click="showCountry=true">
...@@ -425,6 +417,11 @@ ...@@ -425,6 +417,11 @@
this.initHotel() this.initHotel()
}, },
methods: { methods: {
getWeek(date) {
var weekArray = new Array("日", "一", "二", "三", "四", "五", "六");
var week = weekArray[new Date(date).getDay()]; //注意此处必须是先new一个Date
return "周" + week;
},
submitB2COrderHandler(OrderId) { submitB2COrderHandler(OrderId) {
let userInfo = uni.getStorageSync("mall_UserInfo"); let userInfo = uni.getStorageSync("mall_UserInfo");
let guestInfo = `成人x${this.searchObj.adultsNumber}; `; let guestInfo = `成人x${this.searchObj.adultsNumber}; `;
...@@ -736,8 +733,10 @@ ...@@ -736,8 +733,10 @@
} }
} }
} }
if (this.orderMsg.guestLastName == '') { if (this.orderMsg.SurName == '') {
msg = '请输入姓名' msg = '请输入姓'
} else if (this.orderMsg.Name == '') {
msg = '请输入名'
} else if (this.orderMsg.guestPhoneNumber == '') { } else if (this.orderMsg.guestPhoneNumber == '') {
msg = '请输入联系电话' msg = '请输入联系电话'
} else if (this.orderMsg.guestPhoneNumber && this.orderMsg.guestPhoneNumber.length != 11) { } else if (this.orderMsg.guestPhoneNumber && this.orderMsg.guestPhoneNumber.length != 11) {
......
<template> <template>
<view class="hotel-detail"> <view class="hotel-detail" v-if="orderData">
<scroll-view <scroll-view
ref="scrollView" ref="scrollView"
scroll-y="true" scroll-y="true"
...@@ -45,13 +45,13 @@ ...@@ -45,13 +45,13 @@
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638766174213789755.png"/> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638766174213789755.png"/>
</view> </view>
<view class="orderIforRzTime column col"> <view class="orderIforRzTime column col">
<view>入住:<text>2月25日 周二 14:00后</text></view> <view>入住:<text>{{getDate(orderData.parmResultRoomInfo.CheckInDate)}} {{ getWeek(orderData.parmResultRoomInfo.CheckInDate) }} 14:00后</text></view>
<view style="margin-top: 28rpx;">离店:<text>2月28日 周五 12:00前</text></view> <view style="margin-top: 28rpx;">离店:<text>{{getDate(orderData.parmResultRoomInfo.CheckOutDate)}} {{ getWeek(orderData.parmResultRoomInfo.CheckOutDate) }} 12:00前</text></view>
</view> </view>
<view class="orderIforRzNum">3</view> <view class="orderIforRzNum">{{getDay(orderData.parmResultRoomInfo.CheckInDate.slice(0, 10),orderData.parmResultRoomInfo.CheckOutDate.slice(0, 10))}}</view>
</view> </view>
<view class="orderIforDiZhi"> <view class="orderIforDiZhi">
<view class="orderIforDiZhiL">成田国际花园酒店</view> <view class="orderIforDiZhiL">{{ orderData.parmResultRoomInfo.HotelName }}</view>
<view class="orderIforDiZhiR row"> <view class="orderIforDiZhiR row">
<view class="orderIforDiZhiRImg"> <view class="orderIforDiZhiRImg">
<img <img
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638766148323678002.png"/> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Upload/Goods/638766148323678002.png"/>
</view> </view>
<view class="orderIforDiZhiRText"> <view class="orderIforDiZhiRText">
95 Cheongpa-ro 20-gil, 龙山区, 首尔, 首尔(及其周边地区),韩国 酒店地址
</view> </view>
</view> </view>
</view> </view>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
style="flex: 1; margin-left: 30rpx; text-align: left" style="flex: 1; margin-left: 30rpx; text-align: left"
class="name-ali" class="name-ali"
> >
酒店名称 {{ orderData.parmResultRoomInfo.HotelName }}
</view </view
> >
</view> </view>
...@@ -82,55 +82,135 @@ ...@@ -82,55 +82,135 @@
<view class="ReservationInforTitle">预定信息</view> <view class="ReservationInforTitle">预定信息</view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">房型</view> <view class="ResInforL">房型</view>
<view class="ResInforR">高级双床房(1间)</view> <view class="ResInforR">房型</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">餐型</view> <view class="ResInforL">餐型</view>
<view class="ResInforR active">含早餐 x2份</view> <view class="ResInforR active">餐型</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">窗户</view> <view class="ResInforL">窗户</view>
<view class="ResInforR">有窗</view> <view class="ResInforR">窗户</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">人数</view> <view class="ResInforL">人数</view>
<view class="ResInforR">最多入住2人</view> <view class="ResInforR">最多入住人数</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">面积</view> <view class="ResInforL">面积</view>
<view class="ResInforR">32</view> <view class="ResInforR">面积</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">网络</view> <view class="ResInforL">网络</view>
<view class="ResInforR">WIFI</view> <view class="ResInforR">是否有WIFI</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">楼层数</view> <view class="ResInforL">楼层数</view>
<view class="ResInforR">1-20</view> <view class="ResInforR">楼层数</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">取消政策</view> <view class="ResInforL">取消政策</view>
<view class="ResInforR">不可修改</view> <view class="ResInforR">
<text v-if="roomRateDetails&&
roomRateDetails.CancellationPolicyList &&
roomRateDetails.CancellationPolicyList.length > 0">
<template v-for="(itemCancella, index1) in roomRateDetails.CancellationPolicyList">
<template
v-if="index1==0">{{ getformatDateStr(itemCancella.FromDate) }}之前免费取消</template>
<template v-if="itemCancella.Amount==roomRateDetails.TotalPrice">
<template>{{ getformatDateStr(itemCancella.FromDate) }}起不可取消,取消将收取订单全额费用;</template>
</template>
<template v-else>
<template>{{ getformatDateStr(itemCancella.FromDate) }}
<template v-if="index1!=(roomRateDetails.CancellationPolicyList.length-1)">-
{{ getformatDateStr(roomRateDetails.CancellationPolicyList[index1+1].FromDate) }}
之间</template>
取消,收费 {{DanWei}}{{getPrice(itemCancella.Amount)}};</template>
</template>
</template>
</text>
</view>
</view> </view>
</view> </view>
<view class="ReservationInforBox"> <view class="ReservationInforBox">
<view class="ReservationInforTitle">订房信息</view> <view class="ReservationInforTitle">订房信息</view>
<view class="ResInforText row-sb-n" v-for="(item,index) in orderData.parmResultRoomInfo.GuestList"
:key="index">
<view class="ResInforL Lwidth">房间{{ index+1 }}住客</view>
<view class="ResInforR row">
<view v-for="(items,i) in item.GuestInfo" :key="i">{{ items.LastName }}{{ items.FirstName }}
<template v-if="i!=item.GuestInfo.length-1">,</template>
</view>
</view>
</view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">住客姓名</view> <view class="ResInforL Lwidth">联系姓名</view>
<view class="ResInforR">李伟</view> <view class="ResInforR">{{ orderData.parmResultRoomInfo.SurName }}{{ orderData.parmResultRoomInfo.Name }}</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">联系电话</view> <view class="ResInforL Lwidth">联系电话</view>
<view class="ResInforR">1956555</view> <view class="ResInforR">{{ orderData.parmResultRoomInfo.guestPhoneNumber }}</view>
</view> </view>
<view class="ResInforText row-sb-n"> <view class="ResInforText row-sb-n">
<view class="ResInforL">E-mail</view> <view class="ResInforL Lwidth">E-mail</view>
<view class="ResInforR">ran****un@aliyun.com</view> <view class="ResInforR">{{ orderData.parmResultRoomInfo.guestEmail }}</view>
</view> </view>
</view> </view>
<!-- <cancelProgress :datas="orderData"></cancelProgress> -->
<view class="ReservationInforBox">
<view class="big-title">
<text>费用明细</text>
</view>
<view class="jz_form">
<view class="form-items row">
<view class="label"> 总金额 </view>
<view class="val f14 regular col" style="text-align: right">
{{ roomNum }}
<text>间房</text>/
{{ peopleNum }}
<text style="margin-right: 30rpx"></text>
<text class="red">{{DanWei}} {{ orderData.model.TotalPrice }}
</text>
</view>
</view>
<view class="form-items" style="border-bottom: none;padding: 20rpx 0;">
<view class="label"> 明细 </view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx"
v-for="(item,index) in orderData.parmResultRoomInfo.GuestList"
:key="index">
<view style="flex: 1">
<text style="margin-right: 30rpx">房间数</text>
</view>
<view style="text-align: right">
1间({{ item.GuestInfo.length }}人) × {{ DanWei }}{{ orderData.model.RoomPrice }}
</view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx"
:style="{'color':mainColor+' !important'}"
v-if="orderData.model.DiscountMoney&&orderData.model.DiscountMoney>0">
<view style="flex: 1">
<text style="margin-right: 30rpx">优惠金额</text>
</view>
<view style="text-align: right">
-{{ orderData.model.DiscountMoney}} </view>
</view>
<view class="flex f12 grey" style="margin-bottom: 40rpx" :key="index">
<view style="flex: 1">
<text style="margin-right: 30rpx">合计应收</text>
</view>
<view style="text-align: right;color: #ff3166;font-size:32rpx;font-weight: bold;">
{{ DanWei }}
{{(orderData.model.TotalPrice-orderData.model.DiscountMoney).toFixed(2)}}
</view>
</view>
</view>
</view>
<view style="height: 36rpx;"></view> <view style="height: 36rpx;"></view>
</scroll-view> </scroll-view>
<view class="opera-box"> <!-- <view class="opera-box">
<view class="box flex"> <view class="box flex">
<view class="price"> <view class="price">
<text class="f11">¥</text> <text class="f11">¥</text>
...@@ -139,14 +219,41 @@ ...@@ -139,14 +219,41 @@
<view class="sum-detail">共计 222间房</view> <view class="sum-detail">共计 222间房</view>
<u-button :ripple="true" :hair-line="false" :custom-style="btnStyle" @click="buyRoom">立即购买</u-button> <u-button :ripple="true" :hair-line="false" :custom-style="btnStyle" @click="buyRoom">立即购买</u-button>
</view> </view>
</view> </view> -->
<view class="jz_orderbox flex" v-if="showPayBtn">
<view style="display: flex">
<!-- #ifdef MP-DI -->
<button v-if="orderData.model.OrderStatus==1"
class="jz_OrderReNow" @click="goCancel"
style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel"
:loading="submitCancel">
取消
</button>
<button v-if="orderData.model.OrderStatus==1" class="jz_OrderReNow"
style="margin-left: 20rpx;"
@click="submitGetCodeByOrderNo" :disabled="submit" :loading="submit">
立即支付
</button>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<button v-if="orderData.model.OrderStatus==1" class="jz_OrderReNow" @click="goCancel"
style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel"
:loading="submitCancel">
取消
</button>
<!-- #endif -->
</view>
</view>
</view> </view>
</template> </template>
<script> <script>
import cancelProgress from '@/components/cancelPrompt/cancelProgress.vue'
export default { export default {
components: { components: {
cancelProgress
}, },
data() { data() {
return { return {
...@@ -178,6 +285,19 @@ ...@@ -178,6 +285,19 @@
fontWeight:"600", fontWeight:"600",
width:'193rpx', width:'193rpx',
}, },
orderData: null,
orderStatus: {
code: 0,
text: "",
},
showPayBtn: true,
submitCancel: false,
submit: false,
hotelData: null,
roomRateDetails: null,
DanWei: '',
peopleNum: 0,
roomNum: 0,
}; };
}, },
created() { created() {
...@@ -186,7 +306,7 @@ ...@@ -186,7 +306,7 @@
: 0; : 0;
}, },
onLoad(options) { onLoad(options) {
this.id = options.id; this.id = options.orderId;
let that = this; let that = this;
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
...@@ -201,6 +321,59 @@ ...@@ -201,6 +321,59 @@
if(this.id) this.getOrderDetail(this.id); if(this.id) this.getOrderDetail(this.id);
}, },
methods: { methods: {
submitGetCodeByOrderNo() {
if (this.submit || this.submitCancel) return;
this.submit = true
this.apipost("GetCodeByOrderNo_post", {
OrderNo: this.OrderNo,
MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId
}, (res) => {
if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo)
this.goPayHandler();
} else {
uni.showToast({
title:res.message,
icon:'none',
duration:3000
})
this.submit = false;
}
},e=>{
uni.showToast({
title:'无法发起支付,请稍后',
icon:'none',
duration:3000
})
this.submit=false
});
},
goCancel() {
if(this.submitCancel) return
this.submitCancel = true
this.apipost(
"dmc_post_GetDiDaBookingCancel", {
BookingID: this.orderData.model.OrderID,
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
this.getOrderDetail(this.id)
}
},
(err) => {
uni.showToast({
title: err.message,
icon: "none",
});
this.submitCancel = false
}
);
},
//立即购买 //立即购买
buyRoom(){ buyRoom(){
let that = this; let that = this;
...@@ -243,31 +416,50 @@ ...@@ -243,31 +416,50 @@
} }
}) })
}, },
formatStatus(status, loss, isCancel) { formatStatus(status) {
loss = loss ? loss : -1; // #ifdef MP-DI
//1、已申请;!=1未申请 if (status == 4) {
if (loss == 1 || status == 4) { this.orderStatus.code = -1;
this.orderStatus.code = -1; this.orderStatus.text = "已取消";
this.orderStatus.text = "已取消"; this.showPayBtn = false;
this.showPayBtn = false; } else if (status == 1) {
} else if (status == 2 && isCancel != 1) { this.orderStatus.code = 0;
this.orderStatus.code = 0; this.orderStatus.text = "待付款";
this.orderStatus.text = "待付款"; this.showPayBtn = true;
this.showPayBtn = true; } else if (status == 3) {
} else if (status == 3 && isCancel != 1) { this.orderStatus.code = 0;
this.orderStatus.code = 0; this.orderStatus.text = "已完成";
this.orderStatus.text = "候补中"; this.showPayBtn = false;
this.showPayBtn = true; }else if (status == 2) {
} else if (status == 2 && isCancel == 1) { this.orderStatus.code = 1;
this.orderStatus.code = -2; this.orderStatus.text = "正常";
this.orderStatus.text = "审核中"; this.showPayBtn = false;
this.showPayBtn = false; }else if (status == 5) {
} else if (status == 1) { this.orderStatus.code = 0;
this.orderStatus.code = 1; this.orderStatus.text = "售后";
this.orderStatus.text = "正常"; this.showPayBtn = false;
this.showPayBtn = false; }
} // #endif
}, // #ifdef MP-AG
if (status == 4) {
this.orderStatus.code = -1;
this.orderStatus.text = "已取消";
this.showPayBtn = false;
} else if (status == 1) {
this.orderStatus.code = 0;
this.orderStatus.text = "待付款";
this.showPayBtn = true;
} else if (status == 3) {
this.orderStatus.code = 0;
this.orderStatus.text = "已完成";
this.showPayBtn = false;
}else if (status == 2) {
this.orderStatus.code = 1;
this.orderStatus.text = "正常";
this.showPayBtn = false;
}
// #endif
},
scroll(e) { scroll(e) {
this.old.scrollTop = e.detail.scrollTop this.old.scrollTop = e.detail.scrollTop
this.boxOption = Math.floor((e.detail.scrollTop - 50) / 1.5); this.boxOption = Math.floor((e.detail.scrollTop - 50) / 1.5);
...@@ -284,27 +476,69 @@ ...@@ -284,27 +476,69 @@
delta: 1, delta: 1,
}); });
}, },
//获取酒店详情 //获取酒店详情
getOrderDetail(id) { getOrderDetail(id) {
uni.showLoading({
title: "加载中",
});
let msg = { let msg = {
HotelId: id, orderId: id,
StartDate: this.dayObj.start, // StartDate: this.dayObj.start,
EndDate: this.dayObj.end, // EndDate: this.dayObj.end,
}; };
this.request2( this.apipost("dmc_post_Get_GetJAPAN_OrderDetail", msg,
{
url: "/api/Hotel/GetHotelInfo",
data: msg,
},
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
uni.hideLoading();
this.orderData = res.data
this.DanWei = res.data.parmResult.Success.BookingDetails.Hotel.RatePlanList[0].Currency
this.roomRateDetails = res.data.parmResult.Success.BookingDetails.Hotel
res.data.parmResultRoomInfo.GuestList.forEach((item, index) => {
this.roomNum++
item.GuestInfo.forEach((items, i) => {
this.peopleNum++
})
})
// this.orderData = res.data.BookingDetailsList[0]
// this.hotelData = res.data.BookingDetailsList[0].Hotel;
this.formatStatus(res.data.model.OrderStatus);
console.log(res, '订单详情数据'); console.log(res, '订单详情数据');
} }
},err=>{
uni.hideLoading();
} }
); );
}, },
//日期格式化
getformatDateStr(value) {
var dt = new Date(value);
let year = dt.getFullYear();
let month = (dt.getMonth() + 1).toString().padStart(2, "0");
let date = (dt.getDate()).toString().padStart(2, "0");
return year + "-" + month + "-" + date;
},
//计算天数
getDay(date1, date2) {
//获得天数
//date1:开始日期,date2结束日期
var a1 = Date.parse(new Date(date1));
var a2 = Date.parse(new Date(date2));
var day = parseInt((a2 - a1) / (1000 * 60 * 60 * 24)); //核心:时间戳相减,然后除以天数
return day;
},
getDate(date) {
date = date.slice(0, 10);
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;
},
}, },
}; };
</script> </script>
...@@ -807,6 +1041,9 @@ ...@@ -807,6 +1041,9 @@
font-size: 28rpx; font-size: 28rpx;
color: #303133; color: #303133;
} }
.ResInforL.Lwidth{
width: 130rpx;
}
.ResInforR{ .ResInforR{
width: 1px; width: 1px;
flex: 1; flex: 1;
...@@ -874,6 +1111,72 @@ ...@@ -874,6 +1111,72 @@
font-weight: 500; font-weight: 500;
color: #6E6E6E; color: #6E6E6E;
} }
.jz_orderbox {
/* position: fixed; */
background-color: #fff;
bottom: 0;
width: 100vw;
left: 0;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0px 0rpx 50rpx 0px rgba(76, 76, 76, 0.13);
z-index: 99;
justify-content: flex-end;
padding: 20rpx 30rpx;
}
.jz_OrderDiv {
width: 90%;
height: 100rpx;
background-color: #fff;
margin: auto;
padding: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0px 10rpx 30rpx 0px rgba(36, 36, 36, 0.2);
border-radius: 16px;
z-index: 999;
}
.jz_OrderReNow {
width: 170rpx;
height: 80rpx;
background-color: #111111;
text-align: center;
line-height: 80rpx;
color: #fff;
font-weight: 600;
font-size: 28rpx;
border-radius: 16rpx;
}
.big-title{
font-size: 32rpx;
color: #080A09;
padding-bottom: 24rpx;
font-weight: 800;
}
.regular {
font-weight: 500 ;
}
.label {
font-size: 28rpx;
font-weight: 600;
margin-right: 60rpx;
flex-shrink: 0;
}
.grey {
color: #6e6e6e;
}
.f12 {
font-size: 24rpx ;
}
.form-items:first-child{
padding: 0 0 30rpx 0;
display: flex;
border-bottom: 1px solid #e6e6e6;
}
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment