Commit 6f1abe91 authored by youjie's avatar youjie

Merge branch 'B2C' of http://gitlab.oytour.com/zk123/jz_travel into B2C

parents bd78b251 949e79b2
...@@ -363,6 +363,7 @@ ...@@ -363,6 +363,7 @@
Income: 0, Income: 0,
Refund: 0, Refund: 0,
MallBaseId: uni.getStorageSync('mall_UserInfo').MallBaseId, MallBaseId: uni.getStorageSync('mall_UserInfo').MallBaseId,
DOrderType:1,
}; };
this.apipost("AddOrderInfo_post", msg, (res) => { this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
......
...@@ -7,9 +7,12 @@ ...@@ -7,9 +7,12 @@
<view class="o-timer"> <view class="o-timer">
<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)}}<text>{{ getWeek(dayObj.start) }}</text></view> <view class="time-item">
{{getDate(dayObj.start)}}<text>{{ getWeek(dayObj.start) }}</text>
</view>
<view class="time-itemZhi"><text>-</text></view> <view class="time-itemZhi"><text>-</text></view>
<view class="time-item">{{getDate(dayObj.end)}}<text>{{ getWeek(dayObj.end) }}</text></view> <view class="time-item">{{getDate(dayObj.end)}}<text>{{ getWeek(dayObj.end) }}</text>
</view>
<view class="timeline"></view> <view class="timeline"></view>
<view class="time-split"> <view class="time-split">
<view>{{dayObj.day?dayObj.day:''}}</view> <view>{{dayObj.day?dayObj.day:''}}</view>
...@@ -74,8 +77,10 @@ ...@@ -74,8 +77,10 @@
</view> </view>
<view class="LastNameBox column val" style="width: 1px;flex: 1;"> <view class="LastNameBox column val" style="width: 1px;flex: 1;">
<view class="row items-center" v-for="(sItem,i) in item.GuestInfo" :key="i"> <view class="row items-center" v-for="(sItem,i) in item.GuestInfo" :key="i">
<input type="text" v-model="sItem.LastName" :placeholder="`${sItem.IsAdult?'住客'+(i+1):sItem.Age+'岁儿童'}姓`" /> <input type="text" v-model="sItem.LastName"
<input type="text" v-model="sItem.FirstName" :placeholder="`${sItem.IsAdult?'住客'+(i+1):sItem.Age+'岁儿童'}名`" /> :placeholder="`${sItem.IsAdult?'住客'+(i+1):sItem.Age+'岁儿童'}姓`" />
<input type="text" v-model="sItem.FirstName"
:placeholder="`${sItem.IsAdult?'住客'+(i+1):sItem.Age+'岁儿童'}名`" />
<!--<view class="row" style="margin-left:20rpx;"> <!--<view class="row" style="margin-left:20rpx;">
<image v-if="item.GuestInfo.length>1" <image v-if="item.GuestInfo.length>1"
style="width: 27rpx;height: 27rpx;display: block;" style="width: 27rpx;height: 27rpx;display: block;"
...@@ -125,8 +130,7 @@ ...@@ -125,8 +130,7 @@
</view> </view>
</view> </view>
<view> <view>
<textarea class="jz_TextArea" <textarea class="jz_TextArea" placeholder="请输入备注信息" v-model="orderMsg.Remarks"></textarea>
placeholder="请输入备注信息" v-model="orderMsg.Remarks"></textarea>
</view> </view>
</view> </view>
<view class="CouponBox"> <view class="CouponBox">
...@@ -140,7 +144,8 @@ ...@@ -140,7 +144,8 @@
<text style="flex: 1;" <text style="flex: 1;"
v-if="useCouponIds == 0 &&couponList.length>0">{{couponList.length}}张可用优惠券</text> v-if="useCouponIds == 0 &&couponList.length>0">{{couponList.length}}张可用优惠券</text>
<text class="content" style="color:grey" v-else-if="couponList.length==0">暂无优惠券</text> <text class="content" style="color:grey" v-else-if="couponList.length==0">暂无优惠券</text>
<text class="content" v-else :style="{ color: mainColor }">已优惠{{currentCoupon.discountMoney}} </text> <text class="content" v-else
:style="{ color: mainColor }">已优惠{{currentCoupon.discountMoney}} </text>
<!-- <u-icon name="ellipsis" size="36" v-if="couponList.length > 0"></u-icon> --> <!-- <u-icon name="ellipsis" size="36" v-if="couponList.length > 0"></u-icon> -->
</text> </text>
<u-icon name="arrow" :size="32" color="#111" v-if="couponList.length>0"></u-icon> <u-icon name="arrow" :size="32" color="#111" v-if="couponList.length>0"></u-icon>
...@@ -247,7 +252,7 @@ ...@@ -247,7 +252,7 @@
<u-button :ripple="true" :hair-line="false" <u-button :ripple="true" :hair-line="false"
:disabled="(this.orderMsg&&this.orderMsg.TotalPrice==0)||submit" :disabled="(this.orderMsg&&this.orderMsg.TotalPrice==0)||submit"
:custom-style="(this.orderMsg&&this.orderMsg.TotalPrice==0)||submit?btnStyle2:btnStyle" :custom-style="(this.orderMsg&&this.orderMsg.TotalPrice==0)||submit?btnStyle2:btnStyle"
@click="buyRoom" :loading="submit">立即购买</u-button> @click="submitB2COrderHandler" :loading="submit">立即购买</u-button>
</view> </view>
</view> </view>
<u-picker v-model="showtime" mode="time" @confirm='confirm' :params="paramsTime" <u-picker v-model="showtime" mode="time" @confirm='confirm' :params="paramsTime"
...@@ -302,11 +307,11 @@ ...@@ -302,11 +307,11 @@
RatePlanID: "", RatePlanID: "",
CheckOutDate: "", //离店时间 CheckOutDate: "", //离店时间
RoomCount: "", //房间数量 RoomCount: "", //房间数量
guestLastName: "", //英文姓 guestLastName: "", //英文姓
guestFirstName: "", //英文名 guestFirstName: "无误", //英文名
guestAddress: "", guestAddress: "",
guestPhoneNumber: "", guestPhoneNumber: "13344445555",
guestEmail: "", //Email guestEmail: "123@qq.com", //Email
BookingID: "", BookingID: "",
HotelName: "", //酒店名称 HotelName: "", //酒店名称
HotelPic: "", //酒店封面 HotelPic: "", //酒店封面
...@@ -408,15 +413,11 @@ ...@@ -408,15 +413,11 @@
this.orderMsg.ProductId = this.RoomInfo.RoomTypeID; this.orderMsg.ProductId = this.RoomInfo.RoomTypeID;
this.orderMsg.RatePlanID = this.RoomInfo.RatePlanID this.orderMsg.RatePlanID = this.RoomInfo.RatePlanID
this.orderMsg.RoomCount = this.searchObj.rooms this.orderMsg.RoomCount = this.searchObj.rooms
this.getGroupData() this.getGroupData()
this.price = this.RoomInfo.Currency + this.RoomInfo.RatePlanPrice this.price = this.RoomInfo.Currency + this.RoomInfo.RatePlanPrice
this.getUserCouponList() this.getUserCouponList()
this.CalTotalPrice(); this.CalTotalPrice();
this.GetCountryInfo() this.GetCountryInfo()
}, },
created() { created() {
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
...@@ -449,12 +450,12 @@ ...@@ -449,12 +450,12 @@
}); });
}, },
methods: { methods: {
getGroupData(){ getGroupData() {
this.orderMsg.GuestList = []; this.orderMsg.GuestList = [];
this.searchObj.searchroomGroup.forEach((item, index) => { this.searchObj.searchroomGroup.forEach((item, index) => {
var guestInfoList = []; var guestInfoList = [];
let allprople = Number(item.numberOfAdults) + Number(item.numberOfChildren) let allprople = Number(item.numberOfAdults) + Number(item.numberOfChildren)
for (let i = 0; i <= Number(item.numberOfAdults)-1; i++) { for (let i = 0; i <= Number(item.numberOfAdults) - 1; i++) {
let obj = { let obj = {
IsAdult: 1, IsAdult: 1,
LastName: "", LastName: "",
...@@ -463,7 +464,7 @@ ...@@ -463,7 +464,7 @@
}; };
guestInfoList.push(obj); guestInfoList.push(obj);
} }
for (let i = 0; i <= Number(item.numberOfChildren)-1; i++) { for (let i = 0; i <= Number(item.numberOfChildren) - 1; i++) {
let obj = { let obj = {
IsAdult: 0, IsAdult: 0,
LastName: "", LastName: "",
...@@ -487,7 +488,17 @@ ...@@ -487,7 +488,17 @@
var week = weekArray[new Date(date).getDay()]; //注意此处必须是先new一个Date var week = weekArray[new Date(date).getDay()]; //注意此处必须是先new一个Date
return "周" + week; return "周" + week;
}, },
submitB2COrderHandler(OrderId) { submitB2COrderHandler() {
const error = this.validate()
if (error != '') {
uni.showToast({
icon: 'none',
title: error
})
return
}
if (this.submit) return;
this.submit = true;
let userInfo = uni.getStorageSync("mall_UserInfo"); let userInfo = uni.getStorageSync("mall_UserInfo");
let guestInfo = `成人x${this.searchObj.adultsNumber}; `; let guestInfo = `成人x${this.searchObj.adultsNumber}; `;
if (this.orderMsg.ChirdNeedBedNum > 0) { if (this.orderMsg.ChirdNeedBedNum > 0) {
...@@ -498,34 +509,70 @@ ...@@ -498,34 +509,70 @@
Name: this.orderMsg.Name, Name: this.orderMsg.Name,
ContactNumber: this.orderMsg.guestPhoneNumber, ContactNumber: this.orderMsg.guestPhoneNumber,
Mailbox: this.orderMsg.guestEmail, Mailbox: this.orderMsg.guestEmail,
//GoodsId: this.orderMsg.RatePlanID,
GoodsId: this.HotelInfo.hotelId, GoodsId: this.HotelInfo.hotelId,
GoodsName: this.HotelInfo.name, GoodsName: this.HotelInfo.name,
GoodsPic: "", GoodsPic: "",
GoodsType: 9, GoodsType: 9,
OrderMake: `${this.orderMsg.CheckInDate}入住;${this.orderMsg.CheckOutDate}离店 ${guestInfo}`, OrderMake: `${this.orderMsg.CheckInDate}入住;${this.orderMsg.CheckOutDate}离店 ${guestInfo}`,
TotalPrice: this.orderMsg.TotalPrice, //this.getPrice(this.orderMsg.TotalPrice) TotalPrice: this.orderMsg.TotalPrice,
PreferentialPrice: this.currentCoupon.discountMoney, PreferentialPrice: this.currentCoupon.discountMoney,
ErpOrderId: OrderId, CouponAllotIds:"",
ErpOrderId: 0,
Country: 0, Country: 0,
PlatformTax: 0, PlatformTax: 0,
Income: 0, Income: 0,
Refund: 0, Refund: 0,
MallBaseId: userInfo.MallBaseId, MallBaseId: userInfo.MallBaseId,
CreateBy: 0 CreateBy: 0,
DOrderType: 1,
OpenId: "",
DiDaHotelParams: {},
}; };
let CouponAllotIds = ''
if (this.useCouponIds.length > 0) {
CouponAllotIds = this.useCouponIds.join(',')
}
msg.CouponAllotIds = CouponAllotIds;
if (this.HotelInfo.images && this.HotelInfo.images.length > 0) { if (this.HotelInfo.images && this.HotelInfo.images.length > 0) {
msg.GoodsPic = this.HotelInfo.images[0].Path; msg.GoodsPic = this.HotelInfo.images[0].Path;
} }
// #ifdef MP-DI // #ifdef MP-DI
msg.DOrderType = 1;
if (this.customer.salesBaseInfo && this.customer.salesBaseInfo.employeeId) { if (this.customer.salesBaseInfo && this.customer.salesBaseInfo.employeeId) {
msg.CreateBy = this.customer.salesBaseInfo.employeeId msg.CreateBy = this.customer.salesBaseInfo.employeeId;
} }
// #endif // #endif
// #ifdef MP-AG
msg.DOrderType = 2; //同业订单
if (userInfo && userInfo.OpenId) {
msg.OpenId = userInfo.OpenId;
}
// #endif
//道旅酒店参数
let that = this;
var CreateBy = 0
// #ifdef MP-DI
that.orderMsg.DirectCustomerId = this.customer.customerId;
if (this.customer && this.customer.erpBaseInfo && this.customer.erpBaseInfo.employeeId) {
that.orderMsg.EmployeeIdStr = this.customer.erpBaseInfo.employeeId;
}
// #endif
// #ifdef MP-AG
CreateBy = this.CreateBy
that.orderMsg.CustomerId = this.customer.customerId
that.orderMsg.EmployeeIdStr = CreateBy
// #endif
this.orderMsg.CouponAllotIds = CouponAllotIds;
msg.DiDaHotelParams = this.orderMsg;
//道旅参数END
console.log("AddOrderInfo_post", msg);
this.apipost("AddOrderInfo_post", msg, (res) => { this.apipost("AddOrderInfo_post", msg, (res) => {
this.submit = false;
if (res.resultCode == 1) { if (res.resultCode == 1) {
console.log(res.data,'-----33');
this.orderInfo = JSON.parse(res.data.sPayInfo) this.orderInfo = JSON.parse(res.data.sPayInfo)
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
...@@ -538,12 +585,13 @@ ...@@ -538,12 +585,13 @@
icon: 'none', icon: 'none',
duration: 3000 duration: 3000
}) })
this.submit = false;
} }
}, fail => {
this.submit = false;
}); });
}, },
goPayHandler(item) { goPayHandler(item) {
let OrderNo=item.OrderNo; let OrderNo = item.OrderNo;
let that = this; let that = this;
uni.requestPayment({ uni.requestPayment({
provider: "wxpay", provider: "wxpay",
...@@ -558,14 +606,15 @@ ...@@ -558,14 +606,15 @@
title: "支付成功", title: "支付成功",
}); });
setTimeout(() => { setTimeout(() => {
// (that.getPrice(that.orderMsg.TotalPrice) - that //创建道旅订单
// .currentCoupon.discountMoney).toFixed(2) + //that.createDiDaOrder();
// "&isFrom=5
uni.redirectTo({ // uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + // url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
(that.orderMsg.TotalPrice - that.currentCoupon.discountMoney).toFixed(2) + // (that.orderMsg.TotalPrice - that.currentCoupon
"&isFrom=5", // .discountMoney).toFixed(2) +
}); // "&isFrom=5",
// });
}, 100); }, 100);
}, },
fail: function(err) { fail: function(err) {
...@@ -582,6 +631,50 @@ ...@@ -582,6 +631,50 @@
}, },
}); });
}, },
//创建道旅订单
createDiDaOrder() {
let that = this;
var CreateBy = 0
// #ifdef MP-DI
that.orderMsg.DirectCustomerId = this.customer.customerId;
if (this.customer && this.customer.erpBaseInfo && this.customer.erpBaseInfo.employeeId) {
that.orderMsg.EmployeeIdStr = this.customer.erpBaseInfo.employeeId;
}
// #endif
// #ifdef MP-AG
CreateBy = this.CreateBy
that.orderMsg.CustomerId = this.customer.customerId
that.orderMsg.EmployeeIdStr = CreateBy
// #endif
let CouponAllotIds = ''
if (this.useCouponIds.length > 0) {
CouponAllotIds = this.useCouponIds.join(',')
}
this.orderMsg.CouponAllotIds = CouponAllotIds
console.log("酒店下单", that.orderMsg);
that.apipost('dmc_post_GetDiDaBookingConfirm', that.orderMsg,
res => {
if (res.resultCode == 1) {
const tempData = res.data
// #ifdef MP-DI
//this.submitB2COrderHandler(tempData.orderId)
// #endif
// #ifdef MP-AG
this.submit = false
uni.showToast({
title: '订单创建成功.',
icon: 'none'
})
uni.redirectTo({
url: `/pages/AggregateOrders/AggregateOrdersList?OrderTypeStr=7`,
});
// #endif
}
}
);
},
//日期格式化 //日期格式化
getformatDateStr(value) { getformatDateStr(value) {
var dt = new Date(value); var dt = new Date(value);
...@@ -606,8 +699,7 @@ ...@@ -606,8 +699,7 @@
this.roomRateDetails = res.data.PriceDetails.HotelList[0]; this.roomRateDetails = res.data.PriceDetails.HotelList[0];
this.orderMsg.BookingID = res.data.PriceDetails.ReferenceNo; this.orderMsg.BookingID = res.data.PriceDetails.ReferenceNo;
this.orderMsg.checkInTime = res.data.PriceDetails.CheckInDate; this.orderMsg.checkInTime = res.data.PriceDetails.CheckInDate;
this.orderMsg.TotalPrice = this.roomRateDetails this.orderMsg.TotalPrice = this.roomRateDetails.TotalPrice
.TotalPrice //this.getPrice(this.roomRateDetails.TotalPrice);
if (this.roomRateDetails.RatePlanList && this.roomRateDetails.RatePlanList.length > 0) { if (this.roomRateDetails.RatePlanList && this.roomRateDetails.RatePlanList.length > 0) {
this.orderMsg.roomType = this.roomRateDetails.RatePlanList[0].BedType this.orderMsg.roomType = this.roomRateDetails.RatePlanList[0].BedType
} }
...@@ -618,7 +710,6 @@ ...@@ -618,7 +710,6 @@
title: err.message, title: err.message,
icon: 'none', icon: 'none',
}) })
// this.submit = false;
}); });
}, },
getPrice(price) { getPrice(price) {
...@@ -784,14 +875,13 @@ ...@@ -784,14 +875,13 @@
return arr[1] + '月' + arr[2] + '日' return arr[1] + '月' + arr[2] + '日'
} }
}, },
//选择时间 //选择时间
confirm(val) { confirm(val) {
this.orderMsg.ArrivalTime = val.hour + ':' + val.minute; this.orderMsg.ArrivalTime = val.hour + ':' + val.minute;
}, },
//计算总价 //计算总价
CalTotalPrice() { CalTotalPrice() {
this.price = this.orderMsg.TotalPrice*this.orderMsg.RoomCount this.price = this.orderMsg.TotalPrice * this.orderMsg.RoomCount
}, },
validate() { validate() {
let email = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/ let email = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/
...@@ -825,63 +915,7 @@ ...@@ -825,63 +915,7 @@
} }
return msg return msg
}, },
//立即购买
buyRoom() {
const error = this.validate()
if (error != '') {
uni.showToast({
icon: 'none',
title: error
})
return
}
if (this.submit) return;
this.submit = true;
let that = this;
var CreateBy = 0
// #ifdef MP-DI
that.orderMsg.DirectCustomerId = this.customer.customerId;
if (this.customer && this.customer.erpBaseInfo && this.customer.erpBaseInfo.employeeId) {
that.orderMsg.EmployeeIdStr = this.customer.erpBaseInfo.employeeId;
}
// #endif
// #ifdef MP-AG
CreateBy = this.CreateBy
that.orderMsg.CustomerId = this.customer.customerId
// if (this.customer && this.customer.salesBaseInfo && this.customer.salesBaseInfo.employeeId) {
// this.orderMsg.EmployeeIdStr = this.customer.salesBaseInfo.employeeId
// }
that.orderMsg.EmployeeIdStr = CreateBy
// #endif
let CouponAllotIds = ''
if(this.useCouponIds.length>0){
CouponAllotIds = this.useCouponIds.join(',')
}
this.orderMsg.CouponAllotIds = CouponAllotIds
console.log("酒店下单", that.orderMsg);
that.apipost('dmc_post_GetDiDaBookingConfirm', that.orderMsg,
res => {
if (res.resultCode == 1) {
const tempData = res.data
// #ifdef MP-DI
this.submitB2COrderHandler(tempData.orderId)
// #endif
// #ifdef MP-AG
this.submit = false
uni.showToast({
title: '订单创建成功.',
icon: 'none'
})
uni.redirectTo({
url: `/pages/AggregateOrders/AggregateOrdersList?OrderTypeStr=7`,
});
// #endif
}
}
);
},
} }
} }
</script> </script>
...@@ -1280,6 +1314,7 @@ ...@@ -1280,6 +1314,7 @@
.LastNameBox view:last-child { .LastNameBox view:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
.jz_TextArea { .jz_TextArea {
height: 50px; height: 50px;
margin-bottom: 10px; margin-bottom: 10px;
......
...@@ -680,7 +680,8 @@ ...@@ -680,7 +680,8 @@
Income: 0, Income: 0,
Refund: 0, Refund: 0,
MallBaseId: this.userInfo.MallBaseId, MallBaseId: this.userInfo.MallBaseId,
CreateBy:0 CreateBy:0,
DOrderType:1
}; };
// #ifdef MP-DI // #ifdef MP-DI
if(this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId){ if(this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId){
......
...@@ -871,6 +871,7 @@ ...@@ -871,6 +871,7 @@
Income: 0, Income: 0,
Refund: 0, Refund: 0,
MallBaseId: this.userInfo.MallBaseId, MallBaseId: this.userInfo.MallBaseId,
DOrderType:1
}; };
this.apipost("AddOrderInfo_post", msg, (res) => { this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
......
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