优化代码

This commit is contained in:
wuxw 2024-04-07 00:21:34 +08:00
parent a5b110aa5f
commit a2996cb810
3 changed files with 6 additions and 52 deletions

View File

@ -31,12 +31,12 @@
if (!vc.notNull($that.feeDetailInfo.feeId)) {
return;
}
vc.component._loadFeeDetailInfo();
$that._loadFeeDetailInfo();
},
_initEvent: function () {
vc.on('feeDetail', 'listCarData', function (_info) {
//vc.component._loadFeeDetailInfo();
//$that._loadFeeDetailInfo();
$that.changeTab($that.feeDetailInfo._currentTab);
});
},
@ -91,13 +91,13 @@
if (_fee.state == '2009001') {
return "-";
}
return vc.dateFormat(_fee.deadlineTime);
return _fee.deadlineTime;
},
_getEndTime: function (_fee) {
if (_fee.state == '2009001') {
return "-";
}
return vc.dateFormat(_fee.endTime);
return _fee.endTime;
},
}
});

View File

@ -237,7 +237,7 @@
if (_fee.state == '2009001') {
return "-";
}
return vc.dateFormat(_fee.endTime);
return vc.dateFormat(_fee.deadlineTime);
},
_getEndTime: function (_fee) {
if (_fee.state == '2009001') {

View File

@ -118,52 +118,6 @@
}
);
},
/**
* 格式化数字
*/
_getFixedNum: function (num) {
if ($that.owePayFeeOrderInfo.toFixedSign == 2) {
return $that._mathToFixed1(num);
} else if ($that.owePayFeeOrderInfo.toFixedSign == 3) {
return $that._mathCeil(num);
} else if ($that.owePayFeeOrderInfo.toFixedSign == 4) {
return $that._mathFloor(num);
} else if ($that.owePayFeeOrderInfo.toFixedSign == 5) {
return $that._mathRound(num);
} else {
return $that._mathToFixed2(num);
}
},
/**
* 向上取整
*/
_mathCeil: function (_price) {
return Math.ceil(_price);
},
/**
* 向下取整
*/
_mathFloor: function (_price) {
return Math.floor(_price);
},
/**
* 四首五入取整
*/
_mathRound: function (_price) {
return Math.round(_price);
},
/**
* 保留小数点后一位
*/
_mathToFixed1: function (_price) {
return parseFloat(_price).toFixed(1);
},
/**
* 保留小数点后两位
*/
_mathToFixed2: function (_price) {
return parseFloat(_price).toFixed(2);
},
_payFee: function () {
if ($that.owePayFeeOrderInfo.selectPayFeeIds.length <= 0) {
vc.toast('未选择费用');
@ -387,7 +341,7 @@
return "-";
}
//return vc.dateSub(_fee.deadlineTime, _fee.feeFlag);
return vc.dateFormat(_fee.endTime);
return vc.dateFormat(_fee.deadlineTime);
},
_getEndTime: function (_fee) {
if (_fee.state == '2009001') {