b813b09b by 任超

style:身份认证

1 parent 0f3893ee
......@@ -47,16 +47,18 @@
.phone input {
width: 65%!important;
}
.captcha, .num {
.captcha {
border: 1px solid #dedede;
border-radius: 23px;
cursor: pointer;
font-size: 12px;
color: #6e7172;
width: 100px;
display: inline-block;
text-align: center;
line-height: 23px;
display: inline-block;
font-style: normal;
}
.num {
display: none;
.code_input input{
width: 130px!important;
}
\ No newline at end of file
......
//设置当前页面导航栏背景色
function addTabs(id) {
$('.layui-nav-item').removeClass('layui-this')
$(id).addClass('layui-this')
$('.layui-nav-item').removeClass('layui-this')
$(id).addClass('layui-this')
}
//设置ajax调取服务接口
function SetServicesPath() {
return "http://192.168.2.108"
return "http://192.168.2.108"
}
//设置全局參數
var portal =
{
'api_url': "http://192.168.2.108:8000", //属性名用引号括起来,属性间由逗号隔开
'name': 'myName',
"rootPath": GetRootPath()
'api_url': "http://192.168.2.108:8000", //属性名用引号括起来,属性间由逗号隔开
'name': 'myName',
"rootPath": GetRootPath()
};
//截取日期
function CutDate(times) {
var timearr = times.replace(" ", ":").replace(/\:/g, "-").split("-");
var timestr = "" + timearr[0] + "/" + timearr[1] + "/" + timearr[2]
//var timestr = "" + timearr[1].split("")[1] + "月" + timearr[2] + "日\t" + timearr[3] + ":" + timearr[4] + ""
return timestr
var timearr = times.replace(" ", ":").replace(/\:/g, "-").split("-");
var timestr = "" + timearr[0] + "/" + timearr[1] + "/" + timearr[2]
//var timestr = "" + timearr[1].split("")[1] + "月" + timearr[2] + "日\t" + timearr[3] + ":" + timearr[4] + ""
return timestr
}
function GetRootPath() {
var curWwwPath = window.document.location.href;
var pathName = window.document.location.pathname;
var pos = curWwwPath.indexOf(pathName);
return curWwwPath.substring(0, pos);
var curWwwPath = window.document.location.href;
var pathName = window.document.location.pathname;
var pos = curWwwPath.indexOf(pathName);
return curWwwPath.substring(0, pos);
}
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i");
var r = window.location.search.substr(1).match(reg);
if (r!=null) return (r[2]); return null;
}
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return (r[2]); return null;
}
// 存储cookie
function setCookie(name,resdata,duration){
function setCookie(name, resdata, duration) {
var date = new Date();
date.setTime(date.getTime() + duration*24*3600*1000);
document.cookie = name + "="+ JSON.stringify (resdata) + ";expires=" +date.toGMTString() + "; path=/";
date.setTime(date.getTime() + duration * 24 * 3600 * 1000);
document.cookie = name + "=" + JSON.stringify(resdata) + ";expires=" + date.toGMTString() + "; path=/";
// document.cookie = "myCookie=" + JSON.stringify(resdata) + "; expires=" +date.toGMTString() + "; path=/";
};
//获取cookie
function getCookie(){
function getCookie() {
var str = document.cookie;
if(str == ''){
if (str == '') {
return false
}else{
} else {
var arr = str.split(';')
var arr1 = arr[0].replace(/(\s)+/g,'').split('=');
return JSON.parse(arr1[1]);
var arr1 = arr[0].replace(/(\s)+/g, '').split('=');
return JSON.parse(arr1[1]);
}
};
// 设置最小高度
/*
* 验证手机号码
*/
function validatorTel(content) {
// 正则验证格式
eval("var reg = /^1[34578]\\d{9}$/;");
return RegExp(reg).test(content);
}
\ No newline at end of file
......
layui.use('element', function () {
});
$(function () {
layui.use('element', function () {
});
addTabs('#wssq')
setAcceptFlow(GetQueryString('bsm_slsq'), GetQueryString('businessno'));
list = getApplyRecord(GetQueryString('bsm_slsq'), GetQueryString('businessno'));
......@@ -30,18 +29,22 @@ function skipClick() {
// 验证码
$(".captcha").click(function () {
$(".captcha").hide()
$(".num").show()
var second = 30
$(".num").text((second) + "秒")
var interval = setInterval(function () {
second--
$(".num").text((second) + "秒")
if (second === -1) {
$(".captcha").text("重发验证码")
clearInterval(interval)
$(".num").hide()
$(".captcha").show()
}
}, 1000)
console.log($('.phoneInput').val())
let value = $('.phoneInput').val()
if (validatorTel(value)) {
var second = 30
$(".captcha").text((second) + "秒后再发送")
var interval = setInterval(function () {
second--
$(".captcha").text((second) + "秒后再发送")
if (second === -1) {
$(".captcha").text("重发验证码")
clearInterval(interval)
}
}, 1000)
} else {
layui.use('layer', function () {
layer.msg('请输入正确手机号!');
})
}
})
\ No newline at end of file
......
......@@ -40,13 +40,12 @@
<h5>短信认证</h5>
<div class="phone">
<span>手机号</span>
<input type="tel" id="phone" name="phone" placeholder="请输入手机号" class="layui-input">
<span class="captcha">获取验证码</span>
<span class="num"></span>
<input type="tel" maxlength="11" id="phone" name="phone" placeholder="请输入手机号" class="layui-input phoneInput">
<em class="captcha">获取验证码</em>
</div>
<div>
<div class="code_input">
<span>验证码</span>
<input type="tel" id="code" name="code" placeholder="请输入验证码" class="layui-input">
<input type="tel" maxlength="6" id="code" name="code" placeholder="请输入验证码" class="layui-input">
</div>
</div>
......