Merge remote-tracking branch 'origin/feature/installment' into feature/installment
Showing
6 changed files
with
109 additions
and
57 deletions
@@ -196,17 +196,17 @@ const getStauts = (uid) => { | @@ -196,17 +196,17 @@ const getStauts = (uid) => { | ||
196 | method: 'user.instalment.getStatus', | 196 | method: 'user.instalment.getStatus', |
197 | uid: uid | 197 | uid: uid |
198 | }).then((result) => { | 198 | }).then((result) => { |
199 | - // result = { | ||
200 | - // alg: 'SALT_MD5', | ||
201 | - // code: 200, | ||
202 | - // data: { | ||
203 | - // status: '2', | ||
204 | - // isShow: '1', | ||
205 | - // currCreditLimit: '3125.20' | ||
206 | - // }, | ||
207 | - // md5: '6d729d4b35f10fc73531210bd7ecff91', | ||
208 | - // message: 'success' | ||
209 | - // }; | 199 | + result = { |
200 | + alg: 'SALT_MD5', | ||
201 | + code: 200, | ||
202 | + data: { | ||
203 | + status: '2', | ||
204 | + isShow: '1', | ||
205 | + currCreditLimit: '3125.20' | ||
206 | + }, | ||
207 | + md5: '6d729d4b35f10fc73531210bd7ecff91', | ||
208 | + message: 'success' | ||
209 | + }; | ||
210 | if (result && result.code === 200) { | 210 | if (result && result.code === 200) { |
211 | return result.data.status; | 211 | return result.data.status; |
212 | } else { | 212 | } else { |
@@ -281,47 +281,47 @@ const getQueryAmtList = (params) => { | @@ -281,47 +281,47 @@ const getQueryAmtList = (params) => { | ||
281 | }, params), { | 281 | }, params), { |
282 | cache: true | 282 | cache: true |
283 | }).then((result) => { | 283 | }).then((result) => { |
284 | - // result = { | ||
285 | - // alg: 'SALT_MD5', | ||
286 | - // code: 200, | ||
287 | - // data: { | ||
288 | - // amtList: [ | ||
289 | - // { | ||
290 | - // billNo: 'x00001', | ||
291 | - // terms: 3, | ||
292 | - // currTerm: 1, | ||
293 | - // unExpireDays: -3, | ||
294 | - // billInfo: '三叶草运动休闲鞋', | ||
295 | - // currAmt: '845.00', | ||
296 | - // currNoFeeAmt: '840.00', | ||
297 | - // currFee: '5.00' | ||
298 | - // }, { | ||
299 | - // billNo: 'x00002', | ||
300 | - // terms: 3, | ||
301 | - // currTerm: 2, | ||
302 | - // unExpireDays: 10, | ||
303 | - // billInfo: '三叶草运动休闲鞋', | ||
304 | - // currAmt: '840.00', | ||
305 | - // currNoFeeAmt: '840.00', | ||
306 | - // currFee: '0.00' | ||
307 | - // }, { | ||
308 | - // billNo: 'x00003', | ||
309 | - // terms: 3, | ||
310 | - // currTerm: 1, | ||
311 | - // unExpireDays: -3, | ||
312 | - // billInfo: '三叶草运动休闲鞋', | ||
313 | - // currAmt: '845.00', | ||
314 | - // currNoFeeAmt: '840.00', | ||
315 | - // currFee: '5.00' | ||
316 | - // } | ||
317 | - // ], | ||
318 | - // pageNo: 1, | ||
319 | - // pageTotal: 1, | ||
320 | - // total: 2 | ||
321 | - // }, | ||
322 | - // md5: 'c1d725306fb09dcbf504776d276521cb', | ||
323 | - // message: 'ok' | ||
324 | - // }; | 284 | + result = { |
285 | + alg: 'SALT_MD5', | ||
286 | + code: 200, | ||
287 | + data: { | ||
288 | + amtList: [ | ||
289 | + { | ||
290 | + billNo: 'x00001', | ||
291 | + terms: 3, | ||
292 | + currTerm: 1, | ||
293 | + unExpireDays: -3, | ||
294 | + billInfo: '三叶草运动休闲鞋', | ||
295 | + currAmt: '845.00', | ||
296 | + currNoFeeAmt: '840.00', | ||
297 | + currFee: '0.00' | ||
298 | + }, { | ||
299 | + billNo: 'x00002', | ||
300 | + terms: 3, | ||
301 | + currTerm: 2, | ||
302 | + unExpireDays: 10, | ||
303 | + billInfo: '三叶草运动休闲鞋', | ||
304 | + currAmt: '840.00', | ||
305 | + currNoFeeAmt: '840.00', | ||
306 | + currFee: '5.00' | ||
307 | + }, { | ||
308 | + billNo: 'x00003', | ||
309 | + terms: 3, | ||
310 | + currTerm: 1, | ||
311 | + unExpireDays: -3, | ||
312 | + billInfo: '三叶草运动休闲鞋', | ||
313 | + currAmt: '845.00', | ||
314 | + currNoFeeAmt: '840.00', | ||
315 | + currFee: '0.00' | ||
316 | + } | ||
317 | + ], | ||
318 | + pageNo: 1, | ||
319 | + pageTotal: 1, | ||
320 | + total: 2 | ||
321 | + }, | ||
322 | + md5: 'c1d725306fb09dcbf504776d276521cb', | ||
323 | + message: 'ok' | ||
324 | + }; | ||
325 | if (result && result.code === 200) { | 325 | if (result && result.code === 200) { |
326 | return _processAmtList(result.data.amtList, params.queryDays); | 326 | return _processAmtList(result.data.amtList, params.queryDays); |
327 | } else { | 327 | } else { |
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | {{#data}} | 9 | {{#data}} |
10 | <ul class="repay-list"> | 10 | <ul class="repay-list"> |
11 | {{#each repaymentList}} | 11 | {{#each repaymentList}} |
12 | - <li data-currfee="{{currFee}}" data-curramt="{{currAmt}}" data-billno="{{billNo}}" data-termNo={{currTerm}}> | 12 | + <li data-currfee="{{currFee}}" data-currNoFeeAmt="{{currNoFeeAmt}}" data-curramt="{{currAmt}}" data-billno="{{billNo}}" data-termNo={{currTerm}}> |
13 | <input id="list-{{billNo}}" type="checkbox" class="installment-check-btn" {{#if isChecked}}checked{{/if}}/> | 13 | <input id="list-{{billNo}}" type="checkbox" class="installment-check-btn" {{#if isChecked}}checked{{/if}}/> |
14 | <label for="list-{{billNo}}"> | 14 | <label for="list-{{billNo}}"> |
15 | <div class="cont"> | 15 | <div class="cont"> |
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | <input id="repayment-total" type="checkbox" class="installment-check-btn" {{#if isAllChecked}}checked{{/if}}/> | 15 | <input id="repayment-total" type="checkbox" class="installment-check-btn" {{#if isAllChecked}}checked{{/if}}/> |
16 | <label for="repayment-total"> | 16 | <label for="repayment-total"> |
17 | <p class="repay-price">待支付:<span>¥<span class="curr-amt">{{round currAmtCount}}</span></span></p> | 17 | <p class="repay-price">待支付:<span>¥<span class="curr-amt">{{round currAmtCount}}</span></span></p> |
18 | - {{#if isCurrFee}}<p class="serve-price">含服务费¥<span class="curr-fee">{{round currFeeCount}}</span></p>{{/if}} | 18 | + <p class="serve-price" {{#if isCurrFee}}style="display:block;"{{/if}}>含服务费¥<span class="curr-fee">{{round currFeeCount}}</span></p> |
19 | </label> | 19 | </label> |
20 | <a href="" class="repayment-btn">立即还款</a> | 20 | <a href="" class="repayment-btn">立即还款</a> |
21 | </div> | 21 | </div> |
@@ -8,7 +8,8 @@ var $ = require('yoho-jquery'), | @@ -8,7 +8,8 @@ var $ = require('yoho-jquery'), | ||
8 | tip = require('../plugin/tip'); | 8 | tip = require('../plugin/tip'); |
9 | 9 | ||
10 | var $currAmt = $('.repayment-bottom').find('.curr-amt'), | 10 | var $currAmt = $('.repayment-bottom').find('.curr-amt'), |
11 | - $currFee = $('.repayment-bottom').find('.curr-fee'); | 11 | + $currFee = $('.repayment-bottom').find('.curr-fee'), |
12 | + $servePrice = $('.serve-price'); | ||
12 | 13 | ||
13 | require('./overdue-notice'); | 14 | require('./overdue-notice'); |
14 | 15 | ||
@@ -72,13 +73,19 @@ $('.repay-list label').on('click', function() { | @@ -72,13 +73,19 @@ $('.repay-list label').on('click', function() { | ||
72 | } | 73 | } |
73 | } | 74 | } |
74 | 75 | ||
76 | + if (parseFloat($currFee.html()) > 0) { | ||
77 | + $servePrice.show(); | ||
78 | + } else { | ||
79 | + $servePrice.hide(); | ||
80 | + } | ||
81 | + | ||
75 | setTimeout(function() { | 82 | setTimeout(function() { |
76 | count = $('.repay-list input:checked').length; | 83 | count = $('.repay-list input:checked').length; |
77 | $('#repayment-total').prop('checked', count === $('.repay-list li').length); | 84 | $('#repayment-total').prop('checked', count === $('.repay-list li').length); |
78 | }, 0); | 85 | }, 0); |
79 | }); | 86 | }); |
80 | 87 | ||
81 | -// 全选||全不选 | 88 | +//全选||全不选 |
82 | $('.repayment-bottom label').on('click', function() { | 89 | $('.repayment-bottom label').on('click', function() { |
83 | var totalAmt = 0; | 90 | var totalAmt = 0; |
84 | var totalFee = 0; | 91 | var totalFee = 0; |
@@ -87,6 +94,7 @@ $('.repayment-bottom label').on('click', function() { | @@ -87,6 +94,7 @@ $('.repayment-bottom label').on('click', function() { | ||
87 | $('.repay-list input').prop('checked', false); | 94 | $('.repay-list input').prop('checked', false); |
88 | $currAmt.html('0.00'); | 95 | $currAmt.html('0.00'); |
89 | $currFee.html('0.00'); | 96 | $currFee.html('0.00'); |
97 | + $servePrice.hide(); | ||
90 | } else { | 98 | } else { |
91 | $('.repay-list input').prop('checked', true); | 99 | $('.repay-list input').prop('checked', true); |
92 | $('.repay-list li').each(function() { | 100 | $('.repay-list li').each(function() { |
@@ -96,6 +104,12 @@ $('.repayment-bottom label').on('click', function() { | @@ -96,6 +104,12 @@ $('.repayment-bottom label').on('click', function() { | ||
96 | 104 | ||
97 | $currAmt.html(totalAmt.toFixed(2)); | 105 | $currAmt.html(totalAmt.toFixed(2)); |
98 | $currFee.html(totalFee.toFixed(2)); | 106 | $currFee.html(totalFee.toFixed(2)); |
107 | + | ||
108 | + if (parseFloat($currFee.html()) > 0) { | ||
109 | + $servePrice.show(); | ||
110 | + } else { | ||
111 | + $servePrice.hide(); | ||
112 | + } | ||
99 | } | 113 | } |
100 | }); | 114 | }); |
101 | 115 | ||
@@ -118,6 +132,35 @@ $('.repayment-btn').on('click', function() { | @@ -118,6 +132,35 @@ $('.repayment-btn').on('click', function() { | ||
118 | encodeURIComponent(JSON.stringify(list)) + ',"amount":' + (+$currAmt.html()) + '}}'); | 132 | encodeURIComponent(JSON.stringify(list)) + ',"amount":' + (+$currAmt.html()) + '}}'); |
119 | }); | 133 | }); |
120 | 134 | ||
135 | +// const repayment = new Repayment({ | ||
136 | +// onGetSelection: function() { | ||
137 | +// const ret = []; | ||
138 | + | ||
139 | +// $(`${CHECKBOX_SELECTOR}:checked`).each(function(key, item) { | ||
140 | +// const li = $(item).parents('li'); | ||
141 | + | ||
142 | +// const data = { | ||
143 | +// index: key, | ||
144 | +// orderCode: li.attr('data-billno'), | ||
145 | +// termNo: li.attr('data-termNo'), | ||
146 | +// amount: parseFloat(li.attr('data-currNoFeeAmt')), | ||
147 | +// fee: parseFloat(li.attr('data-currfee')) + 0 | ||
148 | +// }; | ||
149 | + | ||
150 | +// ret.push(data); | ||
151 | +// }); | ||
152 | + | ||
153 | +// return ret; | ||
154 | +// }, | ||
155 | +// onDeselectAll: function() { | ||
156 | +// $(`${CHECKBOX_SELECTOR}:checked`).prop('checked', false); | ||
157 | +// return []; | ||
158 | +// }, | ||
159 | +// onSelectAll: function() { | ||
160 | +// $(`${CHECKBOX_SELECTOR}:not(:checked)`).prop('checked', true); | ||
161 | +// return this.getSelection(); | ||
162 | +// } | ||
163 | +// }); | ||
121 | 164 | ||
122 | // 跳转到还款详情 | 165 | // 跳转到还款详情 |
123 | window.jumpDetail = function(id) { | 166 | window.jumpDetail = function(id) { |
@@ -28,10 +28,12 @@ var Repayment = function(options) { | @@ -28,10 +28,12 @@ var Repayment = function(options) { | ||
28 | 28 | ||
29 | var params = { | 29 | var params = { |
30 | action: 'go.instalmentRepayment', | 30 | action: 'go.instalmentRepayment', |
31 | - list: self.getSelection() | 31 | + list: self.getSelection(), |
32 | + amount: this.total | ||
32 | }; | 33 | }; |
33 | 34 | ||
34 | $(this).attr('href', path + '?openby:yohobuy=' + encodeURIComponent(JSON.stringify(params))); | 35 | $(this).attr('href', path + '?openby:yohobuy=' + encodeURIComponent(JSON.stringify(params))); |
36 | + return false; | ||
35 | }); | 37 | }); |
36 | 38 | ||
37 | $('#repayment-total').click(function() { | 39 | $('#repayment-total').click(function() { |
@@ -113,6 +115,12 @@ Repayment.prototype.update = function() { | @@ -113,6 +115,12 @@ Repayment.prototype.update = function() { | ||
113 | 115 | ||
114 | this.setTotal(this.total); | 116 | this.setTotal(this.total); |
115 | this.setFee(this.fee); | 117 | this.setFee(this.fee); |
118 | + | ||
119 | + if (this.fee > 0) { | ||
120 | + $('.serve-price').show(); | ||
121 | + } else { | ||
122 | + $('.serve-price').hide(); | ||
123 | + } | ||
116 | }; | 124 | }; |
117 | 125 | ||
118 | module.exports = Repayment; | 126 | module.exports = Repayment; |
-
Please register or login to post a comment