|
@@ -173,7 +173,7 @@
|
|
|
}
|
|
|
this.GetPayOrderInfo()
|
|
|
},
|
|
|
- GetPayOrderInfo(){
|
|
|
+ GetPayOrderInfo(){//初始化支付信息
|
|
|
this.PayService.PayOrderCheckoutCounter({orderId:this.orderID}).then(response =>{
|
|
|
this.isRepuest = true
|
|
|
this.discernReceipt = response.data.discernReceipt //支付记录
|
|
@@ -181,6 +181,7 @@
|
|
|
this.receiptAmount = response.data.order.receiptAmount //已付金额
|
|
|
this.payableAmount = response.data.order.payableAmount - this.receiptAmount//已付金额
|
|
|
this.payAmount = this.toFixedFn(this.payableAmount) //自定义金额
|
|
|
+ console.log('this.payAmount',this.payAmount)
|
|
|
this.balanceAmount = this.payableAmount - this.payAmount// 计算剩余支付金额
|
|
|
}).catch(error =>{
|
|
|
this.$util.msg(error.msg,2000)
|
|
@@ -227,8 +228,9 @@
|
|
|
this.$util.msg("本次支付的金额必须大于¥0.02",2000)
|
|
|
return
|
|
|
}
|
|
|
+ console.log('this.payAmount',this.payAmount)
|
|
|
let params ={
|
|
|
- payAmount:this.payAmount*100,
|
|
|
+ payAmount:this.accMul(this.payAmount,100),
|
|
|
payWay:"WEIXIN",
|
|
|
code:wechatcode,
|
|
|
orderId:this.orderID
|
|
@@ -269,6 +271,19 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ accMul(value1, value2) {
|
|
|
+ if (value1 == 0 || value2 == 0) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ let m = 0;
|
|
|
+ let v1 = value1.toString();
|
|
|
+ let v2 = value2.toString();
|
|
|
+ m += v1.split(".")[1] ? v1.split(".")[1].length : 0;
|
|
|
+ m += v2.split(".")[1] ? v2.split(".")[1].length : 0;
|
|
|
+ let _v1 = Number(v1.replace(".", ""));
|
|
|
+ let _v2 = Number(v2.replace(".", ""));
|
|
|
+ return (_v1 * _v2) / Math.pow(10, m);
|
|
|
+ },
|
|
|
confirmEvent(value){//点击自定义键盘完成的回调函数
|
|
|
this.chechValue(value)
|
|
|
this.showDigitKeyboard = false
|