Showing
4 changed files
with
27 additions
and
5 deletions
@@ -260,7 +260,7 @@ const orderIndex = (req, res) => { | @@ -260,7 +260,7 @@ const orderIndex = (req, res) => { | ||
260 | 260 | ||
261 | const orderList = (req, res) => { | 261 | const orderList = (req, res) => { |
262 | const params = { | 262 | const params = { |
263 | - uid: req.user.uid || 512579468, // TODO: fix me | 263 | + uid: req.user.uid || 8041876, // TODO: fix me |
264 | type: req.query.type || 1, | 264 | type: req.query.type || 1, |
265 | page: req.query.page || 1, | 265 | page: req.query.page || 1, |
266 | limit: req.query.limit || 10 | 266 | limit: req.query.limit || 10 |
@@ -276,7 +276,7 @@ const orderList = (req, res) => { | @@ -276,7 +276,7 @@ const orderList = (req, res) => { | ||
276 | 276 | ||
277 | const orderDetail = (req, res) => { | 277 | const orderDetail = (req, res) => { |
278 | const params = { | 278 | const params = { |
279 | - uid: req.user.id || 512579468, // TODO: fix me | 279 | + uid: req.user.id || 8041876, // TODO: fix me |
280 | orderCode: req.params.id | 280 | orderCode: req.params.id |
281 | }; | 281 | }; |
282 | 282 | ||
@@ -287,6 +287,9 @@ const orderDetail = (req, res) => { | @@ -287,6 +287,9 @@ const orderDetail = (req, res) => { | ||
287 | navTitle: '分期详情', | 287 | navTitle: '分期详情', |
288 | order: result.data, | 288 | order: result.data, |
289 | navBtn: false, | 289 | navBtn: false, |
290 | + currAmtCount: 0, | ||
291 | + currFeeCount: 0, | ||
292 | + isCurrFee: true, | ||
290 | helpers: { | 293 | helpers: { |
291 | isPaymentComplete: function(status, options) { | 294 | isPaymentComplete: function(status, options) { |
292 | if (status === 2) { // 已结清 | 295 | if (status === 2) { // 已结清 |
1 | const $ = require('yoho-jquery'); | 1 | const $ = require('yoho-jquery'); |
2 | const Repayment = require('./repayment'); | 2 | const Repayment = require('./repayment'); |
3 | const CHECKBOX_SELECTOR = 'input.installment-term'; | 3 | const CHECKBOX_SELECTOR = 'input.installment-term'; |
4 | +const tip = require('../plugin/tip'); | ||
4 | 5 | ||
5 | require('./overdue-notice'); | 6 | require('./overdue-notice'); |
6 | 7 | ||
@@ -20,8 +21,6 @@ $('.status').each(function() { | @@ -20,8 +21,6 @@ $('.status').each(function() { | ||
20 | } | 21 | } |
21 | }); | 22 | }); |
22 | 23 | ||
23 | - | ||
24 | - | ||
25 | const repayment = new Repayment({ | 24 | const repayment = new Repayment({ |
26 | onGetSelection: function() { | 25 | onGetSelection: function() { |
27 | const ret = []; | 26 | const ret = []; |
@@ -57,5 +56,24 @@ repayment.setFee(0); | @@ -57,5 +56,24 @@ repayment.setFee(0); | ||
57 | 56 | ||
58 | 57 | ||
59 | $(`${CHECKBOX_SELECTOR}:checkbox`).click(function() { | 58 | $(`${CHECKBOX_SELECTOR}:checkbox`).click(function() { |
59 | + const selection = repayment.getSelection(); | ||
60 | + let isSkipped = false; | ||
61 | + let lastIndex = 0; | ||
62 | + | ||
63 | + selection.forEach((sel)=> { | ||
64 | + if (sel.index - lastIndex > 1) { | ||
65 | + isSkipped = true; | ||
66 | + } else { | ||
67 | + lastIndex = sel.index; | ||
68 | + } | ||
69 | + }); | ||
70 | + | ||
71 | + if (isSkipped) { | ||
72 | + setTimeout(()=> { | ||
73 | + tip.show($(this).is(':checked') ? '请按时间顺序取消选择,不可以跨期' : '请按时间顺序添加还款,不可以跨期'); | ||
74 | + }, 0); | ||
75 | + return false; | ||
76 | + } | ||
77 | + | ||
60 | repayment.update(); | 78 | repayment.update(); |
61 | }); | 79 | }); |
-
Please register or login to post a comment