|
|
@ -79,6 +79,7 @@ |
|
|
|
import { |
|
|
|
import { |
|
|
|
getOrderById, |
|
|
|
getOrderById, |
|
|
|
orderToPay, |
|
|
|
orderToPay, |
|
|
|
|
|
|
|
unionPay, |
|
|
|
hltUnionCardPay |
|
|
|
hltUnionCardPay |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
} from '../../../Utils/Api.js'; |
|
|
|
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; |
|
|
|
import ssPaymentPassword from '../../../components/sanshui-payment-password/index.vue'; |
|
|
@ -129,7 +130,6 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
"orderId": this.orderNo, |
|
|
|
"orderId": this.orderNo, |
|
|
|
"cardNo": this.user.hltCardNo.cardNo, |
|
|
|
|
|
|
|
"password": this.PaymentPassword |
|
|
|
"password": this.PaymentPassword |
|
|
|
} |
|
|
|
} |
|
|
|
hltUnionCardPay(params).then(res => { |
|
|
|
hltUnionCardPay(params).then(res => { |
|
|
@ -202,52 +202,7 @@ |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (that.paytype == 'weixin') { |
|
|
|
if (that.paytype == 'weixin') { |
|
|
|
let params = { |
|
|
|
that.unionPay(); |
|
|
|
"orderId": that.orderNo, |
|
|
|
|
|
|
|
"openId": app.globalData.openId, |
|
|
|
|
|
|
|
"orderScene": "GOODS_ORDER" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
orderToPay(params).then(res => { |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
// #ifdef MP |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
|
|
title: '支付中...' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
uni.requestPayment({ |
|
|
|
|
|
|
|
"appId": res.return_data.appId, |
|
|
|
|
|
|
|
"nonceStr": res.return_data.nonceStr, |
|
|
|
|
|
|
|
"package": res.return_data.package, |
|
|
|
|
|
|
|
"paySign": res.return_data.sign, |
|
|
|
|
|
|
|
"signType": "MD5", |
|
|
|
|
|
|
|
"timeStamp": res.return_data.timeStamp, |
|
|
|
|
|
|
|
success: function(res) { |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: '支付成功' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
uni.reLaunch({ |
|
|
|
|
|
|
|
url: '/pages/goods/refuel-succes/refuel-succes?id=' +that.orderNo |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
fail: function(err) { |
|
|
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断是否是公众号 |
|
|
|
|
|
|
|
// #ifdef H5 |
|
|
|
|
|
|
|
//判断微信浏览器 |
|
|
|
|
|
|
|
that.payRequest(res); |
|
|
|
|
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.return_msg, |
|
|
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if(that.paytype == 'gonghuika'){ |
|
|
|
if(that.paytype == 'gonghuika'){ |
|
|
@ -257,23 +212,51 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!that.user.isSetHltCard) { |
|
|
|
that.$refs.paymentPassword.modalFun('show'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//银联获取信息 |
|
|
|
|
|
|
|
unionPay() { |
|
|
|
|
|
|
|
let goods = { |
|
|
|
|
|
|
|
"orderId": this.orderNo |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
unionPay(goods).then(res => { |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
this.uniontopay(res.return_data.prepayid); |
|
|
|
|
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.return_msg, |
|
|
|
icon: 'none', |
|
|
|
icon: 'none', |
|
|
|
title: '当前账号还未绑定,前往绑定', |
|
|
|
duration: 2000 |
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
success() { |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
|
|
url: '../../user/bindingCard/bindingCard' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, 1000) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
that.$refs.paymentPassword.modalFun('show'); |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//银联支付 |
|
|
|
|
|
|
|
uniontopay(item) { |
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
|
|
|
upsdk.pluginReady(function() { |
|
|
|
|
|
|
|
upsdk.pay({ |
|
|
|
|
|
|
|
tn: item, |
|
|
|
|
|
|
|
success: function(res) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: '支付成功' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
uni.reLaunch({ |
|
|
|
|
|
|
|
url: '/pages/goods/refuel-succes/refuel-succes?id=' +that.orderNo |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
fail: function(err) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: err.msg, |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
// 支付失败, err.msg 是失败原因描述, 比如TN号不合法, 或者用户取消了交易 等等。 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|