login.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <!DOCTYPE html>
  2. <html class="">
  3. <!--STATUS OK-->
  4. <head>
  5. <meta name="referrer" content="always" />
  6. <meta charset='utf-8' />
  7. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="x-dns-prefetch-control" content="on">
  9. <meta name="description" content="">
  10. <meta name="format-detection" content="telephone=no" />
  11. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  13. <link rel="stylesheet" type="text/css" href="css/main.css" />
  14. <script src="js/vue.js"></script>
  15. <script src="js/vant-ui.js"></script>
  16. <script src="js/main.js"></script>
  17. <title></title>
  18. </head>
  19. <style>
  20. .login .loginFix {
  21. position: absolute;
  22. }
  23. </style>
  24. <body>
  25. <div id="app">
  26. <div class="login" id="aui-header">
  27. <div class="logo"></div>
  28. <div class="loginBox">
  29. <div class="labelTitle flex a-center" style="margin-top: 0;">
  30. <b class="i1"></b>
  31. 账号
  32. </div>
  33. <div class="labelValue flex a-center">
  34. <input type="text" placeholder="请输入登录账号" v-model="userCode"/>
  35. </div>
  36. <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
  37. <b class="i2"></b>
  38. 密码
  39. </div>
  40. <div class="labelValue flex a-center">
  41. <input :type="type?'password':'text'" placeholder="请输入密码" v-model="userPassword"/>
  42. <div class="labelToolbel flex a-center">
  43. <van-icon name="clear" size="0.3rem" v-if="userPassword.length" @click="userPassword=''"></van-icon>
  44. <div>
  45. <svg @click="type=!type" v-if="type" t="1589111457609" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2189" width="22" height="22">
  46. <path d="M512 209.403241c-201.731514 0-374.009206 125.476783-443.808922 302.596759 69.798692 177.119977 242.077408 302.596759 443.808922 302.596759 201.933105 0 374.010229-125.476783 443.808922-302.596759C886.009206 334.880023 713.933105 209.403241 512 209.403241zM512 713.731514c-111.355157 0-201.731514-90.375334-201.731514-201.731514s90.375334-201.731514 201.731514-201.731514 201.731514 90.375334 201.731514 201.731514S623.355157 713.731514 512 713.731514zM512 390.961296c-66.772776 0-121.038704 54.265928-121.038704 121.038704s54.265928 121.038704 121.038704 121.038704 121.038704-54.265928 121.038704-121.038704S578.772776 390.961296 512 390.961296z" p-id="2190" fill="#00a0ea"></path>
  47. </svg>
  48. <svg @click="type=!type" v-else t="1589111610728" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2762" width="22" height="22">
  49. <path d="M928.312889 267.477333C792.078222 436.906667 655.957333 519.111111 519.651556 519.111111c-136.832 0-278.584889-82.773333-425.031112-252.913778a49.777778 49.777778 0 1 0-75.463111 64.938667C182.826667 521.287111 349.596444 618.666667 519.637333 618.666667c170.609778 0 332.785778-97.934222 486.257778-288.810667a49.777778 49.777778 0 0 0-77.582222-62.378667z" p-id="2763" fill="#00a0ea"></path><path d="M162.730667 469.447111l-94.819556 109.710222a35.555556 35.555556 0 1 0 53.802667 46.506667l94.819555-109.710222a35.555556 35.555556 0 0 0-53.802666-46.506667zM354.247111 598.186667l-37.930667 151.708444a35.555556 35.555556 0 0 0 68.992 17.251556l37.930667-151.708445a35.555556 35.555556 0 0 0-68.992-17.251555zM629.575111 604.387556l53.333333 151.694222a35.555556 35.555556 0 0 0 67.072-23.580445l-53.333333-151.694222a35.555556 35.555556 0 0 0-67.072 23.580445zM823.111111 475.164444l109.710222 109.724445a35.555556 35.555556 0 0 0 50.289778-50.289778l-109.710222-109.710222a35.555556 35.555556 0 0 0-50.289778 50.289778z" p-id="2764" fill="#00a0ea"></path>
  50. </svg>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- <div class="flex jlr a-center checkedXieyi">
  55. <van-checkbox v-model="checked">
  56. 同意用户协议
  57. </van-checkbox>
  58. <a href="javascript:;">忘记密码?</a>
  59. </div> -->
  60. <div class="loginBtns flex a-center j-center" v-on:click="login">
  61. 登录
  62. </div>
  63. <!-- <div class="goEnter flex a-center j-center" v-on:click="regize">
  64. 还没有账号? <a href="javascript:;">立即注册</a>
  65. </div> -->
  66. </div>
  67. <div class="loginFix">
  68. 赛轮集团
  69. </div>
  70. </div>
  71. </div>
  72. </body>
  73. <script type="text/javascript" src="../script/api.js"></script>
  74. <script type="text/javascript" src="../script/httpRequest.js"></script>
  75. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  76. <script type="text/javascript">
  77. apiready = function() {
  78. var header = $api.byId('aui-header');
  79. $api.fixStatusBar(header);
  80. var headerPos = $api.offset(header);
  81. if (api.systemType == 'android') {
  82. $api.css($api.byId('aui-header'), 'padding-top:2.1rem');
  83. }
  84. new Vue({
  85. el : '#app',
  86. data : {
  87. userCode : '', // 用户名
  88. userPassword : '', // 用户密码
  89. loginUrl : 'loginUrl',
  90. getPhoneCodeUrl : 'getPhoneCode',
  91. checked : false,
  92. type : true
  93. },
  94. methods : {
  95. // 点击登录
  96. login : function() {
  97. var _this = this;
  98. if (this.userCode == "") {
  99. this.showToast("请输入用户账号");
  100. return;
  101. }
  102. if (this.userPassword == "") {
  103. this.showToast("用户密码不能为空");
  104. return;
  105. }
  106. var data = {
  107. clientId : this.userCode,
  108. password : this.userPassword,
  109. authCode : "",
  110. url : 'json',
  111. type : 'body'
  112. }
  113. this.$post(this.loginUrl, data, function(ret) {
  114. if (ret.code == 0 || ret.code == '0') {
  115. if(ret.data.data == null){
  116. api.toast({ msg : "账号不存在" });
  117. return;
  118. }
  119. _this.showToast("登录成功");
  120. // 将loginid 保存到本地
  121. // $api.setStorage("token", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEwMDAyNzUiLCJra2JlciI6IjgxMDEiLCJzcGFydCI6IjQwIiwia3VubnIiOiIwMDAxMDAwMjc1IiwidmtvcmciOiI4MTAwIiwidnR3ZWciOiIxMCIsImtua2xpIjoiMDAwMTAwMDI3NSJ9.igsiQzKgXQaChTpT8e4Z6Q_jKV28_2dGmHdNaj1B8FY");
  122. $api.setStorage("loginid", ret.data.data.kunnr);
  123. $api.setStorage("token", ret.data.data.token);
  124. $api.setStorage("agentName", ret.data.data.name);
  125. $api.setStorage("kunnr", ret.data.data.kunnr);
  126. setTimeout(function() {
  127. _this.sendEvent("refushUser", "");
  128. }, 500);
  129. setTimeout(function() {
  130. _this.sendEvent("openFrameGroup", "");
  131. }, 500);
  132. }
  133. })
  134. },
  135. // 点击注册
  136. regize : function(){
  137. this.goWin("regize_win", "regize_win.html", "");
  138. }
  139. },
  140. filters : {
  141. },
  142. mounted : function() {
  143. api.addEventListener({
  144. name : 'keyback'
  145. }, function(ret, err) {
  146. api.closeWidget({
  147. id : 'A6040771020543', //这里是应用id
  148. retData : {
  149. name : 'closeWidget'
  150. },
  151. animation : {
  152. type : 'flip',
  153. subType : 'from_bottom',
  154. duration : 500
  155. }
  156. });
  157. });
  158. }
  159. })
  160. }
  161. </script>
  162. </html>