Authored by zhangxiaoru

添加图形验证码

@@ -14,6 +14,15 @@ @@ -14,6 +14,15 @@
14 <span id="area-code" class="area-code">{{areaCode}}</span> 14 <span id="area-code" class="area-code">{{areaCode}}</span>
15 <input id="phone-num" class="input phone-num" type="text" placeholder="手机号"> 15 <input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
16 </div> 16 </div>
  17 +
  18 + {{!--图片验证 start--}}
  19 + {{#if isWechatLogin}}
  20 + <div id="js-img-check">
  21 + <input type="hidden" name="captsrc" value="{{captsrc}}">
  22 + </div>
  23 + {{/if}}
  24 + {{!--图片验证 end--}}
  25 +
17 <span id="btn-next" class="btn btn-next disable row">发送验证码</span> 26 <span id="btn-next" class="btn btn-next disable row">发送验证码</span>
18 27
19 {{#if isWechatLogin}} 28 {{#if isWechatLogin}}
@@ -24,6 +24,17 @@ var requested = false; @@ -24,6 +24,17 @@ var requested = false;
24 24
25 require('../../common'); 25 require('../../common');
26 26
  27 +var ImgCheck = require('plugin/img-check');
  28 +
  29 +var imgCheck = new ImgCheck('#js-img-check', {
  30 + useREM: {
  31 + rootFontSize: 40,
  32 + picWidth: 150
  33 + }
  34 +});
  35 +
  36 +imgCheck.init();
  37 +
27 function nextStep(url, mobileNo, areaCode) { 38 function nextStep(url, mobileNo, areaCode) {
28 if (requested) { 39 if (requested) {
29 return false; 40 return false;
@@ -85,7 +96,8 @@ $btnNext.on('touchstart', function() { @@ -85,7 +96,8 @@ $btnNext.on('touchstart', function() {
85 openId = trim($openId.val()), 96 openId = trim($openId.val()),
86 nickname = trim($nickname.val()), 97 nickname = trim($nickname.val()),
87 sourceType = trim($sourceType.val()), 98 sourceType = trim($sourceType.val()),
88 - areaCode = $countrySelect.val(); 99 + areaCode = $countrySelect.val(),
  100 + verify = trim(imgCheck.getResults());
89 101
90 if ($btnNext.hasClass('disable')) { 102 if ($btnNext.hasClass('disable')) {
91 return; 103 return;