Authored by 王水玲

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

... ... @@ -32,46 +32,47 @@
</div>
</div>
</div>
<div class="detail-list-container">
<ul class="installment-list repay-list">
{{#each packageList}}
<li>
{{#isPaymentIncomplete status}}
<input id="sort-{{@index}}" type="checkbox"
class="installment-check-btn installment-term"
data-order-code="{{../orderCode}}"
data-sort-id="{{sortId}}"
data-fee="{{currFeeAmt}}"
data-delay-fee="{{currDealyFeeAmt}}"
data-amount="{{currPrincipalAmt}}"/>
{{/isPaymentIncomplete}}
<label for="sort-{{@index}}">
{{#isPaymentComplete status}}
<span class="detail-index">{{sortId}}.</span>
{{/isPaymentComplete}}
<ul class="installment-list repay-list">
{{#each packageList}}
<li>
{{#isPaymentIncomplete status}}
<input id="sort-{{@index}}" type="checkbox"
class="installment-check-btn installment-term"
data-order-code="{{../orderCode}}"
data-sort-id="{{sortId}}"
data-fee="{{currFeeAmt}}"
data-delay-fee="{{currDealyFeeAmt}}"
data-amount="{{currPrincipalAmt}}"/>
{{/isPaymentIncomplete}}
<label for="sort-{{@index}}">
{{#isPaymentComplete status}}
<span class="detail-index">{{sortId}}.</span>
{{/isPaymentComplete}}
<span class="amount">¥{{currAmt}}</span>
<div class="fee">
{{currDate}}
本金:¥{{currPrincipalAmt}}
<span class="amount">¥{{currAmt}}</span>
<div class="fee">
{{currDate}}
本金:¥{{currPrincipalAmt}}
{{#if currFeeAmt}}
服务费:¥{{currFeeAmt}}
{{/if}}
{{#if currFeeAmt}}
服务费:¥{{currFeeAmt}}
{{/if}}
{{#if currDealyFeeAmt}}
逾期服务费:¥{{currDealyFeeAmt}}
{{/if}}
</div>
<div class="status">
{{desc}}
<span class="iconfont notice">&#xe639;</span>
</div>
<div class="clearfix"></div>
</label>
</li>
{{/each}}
</ul>
{{#if currDealyFeeAmt}}
逾期服务费:¥{{currDealyFeeAmt}}
{{/if}}
</div>
<div class="status">
{{desc}}
<span class="iconfont notice">&#xe639;</span>
</div>
<div class="clearfix"></div>
</label>
</li>
{{/each}}
</ul>
</div>
{{/order}}
{{> installment/repayment-bottom}}
</div>
... ...
<ul>
{{#each orders}}
<li>
<a href="/home/installment/order/{{orderCode}}">
{{#orderGoods}}
<div class="image-box">
<img src="{{image goodsImage 90 120}}" alt="{{productName}}">
</div>
<div class="title-box">
<div>{{productName}}</div>
<div class="date-box">{{../createTime}}</div>
</div>
{{/orderGoods}}
</a>
{{#each orders}}
<li>
<a href="/home/installment/order/{{orderCode}}">
{{#orderGoods}}
<div class="image-box">
<img src="{{image goodsImage 90 120}}" alt="{{productName}}">
</div>
<div class="title-box">
<div>{{productName}}</div>
<div class="date-box">{{../createTime}}</div>
</div>
{{/orderGoods}}
</a>
<div class="right-box">
<div class="amount">{{amount}}</div>
<div class="status">{{installStatus}}</div>
</div>
<div class="clearfix"></div>
</li>
{{/each}}
</ul>
<div class="right-box">
<div class="amount">¥{{amount}}</div>
<div class="status">{{installStatus}}</div>
</div>
<div class="clearfix"></div>
</li>
{{/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',
list: self.setParams(),
amount: self.total
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;
... ...