Files
littleTiger/template/pc/rainbow/user/set_mobile.html

178 lines
8.1 KiB
HTML
Raw Permalink Normal View History

2019-02-28 19:48:21 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>我的账户-{$tpshop_config['shop_info_store_title']}</title>
<meta name="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
<meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/tpshop.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/myaccount.css" />
<script src="__STATIC__/js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/security_set.css"/>
<style>
.col_main {width: 1000px;float: right;}
.main { background-color: #ffffff;padding: 15px;}
.themes_title { border-bottom: 2px solid #eee;height: 20px;line-height: 20px;padding: 0 10px 7px 5px; margin-bottom: 20px;position: relative;margin-top: -3px;}
.themes_title h3 {color: #6c6c6c;font-size: 14px;font-weight: bold;float:left;}
.themes_title h2{float:right;font-weight:700;}
.themes_title h2 a{color:#f22e00;}
.themes_title h2:after{content:""; clear:both;}
.themes_title .blue {position: absolute;right: 10px; bottom: 6px;}
.btn_pay {width: 84px; height: 28px; line-height: 28px; background: -244px -90px;}
.btn_pay:hover {text-decoration: none; background: -247px -125px;}
.btn_pay,.btn_pay:hover,.btn_to_pay:hover,.btn_to_pay{background-image: url(__STATIC__/images/sprite_btn.png);}
</style>
</head>
<body class="bg-f5">
<include file="user/header"/>
<div class="home-index-middle">
<div class="w1224">
<div class="g-crumbs">
<a href="{:U('Home/User/index')}">我的商城</a>
</div>
<div class="home-main">
<include file="user/menu"/>
<div class="col_main">
<div class="main security_passwd">
<div class="themes_title">
<h3>安全设置</h3>
</div>
<section class="security_passwd">
<div class="wrapper-3">
<div id="step" class="pub-step">
<!-- <div class="steps-nav fixed ">
<p class="step-nav step-nav-1 go">1.原手机<i></i></p>
<p class="step-nav step-nav-2 go">2.新手机<i></i></p>
<p class="step-nav step-nav-3 go">3.完成</p>
</div>-->
<form action="" method="post" id="mobileForm">
<div id="stepBlock2" class="steps-con block-02">
<div class="step-col fn-form captcha_row" data-fn-verify="">
<ul style="display: block;" class="pub-ul verify-captcha-sms">
<li> <span class="title">新手机:</span>
<div class="con verify-group">
<input type="text" class="it-01 verify-ctrl my_chkpwd" value="" id="new_mobile" name="mobile" onpaste="this.value=this.value.replace(/[^\d]/g,'')" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" />
<span style="display: block;" class="v-tips verify-tips"> <i class="icon" id="rightTip"></i> <span id="errorEmail" class="txt"></span> </span> </div>
</li>
<li> <span class="title">验证码:</span>
<div class="con verify-group">
<input type="text" class="msg-code ie-01 verify-ctrl left" name="code" id="new_code">&nbsp;&nbsp;
<input type="button" intervaltime="{$time}" value="获取验证码 " id="btnemailAuthCode2" onClick="sendCode(this,'new_mobile')" style="width:120px;" />
</div>
</li>
<li>
<button class="btn_pay verify-ctrl" type="button" onclick="check_form()"> 确定修改 </button>
</li>
</ul>
</div>
</div>
</form>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
</div>
<include file="user/footer" />
<script>
var ajax_return_status = 1; // 标识ajax 请求是否已经回来 可以进行下一次请求
function check_form()
{
if (ajax_return_status == 0) {
return false;
}
ajax_return_status = 0;
var new_mobile = $('#new_mobile').val();
if(!checkMobile(new_mobile)){
layer.alert('新手机格式错误', {icon: 2});//alert('新手机格式错误');
return false;
}
if($.trim($('#new_code').val()) == '')
{
layer.alert('验证码不能为空', {icon: 2});//alert('验证码不能为空');
return false;
}
//发送验证码
$.ajax({
type : "POST",
url : "{:U('Home/User/set_mobile')}",
data : $('#mobileForm').serialize(),
dataType : 'json',
error: function(request) {
layer.alert('服务器繁忙, 请联系管理员!', {icon: 2});//alert("服务器繁忙, 请联系管理员!");
return;
},
success: function(data) {
ajax_return_status = 1;
if(data.status == 1){
layer.msg(data.msg,{icon: 1},function(){
window.location.href = "{:U('Home/User/index')}";
});
}else{
layer.alert(data.msg,{icon: 2});//alert('发送失败');
}
}
});
}
function sendCode(obj,input_id){
if (ajax_return_status == 0) {
return false;
}
ajax_return_status = 0;
var id = $(obj).attr('id');
var input = $('#'+input_id).val();
if(!checkMobile(input)){
layer.alert('手机号码格式错误', {icon: 2});//alert('手机号码格式错误');
return false;
}
var url = "/index.php?m=Home&c=Api&a=send_validate_code&scene=6&type=mobile&send="+input;
//发送验证码
$.ajax({
type : "GET",
url : url,
dataType : 'json',
error: function(request) {
layer.alert('服务器繁忙, 请联系管理员!', {icon: 2});//alert("服务器繁忙, 请联系管理员!");
return;
},
success: function(res) {
ajax_return_status = 1;
if(res.status == 1){
layer.alert(res.msg,{icon: 1});
jsInnerTimeout(id);
}else{
layer.alert(res.msg,{icon: 2});//alert('发送失败');
}
}
});
}
//倒计时函数
function jsInnerTimeout(id)
{
var codeObj=$("#"+id);
var intAs= parseInt(codeObj.attr("IntervalTime"));
intAs--;
codeObj.attr("disabled","disabled");
if(intAs<=-1)
{
codeObj.removeAttr("disabled");
codeObj.attr("IntervalTime",{$time});
codeObj.val("获取验证码");
return true;
}
codeObj.val(intAs+'s后再次获取');
codeObj.attr("IntervalTime",intAs);
setTimeout("jsInnerTimeout('"+id+"')",1000);
};
$("#btnemailAuthCode2").removeAttr("disabled");
</script>
</body>
</html>