Commit dcc6a194 authored by 黄奎's avatar 黄奎

支付调整

parent bbd6ae3e
......@@ -88,48 +88,6 @@
orderInfo: null,
showModal: false,
currentData: null,
orderMsg: {
ArrivalTime: '14:00', //预计到达时间
EmployeeIdStr: "", //销售id
CheckInDate: "", //到店时间
RatePlanID: "",
CheckOutDate: "", //离店时间
RoomCount: "", //房间数量
guestLastName: "张", //英文姓
guestFirstName: "无误", //英文名
guestAddress: "",
guestPhoneNumber: "13344445555",
guestEmail: "123@qq.com", //Email
BookingID: "",
HotelName: "", //酒店名称
HotelPic: "", //酒店封面
GuestList: [],
TotalPrice: 0, //总价
CustomerPayMoney: 0,
DiscountMoney: 0, //优惠
CouponAllotIds: '', //优惠券Id
// #ifdef MP-DI
OrderSource: 7,
// #endif
// #ifdef MP-AG
OrderSource: 5,
// #endif
// // #ifdef MP-WEIXIN
// OrderSource: 5,
// // #endif
// #ifdef MP-ALIPAY
OrderSource: 6,
// #endif
OrderForm: 4, //订单来源
//备注
guestRequest: "",
hotelId: '', //酒店Id
roomType: 0,
CustomerId: 0, //同行Id
DirectCustomerId: 0, //直客Id
Remarks: '', //备注
},
orderData:{},
}
},
watch: {
......@@ -147,15 +105,19 @@
cancelSuccess() {
this.$emit('research', 5)
},
//调用支付
submitGetCodeByOrderNo(item) {
console.log("item", item)
let mallUserInfo = uni.getStorageSync("mall_UserInfo");
uni.showLoading({
title: "请稍等片刻...",
})
if (this.submit || this.submitCancel) return;
this.submit = true
this.apipost("GetCodeByOrderNo_post", {
OrderNo: item.orderNo,
MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId
OrderNo: item.directOrderNo,
OpenId: mallUserInfo.OpenId,
MallBaseId: mallUserInfo.MallBaseId
}, (res) => {
if (res.resultCode == 1) {
this.orderInfo = JSON.parse(res.data.sPayInfo)
......@@ -170,138 +132,6 @@
})
this.submit = false
});
// if(item.goodsType > 7 && item.goodsType < 12){
// this.getOrderDetail(item.erpOrderId)
// }else{
// this.apipost("GetCodeByOrderNo_post", {
// OrderNo: item.orderNo,
// MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId
// }, (res) => {
// if (res.resultCode == 1) {
// this.orderInfo = JSON.parse(res.data.sPayInfo)
// this.goPayHandler(item);
// }
// }, e => {
// uni.hideLoading()
// uni.showToast({
// title: '无法发起支付,请稍后',
// icon: 'none',
// duration: 3000
// })
// this.submit = false
// });
// }
},
// 酒店详情
getOrderDetail(id) {
let msg = {
orderId: id,
};
this.apipost("dmc_post_Get_GetJAPAN_OrderDetail", msg,
(res) => {
if (res.resultCode == 1) {
this.orderData = res.data
let RoomInfo = res.data.parmResultRoomInfo
this.orderMsg= {
ArrivalTime: RoomInfo.ArrivalTime, //预计到达时间
EmployeeIdStr: RoomInfo.EmployeeIdStr, //销售id
CheckInDate: RoomInfo.CheckInDate, //到店时间
RatePlanID: RoomInfo.RatePlanID,
CheckOutDate: RoomInfo.CheckOutDate, //离店时间
RoomCount: RoomInfo.RoomCount, //房间数量
guestLastName: RoomInfo.guestLastName, //英文姓
guestFirstName: RoomInfo.guestFirstName, //英文名
guestAddress: RoomInfo.guestAddress,
guestPhoneNumber: RoomInfo.guestPhoneNumber,
guestEmail: RoomInfo.guestEmail, //Email
BookingID: RoomInfo.BookingID,
HotelName: RoomInfo.HotelName, //酒店名称
HotelPic: RoomInfo.HotelPic, //酒店封面
GuestList: RoomInfo.GuestList,
TotalPrice: RoomInfo.TotalPrice, //总价
CustomerPayMoney: RoomInfo.CustomerPayMoney,
DiscountMoney: RoomInfo.DiscountMoney, //优惠
CouponAllotIds: RoomInfo.CouponAllotIds, //优惠券Id
// #ifdef MP-DI
OrderSource: 7,
// #endif
// #ifdef MP-AG
OrderSource: 5,
// #endif
// // #ifdef MP-WEIXIN
// OrderSource: 5,
// // #endif
// #ifdef MP-ALIPAY
OrderSource: 6,
// #endif
OrderForm: 4, //订单来源
//备注
guestRequest: RoomInfo.guestRequest,
hotelId: RoomInfo.hotelId, //酒店Id
roomType: RoomInfo.roomType,
CustomerId: RoomInfo.CustomerId, //同行Id
DirectCustomerId: RoomInfo.DirectCustomerId, //直客Id
Remarks: RoomInfo.Remarks, //备注
}
this.submitB2COrderHandler()
}
}, err => {
}
);
},
// 酒店支付
submitB2COrderHandler(){
let userInfo = uni.getStorageSync("mall_UserInfo");
let model = this.orderData.parmResultRoomInfo
let RoomInfo = this.orderData.parmResultRoomInfo
let directOrder = this.orderData.directOrder
let msg = {
SurName: RoomInfo.SurName,
Name: RoomInfo.Name,
ContactNumber: RoomInfo.guestPhoneNumber,
Mailbox: RoomInfo.guestEmail,
GoodsId: RoomInfo.hotelId,
GoodsName: RoomInfo.HotelName,
GoodsPic: model.HotelPic,
GoodsType: directOrder.GoodsType,
OrderMake: `${directOrder.OrderMake}`,
TotalPrice: RoomInfo.TotalPrice,
PreferentialPrice: RoomInfo.DiscountMoney,
CouponAllotIds:"",
ErpOrderId: 0,
Country: 0,
PlatformTax: 0,
Income: 0,
Refund: 0,
MallBaseId: userInfo.MallBaseId,
CreateBy: 0,
// #ifdef MP-DI
DOrderType: 1,
// #endif
// #ifdef MP-AG
DOrderType: 2,
OpenId: userInfo.OpenId?userInfo.OpenId:'',
// #endif
CreateBy:directOrder.CreateBy,
DiDaHotelParams: {},
};
//道旅酒店参数
msg.DiDaHotelParams = this.orderMsg;
this.apipost("AddOrderInfo_post", msg, (res) => {
this.submit = false;
if (res.resultCode == 1) {
this.orderInfo = JSON.parse(res.data.sPayInfo)
this.goPayHandler();
}
}, err => {
uni.showToast({
title: err.message,
icon: 'none',
})
this.submit = false;
});
},
goPayHandler(item) {
let that = this;
......@@ -313,13 +143,12 @@
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function(res) {
console.log("success", res);
that.submit = false;
uni.hideLoading()
uni.showToast({
title: "支付成功",
});
that.goPayPage(item)
that.cancelSuccess();
},
fail: function(err) {
that.submit = false;
......@@ -360,42 +189,42 @@
AnotherOrder(item) {
let url = ''
// #ifdef MP-DI
if (item.goodsType > 0 && item.goodsType < 4) { //线路
const pts = ['', 2, 0, 1]
const productType = pts[item.goodsType]
url = `jiuzhai/jz_Line?teamType=${productType}`
} else if (item.goodsType > 3 && item.goodsType < 8) { //景点门票
if (item.goodsType > 0 && item.goodsType < 4) { //线路
const pts = ['', 2, 0, 1]
const productType = pts[item.goodsType]
url = `jiuzhai/jz_Line?teamType=${productType}`
} else if (item.goodsType > 3 && item.goodsType < 8) { //景点门票
} else if (item.goodsType > 7 && item.goodsType < 12) { //酒店住宿
} else if (item.goodsType > 7 && item.goodsType < 12) { //酒店住宿
} else if (item.goodsType > 11 && item.goodsType < 15) { //目的地用车
} else if (item.goodsType > 11 && item.goodsType < 15) { //目的地用车
} else if (item.goodsType == 15) { //签证
url = "visa/visaList"
} else if (item.goodsType == 16) { //机票
url = "airTicket/airIndex"
}
} else if (item.goodsType == 15) { //签证
url = "visa/visaList"
} else if (item.goodsType == 16) { //机票
url = "airTicket/airIndex"
}
// #endif
// #ifdef MP-AG
if (item.goodsType==2) { //线路
const pts = ['', 2, 0, 1]
const productType = pts[item.goodsType]
url = `jiuzhai/jz_Line?teamType=${productType}`
} else if (item.goodsType==4) { //景点门票
} else if (item.goodsType==3) { //酒店住宿
} else if (item.goodsType==7) { //道旅酒店住宿
url = "hotel/list"
} else if (item.goodsTyp==5) { //目的地用车
} else if (item.goodsType == 6) { //签证
url = "visa/visaList"
} else if (item.goodsType == 1) { //机票
url = "airTicket/airIndex"
}
if (item.goodsType == 2) { //线路
const pts = ['', 2, 0, 1]
const productType = pts[item.goodsType]
url = `jiuzhai/jz_Line?teamType=${productType}`
} else if (item.goodsType == 4) { //景点门票
} else if (item.goodsType == 3) { //酒店住宿
} else if (item.goodsType == 7) { //道旅酒店住宿
url = "hotel/list"
} else if (item.goodsTyp == 5) { //目的地用车
} else if (item.goodsType == 6) { //签证
url = "visa/visaList"
} else if (item.goodsType == 1) { //机票
url = "airTicket/airIndex"
}
// #endif
if (url) {
uni.navigateTo({
url: `/pages/${url}`,
......@@ -406,7 +235,6 @@
goDetails(item) {
let url = null
let msg = null
// #ifdef MP-DI
msg = `OrderNo=${item.orderNo}`
if (item.goodsType > 0 && item.goodsType < 4) url = `jiuzhai/jz_SureOrder?` //线路
......@@ -440,7 +268,6 @@
});
}
},
//取消订单
goCancel(item) {
let that = this
......
......@@ -421,8 +421,6 @@
pHotel.address = this.HotelInfo.location.address;
}
}
console.log("hotelRoom", pHotel);
console.log("searchroomGroup", this.searchObj.searchroomGroup);
uni.navigateTo({
url: `/pages/hotel/order?searchObj=${JSON.stringify(this.searchObj)}&HotelInfo=${JSON.stringify(pHotel)}&RoomInfo=${JSON.stringify(subItem)}&CreateBy=${createBy}`,
});
......
......@@ -210,7 +210,6 @@
size: true
}, (res) => {
that.mapCtx = wx.createMapContext('myMap');
console.log(this.mapCtx,'--------地图实例')
}).exec();
},
fitMapToBounds() {
......@@ -233,7 +232,6 @@
});
},
handleCalloutClick(marker) {
console.log('点击了标记:', marker.detail);
for (let i = 0; i < this.markers.length; i++) {
if(this.markers[i].id==marker.detail.markerId){
this.current = i
......@@ -274,13 +272,8 @@
success: (res) => {
that.fitMapToBounds();
// 更新地图中心点
// if(that.$refs.myMapRef)this.$refs.myMapRef.moveToLocation({
// longitude: res.longitude,
// latitude: res.latitude
// });
},
fail: (err) => {
console.error('定位失败', err);
wx.showModal({
title: '提示',
content: '授权失败,请检查定位权限'
......@@ -289,7 +282,6 @@
});
},
changeCurrent(e) {
// console.log(e.detail.current,'--------',this.HotelList.length-1)
this.prevCurrent = this.current
this.current = e.detail.current;
this.setNewMarkers()
......
......@@ -197,7 +197,7 @@
<view class="flex f12">
<view style="flex: 1">小计</view>
<view>
{{RoomInfo.Currency}}
{{RoomInfo.Currency}}
<!--{{ (getPrice(orderMsg.TotalPrice)*orderMsg.RoomCount)-currentCoupon.discountMoney }}-->
{{ ((orderMsg.TotalPrice*orderMsg.RoomCount*dayObj.day)-currentCoupon.discountMoney).toFixed(2) }}
</view>
......@@ -210,8 +210,7 @@
<text class="">购买说明</text>
</view>
<view class="rule">
<text class="king">此房间
<text class="king">
</text>
<text v-if="roomRateDetails&&
roomRateDetails.CancellationPolicyList &&
......@@ -509,14 +508,14 @@
Name: this.orderMsg.Name,
ContactNumber: this.orderMsg.guestPhoneNumber,
Mailbox: this.orderMsg.guestEmail,
GoodsId: this.HotelInfo.hotelId,
GoodsId: this.HotelInfo.hotelid,
GoodsName: this.HotelInfo.name,
GoodsPic: "",
GoodsType: 9,
OrderMake: `${this.orderMsg.CheckInDate}入住;${this.orderMsg.CheckOutDate}离店 ${guestInfo}`,
TotalPrice: this.orderMsg.TotalPrice,
PreferentialPrice: this.currentCoupon.discountMoney,
CouponAllotIds:"",
CouponAllotIds: "",
ErpOrderId: 0,
Country: 0,
PlatformTax: 0,
......@@ -529,10 +528,10 @@
// #endif
// #ifdef MP-AG
DOrderType: 2,
OpenId: userInfo.OpenId?userInfo.OpenId:"",
OpenId: userInfo.OpenId ? userInfo.OpenId : "",
// #endif
DiDaHotelParams: {},
CustomerId: 0,
};
let CouponAllotIds = ''
if (this.useCouponIds.length > 0) {
......@@ -545,26 +544,29 @@
//道旅酒店参数
let that = this;
var CreateBy = 0
//直客
// #ifdef MP-DI
if (this.customer.salesBaseInfo && this.customer.salesBaseInfo.employeeId) {
msg.CreateBy = this.customer.salesBaseInfo.employeeId;
}
that.orderMsg.DirectCustomerId = this.customer.customerId;
if (this.customer && this.customer.erpBaseInfo && this.customer.erpBaseInfo.employeeId) {
that.orderMsg.EmployeeIdStr = this.customer.erpBaseInfo.employeeId;
}
if (this.customer.salesBaseInfo && this.customer.salesBaseInfo.employeeId) {
msg.CreateBy = this.customer.salesBaseInfo.employeeId;
}
that.orderMsg.DirectCustomerId = this.customer.customerId;
msg.CustomerId = 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
that.orderMsg.CustomerId = this.customer.customerId
msg.CustomerId = this.customer.customerInfoChildrenId;
if (this.customer && this.customer.salesBaseInfo && this.customer.salesBaseInfo.employeeId) {
that.orderMsg.EmployeeIdStr = this.customer.salesBaseInfo.employeeId;
}
// #endif
this.orderMsg.CouponAllotIds = CouponAllotIds;
msg.DiDaHotelParams = this.orderMsg;
//道旅参数END
console.log("AddOrderInfo_post", msg);
this.apipost("AddOrderInfo_post", msg, (res) => {
this.submit = false;
if (res.resultCode == 1) {
......@@ -601,15 +603,10 @@
title: "支付成功",
});
setTimeout(() => {
//创建道旅订单
//that.createDiDaOrder();
// uni.redirectTo({
// url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
// (that.orderMsg.TotalPrice - that.currentCoupon
// .discountMoney).toFixed(2) +
// "&isFrom=5",
// });
//跳转到详情页面
uni.redirectTo({
url: "/pages/hotel/orderdetails?orderId=" + item.ErpOrderId,
});
}, 100);
},
fail: function(err) {
......@@ -626,50 +623,6 @@
},
});
},
//创建道旅订单
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) {
var dt = new Date(value);
......
This diff is collapsed.
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