Commit ee40dfe8 authored by Xuguangxing's avatar Xuguangxing

fix

parent fe0bf3ba
import cookies from 'js-cookie';
const option = {
domain: window.location.host.indexOf('.q-gp.com') >= 0 ? '.q-gp.com' : ''
domain: window.location.host.indexOf('.q-gp.com') >= 0 ? '.q-gp.com' : '',
expires: 1
};
const Cookies = {
get(key) {
......
......@@ -191,7 +191,8 @@ export default {
payContractInfo: {},
isCheckAgreement: false,
mergePayPretreatmentInfo: {},
tradeType: isWechat ? 'JSAPI' : 'MWEB'
tradeType: isWechat ? 'JSAPI' : 'MWEB',
amountInfo: {}
};
},
computed: {
......@@ -537,7 +538,9 @@ export default {
query: {
reason: error,
orderNo: this.orderNo,
payType: this.payType
payType: this.payType,
amount: this.amountInfo.finalAmt || '',
freeAmount: this.amountInfo.freeAmount || ''
}
});
},
......@@ -634,7 +637,8 @@ export default {
: (orderAmt - faceValue || 0).toFixed(2);
const freeAmount =
!IS_THIRD_PAY(this.payType) && this.showCoupon ? faceValue || '0.00' : '0.00';
cookies.set('amount', { finalAmt, freeAmount });
this.amountInfo = { finalAmt, freeAmount };
cookies.set('amount', JSON.stringify({ finalAmt, freeAmount }));
},
async reissueContract() {
await reissueContract({
......
......@@ -98,14 +98,20 @@ export default {
},
created() {
const { orderNo, reason, payType } = this.$route.query;
const { finalAmt, freeAmount } = cookies.get('amount') || {};
const { success } = this.$route.meta;
// const amount = cookies.get('amount') || {};
try {
const amount = JSON.parse(cookies.get('amount'));
this.money = amount.finalAmt || '';
this.freeAmount = amount.freeAmount || '';
} catch (e) {
this.money = '';
this.freeAmount = '';
}
this.payType = payType || '';
this.money = finalAmt || '';
this.orderNo = orderNo;
this.reason = reason || '';
this.isSuccess = success || false;
this.freeAmount = freeAmount || '';
this.payStatus = success ? '订单支付成功' : '订单支付失败';
this.payStatusName = success ? '支付成功' : '支付失败';
this.getCouponList();
......
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