205 lines
9.8 KiB
PHTML
Executable File
205 lines
9.8 KiB
PHTML
Executable File
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
{include file="include/head-product" /}
|
||
<script type="text/javascript">
|
||
var navID = "1";
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<!--top-->
|
||
<header class="header-PC header-Product">
|
||
<div id="header" class="theme-black">
|
||
{include file="include/top" /}
|
||
{include file="include/top-header" /}
|
||
</div>
|
||
</header>
|
||
{include file="include/top-header-mobile" /}
|
||
|
||
<!--top End-->
|
||
|
||
<!-- 新闻详情页 s -->
|
||
<div class="zhuce1">
|
||
<div class="w1200">
|
||
<form action="" method="post" id="register-form">
|
||
<div class="zctit">
|
||
<a href="<?php echo url('/us/register'); ?>" class="zca1">Quick Register</a>
|
||
<a href="<?php echo url('/us/login'); ?>" class="zca2">Already have an account, login now</a>
|
||
<div class="clear"></div>
|
||
</div>
|
||
<ul class="w1000 zclist zclist1">
|
||
<li>
|
||
<span class="zctext1"><i></i>Username:</span>
|
||
<input id="firstname" type="text" name="firstname" value="">
|
||
<span class="zctext2 zctext2s">Username consists of 3-15 characters</span>
|
||
</li>
|
||
<li>
|
||
<span class="zctext1"><i></i>Password:</span>
|
||
<input id="password" type="password" name="password" value="">
|
||
</li>
|
||
<li>
|
||
<span class="zctext1"><i></i>Confirm Password:</span>
|
||
<input id="repassword" type="password" name="repassword" value="">
|
||
</li>
|
||
<li>
|
||
<span class="zctext1"><i></i>Email:</span>
|
||
<input id="email" type="text" name="email" value="">
|
||
</li>
|
||
<li>
|
||
<span class="zctext1"><i></i>Verification Code:</span>
|
||
<input type="text" name="authcode" value="" class="yzm">
|
||
<p class="tishi">Enter the characters in the image below</p>
|
||
<p class="yznum yznums">
|
||
<a href="javascript:void(0);" class="yanzhengma"><img id="yanzhengma" src="<?php echo url('index/authcode/verify', ['id' => 'yanzhengma']); ?>"></a>
|
||
<a href="javascript:void(0);" class="other yanzhengma">Change</a>
|
||
</p>
|
||
</li>
|
||
</ul>
|
||
<div class="tjcon">
|
||
<a href="javascript:void(0);" class="tjbtn" id="submit-btn">Submit</a>
|
||
<input type="checkbox" name="item" value="1" checked="checked">
|
||
<label><a style="color:#002855;" href="<?php echo url_rewrite('singlepage', ['id' => 4]); ?>" target="_blank">Agree the website service terms</a></label>
|
||
</div>
|
||
</form>
|
||
<!--
|
||
<div class="short">
|
||
<span>快捷登录:</span>
|
||
<a href="javascript:void(0);"><img src="__PUBLIC__/web/images/wx1.png"></a>
|
||
<a href="javascript:void(0);"><img src="__PUBLIC__/web/images/QQ.png"></a>
|
||
</div>
|
||
-->
|
||
</div>
|
||
</div>
|
||
<!-- 新闻详情页 e -->
|
||
<script type="text/javascript">
|
||
var InterValObj; //timer变量,控制时间
|
||
var curCount; //当前剩余秒数
|
||
$(function() {
|
||
$("a.yanzhengma").click(function(event) {
|
||
event.preventDefault();
|
||
//$img = $("#authcode");
|
||
$("#yanzhengma").attr("src", "<?php echo url('index/authcode/verify', ['id' => 'yanzhengma']); ?>" + "?" + Math.random());
|
||
});
|
||
$('#register-form').bind('submit', function(event) {
|
||
var nameObj = document.getElementById('firstname');
|
||
if (isNull(nameObj.value) || nameObj.value.length < 3) {
|
||
alert('Name is required and should be at least 3 characters');
|
||
nameObj.focus();
|
||
return false;
|
||
}
|
||
var passwordObj = document.getElementById('password');
|
||
if (isNull(passwordObj.value) || passwordObj.value.length < 6) {
|
||
alert('Please enter user password at least 6 characters');
|
||
passwordObj.focus();
|
||
return false;
|
||
}
|
||
var repasswordObj = document.getElementById('repassword');
|
||
if (isNull(repasswordObj.value) || repasswordObj.value.length < 6) {
|
||
alert('Please enter confirmed password at least 6 characters');
|
||
repasswordObj.focus();
|
||
return false;
|
||
}
|
||
if (repasswordObj.value !== passwordObj.value) {
|
||
repasswordObj.focus();
|
||
alert('User password should be consistent with the confirmed password');
|
||
return false;
|
||
}
|
||
var emailObj = document.getElementById('email');
|
||
if (!validEmail(emailObj.value)) {
|
||
alert('Please enter a valid E-mail address');
|
||
emailObj.focus();
|
||
return false;
|
||
}
|
||
|
||
var options = {
|
||
type: "post",
|
||
cache: false,
|
||
dataType: "json",
|
||
data: $(this).serialize(),
|
||
success: function(data) {
|
||
if (data.code) {
|
||
//alert(data.msg);
|
||
location.href = data.url;
|
||
} else {
|
||
alert(data.msg);
|
||
}
|
||
},
|
||
complete: function() {
|
||
$("a.yanzhengma").click();
|
||
}
|
||
};
|
||
$.ajax(options);
|
||
return false;
|
||
});
|
||
$("a#submit-btn").click(function(event) {
|
||
event.preventDefault();
|
||
$('#register-form').submit();
|
||
});
|
||
$("a#nbtn").click(function(event) {
|
||
event.preventDefault();
|
||
var telephoneObj = document.getElementById('telephone');
|
||
if (isNull(telephoneObj.value) || !isTelephone(telephoneObj.value)) {
|
||
//alert('手机号码格式不正确');
|
||
telephoneObj.focus();
|
||
return false;
|
||
}
|
||
if (InterValObj) {
|
||
return false;
|
||
}
|
||
$.ajax({
|
||
type: 'POST',
|
||
url: '<?php echo url('/index/customer/sendsms'); ?>',
|
||
data: {telephone: telephoneObj.value},
|
||
dataType: 'json',
|
||
success: function(data) {
|
||
if (data.code) {
|
||
//设置button效果,开始计时
|
||
curCount = 60;
|
||
$("a#nbtn").css("background-color", "LightSkyBlue");
|
||
$("a#nbtn").attr("disabled", "true");
|
||
// $("a#nbtn").html("获取短信验证码" + curCount + "秒");
|
||
//alert("验证码发送成功,请查收!");
|
||
InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器,1秒执行一次
|
||
//alert(data.msg);
|
||
} else {
|
||
alert(data.msg);
|
||
}
|
||
}
|
||
});
|
||
});
|
||
});
|
||
function SetRemainTime() {
|
||
if (curCount < 1) {
|
||
window.clearInterval(InterValObj); //停止计时器
|
||
InterValObj = null;
|
||
$("a#nbtn").removeAttr("disabled"); //启用按钮
|
||
$("a#nbtn").css("background-color", "");
|
||
//$("a#nbtn").html("获取短信验证码");
|
||
} else {
|
||
curCount--;
|
||
// $("a#nbtn").html("获取短信验证码" + curCount + "秒");
|
||
}
|
||
}
|
||
function isNull(data) {
|
||
return (data == "" || data == undefined || data == null) ? true : false;
|
||
}
|
||
function trim(str) {
|
||
return str.replace(/(^\s*)|(\s*$)/g, '');
|
||
}
|
||
function isTelephone(value) {
|
||
var isMobile = /^1[345789]\d{9}$/;
|
||
return isMobile.test(value);
|
||
}
|
||
function validEmail(email) {
|
||
//对电子邮件的验证
|
||
var reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
|
||
return reg.test(email);
|
||
}
|
||
</script>
|
||
<!-- bottom s -->
|
||
{include file="include/bottom" /}
|
||
<!-- bottom e -->
|
||
</body>
|
||
</html>
|