style:身份认证
Showing
4 changed files
with
41 additions
and
29 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 | ... | ... |
... | @@ -34,27 +34,35 @@ function GetRootPath() { | ... | @@ -34,27 +34,35 @@ function GetRootPath() { |
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() |
34 | if (validatorTel(value)) { | ||
35 | var second = 30 | 35 | var second = 30 |
36 | $(".num").text((second) + "秒") | 36 | $(".captcha").text((second) + "秒后再发送") |
37 | var interval = setInterval(function () { | 37 | var interval = setInterval(function () { |
38 | second-- | 38 | second-- |
39 | $(".num").text((second) + "秒") | 39 | $(".captcha").text((second) + "秒后再发送") |
40 | if (second === -1) { | 40 | if (second === -1) { |
41 | $(".captcha").text("重发验证码") | 41 | $(".captcha").text("重发验证码") |
42 | clearInterval(interval) | 42 | clearInterval(interval) |
43 | $(".num").hide() | ||
44 | $(".captcha").show() | ||
45 | } | 43 | } |
46 | }, 1000) | 44 | }, 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