You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
125 lines
4.6 KiB
HTML
125 lines
4.6 KiB
HTML
5 years ago
|
<extend name="Public/bases" />
|
||
|
<block name="body" >
|
||
|
<link href="__CSS__/user.css" rel="stylesheet" >
|
||
|
<body class="">
|
||
|
<header class="header">
|
||
|
<div class="">
|
||
|
<a href="{:U('User/userset')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
|
||
|
<h1 class="caption"><empty name="user.phone">绑定手机<else/>解除绑定</empty></h1>
|
||
|
</div>
|
||
|
</header>
|
||
|
<div class="occupy"></div>
|
||
|
<section class="trunker">
|
||
|
<section class="container">
|
||
|
<form id='form' action="" method="post" class="">
|
||
|
<div class="t-table user-auth-list">
|
||
|
<ul class="table clearfix">
|
||
|
<li class="table-row">
|
||
|
<span class="table-cell">手机号</span>
|
||
|
<span class="table-cell">
|
||
|
<input type="text" class="txt" id='phone' name="phone" value="{$user['phone']}" placeholder="请输入正确格式" <if condition="$user['phone'] neq ''"> readonly = "readonly" class="w-input" <else/> class="w-input cheackinput"</if>>
|
||
|
</span>
|
||
|
</li>
|
||
|
<li class="table-row">
|
||
|
<span class="table-cell">短信验证码</span>
|
||
|
<span class="table-cell">
|
||
|
<input type="text" class="w-input cheackinput" name="scode" id="scode"><input type="button" class="g-btn" id="sendSafeCode" value="获取短信验证码">
|
||
|
</span>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="btnbox user-set-btnbox">
|
||
|
<input type="button" class="btn jssubmit" value="提交">
|
||
|
</div>
|
||
|
</form>
|
||
|
</section>
|
||
|
</section>
|
||
|
<div class="popmsg pop-dialog"></div>
|
||
|
<script src="__JS__/pop.lwx.min.js"></script>
|
||
|
<script>
|
||
|
$(function() {
|
||
|
$('#sendSafeCode').on('click',function() {
|
||
|
var jphone = $('#phone'),phone = $.trim(jphone.val()), that = $(this);
|
||
|
var pmsg = $('.popmsg').pop();
|
||
|
if (phone == '') {
|
||
|
pmsg.msg("手机号不能为空");
|
||
|
return false;
|
||
|
}
|
||
|
if (phone.length !== 11 || !(/^[1][35789][0-9]{9}$/.test(phone))) {
|
||
|
pmsg.msg("格式不正确");
|
||
|
return false;
|
||
|
}
|
||
|
$.ajax({
|
||
|
type:'post',
|
||
|
dataType:'json',
|
||
|
data:'phone='+phone,
|
||
|
url:'{:U("sendvcode")}',
|
||
|
success:function(data) {
|
||
|
switch (parseInt(data.status)) {
|
||
|
case 1: {
|
||
|
r(1);
|
||
|
};
|
||
|
case 0:{
|
||
|
pmsg.msg(data.msg);
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
},
|
||
|
error:function() {
|
||
|
alert('服务器开小差了,请稍后再试。');
|
||
|
}
|
||
|
});
|
||
|
var r = function(i, t) {
|
||
|
if (i>0) {
|
||
|
var r = 59;
|
||
|
e='#sendSafeCode';
|
||
|
$(e).removeClass('g-btn').addClass('g-btntn');
|
||
|
var a = setInterval(function() {
|
||
|
r--;
|
||
|
$(e).val('成功'+r + '秒后重发'),
|
||
|
0 == r && ($(e).removeClass('g-btntn').addClass('g-btn'), $(e).val('获取短信验证码'), clearInterval(a))
|
||
|
},1e3)
|
||
|
}
|
||
|
};
|
||
|
});
|
||
|
$('.jssubmit').click(function() {
|
||
|
var pmsg = $('.popmsg').pop();
|
||
|
var phone = $.trim($('#phone').val());
|
||
|
var scode = $.trim($('#scode').val());
|
||
|
if (phone == '') {
|
||
|
pmsg.msg("手机号不能为空");
|
||
|
return false;
|
||
|
}
|
||
|
if (phone.length !== 11 || !(/^[1][358][0-9]{9}$/.test(phone))) {
|
||
|
pmsg.msg("格式不正确");
|
||
|
return false;
|
||
|
}
|
||
|
if(scode == ''){
|
||
|
pmsg.msg("验证码不能为空");
|
||
|
return false;
|
||
|
}
|
||
|
$.ajax({
|
||
|
cache:true,
|
||
|
type:'post',
|
||
|
url:"{:U('User/userphone')}",
|
||
|
data:$('#form').serialize(),
|
||
|
dataType:'json',
|
||
|
success:function(result){
|
||
|
pmsg.msg(result.msg);
|
||
|
if(result.status == 1){
|
||
|
setTimeout(function () {
|
||
|
window.location.href = result.url;
|
||
|
}, 2000);
|
||
|
}
|
||
|
},
|
||
|
error:function(){
|
||
|
pmsg.msg("错误")
|
||
|
}
|
||
|
})
|
||
|
});
|
||
|
|
||
|
|
||
|
});
|
||
|
</script>
|
||
|
</body>
|
||
|
</block>
|