e2ecfe842190e7879d009c625c7082fd.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  5. <meta charset="utf-8">
  6. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  7. <meta content="yes" name="apple-mobile-web-app-capable">
  8. <meta content="black" name="apple-mobile-web-app-status-bar-style">
  9. <meta content="telephone=no" name="format-detection">
  10. <title>新用户注册登录</title>
  11. </head>
  12. <link rel="stylesheet" type="text/css" href="/jdxf/Public/wxapp/css/bootstrap.min.css">
  13. <link rel="stylesheet" type="text/css" href="/jdxf/Public/wxapp/css/style.css">
  14. <script type="text/javascript" src="/jdxf/Public/wxapp/js/jquery-1.11.3.min.js"></script>
  15. <style type="text/css">
  16. .content > form > div > input{ border: 0px; font-size: 14px; outline:none; margin-left: 10px;}
  17. .content > form > div > input::-webkit-input-placeholder{ color:#DCDCDC; }
  18. .hqyzm{ background-color: #FF9C27; font-size: 12px; height: 28px; display: inline-block;
  19. line-height: 28px; color: #ffffff; width: 80px; text-align: center; float: right; border-radius: 4px;
  20. }
  21. .content div{ border-bottom: 1px solid #E5E5E5; width: 80%; margin-top: 40px; text-align: left; margin-left: 10%;}
  22. .content div:nth-child(3){text-align: center; border-bottom: none;}
  23. .yzm{width: 33%; }
  24. .cbotton{display: inline-block; font-size:16px;!important line-height: 40px; width: 100%; height: 40px; background-color: #02A5DE; color: #ffffff; border: 0px; border-radius: 5px; }
  25. .content > form > div > label{width: 80px; font-weight: 500; display: inline-block; margin-bottom: 5px;}
  26. .exits{
  27. z-index: 1000;
  28. text-align: center;
  29. position: absolute;
  30. top: 0;
  31. height: 100%;
  32. width: 100%;
  33. background-color: rgba(0,0,0,.6);
  34. }
  35. .exits-box{
  36. border-radius: 6px;
  37. margin: 0 auto;
  38. top: 30%;
  39. width: 80%;
  40. background-color: #fff;
  41. position: relative;
  42. }
  43. </style>
  44. <body>
  45. <!--头部-->
  46. <div class="header">新用户注册登录</div>
  47. <!--内容-->
  48. <div class="content">
  49. <!--/jdxf/wxapp2.php/Home/Login/add onsubmit="return toVaild()"-->
  50. <form id="form1" method="post" >
  51. <div><label >手机号码</label><input onkeyup="value=value.replace(/[^\d]/g,'') " type="text"id="telphone" name="phone" placeholder="请输入手机号码"></div>
  52. <div><label >验证码</label><input onkeyup="value=value.replace(/[^\d]/g,'') " type="text" class="yzm" id="verify" name="verify" placeholder="请输入验证码">
  53. <input class="hqyzm" style="margin: 0;!important" class="form-control" onclick="SendVerify()" type="button" id="reSendCode" value="获取验证码"></div>
  54. <!-- <div><label >密码</label><input type="text" name="password" placeholder="请输入密码"></div>-->
  55. <div><!--<button onclick="">确定</button>-->
  56. <input style="margin: 0px;" class="cbotton" onclick="tijiao()" type="button" value="确定">
  57. <!--<a href="###" onclick="tijiao()">确定</a>-->
  58. </div>
  59. </form>
  60. </div>
  61. <!--底部-->
  62. <div id="ResMessage" style=" position: absolute; top: 0; left: 0px; width:100%; font-size: 14px; text-align: center;"> </div>
  63. <div class="footer"></div>
  64. </body>
  65. <script type="text/javascript">
  66. $(function()
  67. {
  68. var dataStorage=localStorage.getItem("dataStorage");
  69. //console.log(dataStorage);
  70. if(dataStorage!=null)
  71. {
  72. $.post('/jdxf/wxapp2.php/Home/Login/checkVs', {'datav':dataStorage},function(result)
  73. {
  74. let res=JSON.parse(result);
  75. if(res.code=="success")
  76. {
  77. AltMessage("正在自动登录 请稍等-----!");
  78. window.location.href='https://qhome.usky.cn/jdxf/wxapp2.php/Home/Index/index/token/'+dataStorage;
  79. }
  80. });
  81. }
  82. });
  83. function SendVerify(){
  84. var tel =document.getElementById('telphone').value;
  85. if(tel=="")
  86. {
  87. return AltMessage('手机号码不能为空');
  88. }
  89. if(!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(tel))){
  90. return AltMessage("不是完整的11位手机号或者正确的手机号前七位"); ;
  91. }
  92. $.post('/jdxf/wxapp2.php/Home/Login/checkVerify', {'tel':tel},function(res)
  93. {
  94. if (res)
  95. {
  96. AltMessage('发送成功');
  97. time($('#reSendCode'));
  98. }
  99. else
  100. {
  101. AltMessage('发送失败,服务暂停使用,正在处理中');
  102. }
  103. });
  104. }
  105. var wait = 60;
  106. function time(o){
  107. if (wait == 0)
  108. {
  109. o.attr('disabled',false);
  110. o.css({ 'background': '#FF9C27' });
  111. o.val('获取验证码');
  112. wait = 60;
  113. } else {
  114. o.attr('disabled', 'disabled');
  115. o.css({ 'background': '#a7a7a7' });
  116. o.val(wait + '秒');
  117. wait--;
  118. setTimeout(function () {
  119. time(o);
  120. }, 1000);
  121. }
  122. }
  123. function AltMessage(part)
  124. {
  125. document.getElementById('ResMessage').innerHTML=`<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><strong>${part}</strong></div>`;
  126. setTimeout(function ()
  127. {
  128. document.getElementById('ResMessage').innerHTML='';
  129. }, 2500);
  130. }
  131. function toVaild(){
  132. let val = document.getElementById("telphone").value;
  133. let verify = document.getElementById("verify").value;
  134. if(val =="" || verify==""){
  135. AltMessage("手机号码或验证码不能为空!");
  136. return false;
  137. }
  138. return true;
  139. }
  140. function tijiao(){
  141. let val = document.getElementById("telphone").value;
  142. let verify = document.getElementById("verify").value;
  143. if(val =="" || verify==""){
  144. AltMessage("手机号码或验证码不能为空!");
  145. return false;
  146. }
  147. //console.log($("#form1").serialize());
  148. $.ajax({
  149. url:"/jdxf/wxapp2.php/Home/Login/add",//提交地址
  150. data:$("#form1").serialize(),//将表单数据序列化
  151. type:"POST",
  152. dataType:"text",
  153. success:function(result)
  154. {
  155. let res=JSON.parse(result);
  156. //console.log(res);
  157. AltMessage(res.mesg);
  158. if(res.code=="success")
  159. {
  160. if(res.jdverifys!='')
  161. {
  162. //console.log('ccc');
  163. localStorage.setItem("dataStorage",res.jdverifys);
  164. localStorage.setItem("tagPhone",res.phone);
  165. window.location.href='https://qhome.usky.cn/jdxf/wxapp2.php/Home/Index/index/token/'+res.jdverifys;
  166. }
  167. else
  168. {
  169. window.location.href='https://qhome.usky.cn/jdxf/wxapp2.php/Home/Index/index';
  170. }
  171. }
  172. },
  173. error:function(result)
  174. {
  175. console.log(result);
  176. }
  177. });
  178. }
  179. </script>
  180. </html>