Commit 33381cff authored by youjie's avatar youjie

no message

parent e8c481bd
import { HttpResponse } from '../@types'
import request from './request'
import requestJava from './requestJava'
class HotelService {
//兑换优惠券
static async updateUseCouponBycod(param:any): Promise<HttpResponse> {
return requestJava('/api/b2b/user/updateUseCouponBycod', param)
}
//获取优惠券
static async getUserCanUseCouponList(param:any): Promise<HttpResponse> {
return requestJava('/api/b2b/user/getUserCanUseCouponList', param)
}
//获取相似数据
static async GetHotelHotelBooking(param:any): Promise<HttpResponse> {
return request('dmc_post_Get_GetJAPAN_HotelBooking', param)
......
......@@ -409,7 +409,6 @@ export default defineComponent({
methods.initOrders()
},
modify(id: number) {
//location.href =
currentRouter.push('/hotel/modify/' + id)
},
handleFinish(options: { file: UploadFileInfo; event?: ProgressEvent }) {
......
......@@ -68,6 +68,10 @@ class DirtionmaryHelper {
* 散客预约酒店缓存客房下单是详情数据
*/
static readonly SCATTERED_HOTEL_ORDER = "scatteredhotelorder"
/**
* 散客预约酒店缓存客房下单成功的详情数据
*/
static readonly SCATTERED_HOTEL_ORDER_MSG = "scatteredhotelordermsg"
/**
* 用户是否在中国
......
......@@ -755,6 +755,7 @@ export default {
inputlabel6: '',
inputlabel7: '',
inputlabel8: '',
Errorruzhushu: '入住人数与总入住数不匹配'
}
}
......
......@@ -178,12 +178,12 @@
>
<div class="col-6 row">
<span class="q-px-lg HotelSure-text"><span class="text-red">*</span> {{$t('v101.scatteredOrder.ruzhushijian1')}}</span>
<q-field v-if="$q.platform.is.desktop" stack-label :label="$t('v101.scatteredOrder.ruzhushijian')" standout class="col" style="min-width: 200px" dense>
<q-field v-if="$q.platform.is.desktop" stack-label :label="$t('v101.scatteredOrder.ruzhushijian')" standout class="col" :class="{'ischeckInTimeSure':ischeckInTimeSure}" style="min-width: 200px" dense>
<div class="self-center full-width no-outline" tabindex="0">
{{sureMsg.checkInTime}}
</div>
<q-popup-proxy :offset="[0, 10]" ref="qDateProxy3">
<q-time v-model="sureMsg.checkInTime" :rules="[ val => val && val.length > 0 || 'Please type something']" @update:model-value="dateRangeHandler3" ref="checkInTime"/>
<q-time v-model="sureMsg.checkInTime" :rules="[ val => val && val.length > 0 || ' ']" @update:model-value="dateRangeHandler3"/>
</q-popup-proxy>
</q-field>
</div>
......@@ -247,7 +247,7 @@
label=""
hint=""
lazy-rules
:rules="[ val => val && val.length > 0 || ' ']"
:rules="[(val:any, rules:any) => rules.email(val) || ' ']"
ref="guestEmail"
/>
</div>
......@@ -260,9 +260,10 @@
filled
v-model="sureMsg.guestPhoneNumber"
label=""
type="Number"
hint=""
lazy-rules
:rules="[ val => val && val.length > 0 || ' ']"
:rules="[ val => val && val.length == 11 || ' ']"
ref="guestPhoneNumber"
/>
</div>
......@@ -306,24 +307,24 @@
</div>
</div>
<div class="column text-red q-pl-lg">
<template v-if="(dataList.cancellationPeriod1==-1||dataList.cancellationPeriod1==0)&&(dataList.cancellationType1==1||dataList.cancellationType1==2)">
<div v-if="(dataList.cancellationPeriod1==-1||dataList.cancellationPeriod1==0)&&(dataList.cancellationType1==1||dataList.cancellationType1==2)">
<template v-if="dataList.cancellationPeriod1==-1">{{$t('v101.scatteredOrder.quxiao1')}},</template>
<template v-if="dataList.cancellationPeriod1==0">{{$t('v101.scatteredOrder.quxiao2')}},</template>
<template v-if="dataList.cancellationType1==1">{{$t('v101.scatteredOrder.shouxufei')}}: {{dataList.cancellation1}}%</template>
<template v-if="dataList.cancellationType1==2">{{$t('v101.scatteredOrder.shouxufei')}}: {{dataList.cancellation1}}</template>
</template>
<template v-if="(dataList.cancellationPeriod2==-1||dataList.cancellationPeriod2==0)&&(dataList.cancellationType2==1||dataList.cancellationType2==2)">
</div>
<div v-if="(dataList.cancellationPeriod2==-1||dataList.cancellationPeriod2==0)&&(dataList.cancellationType2==1||dataList.cancellationType2==2)">
<template v-if="dataList.cancellationPeriod2==-1">{{$t('v101.scatteredOrder.quxiao1')}},</template>
<template v-if="dataList.cancellationPeriod2==0">{{$t('v101.scatteredOrder.quxiao2')}},</template>
<template v-if="dataList.cancellationType2==1">{{$t('v101.scatteredOrder.shouxufei')}}: {{dataList.cancellation2}}%</template>
<template v-if="dataList.cancellationType2==2">{{$t('v101.scatteredOrder.shouxufei')}}: {{dataList.cancellation2}}</template>
</template>
<template v-if="(dataList.cancellationPeriod3==-1||dataList.cancellationPeriod3==0)&&(dataList.cancellationType3==1||dataList.cancellationType3==2)">
</div>
<div v-if="(dataList.cancellationPeriod3==-1||dataList.cancellationPeriod3==0)&&(dataList.cancellationType3==1||dataList.cancellationType3==2)">
<template v-if="dataList.cancellationPeriod3==-1">{{$t('v101.scatteredOrder.quxiao1')}},</template>
<template v-if="dataList.cancellationPeriod3==0">{{$t('v101.scatteredOrder.quxiao2')}},</template>
<template v-if="dataList.cancellationType3==1">{{$t('v101.scatteredOrder.shouxufei')}}: {{dataList.cancellation3}}%</template>
<template v-if="dataList.cancellationType3==2">{{$t('v101.scatteredOrder.shouxufei')}}: {{dataList.cancellation3}}</template>
</template>
</div>
</div>
</q-form>
......@@ -346,7 +347,7 @@
lazy-rules
/>
</div>
<div class="q-ml-lg"><q-btn class="q-px-lg q-py-sm" color="primary" dense unelevated :label="$t('v101.scatteredOrder.duihuan')"/></div>
<div class="q-ml-lg"><q-btn class="q-px-lg q-py-sm" color="primary" dense unelevated :label="$t('v101.scatteredOrder.duihuan')" :loading="CodeLoading" @click="GetCode"/></div>
</div>
<div class="column">
<span class="fz16 text-weight-bold q-pb-md">{{$t('v101.scatteredOrder.youhuiquanshiyong')}}</span>
......@@ -374,6 +375,7 @@
import HotelService from '../../api/scattered'
import { currentRouter } from 'src/router'
import { HotelRate,HotelArea, useHotel } from '../../utils/hotelRate'
import { isPhone } from '../../utils/validate'
import { ApiResult } from 'src/@types/enumHelper'
export default defineComponent({
components: { svgIcon },
......@@ -393,7 +395,6 @@
const qDateProxy = ref(null) as any
const qDateProxy2 = ref(null) as any
const qDateProxy3 = ref(null) as any
const checkInTime = ref(null) as any
const guestLastName = ref(null) as any
const guestFirstName = ref(null) as any
const guestAddress = ref(null) as any
......@@ -402,6 +403,9 @@
// const HotelLength = inject(DirtionmaryHelper.HOTEL_CAR_ORDER_LENGTH) as any
const data = reactive({
CodeLoading: false,
UserCanUseCouponList: [] as Array<any>,
CouponList: [] as Array<any>,
ActivateCode: '',//兑换码
params:{
// hotelId:'',
......@@ -410,6 +414,7 @@
arrivalDate:'',
departureDate:'',
searchroomGroup:[],
roomOptionCd: '',
imgUrl: ''
},
getParamsMsg:{} as any,
......@@ -422,7 +427,6 @@
loading: false,
dateRange: '' as any,//当前日期
dateRange2: '' as any,//当前日期
dateRangeFormat: '',//可选日期
roomRateDetails: {} as any,
dataList: {} as any,
//确认MSG参数
......@@ -449,31 +453,28 @@
HotelPic:'',
EmployeeIdStr:'',
OldTotalPrice:0,
CustomerPayMoney:0,
DiscountMoney:0,
OrderSource:2,
OrderForm:1,
},
auditNum:0,
childNum:0,
TotalChildCount:0,//孩子能否报入
chekedChildCount:0,//选了的儿童数
isBaoChild: false,
SettlementPrice : 0,
price: 0,
isShowTime: true,
isLoginB2B: true,
pickerBeginDateBefore:'',//入住时间前可选范围
pickerBeginDateAfter:'',//入住时间后可选范围
RoomTypeList: [] as Array<HotelArea>,//房间等级
scatteredRoomTypeList: [] as Array<HotelArea>,//散客房间类型
WeekList: [] as Array<HotelArea>,//周一至周日
checkInWeek: '',
checkOutWeek: '',
name: '',
age: '',
ischeckInTimeSure: false,
auditNum:0,
childNum:0,
TotalChildCount:0,//孩子能否报入
chekedChildCount:0,//选了的儿童数
isBaoChild: false,
SettlementPrice : 0,
price: 0,
isShowTime: true,
isLoginB2B: true,
pickerBeginDateBefore:'',//入住时间前可选范围
pickerBeginDateAfter:'',//入住时间后可选范围
RoomTypeList: [] as Array<HotelArea>,//房间等级
scatteredRoomTypeList: [] as Array<HotelArea>,//散客房间类型
WeekList: [] as Array<HotelArea>,//周一至周日
checkInWeek: '',//周一至周日
checkOutWeek: '',
})
for(let i=0;i<21;i++){
data.adultList.push(i)
......@@ -487,41 +488,108 @@
data.urlParamsMsg = currentRouter.currentRoute.value.params
data.auditNum = data.getParamsMsg.auditNum
data.childNum = data.getParamsMsg.childNum
// data.dateRange = date.formatDate(date.addToDate(new Date(), { days: 9 }), 'YYYY/MM/DD')
// data.dateRange = date.formatDate(date.addToDate(new Date(), { days: 9 }), 'YYYY/MM/DD')
data.RoomTypeList = useHotel.getHotelRoomType()
data.scatteredRoomTypeList = useHotel.getHotelScatRoom()
data.WeekList = useHotel.getHotelWeek()
// data.dateRange.from = date.formatDate(date.addToDate(new Date(), { days: 8 }), 'YYYY/MM/DD')
// data.dateRangeFormat = data.dateRange
let roomGroupLen = data.params.searchroomGroup.length
for(var i=0;i<roomGroupLen;i++){
var obj = {
roomCount:i+1,
roomMaleCount:0,
roomFemaleCount:0,
roomChildCount:0,
roomInfantCount:0,
rateGroup:[]
}
data.sureMsg.roomGroup.push(obj);
}
// watch(
// () => data.urlParamsMsg.hotelId,
// (o, n) => {
// methods.initHotel()
//
// }
// )
const methods = {
submitForm () {
return
if(data.submLoading) return
checkInTime.value.validate()
let flag = false
guestLastName.value.validate()
guestFirstName.value.validate()
guestAddress.value.validate()
guestEmail.value.validate()
guestPhoneNumber.value.validate()
return
data.loading = true
flag = !guestLastName.value.hasError && !guestFirstName.value.hasError && !guestAddress.value.hasError && !guestEmail.value.hasError && !guestPhoneNumber.value.hasError
if(!data.sureMsg.checkInTime) return data.ischeckInTimeSure = true
if(!isPhone(data.sureMsg.guestPhoneNumber)) return
if(!flag) return
data.sureMsg.hotelId = data.urlParamsMsg.hotelId;
data.sureMsg.arrivalDate = data.params.arrivalDate;
data.sureMsg.totalRoomCount = data.params.searchroomGroup.length;
data.sureMsg.departureDate = data.params.departureDate;
data.sureMsg.roomOptionCd = data.params.roomOptionCd;
data.sureMsg.HotelName = data.dataList.hotelName;
data.sureMsg.HotelPic = data.params.imgUrl;
//判断选择的人数与入住人数
let Count1=0
data.sureMsg.roomGroup.forEach(x=>{
Count1+=x.roomMaleCount+x.roomFemaleCount+x.roomChildCount
})
let Count2=0;
Count2=data.auditNum+data.childNum;
if(Count1!=Count2){
message.errorMsg(t('v101.scatteredOrder.Errorruzhushu'))
return;
}
data.dataList.roomGroup.forEach(x=>{
data.sureMsg.roomGroup.forEach(j=>{
if(Object.prototype.toString.call(x.rateGroup) == '[object Object]'){
j.rateGroup.push(x.rateGroup);
}else{
j.rateGroup=x.rateGroup
}
})
})
if(data.sureMsg.CustomerId==null||data.sureMsg.CustomerId==""){
data.sureMsg.CustomerId=0
}
data.submLoading = true
let param = Object.assign(data.sureMsg)
HotelService.GetHotelHotelBooking(param)
.then(r => {
data.submLoading = false
if (r.data.resultCode == ApiResult.SUCCESS) {
localStorage.removeItem(DirtionmaryHelper.SCATTERED_HOTEL_ORDER_MSG)
message.successMsg(`${t('success')}`)
// localStorage.removeItem(DirtionmaryHelper.HOTEL_HOTELCARS_CACHE)
let num =0;
data.sureMsg.roomGroup.forEach(x=>{
num+=parseInt(x.roomFemaleCount)+parseInt(x.roomMaleCount)+parseInt(x.roomChildCount)
})
let msg = {
RB_Branch_id:r.data.data.RB_Branch_id,
costType:r.data.data.costType,
orderId:r.data.data.orderId,
bookingNumber:r.data.data.parmResult.bookingNumber,
bookMoney:data.SettlementPrice,
CancelTime:r.data.data.CancelTime,
hotelName:r.data.data.parmResult.hotelName,
totalPnumber:num
}
localStorage.setItem(DirtionmaryHelper.SCATTERED_HOTEL_ORDER_MSG,JSON.stringify(msg))
// sessionStorage.setItem("HotelPayMsg", JSON.stringify(msg));
currentRouter.push({
path:"/HotelPayBefore",
})
} else {
message.errorMsg(r.data.message)
}
data.submLoading = false
})
.catch(e => {
message.errorMsg(e.message)
......@@ -771,6 +839,7 @@
data.sureMsg.totalPriceJapanese += parseFloat(AdultJapanCount+childJapanCount+onlyJanpnase);
methods.getUserCanUseCouponList()
})
}
data.loading = false
......@@ -779,7 +848,29 @@
message.errorMsg(e.message)
})
},
// 获取优惠券
GetCode(){
if(data.CodeLoading) return
if(!data.ActivateCode) return
let msg={
ActivateCode:data.ActivateCode
};
data.CodeLoading = true
let param = Object.assign(msg)
HotelService.updateUseCouponBycod(param)
.then(r => {
data.CodeLoading = false
if (r.data.resultCode == ApiResult.SUCCESS) {
message.successMsg(`${t('success')}`)
methods.getUserCanUseCouponList();
}else{
message.errorMsg(r.message)
}
}).catch(e => {
data.CodeLoading = false
message.errorMsg(e.message)
})
},
// 获取优惠券
getUserCanUseCouponList(){
let msg={
lineId:0,
......@@ -787,15 +878,29 @@
CouponsUseScope:10,
};
let param = Object.assign(msg)
// HotelService.GetHotelDetailScat(param)
// .then(r => {
// if (r.data.resultCode == ApiResult.SUCCESS) {
// }
// }).catch(e => {
// data.loading = false
// message.errorMsg(e.message)
// })
HotelService.getUserCanUseCouponList(param)
.then(r => {
if (r.data.resultCode == ApiResult.SUCCESS) {
data.CouponList=res.data.data;
data.CouponList.forEach(item=>{
item.active=false;
})
methods.filterCoupon();
}
}).catch(e => {
data.loading = false
message.errorMsg(e.message)
})
},
filterCoupon() {
let list = []
data.CouponList.forEach(x=>{
if (data.price>x.useCondition) {
x.active = false
list.push(x);
}
})
data.UserCanUseCouponList = list;
},
}
......@@ -803,7 +908,7 @@
methods.initHotel()
})
return { ...toRefs(data), ...methods,qDateProxy,qDateProxy2,qDateProxy3 }
return { ...toRefs(data), ...methods,qDateProxy,qDateProxy2,qDateProxy3,guestLastName,guestFirstName,guestAddress,guestEmail,guestPhoneNumber }
}
})
</script>
......@@ -812,5 +917,8 @@
.HotelSure-text{
width: 120px;
}
.ischeckInTimeSure .q-field__control{
border: 1px solid red;
}
</style>
\ No newline at end of file
......@@ -538,7 +538,6 @@
showImageHandler(url: string) {
data.currentImage = url
data.showImagePriview = true
console.log('===')
}
}
......
......@@ -143,7 +143,7 @@ const useHotel={
}
return rates
},
// 散客下单周一至周
// 散客下单周一至周
getHotelWeek():HotelArea[]{
let rates=[] as HotelArea[]
for(let i=1;i<8;i++){
......
......@@ -32,6 +32,13 @@ export function isEmail(account:string):boolean {
let regexp = new RegExp('/^(([^<>()\[\]\\.,;:\[email protected]"]+(\.[^<>()\[\]\\.,;:\[email protected]"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/');
serchfind = regexp.test(account);
return serchfind
}
export function isPhone(account:string):boolean {
let serchfind:boolean;
let regexp = new RegExp('/^((13|14|15|16|17|18|19)[0-9]{1}\d{8})$/');
serchfind = regexp.test(account);
return serchfind
}
/** 比对数组是否相同 */
......
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