beeMansLogin.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  7. <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
  8. <title>双子星登录</title>
  9. <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
  10. <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
  11. <link rel="stylesheet" href="../static/css/beeMansLogin.css">
  12. </head>
  13. <body>
  14. <div class="fcnc">
  15. <img class="logo" src="../static/img/beeMans/logo.png" alt="">
  16. <div class="login-title">双子星登录</div>
  17. <div class="login-subtitle">- 来至云端的手机 -</div>
  18. <div class="input-item mb30">
  19. <div class="icon"><img class="icon-user" src="../static/img/beeMans/icon-user.png" alt=""></div>
  20. <input type="tel" placeholder="双子星账号登录" maxlength="11" id="tel_input">
  21. </div>
  22. <div class="input-item mb110">
  23. <div class="icon"><img class="icon-user" src="../static/img/beeMans/icon-password.png" alt=""></div>
  24. <input type="password" id="tel_pass" placeholder="请输入密码">
  25. </div>
  26. <button class="btn" onclick="handleClick()">登录</button>
  27. </div>
  28. </body>
  29. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  30. <script src="../static/js/vender/jsencrypt.js"></script>
  31. <script src="../static/js/vender/md5.js"></script>
  32. <script src="../static/js/vender/config.js"></script>
  33. <script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>
  34. <script type="text/javascript">
  35. $("#tel_input").bind('input propertychange', function (e) {
  36. var ipt_phones = $('#tel_input').val();
  37. var c = $(this);
  38. if (/[^\d]/.test(c.val())) {//替换非数字字符
  39. var temp_amount = c.val().replace(/[^\d]/g, '');
  40. $(this).val(temp_amount);
  41. $.toast('请填写正确的手机号', "text");
  42. }
  43. });
  44. function handleClick() {
  45. var ipt_phone = $('#tel_input').val();
  46. var ipt_pass = $('#tel_pass').val();
  47. if (!ipt_phone) {
  48. $.toast('请填写正确的手机号', "text");
  49. } else if (!/^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(ipt_phone)) {
  50. $.toast('请填写正确的手机号', "text");
  51. } else if (!ipt_pass) {
  52. $.toast('请填写密码', "text");
  53. } else {
  54. $.ajax({
  55. url: baseUrl + '/api/user/v1/client/getPbKey',
  56. type: 'post',
  57. contentType: "application/json",
  58. dataType: 'json',
  59. cache: false,
  60. success: function (res) {
  61. getPbKey(res.data.publicKey)
  62. }
  63. })
  64. }
  65. }
  66. function getPbKey(publicKey) {
  67. var form = {
  68. phoneNumber: $('#tel_input').val(),
  69. password: getcode(md5($('#tel_pass').val()), publicKey),
  70. client: 5
  71. }
  72. $.showLoading();
  73. $.ajax({
  74. url: baseUrl + '/api/user/v1/beeMans/fmCloudLogin',
  75. data: JSON.stringify(form),
  76. type: 'post',
  77. contentType: "application/json",
  78. dataType: 'json',
  79. cache: false,
  80. beforeSend: function() {
  81. $('.btn').attr({ disabled: 'disabled' });
  82. },
  83. success: function (res) {
  84. $.hideLoading();
  85. if (res.status === 0) {
  86. WebViewJavascriptBridge.callHandler('OpenBridgeKit', res.data)
  87. } else {
  88. $('.btn').removeAttr('disabled');
  89. $.toast(res.msg, "text");
  90. }
  91. },
  92. error: function() {
  93. $('.btn').removeAttr('disabled');
  94. }
  95. })
  96. }
  97. </script>
  98. </html>