|
@ -211,6 +211,7 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
order () { |
|
|
order () { |
|
|
|
|
|
this.roomUser.forEach(v=>v.name = v.name.trim()) |
|
|
// 校验 |
|
|
// 校验 |
|
|
if (!this.isTel(this.phone)){ |
|
|
if (!this.isTel(this.phone)){ |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
@ -219,13 +220,20 @@ |
|
|
}); |
|
|
}); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (this.roomUser.some(v=>v.trim().length<0)) { |
|
|
if (this.roomUser.some(v=>v.name.length<0)) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '请输入住客姓名', |
|
|
title: '请输入住客姓名', |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}); |
|
|
}); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.roomUser.length != new Set(this.roomUser).length) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '住客姓名不能相同', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
let goods = [] |
|
|
let goods = [] |
|
|
let goodsItem = { |
|
|
let goodsItem = { |
|
@ -234,7 +242,7 @@ |
|
|
start_date: this.selectDate.startDay, |
|
|
start_date: this.selectDate.startDay, |
|
|
end_date: this.selectDate.endDay, |
|
|
end_date: this.selectDate.endDay, |
|
|
customer_name: this.roomUser.map(v=>v.name).join('、'), |
|
|
customer_name: this.roomUser.map(v=>v.name).join('、'), |
|
|
reserve_mobile: this.phone, |
|
|
// reserve_mobile: this.phone, |
|
|
} |
|
|
} |
|
|
goods.push(goodsItem) |
|
|
goods.push(goodsItem) |
|
|
|
|
|
|
|
@ -249,7 +257,7 @@ |
|
|
data: JSON.stringify(data) |
|
|
data: JSON.stringify(data) |
|
|
},'/api/order/place').then(res => { |
|
|
},'/api/order/place').then(res => { |
|
|
console.log('成功'); |
|
|
console.log('成功'); |
|
|
if(res.code == 200){ |
|
|
if(res.code == 1){ |
|
|
uni.removeStorageSync('hotelOrderInfo') |
|
|
uni.removeStorageSync('hotelOrderInfo') |
|
|
this.Post({ |
|
|
this.Post({ |
|
|
order_id: res.data.order_id, |
|
|
order_id: res.data.order_id, |
|
|