Merge branch 'feature/installment1' into release/4.9.1.0
Showing
7 changed files
with
36 additions
and
9 deletions
@@ -105,7 +105,7 @@ const index = (req, res, next) => { | @@ -105,7 +105,7 @@ const index = (req, res, next) => { | ||
105 | 105 | ||
106 | return params; | 106 | return params; |
107 | }); | 107 | }); |
108 | - } else if (openStatus === 1 || openStatus === 3) { | 108 | + } else if (openStatus === '1' || openStatus === '3') { |
109 | res.redirect('/home/installment/review?status=' + openStatus); | 109 | res.redirect('/home/installment/review?status=' + openStatus); |
110 | } | 110 | } |
111 | }).then((result) => { | 111 | }).then((result) => { |
@@ -320,7 +320,7 @@ const activateService = (params) => { | @@ -320,7 +320,7 @@ const activateService = (params) => { | ||
320 | method: 'user.instalment.activate', | 320 | method: 'user.instalment.activate', |
321 | debug: 'XYZ' // TODO: remove this | 321 | debug: 'XYZ' // TODO: remove this |
322 | }, params), { | 322 | }, params), { |
323 | - timeout: API_TIMEOUT | 323 | + timeout: 30000 |
324 | }); | 324 | }); |
325 | }; | 325 | }; |
326 | 326 |
@@ -48,16 +48,16 @@ | @@ -48,16 +48,16 @@ | ||
48 | min="1" | 48 | min="1" |
49 | pattern="\d*" | 49 | pattern="\d*" |
50 | placeholder="请输入验证码" size="6" maxlength="6" /> | 50 | placeholder="请输入验证码" size="6" maxlength="6" /> |
51 | - <button id="send-sms" class="count-down">获取验证码</button> | 51 | + <button id="send-sms" class="count-down disabled">获取验证码</button> |
52 | <div class="clearfix"></div> | 52 | <div class="clearfix"></div> |
53 | </div> | 53 | </div> |
54 | 54 | ||
55 | <div class="agreements"> | 55 | <div class="agreements"> |
56 | <input id="accept-agreements" name="agreements" type="checkbox" class="installment-check-btn"/> | 56 | <input id="accept-agreements" name="agreements" type="checkbox" class="installment-check-btn"/> |
57 | <label for="accept-agreements"> | 57 | <label for="accept-agreements"> |
58 | - <span>免费开通,详情请见 | 58 | + <div class="text-label">免费开通,详情请见 |
59 | <a id="agreements" href="" data-href="/home/installment/agreement">《有货分期-信而富用户服务协议&借款服务协议》</a> | 59 | <a id="agreements" href="" data-href="/home/installment/agreement">《有货分期-信而富用户服务协议&借款服务协议》</a> |
60 | - </span> | 60 | + </div> |
61 | </label> | 61 | </label> |
62 | <div class="clearfix"></div> | 62 | <div class="clearfix"></div> |
63 | </div> | 63 | </div> |
@@ -43,6 +43,13 @@ var validateForm = function() { | @@ -43,6 +43,13 @@ var validateForm = function() { | ||
43 | ret = true; | 43 | ret = true; |
44 | } | 44 | } |
45 | 45 | ||
46 | + // 检查手机号码 | ||
47 | + if (formModel.cardNo && formModel.cardNo.length >= 16 && | ||
48 | + formModel.mobile && formModel.mobile.length === 11) { | ||
49 | + $('#send-sms').removeClass('disabled'); | ||
50 | + } else { | ||
51 | + $('#send-sms').addClass('disabled'); | ||
52 | + } | ||
46 | return ret; | 53 | return ret; |
47 | }; | 54 | }; |
48 | 55 | ||
@@ -150,6 +157,11 @@ Timer.prototype.reset = function() { | @@ -150,6 +157,11 @@ Timer.prototype.reset = function() { | ||
150 | $('#send-sms').click(function() { | 157 | $('#send-sms').click(function() { |
151 | var self = this; | 158 | var self = this; |
152 | 159 | ||
160 | + // 数据不完整情况下不能发送验证码 | ||
161 | + if ($(this).hasClass('disabled')) { | ||
162 | + return false; | ||
163 | + } | ||
164 | + | ||
153 | if ($(this).data('running')) { | 165 | if ($(this).data('running')) { |
154 | return false; | 166 | return false; |
155 | } | 167 | } |
@@ -200,8 +212,7 @@ $('#cardNo').keyup(function() { | @@ -200,8 +212,7 @@ $('#cardNo').keyup(function() { | ||
200 | } | 212 | } |
201 | }); | 213 | }); |
202 | 214 | ||
203 | - | ||
204 | -// 输入框改变时同时更新模型 | 215 | +/* |
205 | $('input').on('change', function() { | 216 | $('input').on('change', function() { |
206 | var name = $(this).attr('name'); | 217 | var name = $(this).attr('name'); |
207 | 218 | ||
@@ -213,10 +224,21 @@ $('input').on('change', function() { | @@ -213,10 +224,21 @@ $('input').on('change', function() { | ||
213 | 224 | ||
214 | validateForm(); | 225 | validateForm(); |
215 | }); | 226 | }); |
227 | +*/ | ||
216 | 228 | ||
217 | -validateForm(); | 229 | +// validateForm(); |
218 | 230 | ||
231 | +// 定时更新模型,解决各种浏览器奇葩问题终极办法 | ||
219 | setInterval(function() { | 232 | setInterval(function() { |
233 | + $('input').each(function() { | ||
234 | + var name = $(this).attr('name'); | ||
235 | + | ||
236 | + if ($(this).is(':checkbox')) { | ||
237 | + formModel[name] = $(this).is(':checked') ? $(this).val() : null; | ||
238 | + } else { | ||
239 | + formModel[name] = $(this).val(); | ||
240 | + } | ||
241 | + }); | ||
220 | validateForm(); | 242 | validateForm(); |
221 | }, 500); | 243 | }, 500); |
222 | 244 |
@@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
40 | color: #444; | 40 | color: #444; |
41 | } | 41 | } |
42 | 42 | ||
43 | - span { | 43 | + .text-label { |
44 | margin-left: 12px; | 44 | margin-left: 12px; |
45 | } | 45 | } |
46 | 46 | ||
@@ -82,6 +82,11 @@ | @@ -82,6 +82,11 @@ | ||
82 | padding: 0; | 82 | padding: 0; |
83 | margin-top: -8px; | 83 | margin-top: -8px; |
84 | margin-right: 6px; | 84 | margin-right: 6px; |
85 | + | ||
86 | + &.disabled { | ||
87 | + color: #e0e0e0; | ||
88 | + border-color: #e0e0e0; | ||
89 | + } | ||
85 | } | 90 | } |
86 | 91 | ||
87 | .data-encryption { | 92 | .data-encryption { |
-
Please register or login to post a comment