Authored by xuqi

new pwd

... ... @@ -14,6 +14,8 @@ var tip = require('../../plugin/tip');
var trim = $.trim;
var showErrTip = tip.show;
var $mobile = $('#mobile');
api.bindEyesEvt();
$pwd.bind('input', function() {
... ... @@ -25,19 +27,45 @@ $pwd.bind('input', function() {
});
$btnOk.on('touchstart', function() {
var pwd = trim($pwd.val());
var pwd = trim($pwd.val()),
mobileBack = true,
setting,
url;
if ($btnOk.hasClass('disable')) {
return;
}
setting = {
password: pwd
};
if ($mobile.length === 0) {
mobileBack = false;
}
if (mobileBack) {
$.extend(setting, {
mobile: $mobile.val(),
areaCode: $('#areaCode').val(),
token: $('#token').val()
});
url = '/passport/back/passwordByMobile';
} else {
$.extend(setting, {
code: $('#email-code').val()
});
url = '/passport/back/passwordByEmail';
}
if (api.pwdValidate(pwd)) {
$.ajax({
type: 'POST',
url: '/passport/back/update',
data: {
password: pwd
},
data: setting,
success: function(data) {
if (data.code === 200) {
showErrTip('密码修改成功');
... ...
... ... @@ -7,5 +7,14 @@
</div>
<span id="btn-ok" class="btn btn-ok disable">完成</span>
</div>
{{#if mobile}}
<input id="mobile" type="hidden" value={{mobile}}>
<input id="area" type="hidden" value={{areaCode}}>
<input id="token" type="hidden" value={{token}}>
{{/if}}
{{# code}}
<input id="email-code" type="hidden" value={{.}}>
{{/ code}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...