Authored by 王水玲

Merge branch 'feature/installment' of git.yoho.cn:fe/yohobuywap-node into feature/installment

... ... @@ -32,7 +32,7 @@
</div>
</div>
</div>
<div class="detail-list-container">
<ul class="installment-list repay-list">
{{#each packageList}}
<li>
... ... @@ -72,6 +72,7 @@
</li>
{{/each}}
</ul>
</div>
{{/order}}
{{> installment/repayment-bottom}}
</div>
... ...
<ul>
{{#each orders}}
{{#each orders}}
<li>
<a href="/home/installment/order/{{orderCode}}">
{{#orderGoods}}
... ... @@ -14,10 +13,9 @@
</a>
<div class="right-box">
<div class="amount">{{amount}}</div>
<div class="amount">¥{{amount}}</div>
<div class="status">{{installStatus}}</div>
</div>
<div class="clearfix"></div>
</li>
{{/each}}
</ul>
{{/each}}
... ...
... ... @@ -12,5 +12,8 @@
</li>
</ul>
<div id="order-list" class="order-list"></div>
<div class="order-list-container">
<ul id="order-list" class="order-list">
</ul>
</div>
</div>
... ...
... ... @@ -22,6 +22,9 @@ var repayment = new Repayment({
return ret;
},
onGetSelectableCount: function() {
return $(CHECKBOX_SELECTOR).length;
},
onDeselectAll: function() {
$(CHECKBOX_SELECTOR + ':checked').prop('checked', false);
return [];
... ... @@ -76,3 +79,7 @@ $(CHECKBOX_SELECTOR + ':checkbox').click(function() {
repayment.update();
});
// 默认选择第一个
$(CHECKBOX_SELECTOR + ':checkbox:first').click();
... ...
... ... @@ -8,6 +8,15 @@ var Repayment = function(options) {
onDeselectAll: $.noop,
/**
* 返回可选择数目
*
* @returns {number}
*/
onGetSelectableCount: function() {
return 0;
},
/**
* 获取选择
*
* @returns {Array}
... ... @@ -28,8 +37,10 @@ var Repayment = function(options) {
var params = {
action: 'go.instalmentRepayment',
params: {
list: self.setParams(),
amount: self.total
}
};
$(this).attr('href', path + '?openby:yohobuy=' + encodeURIComponent(JSON.stringify(params)));
... ... @@ -114,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;
... ... @@ -136,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);
... ...
... ... @@ -14,6 +14,7 @@
background: #fff;
position: fixed;
width: 100%;
top: 0;
li {
display: inline-block;
... ... @@ -33,9 +34,12 @@
}
}
.order-list-container {
margin-top: 3rem;
}
.order-list {
border-top: 1px solid #e1e1e1;
margin-top: 120px;
background: #fff;
li {
... ... @@ -126,8 +130,11 @@
height: 120px;
}
.installment-list {
.detail-list-container {
padding-top: 330px;
}
.installment-list {
border-top: 1px solid #e0e0e0;
overflow: scroll;
... ...