Showing
7 changed files
with
150 additions
and
123 deletions
@@ -222,7 +222,7 @@ const startingService = (req, res) => { | @@ -222,7 +222,7 @@ const startingService = (req, res) => { | ||
222 | 222 | ||
223 | const activateService = (req, res, next) => { | 223 | const activateService = (req, res, next) => { |
224 | installmentModel.activateService({ | 224 | installmentModel.activateService({ |
225 | - uid: req.cookies.installmentUid || 4, | 225 | + uid: req.cookies.installmentUid || 53289, |
226 | userName: req.body.userName, | 226 | userName: req.body.userName, |
227 | identityCardNo: req.body.identityCardNo, | 227 | identityCardNo: req.body.identityCardNo, |
228 | cardNo: req.body.cardNo, | 228 | cardNo: req.body.cardNo, |
@@ -59,7 +59,8 @@ | @@ -59,7 +59,8 @@ | ||
59 | 数据智能加密,保障您的用卡安全 | 59 | 数据智能加密,保障您的用卡安全 |
60 | </div> | 60 | </div> |
61 | 61 | ||
62 | - <button id="apply-button" class="apply-button" type="submit">下一步</button> | 62 | + <a href="/home/installment/starting-service?openby:yohobuy=%7B%22action%22%3A%22go.instalmentActivated%22%7D" id="apply-button" class="apply-button">下一步</a> |
63 | + <a href="#" id="hidden-link"></a> | ||
63 | <div class="provider-mark"> | 64 | <div class="provider-mark"> |
64 | Yoho!Buy信而富联合提供 | 65 | Yoho!Buy信而富联合提供 |
65 | </div> | 66 | </div> |
1 | -const $ = require('yoho-jquery'); | ||
2 | -const Repayment = require('./repayment'); | ||
3 | -const CHECKBOX_SELECTOR = 'input.installment-term'; | ||
4 | -const tip = require('../plugin/tip'); | ||
5 | - | ||
6 | -require('./overdue-notice'); | ||
7 | - | ||
8 | - | ||
9 | -/** | ||
10 | - * 订单状态样式 | ||
11 | - */ | ||
12 | -$('.status').each(function() { | ||
13 | - const text = $(this).text().trim(); | ||
14 | - const fade = text.match(/已还款|已退款|已结清|订单取消/) || []; | ||
15 | - const expire = text.match(/逾期/) || []; | ||
16 | - | ||
17 | - if (fade.length > 0) { | ||
18 | - $(this).addClass('faded'); | ||
19 | - } else if (expire.length > 0) { | ||
20 | - $(this).addClass('expired'); | ||
21 | - } | ||
22 | -}); | ||
23 | - | ||
24 | -const repayment = new Repayment({ | 1 | +var $ = require('yoho-jquery'); |
2 | +var Repayment = require('./repayment'); | ||
3 | +var CHECKBOX_SELECTOR = 'input.installment-term'; | ||
4 | +var tip = require('../plugin/tip'); | ||
5 | +var repayment = new Repayment({ | ||
25 | onGetSelection: function() { | 6 | onGetSelection: function() { |
26 | - const ret = []; | 7 | + var ret = []; |
27 | 8 | ||
28 | - $(`${CHECKBOX_SELECTOR}:checked`).each(function() { | ||
29 | - const input = $(this); | 9 | + $(CHECKBOX_SELECTOR + ':checked').each(function() { |
10 | + var input = $(this); | ||
30 | 11 | ||
31 | - const data = { | 12 | + var data = { |
32 | index: input.data('sortId'), | 13 | index: input.data('sortId'), |
33 | orderCode: input.data('orderCode'), | 14 | orderCode: input.data('orderCode'), |
34 | termNo: input.data('sortId'), | 15 | termNo: input.data('sortId'), |
@@ -42,25 +23,43 @@ const repayment = new Repayment({ | @@ -42,25 +23,43 @@ const repayment = new Repayment({ | ||
42 | return ret; | 23 | return ret; |
43 | }, | 24 | }, |
44 | onDeselectAll: function() { | 25 | onDeselectAll: function() { |
45 | - $(`${CHECKBOX_SELECTOR}:checked`).prop('checked', false); | 26 | + $(CHECKBOX_SELECTOR + ':checked').prop('checked', false); |
46 | return []; | 27 | return []; |
47 | }, | 28 | }, |
48 | onSelectAll: function() { | 29 | onSelectAll: function() { |
49 | - $(`${CHECKBOX_SELECTOR}:not(:checked)`).prop('checked', true); | 30 | + $(CHECKBOX_SELECTOR + ':not(:checked)').prop('checked', true); |
50 | return this.getSelection(); | 31 | return this.getSelection(); |
51 | } | 32 | } |
52 | }); | 33 | }); |
53 | 34 | ||
35 | +require('./overdue-notice'); | ||
36 | + | ||
54 | repayment.setTotal(0); | 37 | repayment.setTotal(0); |
55 | repayment.setFee(0); | 38 | repayment.setFee(0); |
56 | 39 | ||
57 | 40 | ||
58 | -$(`${CHECKBOX_SELECTOR}:checkbox`).click(function() { | ||
59 | - const selection = repayment.getSelection(); | ||
60 | - let isSkipped = false; | ||
61 | - let lastIndex = 0; | 41 | +/** |
42 | + * 订单状态样式 | ||
43 | + */ | ||
44 | +$('.status').each(function() { | ||
45 | + var text = $(this).text().trim(); | ||
46 | + var fade = text.match(/已还款|已退款|已结清|订单取消/) || []; | ||
47 | + var expire = text.match(/逾期/) || []; | ||
48 | + | ||
49 | + if (fade.length > 0) { | ||
50 | + $(this).addClass('faded'); | ||
51 | + } else if (expire.length > 0) { | ||
52 | + $(this).addClass('expired'); | ||
53 | + } | ||
54 | +}); | ||
55 | + | ||
56 | +$(CHECKBOX_SELECTOR + ':checkbox').click(function() { | ||
57 | + var selection = repayment.getSelection(); | ||
58 | + var isSkipped = false; | ||
59 | + var lastIndex = 0; | ||
60 | + var self = this; | ||
62 | 61 | ||
63 | - selection.forEach((sel)=> { | 62 | + selection.forEach(function(sel) { |
64 | if (sel.index - lastIndex > 1) { | 63 | if (sel.index - lastIndex > 1) { |
65 | isSkipped = true; | 64 | isSkipped = true; |
66 | } else { | 65 | } else { |
@@ -69,8 +68,8 @@ $(`${CHECKBOX_SELECTOR}:checkbox`).click(function() { | @@ -69,8 +68,8 @@ $(`${CHECKBOX_SELECTOR}:checkbox`).click(function() { | ||
69 | }); | 68 | }); |
70 | 69 | ||
71 | if (isSkipped) { | 70 | if (isSkipped) { |
72 | - setTimeout(()=> { | ||
73 | - tip.show($(this).is(':checked') ? '请按时间顺序取消选择,不可以跨期' : '请按时间顺序添加还款,不可以跨期'); | 71 | + setTimeout(function() { |
72 | + tip.show($(self).is(':checked') ? '请按时间顺序取消选择,不可以跨期' : '请按时间顺序添加还款,不可以跨期'); | ||
74 | }, 0); | 73 | }, 0); |
75 | return false; | 74 | return false; |
76 | } | 75 | } |
1 | -const $ = require('yoho-jquery'); | ||
2 | -const search = { | 1 | +var $ = require('yoho-jquery'); |
2 | +var search = { | ||
3 | pageIndex: 1, | 3 | pageIndex: 1, |
4 | type: 1 | 4 | type: 1 |
5 | }; | 5 | }; |
@@ -10,12 +10,12 @@ const search = { | @@ -10,12 +10,12 @@ const search = { | ||
10 | * | 10 | * |
11 | * @param type | 11 | * @param type |
12 | */ | 12 | */ |
13 | -const loadOrderList = (pageIndex, type)=> { | 13 | +var loadOrderList = function(pageIndex, type) { |
14 | if (type) { | 14 | if (type) { |
15 | $.get('/home/installment/order.html', { | 15 | $.get('/home/installment/order.html', { |
16 | page: pageIndex, | 16 | page: pageIndex, |
17 | type: type | 17 | type: type |
18 | - }).then((result)=> { | 18 | + }).then(function(result) { |
19 | if (type !== search.type) { | 19 | if (type !== search.type) { |
20 | // 切换TAB时清空列表 | 20 | // 切换TAB时清空列表 |
21 | $('#order-list').empty(); | 21 | $('#order-list').empty(); |
@@ -26,7 +26,7 @@ const loadOrderList = (pageIndex, type)=> { | @@ -26,7 +26,7 @@ const loadOrderList = (pageIndex, type)=> { | ||
26 | 26 | ||
27 | // 订单状态样式 | 27 | // 订单状态样式 |
28 | $('.status').each(function() { | 28 | $('.status').each(function() { |
29 | - const text = $(this).text(); | 29 | + var text = $(this).text(); |
30 | 30 | ||
31 | if (text.indexOf(/已还清|已取消|已退款|已结清|订单取消/)) { | 31 | if (text.indexOf(/已还清|已取消|已退款|已结清|订单取消/)) { |
32 | $(this).addClass('faded'); | 32 | $(this).addClass('faded'); |
@@ -51,7 +51,7 @@ $('.header-tab a').click(function() { | @@ -51,7 +51,7 @@ $('.header-tab a').click(function() { | ||
51 | loadOrderList(search.pageIndex, 1); | 51 | loadOrderList(search.pageIndex, 1); |
52 | 52 | ||
53 | // TODO: 滚屏分页 | 53 | // TODO: 滚屏分页 |
54 | -$(window).scroll(()=> { | 54 | +$(window).scroll(function() { |
55 | // var scrollTop = $(window).scrollTop(); | 55 | // var scrollTop = $(window).scrollTop(); |
56 | 56 | ||
57 | 57 |
1 | -const $ = require('yoho-jquery'); | ||
2 | -const tip = require('../plugin/tip'); | 1 | +var $ = require('yoho-jquery'); |
2 | +var tip = require('../plugin/tip'); | ||
3 | 3 | ||
4 | -const Timer = function() { | 4 | +var Timer = function() { |
5 | this.counter = 0; | 5 | this.counter = 0; |
6 | this.countdownTimer = null; | 6 | this.countdownTimer = null; |
7 | }; | 7 | }; |
8 | 8 | ||
9 | -const FormModel = function() { | ||
10 | - Object.assign(this, { | 9 | +var FormModel = function() { |
10 | + $.extend(this, { | ||
11 | userName: '', | 11 | userName: '', |
12 | identityCardNo: '', | 12 | identityCardNo: '', |
13 | cardNo: '', | 13 | cardNo: '', |
@@ -17,7 +17,25 @@ const FormModel = function() { | @@ -17,7 +17,25 @@ const FormModel = function() { | ||
17 | }); | 17 | }); |
18 | }; | 18 | }; |
19 | 19 | ||
20 | -const formModel = new FormModel(); | 20 | +var formModel = new FormModel(); |
21 | + | ||
22 | +/** | ||
23 | + * 表单验证 | ||
24 | + */ | ||
25 | +var validateForm = function() { | ||
26 | + var applyButton = $('#apply-button'); | ||
27 | + | ||
28 | + if (formModel.userName && | ||
29 | + formModel.identityCardNo && | ||
30 | + formModel.cardNo && | ||
31 | + formModel.mobile && | ||
32 | + formModel.snsCheckCode && | ||
33 | + formModel.agreements === 'on') { | ||
34 | + applyButton.prop('disabled', false); | ||
35 | + } else { | ||
36 | + applyButton.prop('disabled', true); | ||
37 | + } | ||
38 | +}; | ||
21 | 39 | ||
22 | /** | 40 | /** |
23 | * 倒计时 | 41 | * 倒计时 |
@@ -27,6 +45,8 @@ const formModel = new FormModel(); | @@ -27,6 +45,8 @@ const formModel = new FormModel(); | ||
27 | * @param complete 完成回调 | 45 | * @param complete 完成回调 |
28 | */ | 46 | */ |
29 | Timer.prototype.startCountdown = function(start, tick, complete) { | 47 | Timer.prototype.startCountdown = function(start, tick, complete) { |
48 | + var self = this; | ||
49 | + | ||
30 | if (this.counter > 0 || this.countdownTimer) { | 50 | if (this.counter > 0 || this.countdownTimer) { |
31 | return; | 51 | return; |
32 | } else { | 52 | } else { |
@@ -43,47 +63,60 @@ Timer.prototype.startCountdown = function(start, tick, complete) { | @@ -43,47 +63,60 @@ Timer.prototype.startCountdown = function(start, tick, complete) { | ||
43 | tick.call(this, this.counter); | 63 | tick.call(this, this.counter); |
44 | } | 64 | } |
45 | 65 | ||
66 | + this.complete = complete; | ||
67 | + | ||
68 | + | ||
46 | // 开始计时器 | 69 | // 开始计时器 |
47 | - this.countdownTimer = setInterval(()=> { | ||
48 | - this.counter--; | 70 | + this.countdownTimer = setInterval(function() { |
71 | + self.counter--; | ||
49 | 72 | ||
50 | - if (this.counter <= 0) { | 73 | + if (self.counter <= 0) { |
51 | if (complete) { | 74 | if (complete) { |
52 | - clearInterval(this.countdownTimer); | 75 | + clearInterval(self.countdownTimer); |
53 | 76 | ||
54 | // 重置计时器 | 77 | // 重置计时器 |
55 | - this.counter = 0; | ||
56 | - this.countdownTimer = null; | ||
57 | - complete.call(this); | 78 | + self.counter = 0; |
79 | + self.countdownTimer = null; | ||
80 | + complete.call(self); | ||
58 | } | 81 | } |
59 | } | 82 | } |
60 | 83 | ||
61 | // 完成回调 | 84 | // 完成回调 |
62 | - if (tick && this.counter > 0) { | ||
63 | - tick.call(this, this.counter); | 85 | + if (tick && self.counter > 0) { |
86 | + tick.call(self, self.counter); | ||
64 | } | 87 | } |
65 | }, 1000); | 88 | }, 1000); |
89 | + | ||
90 | + return this; | ||
66 | }; | 91 | }; |
67 | 92 | ||
93 | +Timer.prototype.reset = function() { | ||
94 | + if (this.complete) { | ||
95 | + this.complete(); | ||
96 | + } | ||
97 | +}; | ||
68 | 98 | ||
69 | /** | 99 | /** |
70 | * 点击发送短信事件 | 100 | * 点击发送短信事件 |
71 | */ | 101 | */ |
72 | $('#send-sms').click(function() { | 102 | $('#send-sms').click(function() { |
73 | - new Timer().startCountdown(function() { | ||
74 | - $.get('/home/installment/starting-service/verify-code', { | ||
75 | - mobile: formModel.mobile | ||
76 | - }).then((result)=> { | ||
77 | - if (result.code === 200) { | ||
78 | - formModel.verifyId = result.data.verifyId; | ||
79 | - } | ||
80 | - }); | ||
81 | - }, function(counter) { | ||
82 | - // 进度回调 | ||
83 | - $('#send-sms').text(counter + 's'); | ||
84 | - }, function() { | ||
85 | - // 倒计时结束后再次显示 "获取验证码" | ||
86 | - $('#send-sms').text('获取验证码'); | 103 | + $.get('/home/installment/starting-service/verify-code', { |
104 | + mobile: formModel.mobile | ||
105 | + }).then(function(result) { | ||
106 | + if (result.code === 200) { | ||
107 | + formModel.verifyId = result.data.verifyId; | ||
108 | + new Timer().startCountdown(function() { | ||
109 | + }, function(counter) { | ||
110 | + // 进度回调 | ||
111 | + $('#send-sms').text(counter + 's'); | ||
112 | + }, function() { | ||
113 | + // 倒计时结束后再次显示 "获取验证码" | ||
114 | + $('#send-sms').text('获取验证码'); | ||
115 | + }); | ||
116 | + | ||
117 | + } else { | ||
118 | + tip.show(result.message); | ||
119 | + } | ||
87 | }); | 120 | }); |
88 | 121 | ||
89 | return false; | 122 | return false; |
@@ -93,14 +126,14 @@ $('#send-sms').click(function() { | @@ -93,14 +126,14 @@ $('#send-sms').click(function() { | ||
93 | * 银行卡格式化 | 126 | * 银行卡格式化 |
94 | */ | 127 | */ |
95 | $('#cardNo').keyup(function() { | 128 | $('#cardNo').keyup(function() { |
96 | - const value = $(this).val(); | 129 | + var value = $(this).val(); |
130 | + var cardNo = $(this).val().replace(/\s/, ''); | ||
97 | 131 | ||
98 | $(this).val(value.replace(/[^\d]/g, '').replace(/(\d{4})(?=\d)/g, '$1 ')).trigger('change'); | 132 | $(this).val(value.replace(/[^\d]/g, '').replace(/(\d{4})(?=\d)/g, '$1 ')).trigger('change'); |
99 | -}).change(function() { | ||
100 | - const cardNo = $(this).val().replace(/\s/, ''); | 133 | + |
101 | 134 | ||
102 | // 获取银行信息 | 135 | // 获取银行信息 |
103 | - $.get('/home/installment/bank-info', {cardNo: cardNo}).then((result)=> { | 136 | + $.get('/home/installment/bank-info', {cardNo: cardNo}).then(function(result) { |
104 | if (result.code === 200) { | 137 | if (result.code === 200) { |
105 | // 设置银行名称 | 138 | // 设置银行名称 |
106 | $('#bank-name').text(result.data.bankName); | 139 | $('#bank-name').text(result.data.bankName); |
@@ -108,31 +141,16 @@ $('#cardNo').keyup(function() { | @@ -108,31 +141,16 @@ $('#cardNo').keyup(function() { | ||
108 | // 设置银行图标 | 141 | // 设置银行图标 |
109 | $('#bank-icon').attr('src', '/img/home/bank-icons/' + result.data.bankCode + '.png'); | 142 | $('#bank-icon').attr('src', '/img/home/bank-icons/' + result.data.bankCode + '.png'); |
110 | $('#bank-desc').show(); | 143 | $('#bank-desc').show(); |
144 | + } else { | ||
145 | + $('#bank-desc').hide(); | ||
111 | } | 146 | } |
112 | }); | 147 | }); |
113 | }); | 148 | }); |
114 | 149 | ||
115 | -/** | ||
116 | - * 表单验证 | ||
117 | - */ | ||
118 | -const validateForm = function() { | ||
119 | - const applyButton = $('#apply-button'); | ||
120 | - | ||
121 | - if (formModel.userName && | ||
122 | - formModel.identityCardNo && | ||
123 | - formModel.cardNo && | ||
124 | - formModel.mobile && | ||
125 | - formModel.snsCheckCode && | ||
126 | - formModel.agreements === 'on') { | ||
127 | - applyButton.prop('disabled', false); | ||
128 | - } else { | ||
129 | - applyButton.prop('disabled', true); | ||
130 | - } | ||
131 | -}; | ||
132 | 150 | ||
133 | // 输入框改变时同时更新模型 | 151 | // 输入框改变时同时更新模型 |
134 | $('input').on('change', function() { | 152 | $('input').on('change', function() { |
135 | - const name = $(this).attr('name'); | 153 | + var name = $(this).attr('name'); |
136 | 154 | ||
137 | if ($(this).is(':checkbox')) { | 155 | if ($(this).is(':checkbox')) { |
138 | formModel[name] = $(this).is(':checked') ? $(this).val() : null; | 156 | formModel[name] = $(this).is(':checked') ? $(this).val() : null; |
@@ -145,23 +163,29 @@ $('input').on('change', function() { | @@ -145,23 +163,29 @@ $('input').on('change', function() { | ||
145 | 163 | ||
146 | validateForm(); | 164 | validateForm(); |
147 | 165 | ||
148 | -setInterval(()=> { | 166 | +setInterval(function() { |
149 | validateForm(); | 167 | validateForm(); |
150 | }, 500); | 168 | }, 500); |
151 | 169 | ||
152 | /** | 170 | /** |
153 | * 表单提交 | 171 | * 表单提交 |
154 | */ | 172 | */ |
155 | -$('#apply-form').submit(function() { | ||
156 | - $.post('/home/installment/activate-service', formModel).then((result)=> { | ||
157 | - const params = { action: 'go.instalmentRepayment' }; | ||
158 | - | 173 | +$('#apply-button').click(function() { |
174 | + $.post('/home/installment/activate-service', formModel).then(function(result) { | ||
159 | if (result.code === 200) { | 175 | if (result.code === 200) { |
160 | - location.href = `/home/installment/review?openby:yohobuy=${encodeURIComponent(JSON.stringify(params))}`; | 176 | + if (result.data.result === 'success') { |
177 | + // 调用成功 | ||
178 | + $('#hidden-link').click(); // 点击一个隐藏的超链接才能触发APP的URL回调?到底什么鬼? | ||
179 | + } else { | ||
180 | + // 调用失败 | ||
181 | + if (result.data.resultMsgType === '1') { | ||
182 | + tip.show(result.data.resultMsg); | ||
183 | + return false; | ||
184 | + } | ||
185 | + } | ||
161 | } else { | 186 | } else { |
162 | tip.show(result.message); | 187 | tip.show(result.message); |
163 | - | 188 | + return false; |
164 | } | 189 | } |
165 | }); | 190 | }); |
166 | - return false; | ||
167 | }); | 191 | }); |
1 | -const Repayment = function(options) { | ||
2 | - this.settings = Object.assign({ | 1 | +var Repayment = function(options) { |
2 | + var self = this; | ||
3 | + | ||
4 | + this.settings = $.extend({}, { | ||
3 | 5 | ||
4 | onSelectAll: $.noop, | 6 | onSelectAll: $.noop, |
5 | 7 | ||
@@ -20,12 +22,11 @@ const Repayment = function(options) { | @@ -20,12 +22,11 @@ const Repayment = function(options) { | ||
20 | this.total = 0; | 22 | this.total = 0; |
21 | this.fee = 0; | 23 | this.fee = 0; |
22 | 24 | ||
23 | - const self = this; | ||
24 | 25 | ||
25 | $('.repayment-btn').on('click', function() { | 26 | $('.repayment-btn').on('click', function() { |
26 | - const path = location.pathname; | 27 | + var path = location.pathname; |
27 | 28 | ||
28 | - const params = { | 29 | + var params = { |
29 | action: 'go.instalmentRepayment', | 30 | action: 'go.instalmentRepayment', |
30 | list: self.getSelection() | 31 | list: self.getSelection() |
31 | }; | 32 | }; |
@@ -33,17 +34,17 @@ const Repayment = function(options) { | @@ -33,17 +34,17 @@ const Repayment = function(options) { | ||
33 | $(this).attr('href', path + '?openby:yohobuy=' + encodeURIComponent(JSON.stringify(params))); | 34 | $(this).attr('href', path + '?openby:yohobuy=' + encodeURIComponent(JSON.stringify(params))); |
34 | }); | 35 | }); |
35 | 36 | ||
36 | - $('#repayment-total').click(()=> { | ||
37 | - const isChecked = $(this).data('checked'); | 37 | + $('#repayment-total').click(function() { |
38 | + var isChecked = $(this).data('checked'); | ||
38 | 39 | ||
39 | if (!isChecked) { | 40 | if (!isChecked) { |
40 | - this.settings.onSelectAll.bind(this)(); | 41 | + self.settings.onSelectAll.bind(self)(); |
41 | } else { | 42 | } else { |
42 | - this.settings.onDeselectAll.bind(this)(); | 43 | + self.settings.onDeselectAll.bind(self)(); |
43 | } | 44 | } |
44 | 45 | ||
45 | - this.update(); | ||
46 | - $(this).data('checked', !$(this).data('checked')); | 46 | + self.update(); |
47 | + $(self).data('checked', !$(self).data('checked')); | ||
47 | }); | 48 | }); |
48 | }; | 49 | }; |
49 | 50 | ||
@@ -55,13 +56,13 @@ const Repayment = function(options) { | @@ -55,13 +56,13 @@ const Repayment = function(options) { | ||
55 | * @private | 56 | * @private |
56 | */ | 57 | */ |
57 | Repayment.prototype._formatCurrency = function(amount) { | 58 | Repayment.prototype._formatCurrency = function(amount) { |
58 | - const m = ('' + amount).match(/(\d+)\.?(\d+)?/); | ||
59 | - const fixedPart = m[1], floatPart = m[2]; | 59 | + var m = ('' + amount).match(/(\d+)\.?(\d+)?/); |
60 | + var fixedPart = m[1], floatPart = m[2]; | ||
60 | 61 | ||
61 | - let ret = '0.00'; | 62 | + var ret = '0.00'; |
62 | 63 | ||
63 | if (m && m.length === 3) { | 64 | if (m && m.length === 3) { |
64 | - ret = `${fixedPart}.${floatPart || '00'}`; | 65 | + ret = fixedPart + (floatPart || '00'); |
65 | } | 66 | } |
66 | 67 | ||
67 | return ret; | 68 | return ret; |
@@ -96,16 +97,17 @@ Repayment.prototype.getSelection = function() { | @@ -96,16 +97,17 @@ Repayment.prototype.getSelection = function() { | ||
96 | }; | 97 | }; |
97 | 98 | ||
98 | Repayment.prototype.update = function() { | 99 | Repayment.prototype.update = function() { |
99 | - const values = this.getSelection(); | 100 | + var values = this.getSelection(); |
101 | + var self = this; | ||
100 | 102 | ||
101 | this.total = 0; | 103 | this.total = 0; |
102 | this.fee = 0; | 104 | this.fee = 0; |
103 | 105 | ||
104 | if (values && values.length) { | 106 | if (values && values.length) { |
105 | - values.forEach((value)=> { | 107 | + values.forEach(function(value) { |
106 | // 计算还款总额和费用 | 108 | // 计算还款总额和费用 |
107 | - this.total += value.amount + value.fee; | ||
108 | - this.fee += value.fee; | 109 | + self.total += value.amount + value.fee; |
110 | + self.fee += value.fee; | ||
109 | }); | 111 | }); |
110 | } | 112 | } |
111 | 113 |
-
Please register or login to post a comment