...
|
...
|
@@ -8,7 +8,9 @@ var $ = require('yoho.zepto'); |
|
|
module.exports = function(useInRegister) {
|
|
|
var $captcha = $('#captcha'),
|
|
|
$btnNext = $('#btn-next'),
|
|
|
$captchaTip = $('#captcha-tip');
|
|
|
$captchaTip = $('#captcha-tip'),
|
|
|
mobile = $('#mobile').val(),
|
|
|
area = $('#area').val().split('+')[1];
|
|
|
|
|
|
var api = require('./api');
|
|
|
var tip = require('../plugin/tip');
|
...
|
...
|
@@ -16,7 +18,7 @@ module.exports = function(useInRegister) { |
|
|
var trim = $.trim;
|
|
|
var showErrTip = tip.show;
|
|
|
|
|
|
var urlMid = useInRegister ? 'register' : 'back';
|
|
|
var urlMid = useInRegister ? 'reg' : 'back';
|
|
|
|
|
|
function countDown() {
|
|
|
var count = 59,
|
...
|
...
|
@@ -50,7 +52,11 @@ module.exports = function(useInRegister) { |
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/passport/' + urlMid + '/sendPhone',
|
|
|
url: '/passport/' + urlMid + '/sendcode',
|
|
|
data: {
|
|
|
phoneNum: mobile,
|
|
|
areaCode: area
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (data.code === 200) {
|
|
|
$captchaTip.text('重发验证码 (60秒)').addClass('disable');
|
...
|
...
|
@@ -73,7 +79,10 @@ module.exports = function(useInRegister) { |
|
|
type: 'POST',
|
|
|
url: '/passport/' + urlMid + '/verifycode',
|
|
|
data: {
|
|
|
verifyCode: trim($captcha.val())
|
|
|
mobile: mobile,
|
|
|
area: area,
|
|
|
code: trim($captcha.val()),
|
|
|
token: $('#token').val()
|
|
|
},
|
|
|
success: function(data) {
|
|
|
if (data.code === 200) {
|
...
|
...
|
|