www.lightcourse.com/app/home/view/default/member/membersecurity/auth.html

151 lines
7.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{block name="mall_top"}{include file='default/base/mall_top'/}{/block}
{block name="member_header"}{include file='default/base/member_header'/}{/block}
<div class="member_center_back">
<div class="dsm-container dsm-auth">
<div class="right-layout" style="margin-top:50px;">
<div class="dsm-default-form">
<form method="post" id="auth_form" action="">
<input type="hidden" name="type" value="{$Request.param.type}">
<dl>
<dt><i class="required">*</i>Method</dt>
<dd><p>
<select name="auth_type" id="auth_type" class="auth_type_h">
{if $member_info.member_mobile}
<option value="mobile">Mobile: [{:encrypt_show($member_info['member_mobile'],4,4)}]</option>
{/if}
{if $member_info.member_email}
<option value="email"> Email:[{:encrypt_show($member_info['member_email'],4,4)}]</option>
{/if}
</select>
<a href="javascript:void(0);" id="send_auth_code" class="dsm-btn ml5">
<span id="sending" style="display:none"></span>
<span class="send_success_tips">Resend in <strong id="show_times" class="red mr5"></strong>
s </span>
<span class="sendcode">Send Code</span>
</a>
</p>
<p class="send_success_tips hint mt10">The verification code is valid for
<strong>30 minutes</strong></p>
</dd>
</dl>
<dl>
<dt><i class="required">*</i>Code</dt>
<dd>
<input type="text" class="text" maxlength="6" value="" name="auth_code" size="10" id="auth_code" autocomplete="off" />
<label for="auth_code" generated="true" class="error"></label>
</dd>
</dl>
<dl class="bottom">
<dt>&nbsp;</dt>
<dd>
<input type="button" class="submit" value="SUBMIT" />
</dd>
</dl>
</form>
</div>
<script type="text/javascript">
$('.send_success_tips').hide();
var ALLOW_SEND = true;
$(function() {
$('.submit').on('click', function() {
if (!$('#auth_form').valid()) {
document.getElementById('codeimage').src = HOMESITEURL+'/Seccode/makecode.html?t=' + Math.random();
} else {
$('#auth_form').submit();
}
});
function StepTimes() {
$num = parseInt($('#show_times').html());
$num = $num - 1;
$('#show_times').html($num);
if ($num <= 0) {
ALLOW_SEND = !ALLOW_SEND;
$('.send_success_tips').hide();
$('.sendcode').show();
} else {
setTimeout(StepTimes, 1000);
}
}
$('#send_auth_code').on('click', function() {
if (!ALLOW_SEND)
return;
ALLOW_SEND = !ALLOW_SEND;
$('#sending').show();
$.getJSON("{:url('/index.php/home/Membersecurity/send_auth_code')}", {type: $('#auth_type').val()}, function(data) {
if (data.state == 'true') {
$('#sending').hide();
$('#show_times').html(60);
$('.send_success_tips').show();
$('.sendcode').hide();
setTimeout(StepTimes, 1000);
} else {
ALLOW_SEND = !ALLOW_SEND;
$('#sending').hide();
layer.msg(data.msg);
}
});
});
$('#auth_form').validate({
rules: {
auth_code: {
required: true,
maxlength: 6,
minlength: 6,
digits: true
},
captcha: {
required: true,
minlength: 4,
remote: {
url: "{:url('/index.php/home/Seccode/check')}",
type: 'get',
data: {
captcha: function() {
return $('#captcha').val();
}
}
}
}
},
messages: {
auth_code: {
required: '<i class="iconfont">&#xe64c;</i>Invalid Code',
maxlength: '<i class="iconfont">&#xe64c;</i>Invalid Code',
minlength: '<i class="iconfont">&#xe64c;</i>Invalid Code',
digits: '<i class="iconfont">&#xe64c;</i>Invalid Code'
},
captcha: {
required: '<i class="iconfont">&#xe64c;</i>Please input the graphic verification code correctly',
minlength: '<i class="iconfont">&#xe64c;</i>Please input the graphic verification code correctly',
remote: '<i class="iconfont">&#xe64c;</i>Please input the graphic verification code correctly'
}
}
});
});
</script>
<style>
/*.member_center_back .dsm-container .left{*/
/* display: none!important;*/
/*}*/
/*.right-layout{*/
/* float: none!important;*/
/* margin: auto!important;*/
/*}*/
</style>
</div>
<div class="clear"></div>
</div>
</div>
{block name="mall_server"}{include file='default/base/mall_server'/}{/block}
{block name="mall_footer"}{include file='default/base/mall_footer'/}{/block}