Commit 2a3448e1 authored by 罗超's avatar 罗超

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

parents d0857249 a321732b
...@@ -129,16 +129,25 @@ ...@@ -129,16 +129,25 @@
<view class="fz26 color9999A5 MT5">共 {{dataModel.GuestNum}} 人</view> <view class="fz26 color9999A5 MT5">共 {{dataModel.GuestNum}} 人</view>
</view> </view>
<view class="row-aic-n"> <view class="row-aic-n">
<view v-if="dataModel.OrderState==1||dataModel.OrderState==2||dataModel.OrderState==3"
<!-- #ifdef MP-DI -->
<view v-if="dataModel.OrderState==1"
class="fz32 relative TicketOrderListCard-PrQx MR20" class="fz32 relative TicketOrderListCard-PrQx MR20"
:class="[loading?'color9999A5':'colorDEBF7B']" :class="[loading?'color9999A5':'colorDEBF7B']"
@click="cancelOrder(dataModel)">取 消</view> @click="cancelOrderZK()">取 消</view>
<!-- <view v-if="dataModel.OrderState==1||dataModel.OrderState==2" <view v-if="dataModel.OrderState==1"
class="airTicketDetailsFooter-order PXY2463 row-ajc-w fontBold" class="airTicketDetailsFooter-order PXY2463 row-ajc-w fontBold"
:class="[loading?'bgF5':'bgDEBF7B']" :class="[loading?'bgF5':'bgDEBF7B']"
@click="queren(orderMsg.ID)"> @click="submitGetCodeByOrderNo">
<text class="fz32">立即支付</text> <text class="fz32">立即支付</text>
</view> --> </view>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<view v-if="dataModel.OrderState==1||dataModel.OrderState==2||dataModel.OrderState==3"
class="fz32 relative TicketOrderListCard-PrQx MR20"
:class="[loading?'color9999A5':'colorDEBF7B']"
@click="cancelOrder(dataModel)">取 消</view>
<!-- #endif -->
<view v-if="dataModel.OrderState==5||dataModel.OrderState==4" <view v-if="dataModel.OrderState==5||dataModel.OrderState==4"
class="airTicketDetailsFooter-order PXY2463 row-ajc-w fontBold bgDEBF7B borderDEBF7B" class="airTicketDetailsFooter-order PXY2463 row-ajc-w fontBold bgDEBF7B borderDEBF7B"
@click="goUndOrder(dataModel.TCID)"> @click="goUndOrder(dataModel.TCID)">
...@@ -185,7 +194,8 @@ ...@@ -185,7 +194,8 @@
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696906397000_762.png', 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696906397000_762.png',
'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696906709000_896.png' 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1696906709000_896.png'
], ],
title:'订单详情' title:'订单详情',
OrderNo: '',
} }
}, },
onLoad(options){ onLoad(options){
...@@ -193,8 +203,14 @@ ...@@ -193,8 +203,14 @@
backgroundColor: '#ECDFC4', backgroundColor: '#ECDFC4',
frontColor:'#000000' frontColor:'#000000'
}) })
if (options.orderId){
this.orderMsg.ID = options.orderId this.orderMsg.ID = options.orderId
this.getOrderDetails() this.getOrderDetails()
} else if(options.OrderNo){
this.OrderNo = options.OrderNo
this.getOrderInfoHandler(this.OrderNo)
}
let that = this; let that = this;
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
...@@ -212,6 +228,70 @@ ...@@ -212,6 +228,70 @@
}, },
methods: { methods: {
submitGetCodeByOrderNo() {
if (this.submit || this.submitCancel) return;
this.submit = true
this.apipost("GetCodeByOrderNo_post", {
OrderNo: this.OrderNo,
MallBaseId: uni.getStorageSync("mall_UserInfo").MallBaseId
}, (res) => {
if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo)
this.goPayHandler();
} else {
uni.showToast({
title:res.message,
icon:'none',
duration:3000
})
this.submit = false;
}
});
},
goPayHandler() {
let that = this;
uni.requestPayment({
provider: "wxpay",
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function(res) {
console.log("success", res);
this.submit = false;
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
this.price +
"&isFrom=1",
});
}, 100);
},
fail: function(err) {
console.log("fail:", err);
that.submit = false;
uni.showToast({
title: "支付失败",
icon: "none",
});
},
});
},
getOrderInfoHandler(OrderNo){
this.apipost("GetDetailsByOrderNo_post",{OrderNo},res=>{
if(res.resultCode==1){
this.dataModel = res.data
this.orderMsg.ID = res.data.ErpOrderId
this.getOrderDetails()
}else{
}
})
},
goUndOrder(TCID){ goUndOrder(TCID){
uni.navigateTo({ uni.navigateTo({
url: '/pages/airTicket/airIndex' url: '/pages/airTicket/airIndex'
...@@ -235,7 +315,9 @@ ...@@ -235,7 +315,9 @@
this.orderData = res.data; this.orderData = res.data;
// IsChargeLossOrders 1是收损单 2否 // IsChargeLossOrders 1是收损单 2否
// IsApplyForCancel 1是小程序端发起取消 2否 // IsApplyForCancel 1是小程序端发起取消 2否
// #ifdef MP-AG
this.dataModel = res.data.model this.dataModel = res.data.model
// #endif
this.orderData.model.GuestList.forEach(x=>{ this.orderData.model.GuestList.forEach(x=>{
let obj = { let obj = {
SurName:x.SurName+x.Name, SurName:x.SurName+x.Name,
...@@ -475,6 +557,34 @@ ...@@ -475,6 +557,34 @@
); );
} }
}, },
cancelOrderZK(){
let that = this
if(this.loading){
return
}
uni.showLoading({
title: "请稍等片刻...",
})
this.loading = true
this.apipost(
"GetCancelOrder_post", {
OrderNo: this.OrderNo
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
that.getOrderDetails()
}
this.loading = false
},
(err) => {
this.loading = false
}
);
},
//微信支付 //微信支付
queren(OrderId) { queren(OrderId) {
if(this.loading){ if(this.loading){
......
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
}, },
checkedChange(){ checkedChange(){
const r = this.guests.filter(x=>x.Checked) const r = this.guests.filter(x=>x.Checked)
console.log('checkedChange----',r)
this.$emit('selected',r) this.$emit('selected',r)
}, },
selectedHandle(val){ selectedHandle(val){
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
required> required>
</u-field> </u-field>
</view> </view>
<!-- #ifdef MP-AG -->
<view class="flight-card q-mt-md" v-if="sales.length>1"> <view class="flight-card q-mt-md" v-if="sales.length>1">
<view class="title">服务专员</view> <view class="title">服务专员</view>
<u-field <u-field
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
required> required>
</u-field> </u-field>
</view> </view>
<!-- #endif -->
<view class="flight-card q-mt-md"> <view class="flight-card q-mt-md">
<view class="title"> <view class="title">
...@@ -162,7 +163,12 @@ ...@@ -162,7 +163,12 @@
<text style="color: #6e6e6e; font-size: 24rpx;font-family: microsoft yahei ui light;">共计{{ guest.length }}</text> <text style="color: #6e6e6e; font-size: 24rpx;font-family: microsoft yahei ui light;">共计{{ guest.length }}</text>
</view> </view>
<button class="jz_OrderReNow" @click="orderHandler" :disabled="submit" :loading="submit"> <button class="jz_OrderReNow" @click="orderHandler" :disabled="submit" :loading="submit">
<!-- #ifdef MP-DI -->
立即支付
<!-- #endif -->
<!-- #ifdef MP-AG -->
立即预定 立即预定
<!-- #endif -->
</button> </button>
</view> </view>
</view> </view>
...@@ -242,7 +248,8 @@ ...@@ -242,7 +248,8 @@
saleVisable:false, saleVisable:false,
statusVisible:false, statusVisible:false,
backVisible:false, backVisible:false,
goVisible:false goVisible:false,
orderInfo: {},
} }
}, },
components: { components: {
...@@ -313,15 +320,94 @@ ...@@ -313,15 +320,94 @@
created() { created() {
this.mainColor = this.$uiConfig.mainColor this.mainColor = this.$uiConfig.mainColor
this.customer = uni.getStorageSync("b2b_user"); this.customer = uni.getStorageSync("b2b_user");
console.log(this.customer,'----')
this.getUserCouponList() this.getUserCouponList()
// #ifdef MP-DI // #ifdef MP-DI
this.createBy.CreateBy = this.customer.pid let employeeId = this.customer.directCustomerId?this.customer.directCustomerId:0
this.createBy.CreateBy = employeeId
// #endif // #endif
// #ifdef MP-AG // #ifdef MP-AG
this.getSalesHandle() this.getSalesHandle()
// #endif // #endif
}, },
methods: { methods: {
submitB2COrderHandler(OrderId) {
let guestInfo = `${this.guest.length}人; `;
let msg = {
SurName: this.contactName,
Name: '',
ContactNumber: this.contactPhone,
Mailbox: this.customer.Mailbox,
GoodsId: this.currentPriceInfo.tcid,
GoodsName: `${this.goList[0].DepartureName}${this.backList[0].DepartureName}`,
GoodsPic: this.goList[0].AirlineUrl? this.goList[0].AirlineUrl : '',
GoodsType: 16,
OrderMake: `${guestInfo} ${this.goList[0].FlightDate}${this.goList[0].DepartureName}出发到${this.backList[0].DepartureName}; ${this.backList[this.backList.length-1].FlightDate}出发回${this.backList[this.backList.length-1].ArrivalCityName}`,
TotalPrice: this.price,
PreferentialPrice: this.currentCoupon.discountMoney,
ErpOrderId: OrderId,
Country: 0,
PlatformTax: 0,
Income: 0,
Refund: 0,
MallBaseId: uni.getStorageSync('mall_UserInfo').MallBaseId,
};
this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo)
uni.showToast({
icon: 'none',
title: '订单创建成功'
})
this.goPayHandler(res.data.OrderNo);
} else {
uni.showToast({
title:res.message,
icon:'none',
duration:3000
})
this.submit = false;
}
});
},
goPayHandler(OrderNo) {
let that = this;
uni.requestPayment({
provider: "wxpay",
timeStamp: this.orderInfo.timeStamp,
nonceStr: this.orderInfo.nonceStr,
package: this.orderInfo.package,
signType: this.orderInfo.signType,
paySign: this.orderInfo.sign,
success: function(res) {
console.log("success", res);
that.submit = false;
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
that.price +
"&isFrom=1",
});
}, 100);
},
fail: function(err) {
console.log("fail:", err);
that.submit=false
uni.showToast({
title: "支付失败",
icon: "none",
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/airTicket/TicketOrderDetails?OrderNo=" + OrderNo,
});
}, 100);
},
});
},
getSalesHandle(){ getSalesHandle(){
const p = { CustomerId: this.customer.customerId } const p = { CustomerId: this.customer.customerId }
this.apipost( "b2b_get_GetCustomerCreateByList", p,(res) => { this.apipost( "b2b_get_GetCustomerCreateByList", p,(res) => {
...@@ -355,14 +441,22 @@ ...@@ -355,14 +441,22 @@
const p = this.createParameter() const p = this.createParameter()
this.apipost('sellorder_post_SetOrderInfoForAirTicket',p,r=>{ this.apipost('sellorder_post_SetOrderInfoForAirTicket',p,r=>{
if(r.resultCode==1){ if(r.resultCode==1){
let tempData = r.data
// #ifdef MP-DI
this.submitB2COrderHandler(tempData.OrderId)
// #endif
// #ifdef MP-AG
this.successVisible=true this.successVisible=true
// #endif
}else{ }else{
uni.showToast({ uni.showToast({
icon:'error', icon:'error',
title: r.message title: r.message
}) })
} }
// #ifdef MP-AG
this.submit=false this.submit=false
// #endif
},e=>{ },e=>{
this.submit=false this.submit=false
}) })
...@@ -382,7 +476,9 @@ ...@@ -382,7 +476,9 @@
} else if(this.contactPhone=='' || this.contactPhone.length!=11){ } else if(this.contactPhone=='' || this.contactPhone.length!=11){
msg = '请输入11位联系电话' msg = '请输入11位联系电话'
} else if(this.createBy.CreateBy==0){ } else if(this.createBy.CreateBy==0){
// #ifdef MP-AG
msg = '请选择与你对接的服务人员' msg = '请选择与你对接的服务人员'
// #endif
} }
return msg return msg
}, },
...@@ -397,16 +493,20 @@ ...@@ -397,16 +493,20 @@
PassportExpiry:x.PassportExpired, PassportExpiry:x.PassportExpired,
Birthday:x.BrithDay, Birthday:x.BrithDay,
MobilePhone:x.Mobile, MobilePhone:x.Mobile,
Nationality:x.CountryId Nationality:x.CountryId,
} }
return n return n
}) })
let PriceNum = 0 let PriceNum = 0
var CreateBy = 0
var DirectCustomerId = 0
//#ifdef MP-DI //#ifdef MP-DI
PriceNum = this.flight.B2CPrice PriceNum = this.flight.B2CPrice
DirectCustomerId = this.createBy.CreateBy
//#endif //#endif
//#ifdef MP-AG //#ifdef MP-AG
PriceNum = this.flight.B2CPrice PriceNum = this.flight.B2CPrice
CreateBy = this.createBy.CreateBy
//#endif //#endif
const p = { const p = {
OrderId:0, OrderId:0,
...@@ -429,10 +529,24 @@ ...@@ -429,10 +529,24 @@
GuestNum:this.crCount+this.etCount+this.babyCount, GuestNum:this.crCount+this.etCount+this.babyCount,
PlaceOrderFrom:2, PlaceOrderFrom:2,
MiniAppUserId:mallUser.UserId, MiniAppUserId:mallUser.UserId,
DirectCustomerId:0, DirectCustomerId:DirectCustomerId,
EnterID:0, EnterID:0,
GuestList:list, GuestList:list,
CreateBy:this.createBy.CreateBy CreateBy:CreateBy,
// #ifdef MP-DI
OrderSource: 7,
// #endif
// #ifdef MP-AG
OrderSource: 5,
// #endif
// #ifdef MP-DI
ClientType: 2,
// #endif
// #ifdef MP-AG
ClientType: 1,
// #endif
CreateBy: CreateBy, //同行联系人创建人 CustomerCreateBy
DirectCustomerId: DirectCustomerId, //直客Id
} }
return p return p
}, },
......
...@@ -1889,7 +1889,7 @@ ...@@ -1889,7 +1889,7 @@
let createBy = 0 let createBy = 0
// #ifdef MP-DI // #ifdef MP-DI
let employeeId = this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId?this.customer.salesBaseInfo.employeeId:0 let employeeId = this.customer.directCustomerId?this.customer.directCustomerId:0
createBy = this.createBy>0?this.createBy:employeeId createBy = this.createBy>0?this.createBy:employeeId
// #endif // #endif
// #ifdef MP-AG // #ifdef MP-AG
......
...@@ -689,7 +689,6 @@ ...@@ -689,7 +689,6 @@
this.apipost("AddOrderInfo_post", msg, (res) => { this.apipost("AddOrderInfo_post", msg, (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo) this.orderInfo =JSON.parse(res.data.sPayInfo)
console.log(this.orderInfo,'----orderInfo');
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '订单创建成功' title: '订单创建成功'
...@@ -706,7 +705,6 @@ ...@@ -706,7 +705,6 @@
}); });
}, },
goPayHandler(OrderNo) { goPayHandler(OrderNo) {
//pay.OrderNo
let that = this; let that = this;
uni.requestPayment({ uni.requestPayment({
provider: "wxpay", provider: "wxpay",
...@@ -717,21 +715,21 @@ ...@@ -717,21 +715,21 @@
paySign: this.orderInfo.sign, paySign: this.orderInfo.sign,
success: function(res) { success: function(res) {
console.log("success", res); console.log("success", res);
this.submit = false; that.submit = false;
uni.showToast({ uni.showToast({
title: "支付成功", title: "支付成功",
}); });
setTimeout(() => { setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
this.price + that.price +
"&isFrom=1", "&isFrom=1",
}); });
}, 100); }, 100);
}, },
fail: function(err) { fail: function(err) {
console.log("fail:", err); console.log("fail:", err);
this.submit = false; that.submit = false;
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
......
...@@ -544,20 +544,29 @@ ...@@ -544,20 +544,29 @@
</view> </view>
<view class="jz_orderbox flex"> <view class="jz_orderbox flex">
<view style="display: flex" v-if="showPayBtn"> <view style="display: flex" v-if="showPayBtn">
<button class="jz_OrderReNow" @click="goCancel" <!-- #ifdef MP-DI -->
<button class="jz_OrderReNow" @click="goCancelZK"
style="background: #fff; color: #111; border: 1px solid #111" style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel" :disabled="submitCancel"
:loading="submitCancel"> :loading="submitCancel">
<text v-if="!submitCancel">取消</text> <text v-if="!submitCancel">取消</text>
<u-loading v-if="submitCancel" size="32" color="#111"></u-loading> <u-loading v-if="submitCancel" size="32" color="#111"></u-loading>
</button> </button>
<!-- #ifdef MP-DI -->
<button class="jz_OrderReNow" <button class="jz_OrderReNow"
style="margin-left: 20rpx;" style="margin-left: 20rpx;"
@click="submitGetCodeByOrderNo" :disabled="submit" :loading="submit"> @click="submitGetCodeByOrderNo" :disabled="submit" :loading="submit">
立即支付 立即支付
</button> </button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-AG -->
<button class="jz_OrderReNow" @click="goCancel"
style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel"
:loading="submitCancel">
<text v-if="!submitCancel">取消</text>
<u-loading v-if="submitCancel" size="32" color="#111"></u-loading>
</button>
<!-- #endif -->
<!-- 返回上一页 --> <!-- 返回上一页 -->
<!-- <view <!-- <view
class="jz_OrderReNow" class="jz_OrderReNow"
...@@ -622,6 +631,7 @@ ...@@ -622,6 +631,7 @@
}, },
methods: { methods: {
submitGetCodeByOrderNo() { submitGetCodeByOrderNo() {
if (this.submit || this.submitCancel) return;
this.submit = true this.submit = true
this.apipost("GetCodeByOrderNo_post", { this.apipost("GetCodeByOrderNo_post", {
OrderNo: this.OrderNo, OrderNo: this.OrderNo,
...@@ -629,7 +639,6 @@ ...@@ -629,7 +639,6 @@
}, (res) => { }, (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo) this.orderInfo =JSON.parse(res.data.sPayInfo)
console.log(this.orderInfo,'----orderInfo');
this.goPayHandler(); this.goPayHandler();
} else { } else {
uni.showToast({ uni.showToast({
...@@ -652,14 +661,14 @@ ...@@ -652,14 +661,14 @@
paySign: this.orderInfo.sign, paySign: this.orderInfo.sign,
success: function(res) { success: function(res) {
console.log("success", res); console.log("success", res);
this.submit = false; that.submit = false;
uni.showToast({ uni.showToast({
title: "支付成功", title: "支付成功",
}); });
setTimeout(() => { setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
this.price + that.price +
"&isFrom=1", "&isFrom=1",
}); });
}, 100); }, 100);
...@@ -678,6 +687,11 @@ ...@@ -678,6 +687,11 @@
this.apipost("GetDetailsByOrderNo_post",{OrderNo},res=>{ this.apipost("GetDetailsByOrderNo_post",{OrderNo},res=>{
if(res.resultCode==1){ if(res.resultCode==1){
this.initOrderInfo(res.data.ErpOrderId); this.initOrderInfo(res.data.ErpOrderId);
this.formatStatus(
res.data.OrderStatus,
null,
null
);
}else{ }else{
} }
...@@ -746,6 +760,32 @@ ...@@ -746,6 +760,32 @@
); );
} }
}, },
goCancelZK() {
if (this.submit || this.submitCancel) return;
this.submitCancel = true;
if (this.orderData.model.OrderState == 2) {
this.apipost(
"GetCancelOrder_post", {
OrderNo: this.OrderNo
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
uni.navigateTo({
url: "/pages/jiuzhai/jz_MyOrder",
});
}
this.submitCancel = false
},
(err) => {
this.submitCancel = false
}
);
}
},
getWeek(date) { getWeek(date) {
var weekArray = new Array("日", "一", "二", "三", "四", "五", "六"); var weekArray = new Array("日", "一", "二", "三", "四", "五", "六");
var week = weekArray[new Date(date).getDay()]; //注意此处必须是先new一个Date var week = weekArray[new Date(date).getDay()]; //注意此处必须是先new一个Date
...@@ -767,12 +807,16 @@ ...@@ -767,12 +807,16 @@
msg, msg,
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.orderData = res.data; this.orderData = {
...res.data
};
// #ifdef MP-AG
this.formatStatus( this.formatStatus(
this.orderData.model.OrderState, this.orderData.model.OrderState,
this.orderData.model.IsChargeLossOrders, this.orderData.model.IsChargeLossOrders,
this.orderData.model.IsApplyForCancel this.orderData.model.IsApplyForCancel
); );
// #endif
} else { } else {
this.orderData = { this.orderData = {
result: -1, result: -1,
...@@ -784,6 +828,27 @@ ...@@ -784,6 +828,27 @@
); );
}, },
formatStatus(status, loss, isCancel) { formatStatus(status, loss, isCancel) {
console.log(status, '------');
// #ifdef MP-DI
if(status==1){
this.orderStatus.code = 0;
this.orderStatus.text = "待付款";
this.showPayBtn = true;
}else if(status==2){
this.orderStatus.code = 1;
this.orderStatus.text = "已付款";
this.showPayBtn = false;
}else if(status==3){
this.orderStatus.code = 1;
this.orderStatus.text = "已完成";
this.showPayBtn = false;
}else if(status==4){
this.orderStatus.code = -1;
this.orderStatus.text = "已取消";
this.showPayBtn = false;
}
// #endif
// #ifdef MP-AG
loss = loss ? loss : -1; loss = loss ? loss : -1;
//1、已申请;!=1未申请 //1、已申请;!=1未申请
if (loss == 1 || status == 4) { if (loss == 1 || status == 4) {
...@@ -797,9 +862,7 @@ ...@@ -797,9 +862,7 @@
} else if (status == 3 && isCancel != 1) { } else if (status == 3 && isCancel != 1) {
this.orderStatus.code = 0; this.orderStatus.code = 0;
this.orderStatus.text = "候补中"; this.orderStatus.text = "候补中";
// #ifdef MP-AG
this.showPayBtn = true; this.showPayBtn = true;
// #endif
} else if (status == 2 && isCancel == 1) { } else if (status == 2 && isCancel == 1) {
this.orderStatus.code = -2; this.orderStatus.code = -2;
this.orderStatus.text = "审核中"; this.orderStatus.text = "审核中";
...@@ -809,6 +872,7 @@ ...@@ -809,6 +872,7 @@
this.orderStatus.text = "正常"; this.orderStatus.text = "正常";
this.showPayBtn = false; this.showPayBtn = false;
} }
// #endif
}, },
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
goFukuan() { goFukuan() {
......
...@@ -728,7 +728,7 @@ ...@@ -728,7 +728,7 @@
// #endif // #endif
let createBy = 0 let createBy = 0
// #ifdef MP-DI // #ifdef MP-DI
let employeeId = this.customer.salesBaseInfo&&this.customer.salesBaseInfo.employeeId?this.customer.salesBaseInfo.employeeId:0 let employeeId = this.customer.directCustomerId?this.customer.directCustomerId:0
createBy = this.createBy>0?this.createBy:employeeId createBy = this.createBy>0?this.createBy:employeeId
// #endif // #endif
// #ifdef MP-AG // #ifdef MP-AG
......
...@@ -896,21 +896,21 @@ ...@@ -896,21 +896,21 @@
paySign: this.orderInfo.sign, paySign: this.orderInfo.sign,
success: function(res) { success: function(res) {
console.log("success", res); console.log("success", res);
this.submit = false; that.submit = false;
uni.showToast({ uni.showToast({
title: "支付成功", title: "支付成功",
}); });
setTimeout(() => { setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
this.price + that.price +
"&isFrom=1", "&isFrom=1",
}); });
}, 100); }, 100);
}, },
fail: function(err) { fail: function(err) {
console.log("fail:", err); console.log("fail:", err);
this.submit = false; that.submit = false;
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
......
...@@ -512,19 +512,29 @@ ...@@ -512,19 +512,29 @@
</view> </view>
<view class="jz_orderbox flex" v-if="showPayBtn"> <view class="jz_orderbox flex" v-if="showPayBtn">
<view style="display: flex"> <view style="display: flex">
<button class="jz_OrderReNow" @click="goCancel" <!-- #ifdef MP-DI -->
<button class="jz_OrderReNow" @click="goCancelZK"
style="background: #fff; color: #111; border: 1px solid #111" style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel" :loading="submitCancel"> :disabled="submitCancel"
:loading="submitCancel">
<text v-if="!submitCancel">取消</text> <text v-if="!submitCancel">取消</text>
<u-loading v-if="submitCancel" size="32" color="#111"></u-loading> <u-loading v-if="submitCancel" size="32" color="#111"></u-loading>
</button> </button>
<!-- #ifdef MP-DI -->
<button class="jz_OrderReNow" <button class="jz_OrderReNow"
style="margin-left: 20rpx;" style="margin-left: 20rpx;"
@click="submitGetCodeByOrderNo" :disabled="submit" :loading="submit"> @click="submitGetCodeByOrderNo" :disabled="submit" :loading="submit">
立即支付 立即支付
</button> </button>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-AG -->
<button class="jz_OrderReNow" @click="goCancel"
style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel"
:loading="submitCancel">
<text v-if="!submitCancel">取消</text>
<u-loading v-if="submitCancel" size="32" color="#111"></u-loading>
</button>
<!-- #endif -->
<!-- 返回上一页 --> <!-- 返回上一页 -->
<!-- <view <!-- <view
class="jz_OrderReNow" class="jz_OrderReNow"
...@@ -590,6 +600,7 @@ ...@@ -590,6 +600,7 @@
}, },
methods: { methods: {
submitGetCodeByOrderNo() { submitGetCodeByOrderNo() {
if (this.submit || this.submitCancel) return;
this.submit = true this.submit = true
this.apipost("GetCodeByOrderNo_post", { this.apipost("GetCodeByOrderNo_post", {
OrderNo: this.OrderNo, OrderNo: this.OrderNo,
...@@ -597,7 +608,6 @@ ...@@ -597,7 +608,6 @@
}, (res) => { }, (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.orderInfo =JSON.parse(res.data.sPayInfo) this.orderInfo =JSON.parse(res.data.sPayInfo)
console.log(this.orderInfo,'----orderInfo');
this.goPayHandler(); this.goPayHandler();
} else { } else {
uni.showToast({ uni.showToast({
...@@ -620,14 +630,14 @@ ...@@ -620,14 +630,14 @@
paySign: this.orderInfo.sign, paySign: this.orderInfo.sign,
success: function(res) { success: function(res) {
console.log("success", res); console.log("success", res);
this.submit = false; that.submit = false;
uni.showToast({ uni.showToast({
title: "支付成功", title: "支付成功",
}); });
setTimeout(() => { setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: "/pages/jiuzhai/paysuccess?PreferPrice=" + url: "/pages/jiuzhai/paysuccess?PreferPrice=" +
this.price + that.price +
"&isFrom=1", "&isFrom=1",
}); });
}, 100); }, 100);
...@@ -646,6 +656,12 @@ ...@@ -646,6 +656,12 @@
this.apipost("GetDetailsByOrderNo_post",{OrderNo},res=>{ this.apipost("GetDetailsByOrderNo_post",{OrderNo},res=>{
if(res.resultCode==1){ if(res.resultCode==1){
this.initOrderInfo(res.data.ErpOrderId); this.initOrderInfo(res.data.ErpOrderId);
this.formatStatus(
res.data.OrderStatus,
null,
null,
null
);
}else{ }else{
} }
...@@ -702,6 +718,32 @@ ...@@ -702,6 +718,32 @@
}) })
} }
}, },
goCancelZK() {
if (this.submit || this.submitCancel) return;
this.submitCancel = true;
if (this.orderData.model.OrderState == 2) {
this.apipost(
"GetCancelOrder_post", {
OrderNo: this.OrderNo
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
uni.navigateTo({
url: "/pages/jiuzhai/jz_MyOrder",
});
}
this.submitCancel = false
},
(err) => {
this.submitCancel = false
}
);
}
},
getWeek(date) { getWeek(date) {
var weekArray = new Array("日", "一", "二", "三", "四", "五", "六"); var weekArray = new Array("日", "一", "二", "三", "四", "五", "六");
var week = weekArray[new Date(date).getDay()]; //注意此处必须是先new一个Date var week = weekArray[new Date(date).getDay()]; //注意此处必须是先new一个Date
...@@ -723,12 +765,15 @@ ...@@ -723,12 +765,15 @@
(res) => { (res) => {
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.orderData = res.data; this.orderData = res.data;
// #ifdef MP-AG
this.formatStatus( this.formatStatus(
this.orderData.OrderModel.VisaOrderStatus, this.orderData.OrderModel.VisaOrderStatus,
this.orderData.OrderModel.Income, this.orderData.OrderModel.Income,
this.orderData.OrderModel.TotalPrice, this.orderData.OrderModel.TotalPrice,
this.orderData.OrderModel.PlatformTax this.orderData.OrderModel.PlatformTax
); );
// #endif
} else { } else {
this.orderData = { this.orderData = {
result: -1, result: -1,
...@@ -739,6 +784,26 @@ ...@@ -739,6 +784,26 @@
); );
}, },
formatStatus(status,Income,TotalPrice,PlatformTax) { formatStatus(status,Income,TotalPrice,PlatformTax) {
// #ifdef MP-DI
if(status==1){
this.orderStatus.code = 0;
this.orderStatus.text = "待付款";
this.showPayBtn = true;
}else if(status==2){
this.orderStatus.code = 1;
this.orderStatus.text = "已付款";
this.showPayBtn = false;
}else if(status==3){
this.orderStatus.code = 1;
this.orderStatus.text = "已完成";
this.showPayBtn = false;
}else if(status==4){
this.orderStatus.code = -1;
this.orderStatus.text = "已取消";
this.showPayBtn = false;
}
// #endif
// #ifdef MP-AG
if (status == 2) { if (status == 2) {
this.orderStatus.code = -1; this.orderStatus.code = -1;
this.orderStatus.text = "已取消"; this.orderStatus.text = "已取消";
...@@ -756,6 +821,7 @@ ...@@ -756,6 +821,7 @@
this.orderStatus.text = "已付款"; this.orderStatus.text = "已付款";
this.showPayBtn = false; this.showPayBtn = false;
} }
// #endif
}, },
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
goFukuan() { goFukuan() {
......
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