Нет описания

login.html 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. <script src="../Script/Common/huayi.config.js"></script>
  9. <script src="../Script/Common/huayi.http.js"></script>
  10. <link rel="stylesheet" href="../layui/css/layui.mobile.css" />
  11. <link href="../css/mui.min.css" rel="stylesheet" />
  12. <title>登陆</title>
  13. <style>
  14. /* body{
  15. width: 100vw;
  16. height: 100vh;
  17. background-color: #f8f8f8;
  18. } */
  19. .mui-input-row {
  20. border-bottom: 1px solid #c9c9c9;
  21. }
  22. .mui-card-content {
  23. padding: 0 20px;
  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 {
  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 40px;
  58. background-color: #1ba3c9;
  59. outline: none;
  60. border: none;
  61. padding: 10px 12px;
  62. display: block;
  63. border-radius: 10px;
  64. font-size: 16px;
  65. color: #fff;
  66. }
  67. </style>
  68. </head>
  69. <body>
  70. <header class="mui-bar mui-bar-nav">
  71. <h1 class="mui-title">手机认证</h1>
  72. </header>
  73. <div class="mui-content">
  74. <div class="mui-card">
  75. <div class="mui-card-content">
  76. <div class="mui-input-row phone">
  77. <label>手机号</label>
  78. <input type="text" placeholder="请输入手机号" id="phone">
  79. </div>
  80. <div class="mui-input-row">
  81. <label>验证码</label>
  82. <input type="text" class="mui-input-clear" placeholder="请输入验证码" id="code">
  83. <span class="line" onclick="getCode()">获取验证码</span>
  84. </div>
  85. <button type="button" class="btn">登陆</button>
  86. </div>
  87. </div>
  88. </div>
  89. <script src="../js/mui.min.js"></script>
  90. <script>
  91. var openid = "obwtK6JT-bTCeSbtqu4lkw4lIz0o";
  92. // var openid = helper.cookies.get("openid");
  93. if (!openid) {
  94. window.location.replace("../html/error.html");
  95. }
  96. $(document).ready(function () {
  97. $('.btn').click(function(){
  98. $.ajax({
  99. type: "get",
  100. url: huayi.config.callcenter_url + '/WxLogin/EditUserInfo',
  101. data: {
  102. code: $('#code').val(),
  103. mobile:$('#phone').val() ,
  104. OpenId: openid
  105. },
  106. dataType: 'json',
  107. success: function (result) {
  108. if (result.state.toLowerCase() == "success") {
  109. window.location.replace("../html/addWorkOrder.html");
  110. }
  111. }
  112. });
  113. })
  114. })
  115. function getCode(){
  116. $.ajax({
  117. type: "get",
  118. url: huayi.config.callcenter_url + 'WxLogin/SendCode',
  119. async: true,
  120. data: {
  121. mobile: $('#phone').val()
  122. },
  123. success: function (data) {
  124. if(data.data == 'success'){
  125. let num = 60;
  126. let fq=setInterval(function(){
  127. num -=1
  128. $('.line').text(num);
  129. if(num == 0){
  130. clearInterval(fq)
  131. layer.msg('请重新发送验证码')
  132. $('.line').text('获取验证码')
  133. }
  134. },1000)
  135. }
  136. }
  137. })
  138. }
  139. </script>
  140. </body>
  141. </html>