...
|
...
|
@@ -8,6 +8,15 @@ var Repayment = function(options) { |
|
|
onDeselectAll: $.noop,
|
|
|
|
|
|
/**
|
|
|
* 返回可选择数目
|
|
|
*
|
|
|
* @returns {number}
|
|
|
*/
|
|
|
onGetSelectableCount: function() {
|
|
|
return 0;
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 获取选择
|
|
|
*
|
|
|
* @returns {Array}
|
...
|
...
|
@@ -116,11 +125,17 @@ Repayment.prototype.getSelection = function() { |
|
|
return this.settings.onGetSelection();
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 更新组件并计算金额
|
|
|
*/
|
|
|
Repayment.prototype.update = function() {
|
|
|
var values = this.getSelection();
|
|
|
var $repaymentBottom = $('.repayment-bottom');
|
|
|
var self = this;
|
|
|
|
|
|
// 是否选择全部
|
|
|
var totalCheck = this.settings.onGetSelectableCount() === values.length;
|
|
|
|
|
|
this.total = 0;
|
|
|
this.fee = 0;
|
|
|
|
...
|
...
|
@@ -138,6 +153,8 @@ Repayment.prototype.update = function() { |
|
|
$repaymentBottom.slideDown();
|
|
|
}
|
|
|
|
|
|
$('#repayment-total').prop('checked', totalCheck).data('checked', totalCheck);
|
|
|
|
|
|
this.setTotal(this.total);
|
|
|
this.setFee(this.fee);
|
|
|
|
...
|
...
|
|