Commit a3808913 authored by youjie's avatar youjie

线路支付

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