style:身份认证
Showing
4 changed files
with
65 additions
and
53 deletions
| ... | @@ -47,16 +47,18 @@ | ... | @@ -47,16 +47,18 @@ | 
| 47 | .phone input { | 47 | .phone input { | 
| 48 | width: 65%!important; | 48 | width: 65%!important; | 
| 49 | } | 49 | } | 
| 50 | .captcha, .num { | 50 | .captcha { | 
| 51 | border: 1px solid #dedede; | 51 | border: 1px solid #dedede; | 
| 52 | border-radius: 23px; | 52 | border-radius: 23px; | 
| 53 | cursor: pointer; | 53 | cursor: pointer; | 
| 54 | font-size: 12px; | 54 | font-size: 12px; | 
| 55 | color: #6e7172; | 55 | color: #6e7172; | 
| 56 | width: 100px; | ||
| 57 | display: inline-block; | ||
| 56 | text-align: center; | 58 | text-align: center; | 
| 57 | line-height: 23px; | 59 | line-height: 23px; | 
| 58 | display: inline-block; | 60 | font-style: normal; | 
| 59 | } | 61 | } | 
| 60 | .num { | 62 | .code_input input{ | 
| 61 | display: none; | 63 | width: 130px!important; | 
| 62 | } | 64 | } | 
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... | 
| 1 | //设置当前页面导航栏背景色 | 1 | //设置当前页面导航栏背景色 | 
| 2 | function addTabs(id) { | 2 | function addTabs(id) { | 
| 3 | $('.layui-nav-item').removeClass('layui-this') | 3 | $('.layui-nav-item').removeClass('layui-this') | 
| 4 | $(id).addClass('layui-this') | 4 | $(id).addClass('layui-this') | 
| 5 | } | 5 | } | 
| 6 | 6 | ||
| 7 | //设置ajax调取服务接口 | 7 | //设置ajax调取服务接口 | 
| 8 | 8 | ||
| 9 | function SetServicesPath() { | 9 | function SetServicesPath() { | 
| 10 | return "http://192.168.2.108" | 10 | return "http://192.168.2.108" | 
| 11 | } | 11 | } | 
| 12 | 12 | ||
| 13 | //设置全局參數 | 13 | //设置全局參數 | 
| 14 | var portal = | 14 | var portal = | 
| 15 | { | 15 | { | 
| 16 | 'api_url': "http://192.168.2.108:8000", //属性名用引号括起来,属性间由逗号隔开 | 16 | 'api_url': "http://192.168.2.108:8000", //属性名用引号括起来,属性间由逗号隔开 | 
| 17 | 'name': 'myName', | 17 | 'name': 'myName', | 
| 18 | "rootPath": GetRootPath() | 18 | "rootPath": GetRootPath() | 
| 19 | }; | 19 | }; | 
| 20 | 20 | ||
| 21 | //截取日期 | 21 | //截取日期 | 
| 22 | function CutDate(times) { | 22 | function CutDate(times) { | 
| 23 | var timearr = times.replace(" ", ":").replace(/\:/g, "-").split("-"); | 23 | var timearr = times.replace(" ", ":").replace(/\:/g, "-").split("-"); | 
| 24 | var timestr = "" + timearr[0] + "/" + timearr[1] + "/" + timearr[2] | 24 | var timestr = "" + timearr[0] + "/" + timearr[1] + "/" + timearr[2] | 
| 25 | //var timestr = "" + timearr[1].split("")[1] + "月" + timearr[2] + "日\t" + timearr[3] + ":" + timearr[4] + "" | 25 | //var timestr = "" + timearr[1].split("")[1] + "月" + timearr[2] + "日\t" + timearr[3] + ":" + timearr[4] + "" | 
| 26 | return timestr | 26 | return timestr | 
| 27 | } | 27 | } | 
| 28 | 28 | ||
| 29 | function GetRootPath() { | 29 | function GetRootPath() { | 
| 30 | var curWwwPath = window.document.location.href; | 30 | var curWwwPath = window.document.location.href; | 
| 31 | var pathName = window.document.location.pathname; | 31 | var pathName = window.document.location.pathname; | 
| 32 | var pos = curWwwPath.indexOf(pathName); | 32 | var pos = curWwwPath.indexOf(pathName); | 
| 33 | return curWwwPath.substring(0, pos); | 33 | return curWwwPath.substring(0, pos); | 
| 34 | } | 34 | } | 
| 35 | 35 | ||
| 36 | function GetQueryString(name) { | 36 | function GetQueryString(name) { | 
| 37 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i"); | 37 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); | 
| 38 | var r = window.location.search.substr(1).match(reg); | 38 | var r = window.location.search.substr(1).match(reg); | 
| 39 | if (r!=null) return (r[2]); return null; | 39 | if (r != null) return (r[2]); return null; | 
| 40 | } | 40 | } | 
| 41 | // 存储cookie | 41 | // 存储cookie | 
| 42 | function setCookie(name,resdata,duration){ | 42 | function setCookie(name, resdata, duration) { | 
| 43 | var date = new Date(); | 43 | var date = new Date(); | 
| 44 | date.setTime(date.getTime() + duration*24*3600*1000); | 44 | date.setTime(date.getTime() + duration * 24 * 3600 * 1000); | 
| 45 | document.cookie = name + "="+ JSON.stringify (resdata) + ";expires=" +date.toGMTString() + "; path=/"; | 45 | document.cookie = name + "=" + JSON.stringify(resdata) + ";expires=" + date.toGMTString() + "; path=/"; | 
| 46 | // document.cookie = "myCookie=" + JSON.stringify(resdata) + "; expires=" +date.toGMTString() + "; path=/"; | 46 | // document.cookie = "myCookie=" + JSON.stringify(resdata) + "; expires=" +date.toGMTString() + "; path=/"; | 
| 47 | }; | 47 | }; | 
| 48 | 48 | ||
| 49 | //获取cookie | 49 | //获取cookie | 
| 50 | function getCookie(){ | 50 | function getCookie() { | 
| 51 | var str = document.cookie; | 51 | var str = document.cookie; | 
| 52 | if(str == ''){ | 52 | if (str == '') { | 
| 53 | return false | 53 | return false | 
| 54 | }else{ | 54 | } else { | 
| 55 | var arr = str.split(';') | 55 | var arr = str.split(';') | 
| 56 | var arr1 = arr[0].replace(/(\s)+/g,'').split('='); | 56 | var arr1 = arr[0].replace(/(\s)+/g, '').split('='); | 
| 57 | return JSON.parse(arr1[1]); | 57 | return JSON.parse(arr1[1]); | 
| 58 | } | 58 | } | 
| 59 | }; | 59 | }; | 
| 60 | // 设置最小高度 | 60 | /* | 
| 61 | * 验证手机号码 | ||
| 62 | */ | ||
| 63 | function validatorTel(content) { | ||
| 64 | |||
| 65 | // 正则验证格式 | ||
| 66 | eval("var reg = /^1[34578]\\d{9}$/;"); | ||
| 67 | return RegExp(reg).test(content); | ||
| 68 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... | 
| 1 | layui.use('element', function () { | ||
| 2 | }); | ||
| 1 | $(function () { | 3 | $(function () { | 
| 2 | layui.use('element', function () { | ||
| 3 | }); | ||
| 4 | |||
| 5 | addTabs('#wssq') | 4 | addTabs('#wssq') | 
| 6 | setAcceptFlow(GetQueryString('bsm_slsq'), GetQueryString('businessno')); | 5 | setAcceptFlow(GetQueryString('bsm_slsq'), GetQueryString('businessno')); | 
| 7 | list = getApplyRecord(GetQueryString('bsm_slsq'), GetQueryString('businessno')); | 6 | list = getApplyRecord(GetQueryString('bsm_slsq'), GetQueryString('businessno')); | 
| ... | @@ -30,18 +29,22 @@ function skipClick() { | ... | @@ -30,18 +29,22 @@ function skipClick() { | 
| 30 | // 验证码 | 29 | // 验证码 | 
| 31 | 30 | ||
| 32 | $(".captcha").click(function () { | 31 | $(".captcha").click(function () { | 
| 33 | $(".captcha").hide() | 32 | console.log($('.phoneInput').val()) | 
| 34 | $(".num").show() | 33 | let value = $('.phoneInput').val() | 
| 35 | var second = 30 | 34 | if (validatorTel(value)) { | 
| 36 | $(".num").text((second) + "秒") | 35 | var second = 30 | 
| 37 | var interval = setInterval(function () { | 36 | $(".captcha").text((second) + "秒后再发送") | 
| 38 | second-- | 37 | var interval = setInterval(function () { | 
| 39 | $(".num").text((second) + "秒") | 38 | second-- | 
| 40 | if (second === -1) { | 39 | $(".captcha").text((second) + "秒后再发送") | 
| 41 | $(".captcha").text("重发验证码") | 40 | if (second === -1) { | 
| 42 | clearInterval(interval) | 41 | $(".captcha").text("重发验证码") | 
| 43 | $(".num").hide() | 42 | clearInterval(interval) | 
| 44 | $(".captcha").show() | 43 | } | 
| 45 | } | 44 | }, 1000) | 
| 46 | }, 1000) | 45 | } else { | 
| 46 | layui.use('layer', function () { | ||
| 47 | layer.msg('请输入正确手机号!'); | ||
| 48 | }) | ||
| 49 | } | ||
| 47 | }) | 50 | }) | 
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... | 
| ... | @@ -40,13 +40,12 @@ | ... | @@ -40,13 +40,12 @@ | 
| 40 | <h5>短信认证</h5> | 40 | <h5>短信认证</h5> | 
| 41 | <div class="phone"> | 41 | <div class="phone"> | 
| 42 | <span>手机号</span> | 42 | <span>手机号</span> | 
| 43 | <input type="tel" id="phone" name="phone" placeholder="请输入手机号" class="layui-input"> | 43 | <input type="tel" maxlength="11" id="phone" name="phone" placeholder="请输入手机号" class="layui-input phoneInput"> | 
| 44 | <span class="captcha">获取验证码</span> | 44 | <em class="captcha">获取验证码</em> | 
| 45 | <span class="num"></span> | ||
| 46 | </div> | 45 | </div> | 
| 47 | <div> | 46 | <div class="code_input"> | 
| 48 | <span>验证码</span> | 47 | <span>验证码</span> | 
| 49 | <input type="tel" id="code" name="code" placeholder="请输入验证码" class="layui-input"> | 48 | <input type="tel" maxlength="6" id="code" name="code" placeholder="请输入验证码" class="layui-input"> | 
| 50 | </div> | 49 | </div> | 
| 51 | </div> | 50 | </div> | 
| 52 | 51 | ... | ... | 
- 
Please register or sign in to post a comment
