|
@@ -1,4 +1,5 @@
|
|
const app = getApp();
|
|
const app = getApp();
|
|
|
|
+const utils = require('../../utils/util.js')
|
|
Page({
|
|
Page({
|
|
data: {
|
|
data: {
|
|
images: {
|
|
images: {
|
|
@@ -132,7 +133,7 @@ Page({
|
|
// 计算默认实缴金额
|
|
// 计算默认实缴金额
|
|
calculateDefaultAmount: function() {
|
|
calculateDefaultAmount: function() {
|
|
const { actualAmount, balance } = this.data;
|
|
const { actualAmount, balance } = this.data;
|
|
- const difference = (actualAmount - balance).toFixed(2);
|
|
|
|
|
|
+ const difference = utils.floatSub(actualAmount,balance);
|
|
|
|
|
|
if (difference <= 0) {
|
|
if (difference <= 0) {
|
|
this.setData({
|
|
this.setData({
|
|
@@ -178,10 +179,10 @@ Page({
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (actualAmount > 0 && amount * 1000 + balance * 1000 < actualAmount * 1000) {
|
|
|
|
|
|
+ debugger;
|
|
|
|
+ if (actualAmount > 0 && utils.floatAdd(amount,balance) < actualAmount) {
|
|
// 先转整数计算,再转回浮点数
|
|
// 先转整数计算,再转回浮点数
|
|
- const minPayment = (actualAmount * 1000 - balance * 1000) / 1000;
|
|
|
|
|
|
+ const minPayment = utils.floatSub(actualAmount - balance);
|
|
const formattedMinPayment = minPayment.toFixed(2);
|
|
const formattedMinPayment = minPayment.toFixed(2);
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '最低缴费金额:' + formattedMinPayment + '元',
|
|
title: '最低缴费金额:' + formattedMinPayment + '元',
|
|
@@ -204,7 +205,7 @@ Page({
|
|
},
|
|
},
|
|
data: {
|
|
data: {
|
|
openId: app.globalData.userWxInfo.openid,
|
|
openId: app.globalData.userWxInfo.openid,
|
|
- totalAmount: this.data.amount*1000/10,
|
|
|
|
|
|
+ totalAmount: utils.floatMul(this.data.amount,100),
|
|
dskey: app.globalData.currentAccountInfo.dsKey,
|
|
dskey: app.globalData.currentAccountInfo.dsKey,
|
|
zdId: this.data.zdId,
|
|
zdId: this.data.zdId,
|
|
userNumber: app.globalData.currentAccountInfo.usernumber
|
|
userNumber: app.globalData.currentAccountInfo.usernumber
|