|
|
|
@ -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 = { |
|
|
|
|