对接银联支付

main
Tuzki 8 months ago
parent 242620f397
commit c5ba3e47d2
  1. 134
      pages/orderDetail/orderDetail.vue

@ -79,11 +79,11 @@
title: '支付宝支付',
imgPath: '/static/images/index/icon_alipay.png'
},
// {
// id: 3,
// title: '',
// imgPath: '/static/images/index/icon_unionpay.png'
// },
{
id: 3,
title: '银联支付',
imgPath: '/static/images/index/icon_unionpay.png'
},
{
id: 'cash',
title: '现金支付',
@ -208,7 +208,7 @@
resvcePrice(val) {
let that = this
console.log(val);
if (val == 1) {
if (val != 'cash') {
uni.hideLoading();
uni.scanCode({
scanType: ['barCode', 'qrCode'],
@ -216,7 +216,7 @@
console.log('条码内容:' + resposon.result);
// console.log('this.orderDetail', this.orderDetail);
const obj = {
channelCode: 'wx_bar',
channelCode: val==1?'wx_bar':val==2?'alipay_bar':'union_qr',
channelExtras: {
auth_code: resposon.result
},
@ -268,67 +268,67 @@
}
});
}
if (val == 2) {
//
uni.hideLoading();
uni.scanCode({
scanType: ['barCode', 'qrCode'],
success: function(resposon) {
console.log('条码内容:' + resposon.result);
// console.log('this.orderDetail', this.orderDetail);
const obj = {
channelCode: 'alipay_bar',
channelExtras: {
auth_code: resposon.result
},
id: that.orderDetail.orderInfo.belongingPayOrderId,
returnUrl: ''
};
debugger
submitOrder(obj).then((res) => {
console.log('支付结果', res)
const data = res.data;
if (data.status === 10) {
that.clearQueryInterval();
uni.showToast({
icon: 'none',
title: '支付成功!',
duration: 1000
});
const ob = {
orderNumber: that.orderDetail.orderInfo.orderNumber
};
printTicket(ob)
.then((ress) => {
const datas = JSON.stringify(that.orderDetail.orderInfo
.ticketList);
// console.log(data)
uni.navigateTo({
url: '/pages/payResult/payResult?status=success&detail=' +
datas + '&tickets=' + ress.data
});
})
.catch((err) => {
console.log(err);
});
// if (val == 2) {
// //
// uni.hideLoading();
// uni.scanCode({
// scanType: ['barCode', 'qrCode'],
// success: function(resposon) {
// console.log('' + resposon.result);
// // console.log('this.orderDetail', this.orderDetail);
// const obj = {
// channelCode: 'alipay_bar',
// channelExtras: {
// auth_code: resposon.result
// },
// id: that.orderDetail.orderInfo.belongingPayOrderId,
// returnUrl: ''
// };
// debugger
// submitOrder(obj).then((res) => {
// console.log('', res)
// const data = res.data;
// if (data.status === 10) {
// that.clearQueryInterval();
// uni.showToast({
// icon: 'none',
// title: '',
// duration: 1000
// });
// const ob = {
// orderNumber: that.orderDetail.orderInfo.orderNumber
// };
// printTicket(ob)
// .then((ress) => {
// const datas = JSON.stringify(that.orderDetail.orderInfo
// .ticketList);
// // console.log(data)
// uni.navigateTo({
// url: '/pages/payResult/payResult?status=success&detail=' +
// datas + '&tickets=' + ress.data
// });
// })
// .catch((err) => {
// console.log(err);
// });
return;
}
//
uni.showLoading({
title: '支付中...',
mask: true
});
this.createQueryInterval();
}).catch(err => {
// uni.showLoading({
// title: '...'
// });
// this.createQueryInterval();
})
}
});
}
// return;
// }
// //
// uni.showLoading({
// title: '...',
// mask: true
// });
// this.createQueryInterval();
// }).catch(err => {
// // uni.showLoading({
// // title: '...'
// // });
// // this.createQueryInterval();
// })
// }
// });
// }
if (val == 'cash') {
const obj = {

Loading…
Cancel
Save