No Description

login.html 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  6. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  8. <link rel="stylesheet" href="../layui/css/layui.mobile.css" />
  9. <link href="../css/mui.min.css" rel="stylesheet" />
  10. <title>手机认证</title>
  11. <style>
  12. /* body{
  13. width: 100vw;
  14. height: 100vh;
  15. background-color: #f8f8f8;
  16. } */
  17. .mui-input-row {
  18. border-bottom: 1px solid #c9c9c9;
  19. }
  20. .mui-card-content {
  21. padding: 0 20px;
  22. position: relative;
  23. padding-top: 60px;
  24. }
  25. .mui-input-row {
  26. height: 75px;
  27. }
  28. #phone,
  29. #code {
  30. height: 50%;
  31. }
  32. label,
  33. input {
  34. float: none !important;
  35. }
  36. input {
  37. padding: 0 15px !important;
  38. }
  39. label {
  40. display: block;
  41. font-weight: 600;
  42. padding: 13px 15px 8px !important;
  43. }
  44. .line,.codeTX {
  45. display: inline-block;
  46. border-left: 1px solid #1ba3c9;
  47. padding-left: 10px;
  48. height: 25px;
  49. position: absolute;
  50. right: 10px;
  51. color: #1ba3c9;
  52. font-size: 16px;
  53. font-weight: 600;
  54. }
  55. .btn{
  56. width: 90%;
  57. margin: 50px auto 78px;
  58. background-color: #1ba3c9;
  59. outline: none;
  60. border: none;
  61. padding: 12px 12px;
  62. display: block;
  63. border-radius: 30px;
  64. font-size: 18px;
  65. color: #fff;
  66. }
  67. .tbtn{
  68. position: absolute;
  69. left: -1px;
  70. top: 15px;
  71. display: inline-block;
  72. width: 85px;
  73. padding: 5px 0;
  74. color: #fff;
  75. text-align: center;
  76. border-radius: 0 20px 20px 0;
  77. background-color: #fb9703;
  78. }
  79. </style>
  80. </head>
  81. <body>
  82. <div class="mui-content">
  83. <div class="mui-card">
  84. <div class="mui-card-content">
  85. <div class="mui-input-row phone">
  86. <label>手机号</label>
  87. <input type="text" placeholder="请输入手机号" id="phone">
  88. </div>
  89. <div class="mui-input-row">
  90. <label>验证码</label>
  91. <input type="text" class="mui-input-clear" placeholder="请输入验证码" id="code">
  92. <span class="line" onclick="getCode()">获取验证码</span>
  93. <span class="codeTX">60s</span>
  94. </div>
  95. <button type="button" class="btn" >登录</button>
  96. <button type="button" class="tbtn" >退回</button>
  97. </div>
  98. </div>
  99. </div>
  100. <script src="../js/mui.min.js"></script>
  101. <script src="../js/jquery.min.js"></script>
  102. <script src="../layui/layui.js"></script>
  103. <script src="../Script/Common/huayi.config.js"></script>
  104. <script src="../Script/Common/huayi.http.js"></script>
  105. <script>
  106. $('.codeTX').css('display', 'none')
  107. // var openid = 'obwtK6JT-bTCeSbtqu4lkw4lIz0o'
  108. var openid = helper.cookies.get("openid");
  109. // if (!openid) {
  110. // window.location.replace("../html/error.html");
  111. // }
  112. $('.btn').click(function(){
  113. if(!(/^1[3|4|5|7|8]\d{9}$/.test($('#phone').val()))){
  114. mui.alert("请输入正确的手机号");
  115. return false;
  116. }
  117. $.ajax({
  118. type: "get",
  119. url: huayi.config.callcenter_url + '/APP/Checking',
  120. data: {
  121. code: $('#code').val(),
  122. phone:$('#phone').val()
  123. },
  124. dataType: 'json',
  125. success: function (result) {
  126. if (result.state.toLowerCase() == "success") {
  127. localStorage.setItem('tell', $('#phone').val());
  128. window.location.replace("../html/workOrdeListr.html?tell="+$('#phone').val());
  129. }
  130. }
  131. });
  132. })
  133. $('.tbtn').click(function(){
  134. window.location.replace("../html/home.html")
  135. })
  136. function getCode(){
  137. $.ajax({
  138. type: "get",
  139. url: huayi.config.callcenter_url + 'WxLogin/SendCode',
  140. async: true,
  141. dataType: 'json',
  142. data: {
  143. mobile: $('#phone').val()
  144. },
  145. success: function (res) {
  146. if (res.state == 'success') {
  147. let num = 60
  148. $('.line').css('display', 'none')
  149. $('.codeTX').css('display', 'inline-block')
  150. var fq = setInterval(function() {
  151. num -= 1
  152. $('.codeTX').text(num+'s')
  153. console.log(num)
  154. if (num == 0) {
  155. clearInterval(fq)
  156. $('.codeTX').css('display', 'none')
  157. $('.line').css('display', 'inline-block')
  158. }
  159. }, 1000)
  160. }
  161. }
  162. })
  163. }
  164. </script>
  165. </body>
  166. </html>