对接支付宝小程序
This commit is contained in:
@@ -324,12 +324,6 @@
|
||||
// 没有指定支付方式则不匹配支付标识
|
||||
var payment = null;
|
||||
if ((payment_id || 0) != 0) {
|
||||
// #ifdef H5
|
||||
// 微信环境判断是否已有web_openid、不存在则不继续执行跳转到插件进行授权
|
||||
// if (!app.globalData.is_user_weixin_web_openid(order_id, payment_id || this.payment_id, this.propToAppointPage)) {
|
||||
// return false;
|
||||
// }
|
||||
// #endif
|
||||
// 支付方式
|
||||
for (var i in this.payment_list) {
|
||||
if (this.payment_list[i]['id'] == (payment_id || this.payment_id)) {
|
||||
@@ -350,6 +344,9 @@
|
||||
uni.redirectTo({
|
||||
url: `/pages/buy/wu_you_status?payment_id=${payment.id}&order_id=${order_id}`,
|
||||
});
|
||||
} else if (payment.payment == 'WalletPay') {
|
||||
console.log('支付宝支付order_id===', order_id);
|
||||
// console.log('支付宝支付===', data);
|
||||
} else {
|
||||
// 请求数据
|
||||
var post_data = {
|
||||
@@ -374,16 +371,18 @@
|
||||
title: this.$t('payment.payment.e1f54e'),
|
||||
mask: true,
|
||||
});
|
||||
|
||||
console.log('this.propPayUrl===', this.propPayUrl);
|
||||
|
||||
if (this.propPayUrl) {
|
||||
console.log('post_data===', post_data);
|
||||
uni.request({
|
||||
url: this.propPayUrl,
|
||||
method: 'POST',
|
||||
data: {
|
||||
...post_data,
|
||||
wechat_open_id: localStorage.getItem('web_openid') || '',
|
||||
},
|
||||
data: post_data,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
console.log('this.propPayUrl.res===', res);
|
||||
uni.hideLoading();
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
@@ -467,11 +466,13 @@
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log('fail', res);
|
||||
uni.hideLoading();
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
} else {
|
||||
console.log('为什么不进支付');
|
||||
app.globalData.showToast(this.$t('payment.payment.597s8b'));
|
||||
}
|
||||
}
|
||||
@@ -636,6 +637,8 @@
|
||||
service: 5,
|
||||
// #endif
|
||||
success: (res) => {
|
||||
console.log('支付成功1111===', res);
|
||||
|
||||
// #ifdef MP-ALIPAY
|
||||
if (res.resultCode != 9000) {
|
||||
self.order_item_pay_fail_handle(data, order_id, res.memo || self.$t('paytips.paytips.6y488i'));
|
||||
@@ -652,6 +655,7 @@
|
||||
self.order_item_pay_success_handle(data, order_id);
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log('支付失败2222===', res);
|
||||
self.order_item_pay_fail_handle(data, order_id, self.$t('paytips.paytips.6y488i'));
|
||||
},
|
||||
});
|
||||
@@ -756,6 +760,13 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// 支付宝支付
|
||||
if (data.payment.payment == 'WalletPay') {
|
||||
console.log('支付宝支付order_id===', order_id);
|
||||
console.log('支付宝支付===', data);
|
||||
return;
|
||||
}
|
||||
|
||||
// 二维码展示
|
||||
if ((data.data.qrcode_url || null) != null && (data.data.name || null) != null && (data.data.order_no || null) != null) {
|
||||
status = true;
|
||||
|
||||
Reference in New Issue
Block a user