|
@@ -58,7 +58,7 @@
|
|
default: false
|
|
default: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mixins:[colors],
|
|
|
|
|
|
+ mixins: [colors],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
formContent: '',
|
|
formContent: '',
|
|
@@ -88,7 +88,7 @@
|
|
methods: {
|
|
methods: {
|
|
payType(number, paytype, index) {
|
|
payType(number, paytype, index) {
|
|
this.active = index;
|
|
this.active = index;
|
|
- console.log(this.active,'this.active');
|
|
|
|
|
|
+ console.log(this.active, 'this.active');
|
|
this.paytype = paytype;
|
|
this.paytype = paytype;
|
|
this.number = number;
|
|
this.number = number;
|
|
this.$emit('changePayType', paytype)
|
|
this.$emit('changePayType', paytype)
|
|
@@ -144,11 +144,11 @@
|
|
});
|
|
});
|
|
|
|
|
|
// #ifdef MP
|
|
// #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]({
|
|
uni[mp_pay_name]({
|
|
timeStamp: jsConfig.timestamp,
|
|
timeStamp: jsConfig.timestamp,
|
|
@@ -218,7 +218,7 @@
|
|
.catch(function(res) {
|
|
.catch(function(res) {
|
|
if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
|
|
if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
|
|
title: '取消支付'
|
|
title: '取消支付'
|
|
- },() => {
|
|
|
|
|
|
+ }, () => {
|
|
that.$emit('onChangeFun', {
|
|
that.$emit('onChangeFun', {
|
|
action: 'pay_fail'
|
|
action: 'pay_fail'
|
|
});
|
|
});
|
|
@@ -231,7 +231,8 @@
|
|
provider: 'wxpay',
|
|
provider: 'wxpay',
|
|
orderInfo: jsConfig,
|
|
orderInfo: jsConfig,
|
|
success: (e) => {
|
|
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=支付成功';
|
|
'&msg=支付成功';
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: "支付成功"
|
|
title: "支付成功"
|
|
@@ -339,12 +340,15 @@
|
|
break;
|
|
break;
|
|
case "huifu":
|
|
case "huifu":
|
|
// #ifdef MP
|
|
// #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({
|
|
uni.showToast({
|
|
title: "支付成功"
|
|
title: "支付成功"
|
|
})
|
|
})
|
|
@@ -354,15 +358,17 @@
|
|
});
|
|
});
|
|
}, 2000)
|
|
}, 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
|
|
// #endif
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
@@ -406,9 +412,10 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
- .bgcolor{
|
|
|
|
|
|
+ .bgcolor {
|
|
background-color: var(--view-theme)
|
|
background-color: var(--view-theme)
|
|
}
|
|
}
|
|
|
|
+
|
|
.payment {
|
|
.payment {
|
|
position: fixed;
|
|
position: fixed;
|
|
bottom: 0;
|
|
bottom: 0;
|
|
@@ -521,4 +528,4 @@
|
|
font-size: 40rpx;
|
|
font-size: 40rpx;
|
|
color: #ccc;
|
|
color: #ccc;
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|