|
@@ -58,7 +58,7 @@
|
|
|
default: false
|
|
|
}
|
|
|
},
|
|
|
- mixins:[colors],
|
|
|
+ mixins: [colors],
|
|
|
data() {
|
|
|
return {
|
|
|
formContent: '',
|
|
@@ -88,7 +88,7 @@
|
|
|
methods: {
|
|
|
payType(number, paytype, index) {
|
|
|
this.active = index;
|
|
|
- console.log(this.active,'this.active');
|
|
|
+ console.log(this.active, 'this.active');
|
|
|
this.paytype = paytype;
|
|
|
this.number = number;
|
|
|
this.$emit('changePayType', paytype)
|
|
@@ -144,11 +144,11 @@
|
|
|
});
|
|
|
|
|
|
// #ifdef MP
|
|
|
- let mp_pay_name=''
|
|
|
- if(uni.requestOrderPayment){
|
|
|
- mp_pay_name='requestOrderPayment'
|
|
|
- }else{
|
|
|
- mp_pay_name='requestPayment'
|
|
|
+ let mp_pay_name = ''
|
|
|
+ if (uni.requestOrderPayment) {
|
|
|
+ mp_pay_name = 'requestOrderPayment'
|
|
|
+ } else {
|
|
|
+ mp_pay_name = 'requestPayment'
|
|
|
}
|
|
|
uni[mp_pay_name]({
|
|
|
timeStamp: jsConfig.timestamp,
|
|
@@ -218,7 +218,7 @@
|
|
|
.catch(function(res) {
|
|
|
if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
|
|
|
title: '取消支付'
|
|
|
- },() => {
|
|
|
+ }, () => {
|
|
|
that.$emit('onChangeFun', {
|
|
|
action: 'pay_fail'
|
|
|
});
|
|
@@ -231,7 +231,8 @@
|
|
|
provider: 'wxpay',
|
|
|
orderInfo: jsConfig,
|
|
|
success: (e) => {
|
|
|
- let url = '/pages/goods/order_pay_status/index?order_id=' + orderId +
|
|
|
+ let url = '/pages/goods/order_pay_status/index?order_id=' +
|
|
|
+ orderId +
|
|
|
'&msg=支付成功';
|
|
|
uni.showToast({
|
|
|
title: "支付成功"
|
|
@@ -339,12 +340,15 @@
|
|
|
break;
|
|
|
case "huifu":
|
|
|
// #ifdef MP
|
|
|
- uni.openEmbeddedMiniProgram({
|
|
|
- appId: 'wx33dc829ad98f7c64',
|
|
|
- path: `pages/index/index?token=${res.data.result.data.pre_order_id}`,
|
|
|
- envVersion: 'release',
|
|
|
- // release: 正式版 trial: 体验版
|
|
|
- success(res) {
|
|
|
+ console.log(res, 'resdata')
|
|
|
+ let data = JSON.parse(res.data.result.data.pay_info);
|
|
|
+ uni.requestPayment({
|
|
|
+ timeStamp: data.timeStamp,
|
|
|
+ nonceStr: data.nonceStr,
|
|
|
+ package: data.package,
|
|
|
+ signType: data.signType,
|
|
|
+ paySign: data.paySign,
|
|
|
+ success: function(res) {
|
|
|
uni.showToast({
|
|
|
title: "支付成功"
|
|
|
})
|
|
@@ -354,15 +358,17 @@
|
|
|
});
|
|
|
}, 2000)
|
|
|
},
|
|
|
- complete(err) {
|
|
|
- // uni.showModal({
|
|
|
- // title:"",
|
|
|
- // content:err
|
|
|
- // })
|
|
|
- console.log(err,'errrs')
|
|
|
- uni.hideLoading();
|
|
|
+ fail: function() {
|
|
|
+ return that.$util.Tips({
|
|
|
+ title: '支付失败'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ complete: function(res) {
|
|
|
+ if (res.errMsg == 'requestPayment:cancel') return that.$util
|
|
|
+ .Tips({
|
|
|
+ title: '取消支付'
|
|
|
+ });
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
// #endif
|
|
|
// #ifdef H5
|
|
@@ -406,9 +412,10 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
- .bgcolor{
|
|
|
+ .bgcolor {
|
|
|
background-color: var(--view-theme)
|
|
|
}
|
|
|
+
|
|
|
.payment {
|
|
|
position: fixed;
|
|
|
bottom: 0;
|
|
@@ -521,4 +528,4 @@
|
|
|
font-size: 40rpx;
|
|
|
color: #ccc;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|