Commit 1f906032 authored by FE-安焕焕's avatar FE-安焕焕 👣

支付成功的金额

parent ed2fb93a
...@@ -388,6 +388,7 @@ export default { ...@@ -388,6 +388,7 @@ export default {
this.$toast('请仔细阅读并同意相关协议'); this.$toast('请仔细阅读并同意相关协议');
return; return;
} }
this.setAmount();
if (!params && !this.isDetention && IS_THIRD_PAY(this.payType)) { if (!params && !this.isDetention && IS_THIRD_PAY(this.payType)) {
this.isDetention = true; this.isDetention = true;
isDetentionFn.call(this); isDetentionFn.call(this);
...@@ -466,12 +467,6 @@ export default { ...@@ -466,12 +467,6 @@ export default {
} }
}, },
payResult(type, error) { payResult(type, error) {
const finalAmt =
IS_THIRD_PAY(this.payType) || !this.showCoupon
? this.displayInfo.orderAmt || '0.00'
: (this.displayInfo.orderAmt - this.selectedCoupon.faceValue || 0).toFixed(2);
const freeAmount = this.showCoupon ? this.selectedCoupon.faceValue || '0.00' : '0.00';
cookies.set('amount', { finalAmt, freeAmount });
/* 跳转支付结果页面 */ /* 跳转支付结果页面 */
this.$router.replace({ this.$router.replace({
name: `pay${type}`, name: `pay${type}`,
...@@ -572,6 +567,14 @@ export default { ...@@ -572,6 +567,14 @@ export default {
}, },
getObjectKey(obj) { getObjectKey(obj) {
return Object.keys(obj); return Object.keys(obj);
},
setAmount() {
const finalAmt =
IS_THIRD_PAY(this.payType) || !this.showCoupon
? this.displayInfo?.orderAmt || '0.00'
: (this.displayInfo?.orderAmt - this.selectedCoupon?.faceValue || 0).toFixed(2);
const freeAmount = this.showCoupon ? this.selectedCoupon?.faceValue || '0.00' : '0.00';
cookies.set('amount', { finalAmt, freeAmount });
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment