Commit bcd66615 authored by 黄奎's avatar 黄奎

订单支付测试

parent dcc6a194
......@@ -183,7 +183,9 @@
x.orderStatusInfo = EnumHelper.ParseToEnum(OrderStatusEnum, x.orderStatus,
'value')
})
this.g = this.g.concat(res.data.pageData);
console.log("res.data.pageData",res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
......
......@@ -49,6 +49,7 @@
<!-- #ifdef MP-DI -->
<view v-if="item.orderStatus==1||item.orderStatus==2" class="jz_Zailai"
style="width: 110rpx;margin-left: 10rpx;" @click.stop="goCancelZK(item)">取消</view>
<view v-if="item.orderStatus==1" class="jz_Zailai jz_ZailaiZF"
style="width: 150rpx;margin-left: 10rpx;" @click.stop="submitGetCodeByOrderNo(item)">
立即支付</view>
......@@ -56,7 +57,9 @@
@click.stop="AnotherOrder(item)">再来一单</view>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<view v-if="item.income == 0&&item.orderStatus==1" class="jz_Zailai"
<view v-if="item.goodsType==7&&(item.orderStatus==1||item.orderStatus==2)" class="jz_Zailai"
style="width: 110rpx;margin-left: 10rpx;" @click.stop="cancelHotelOrder(item)">取消</view>
<view v-if="item.goodsType!=7&&item.income == 0&&item.orderStatus==1" class="jz_Zailai"
style="width: 110rpx;margin-left: 10rpx;" @click.stop="goCancel(item)">取消</view>
<view v-if="item.goodsType==7&&item.orderStatus==1" class="jz_Zailai jz_ZailaiZF"
style="width: 150rpx;margin-left: 10rpx;" @click.stop="submitGetCodeByOrderNo(item)">
......@@ -105,6 +108,92 @@
cancelSuccess() {
this.$emit('research', 5)
},
//取消酒店订单
cancelHotelOrder(item) {
var that = this;
if (this.submitCancel) return
this.submitCancel = true;
var cancelMsg = {
OrderNo: item.directOrderNo, //注意这是直客表的订单流水号
ErpOrderId: item.erpOrderId, //这是第三方订单表的Id
OrderTypeStr: "Hotel", //订单类型为酒店
ConfirmID: "",
};
wx.showModal({
title: '提示',
content: '确定取消订单?',
success: (tip) => {
if (tip.confirm) {
that.submitCancel = true
//待付款-直接取消
if (item.orderStatus == 1) {
that.cancelOrder(cancelMsg)
}
//已付款,可能会有取消费用
else if (item.orderStatus == 2) {
var didaMsg = {
BookingID: item.thirdOrderNo
}
that.apipost("dmc_post_GetDiDaBookingCancel", didaMsg, (res) => {
if (res.resultCode == 1) {
var tempData = res.data;
if (tempData) {
cancelMsg.ConfirmID = tempData.ConfirmID;
//有取消费用
if (tempData.Amount && tempData.Amount > 0) {
var tipmsg = "取消订单将收取【" + tempData.Amount +
"】取消费用,是否确认取消订单?"
wx.showModal({
title: '提示',
content: tipmsg,
success: (tip) => {
if (tip.confirm) {
that.submitCancel = true;
that.cancelOrder(cancelMsg);
}
}
})
}
//无取消费用
else {
that.cancelOrder(cancelMsg);
}
}
}
},
(err) => {
uni.showToast({
title: err.message,
icon: "none",
});
that.submitCancel = false
})
}
}
}
})
},
cancelOrder(postMsg) {
this.apipost(
"post_CancelThirdHotelOrder", postMsg,
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
this.$emit('research');
}
},
(err) => {
uni.showToast({
title: err.message,
icon: "none",
});
this.submitCancel = false
}
);
},
//调用支付
submitGetCodeByOrderNo(item) {
console.log("item", item)
......@@ -224,7 +313,6 @@
url = "airTicket/airIndex"
}
// #endif
if (url) {
uni.navigateTo({
url: `/pages/${url}`,
......@@ -268,7 +356,7 @@
});
}
},
//取消订单
//取消订单(同行订单取消)
goCancel(item) {
let that = this
if (this.submit || this.submitCancel) return
......@@ -308,6 +396,7 @@
cancelModal() {
this.showModal = false
},
//直客订单取消
goCancelZK(item) {
if (item.orderStatus == 2) {
this.currentData = item
......
......@@ -46,7 +46,6 @@
<text></text>
</view>
</view>
</view>
</view>
</template>
......
......@@ -51,7 +51,7 @@
<view class="row">
<view class="column">
<view class="hotelDetailRPrice">
{{subItem.Currency }}
{{subItem.Currency }}
<text>
{{subItem.TotalPrice}}
</text>起/晚
......@@ -64,11 +64,11 @@
</view>
<!--:class="[!index?'active':'']"-->
<view class="column hotelDetailRPriceBook">
<!--<text v-if="!index" class="hotelDetailMinXiRS">剩2间</text>-->
<view class="hotelDetailMinXiRB" @click="setOrder(subItem)">
</view>
<!--<text v-if="!index" class="hotelDetailMinXiRS">剩2间</text>-->
<view class="hotelDetailMinXiRB" @click="setOrder(subItem)">
</view>
</view>
<!-- <view class="hotelDetailRPriceBook" @click="setOrder(subItem)">
</view> -->
......@@ -110,7 +110,7 @@
<view class="column">
<view class="hotelDetailMinXiRF"> </view>
<view class="hotelDetailMinXiRP">
{{subItem.Currency }}
{{subItem.Currency }}
<text>
{{subItem.TotalPrice}}
</text>
......@@ -136,18 +136,16 @@
</view>
</view>
</view>
<u-popup v-model="showSalePreviwe" mode="bottom"
border-radius="50" length="60%"
:safe-area-inset-bottom="true">
<orderService :msg="msg" :list="SaleList" @goReserce="goReserce"></orderService>
</u-popup>
<u-popup v-model="showSalePreviwe" mode="bottom" border-radius="50" length="60%" :safe-area-inset-bottom="true">
<orderService :msg="msg" :list="SaleList" @goReserce="goReserce"></orderService>
</u-popup>
</view>
</template>
<script>
import orderService from "@/components/serviceStaff/orderService";
export default {
props: ['roomMsg', 'dataList', 'search', 'rooms', 'qRoomType', 'qMealType','createById'],
props: ['roomMsg', 'dataList', 'search', 'rooms', 'qRoomType', 'qMealType', 'createById'],
components: {
orderService,
},
......@@ -171,7 +169,7 @@
qMealTypeList: [],
b2bUser: null,
SaleList: [],
msg:{
msg: {
SaleName: '',
SaleId: 0,
},
......@@ -263,39 +261,38 @@
});
},
methods: {
goReserce(item){
goReserce(item) {
this.msg.SaleName = item.SaleName
this.msg.SaleId = item.SaleId
setTimeout(()=>{
setTimeout(() => {
this.showSalePreviwe = false
},500)
}, 500)
this.goUrl()
},
getSale(){
if(!this.b2bUser.customerId) return
getSale() {
if (!this.b2bUser.customerId) return
this.apipost(
"b2b_get_GetCustomerCreateByList",
{
"b2b_get_GetCustomerCreateByList", {
CustomerId: this.b2bUser.customerId
},
(res) => {
if (res.resultCode == 1) {
if(res.data.length>0){
if (res.data.length > 0) {
this.SaleList = res.data
if(res.data.length==1&&this.createBy==0){
if (res.data.length == 1 && this.createBy == 0) {
this.msg.SaleName = res.data[0].EmName
this.msg.SaleId = res.data[0].CreateBy
}
}else{
} else {
this.msg.SaleName = ''
this.msg.SaleId = 0
}
} else {
}
},
(err) => {
}
);
},
......@@ -382,14 +379,14 @@
setOrder(subItem) {
this.subItem = subItem
// #ifdef MP-AG
if (this.SaleList&&this.SaleList.length>1&&this.msg.SaleId==0&&this.createBy==0) {
// uni.showToast({
// title: "请选择服务人员",
// icon: "none",
// });
this.showSalePreviwe = true;
return;
}
if (this.SaleList && this.SaleList.length > 1 && this.msg.SaleId == 0 && this.createBy == 0) {
// uni.showToast({
// title: "请选择服务人员",
// icon: "none",
// });
this.showSalePreviwe = true;
return;
}
// #endif
this.goUrl()
},
......@@ -397,19 +394,17 @@
let subItem = this.subItem
let createBy = 0
// #ifdef MP-DI
let employeeId = this.b2bUser.salesBaseInfo&&this.b2bUser.salesBaseInfo.employeeId?this.b2bUser.salesBaseInfo.employeeId:0
createBy = this.createBy>0?this.createBy:employeeId
let employeeId = this.b2bUser.salesBaseInfo && this.b2bUser.salesBaseInfo.employeeId ? this.b2bUser
.salesBaseInfo.employeeId : 0
createBy = this.createBy > 0 ? this.createBy : employeeId
// #endif
// #ifdef MP-AG
if(this.createBy>0||this.msg.SaleId) createBy = this.createBy>0?this.createBy:this.msg.SaleId
if (this.createBy > 0 || this.msg.SaleId) createBy = this.createBy > 0 ? this.createBy : this.msg.SaleId
// #endif
let pHotel = {
hotelid: this.HotelInfo.hotelid,
name: this.HotelInfo.name,
address: "",
images: [],
destination: this.HotelInfo.location&&this.HotelInfo.location.destination&&this.HotelInfo.location.destination.name,
country: this.HotelInfo.location&&this.HotelInfo.location.country&&this.HotelInfo.location.country.name,
}
if (this.HotelInfo) {
if (this.HotelInfo.images && this.HotelInfo.images.length > 0) {
......@@ -417,9 +412,6 @@
Path: this.HotelInfo.images[0].url
});
}
if (this.HotelInfo.location&&this.HotelInfo.location.address) {
pHotel.address = this.HotelInfo.location.address;
}
}
uni.navigateTo({
url: `/pages/hotel/order?searchObj=${JSON.stringify(this.searchObj)}&HotelInfo=${JSON.stringify(pHotel)}&RoomInfo=${JSON.stringify(subItem)}&CreateBy=${createBy}`,
......@@ -1343,17 +1335,21 @@
line-height: 81rpx;
text-align: center;
}
.hotelDetailRPriceBook.active{
.hotelDetailRPriceBook.active {
position: relative;
top: -45rpx;
}
.hotelDetailMinXiRBBox {
margin-left: 16rpx;
}
.hotelDetailMinXiRBBox.active{
.hotelDetailMinXiRBBox.active {
position: relative;
top: -20rpx;
}
.hotelDetailMinXiRF {
height: 1px;
flex: 1;
......
......@@ -202,11 +202,10 @@
<view style="height: 1rpx;"></view>
</scroll-view>
<view class="jz_orderbox flex" v-if="showPayBtn">
<view class="jz_orderbox flex">
<view style="display: flex">
<!-- #ifdef MP-DI -->
<button v-if="orderData.model.OrderStatus==1||orderData.model.OrderStatus==5" class="jz_OrderReNow"
@click="goCancel" style="background: #fff; color: #111; border: 1px solid #111"
@click="cancelHotelOrder" style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel" :loading="submitCancel">
取消
</button>
......@@ -214,18 +213,6 @@
@click="payHotelOrder" :disabled="submit" :loading="submit">
立即支付
</button>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<button v-if="orderData.model.OrderStatus==1||orderData.model.OrderStatus==5" 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="payHotelOrder" :disabled="submit" :loading="submit">
立即支付
</button>
<!-- #endif -->
</view>
</view>
</view>
......@@ -255,7 +242,6 @@
text: "待支付",
code: 0,
},
showPayBtn: false,
btnStyle: {
height: "80rpx",
lineHeight: "80rpx",
......@@ -267,11 +253,6 @@
width: '193rpx',
},
orderData: null,
orderStatus: {
code: 0,
text: "",
},
showPayBtn: true,
submitCancel: false,
submit: false,
hotelData: null,
......@@ -281,47 +262,6 @@
roomNum: 0,
RatePlanList: null,
HotelMealTypes: [],
orderMsg: {
ArrivalTime: '', //预计到达时间
EmployeeIdStr: "", //销售id
CheckInDate: "", //到店时间
RatePlanID: "",
CheckOutDate: "", //离店时间
RoomCount: "", //房间数量
guestLastName: "", //英文姓
guestFirstName: "", //英文名
guestAddress: "",
guestPhoneNumber: "",
guestEmail: "", //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: '', //备注
},
customer: {},
};
},
......@@ -353,7 +293,7 @@
var payMsg = {
OrderNo: this.orderData.directOrder.OrderNo,
OpenId: userInfo.OpenId,
MallBaseId:userInfo.MallBaseId,
MallBaseId: userInfo.MallBaseId,
};
this.submit = true
this.apipost("GetCodeByOrderNo_post", payMsg, (res) => {
......@@ -400,160 +340,108 @@
},
});
},
goCancel() {
cancelHotelOrder() {
var that = this;
if (this.submitCancel) return
this.submitCancel = true;
var cancelMsg = {
let cancelMsg = {
OrderNo: this.orderData.directOrder.OrderNo,
ErpOrderId: this.orderData.model.OrderID,
OrderTypeStr: "Hotel", //订单类型为酒店
ConfirmID: "",
};
//待付款-直接取消
if (this.orderData.model.OrderStatus == 1) {
this.apipost(
"post_CancelThirdHotelOrder", cancelMsg,
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
this.getOrderDetail(this.id)
wx.showModal({
title: '提示',
content: '确定取消订单?',
success: (tip) => {
if (tip.confirm) {
that.submitCancel = true
//待付款-直接取消
if (that.orderData.model.OrderStatus == 1) {
that.cancelOrder(cancelMsg)
}
},
(err) => {
uni.showToast({
title: err.message,
icon: "none",
});
this.submitCancel = false
}
);
}
//已付款,可能会有取消费用
else if (this.orderData.model.OrderStatus == 5) {
var didaMsg = {
BookingID: this.orderData.model.ThirdOrderNo
}
this.apipost("dmc_post_GetDiDaBookingCancel", didaMsg, (res) => {
if (res.resultCode == 1) {
var tempData = res.data;
console.log("tempData", tempData);
if (tempData) {
cancelMsg.ConfirmID = tempData.ConfirmID;
//有取消费用
if (tempData.Amount && tempData.Amount > 0) {
var tipmsg = "取消订单将收取【" + tempData.Amount + "】取消费用,是否确认取消订单?"
wx.showModal({
title: '提示',
content: tipmsg,
success: (tip) => {
if (tip.confirm) {
that.submitCancel = true
that.apipost(
"post_CancelThirdHotelOrder", cancelMsg,
(res) => {
that.submitCancel = false
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
that.$emit('research');
//已付款,可能会有取消费用
else if (that.orderData.model.OrderStatus == 5) {
var didaMsg = {
BookingID: that.orderData.model.ThirdOrderNo
}
that.apipost("dmc_post_GetDiDaBookingCancel", didaMsg, (res) => {
if (res.resultCode == 1) {
var tempData = res.data;
if (tempData) {
cancelMsg.ConfirmID = tempData.ConfirmID;
//有取消费用
if (tempData.Amount && tempData.Amount > 0) {
var tipmsg = "取消订单将收取【" + tempData.Amount +
"】取消费用,是否确认取消订单?"
wx.showModal({
title: '提示',
content: tipmsg,
success: (tip) => {
if (tip.confirm) {
that.submitCancel = true;
that.cancelOrder(cancelMsg);
}
},
(err) => {
that.submitCancel = false
uni.showToast({
title: err.message,
icon: "none",
})
}
);
})
}
}
})
}
//无取消费用
else {
that.apipost(
"post_CancelThirdHotelOrder", cancelMsg,
(res) => {
that.submitCancel = false
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
that.$emit('research');
//无取消费用
else {
that.cancelOrder(cancelMsg);
}
},
(err) => {
that.submitCancel = false
uni.showToast({
title: err.message,
icon: "none",
})
}
);
}
}
}
},
(err) => {
uni.showToast({
title: err.message,
icon: "none",
});
that.submitCancel = false
})
}
},
(err) => {
}
}
})
},
cancelOrder(postMsg) {
this.apipost(
"post_CancelThirdHotelOrder", postMsg,
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: err.message,
icon: "none",
title: "操作成功",
icon: "success",
});
this.submitCancel = false
})
}
this.getOrderDetail(this.id)
}
},
(err) => {
uni.showToast({
title: err.message,
icon: "none",
});
this.submitCancel = false
}
);
},
formatStatus(status) {
// #ifdef MP-DI
if (status == 4) {
this.orderStatus.code = -1;
this.orderStatus.text = "已取消";
this.showPayBtn = false;
} else if (status == 1) {
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;
} else if (status == 5) {
this.orderStatus.code = 0;
this.orderStatus.text = "售后";
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 = "退款中";
} else if (status == 4) {
this.orderStatus.code = -1;
this.orderStatus.text = "已退款";
} else if (status == 5) {
this.orderStatus.code = 0;
this.orderStatus.text = "正常";
this.showPayBtn = false;
}
// #endif
},
scroll(e) {
this.old.scrollTop = e.detail.scrollTop
......@@ -595,48 +483,6 @@
this.peopleNum++
})
})
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.formatStatus(res.data.model.OrderStatus);
}
}, err => {
......
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