Commit a3808913 authored by youjie's avatar youjie

线路支付

parent c21784bf
...@@ -635,13 +635,6 @@ ...@@ -635,13 +635,6 @@
this.getUserCouponList(); this.getUserCouponList();
}, },
methods: { methods: {
getUserInfoHandler() {
this.apipost("GetCustomerInfo_post", { Id: this.customer.customerId }, (res) => {
if (res.resultCode == 1) {
// this.userInfo = res.data;
}
});
},
submitB2COrderHandler(OrderId) { submitB2COrderHandler(OrderId) {
let productType = 0 let productType = 0
if (this.currentPriceInfo.teamType == "0") { if (this.currentPriceInfo.teamType == "0") {
...@@ -686,13 +679,13 @@ ...@@ -686,13 +679,13 @@
}; };
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) this.orderInfo =JSON.parse(res.data.sPayInfo)
console.log(this.orderInfo,'----orderInfo'); console.log(this.orderInfo,'----orderInfo');
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '订单创建成功' title: '订单创建成功'
}) })
this.goPayHandler(OrderId); this.goPayHandler(res.data.OrderNo);
} else { } else {
uni.showToast({ uni.showToast({
title:res.message, title:res.message,
...@@ -703,7 +696,7 @@ ...@@ -703,7 +696,7 @@
} }
}); });
}, },
goPayHandler(OrderId) { goPayHandler(OrderNo) {
//pay.OrderNo //pay.OrderNo
let that = this; let that = this;
uni.requestPayment({ uni.requestPayment({
...@@ -736,7 +729,7 @@ ...@@ -736,7 +729,7 @@
}); });
setTimeout(() => { setTimeout(() => {
uni.redirectTo({ uni.redirectTo({
url: "/pages/jiuzhai/jz_SureOrder?orderId=" + OrderId, url: "/pages/jiuzhai/jz_SureOrder?OrderNo=" + OrderNo,
}); });
}, 100); }, 100);
}, },
...@@ -1041,7 +1034,7 @@ ...@@ -1041,7 +1034,7 @@
MiniAppUserId = this.userInfo.UserId; MiniAppUserId = this.userInfo.UserId;
} }
var ContactName = this.customer.name; //联系人 var ContactName = this.customer.SurName+this.customer.name; //联系人
var ContactMobile = this.customer.contactNumber; //联系电话 var ContactMobile = this.customer.contactNumber; //联系电话
var CustomerType = 0; var CustomerType = 0;
// #ifdef MP-DI // #ifdef MP-DI
...@@ -1105,7 +1098,6 @@ ...@@ -1105,7 +1098,6 @@
TradeDate: this.currentPriceInfo.startDate, TradeDate: this.currentPriceInfo.startDate,
CostType: 0, CostType: 0,
MinOrderPrice: 0, MinOrderPrice: 0,
Remarks: "",
VisaNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum + this.orderMsg.BabyNum, VisaNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum + this.orderMsg.BabyNum,
SafeNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum + this.orderMsg.BabyNum, SafeNum: this.orderMsg.ManNum + this.orderMsg.ChirdNum + this.orderMsg.BabyNum,
AirticketNum: 0, AirticketNum: 0,
......
...@@ -535,10 +535,20 @@ ...@@ -535,10 +535,20 @@
</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">
<view class="jz_OrderReNow" @click="goCancel" style="background: #fff; color: #111; border: 1px solid #111"> <button class="jz_OrderReNow" @click="goCancel"
style="background: #fff; color: #111; border: 1px solid #111"
: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>
</view> </button>
<!-- #ifdef MP-DI -->
<button class="jz_OrderReNow"
style="margin-left: 20rpx;"
@click="submitGetCodeByOrderNo" :disabled="submit" :loading="submit">
立即支付
</button>
<!-- #endif -->
<!-- 返回上一页 --> <!-- 返回上一页 -->
<!-- <view <!-- <view
class="jz_OrderReNow" class="jz_OrderReNow"
...@@ -586,17 +596,89 @@ ...@@ -586,17 +596,89 @@
submit: false, submit: false,
submitCancel: false, submitCancel: false,
showPayBtn: true, showPayBtn: true,
orderInfo:null,
OrderNo: '',
}; };
}, },
created() {}, created() {},
onLoad(option) { onLoad(option) {
if (option.orderData) { if (option.orderData) {
this.orderData = JSON.parse(decodeURIComponent(option.orderData)); this.orderData = JSON.parse(decodeURIComponent(option.orderData));
this.getOrderInfoHandler()
} else if (option.orderId) { } else if (option.orderId) {
this.initOrderInfo(option.orderId); this.initOrderInfo(option.orderId);
} else if(option.OrderNo){
this.OrderNo = option.OrderNo
this.getOrderInfoHandler(this.OrderNo)
} }
}, },
methods: { methods: {
submitGetCodeByOrderNo() {
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)
console.log(this.orderInfo,'----orderInfo');
uni.showToast({
icon: 'none',
title: '支付中...',
})
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);
this.submit = false;
uni.showToast({
title: "支付失败",
icon: "none",
});
},
});
},
getOrderInfoHandler(OrderNo){
this.apipost("GetDetailsByOrderNo_post",{OrderNo},res=>{
if(res.resultCode==1){
this.initOrderInfo(res.data.ErpOrderId);
}else{
}
})
},
//跳转至详情 //跳转至详情
goJzDetail() { goJzDetail() {
let model = this.orderData.model; let model = this.orderData.model;
...@@ -611,6 +693,7 @@ ...@@ -611,6 +693,7 @@
}, },
goCancel() { goCancel() {
if (this.submit || this.submitCancel) return; if (this.submit || this.submitCancel) return;
this.submitCancel = true;
//未付款-调用后台取消 //未付款-调用后台取消
if (this.orderData.model.OrderState == 2 || this.orderData.model.OrderState == 3) { if (this.orderData.model.OrderState == 2 || this.orderData.model.OrderState == 3) {
this.apipost( this.apipost(
...@@ -625,12 +708,16 @@ ...@@ -625,12 +708,16 @@
}); });
uni.navigateTo({ uni.navigateTo({
url: "/pages/jiuzhai/jz_MyOrder", url: "/pages/jiuzhai/jz_MyOrder",
}); });
} }
this.submitCancel = false
}, },
(err) => {} (err) => {
this.submitCancel = false
}
); );
} else { } else {
this.submitCancel = true
let msg = { let msg = {
OrderId: this.orderData.model.OrderId, OrderId: this.orderData.model.OrderId,
UserId: uni.getStorageSync("mall_UserInfo").UserId, UserId: uni.getStorageSync("mall_UserInfo").UserId,
...@@ -649,6 +736,7 @@ ...@@ -649,6 +736,7 @@
url: "/pages/jiuzhai/jz_MyOrder", url: "/pages/jiuzhai/jz_MyOrder",
}); });
} else {} } else {}
this.submitCancel = false
}, },
null null
); );
......
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