login.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title>title</title>
  8. <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
  9. <link rel="stylesheet" href="../../css/common.css"/>
  10. <link rel="stylesheet" href="../../css/login.css"/>
  11. <link rel="stylesheet" href="../../css/html.css"/>
  12. <style>
  13. body {
  14. }
  15. .zc_btn {
  16. text-align: center;
  17. margin-top: 10px;
  18. color: #374782;
  19. }
  20. .zmq-form {
  21. top: 42%;
  22. position: absolute;
  23. box-sizing: border-box;
  24. width : 90%;
  25. left: 5%;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <div id="app">
  31. <!--<div id="login"></div>-->
  32. <img src="../../image/zy_logo.png" style="width: 60%;height: 40px;margin-left: 20%;margin-top: 30%"/>
  33. <div>
  34. <form class="zmq-form" action="">
  35. <div class="userName zmq-input-parent">
  36. <img src="../../image/drawable-xhdpi/11.png" class="zmq-input-img"/>
  37. <input class="zmq-input" type="text" name="clientId" placeholder="请输入用户名" required v-model = "clientId" />
  38. </div>
  39. <div class="passWord zmq-input-parent">
  40. <img src="../../image/drawable-xhdpi/pass.png" class="zmq-input-img"/>
  41. <input class="zmq-input" type="password" name="password" placeholder="请输入密码" required v-model="password" />
  42. </div>
  43. <div class="choose_box">
  44. <!--<div>
  45. <input type="checkbox" checked="checked" name="checkbox"/>
  46. <em> 记住密码 </em>
  47. </div>-->
  48. <a href="javascript:void(0)" class="zmq-text-msg zmq-text-font-09"></a>
  49. </div>
  50. <div class="zmq-btn zmq-btn-img" v-on:click="login">
  51. 登&nbsp;&nbsp;录
  52. </div>
  53. <!--<div class="zmq-text-font-09 zmq-text-right" v-on:click="goRegize">
  54. 还没有账号?<em class="zmq-text-msg">我要注册</em>
  55. </div>-->
  56. </form>
  57. <!--<div class="other_login">
  58. <div class="other"></div>
  59. <span>其他方式登录</span>
  60. <div class="other"></div>
  61. </div>
  62. <div class="other_choose">
  63. <a href=""> <img src="../../image/qq.png" alt=""/> </a>
  64. <a href=""> <img src="../../image/wx.png" alt=""/> </a>
  65. <a href=""> <img src="../../image/wb.png" alt=""/> </a>
  66. </div>-->
  67. </div>
  68. </div>
  69. </body>
  70. <script type="text/javascript" src="../../script/api.js"></script>
  71. <script type="text/javascript" src="../../script/vue.js"></script>
  72. <script type="text/javascript" src="../../script/httpRequest.js"></script>
  73. <script type="text/javascript" src="../../script/vue_plugins.js"></script>
  74. <script type="text/javascript">
  75. apiready = function() {
  76. new Vue({
  77. el : '#app',
  78. data : {
  79. // 输入的用户名和密码
  80. clientId : '1000275', // 用户名
  81. password : '000000', // 用户密码
  82. loginUrl : 'loginUrl',
  83. bodyH : '', // 屏幕高度
  84. },
  85. methods : {
  86. // 注册成功,跳转登录
  87. login : function() {
  88. var _this = this;
  89. // setTimeout(function() {
  90. // _this.sendEvent("openFrameGroup", "");
  91. // }, 500);
  92. if (this.userCode == "") {
  93. this.showToast("请输入用户名");
  94. return;
  95. }
  96. if (this.userPassword == "") {
  97. this.showToast("用户密码不能为空");
  98. return;
  99. }
  100. var data = {
  101. clientId : this.clientId,
  102. password : this.password,
  103. authCode : '',
  104. url : 'json',
  105. type : 'body'
  106. }
  107. this.$post(this.loginUrl, data, function(ret) {
  108. if (ret.code == 0 || ret.code == '0') {
  109. _this.showToast("登录成功");
  110. // 将loginid 保存到本地
  111. $api.setStorage("loginid", ret.data.data.kunnr);
  112. $api.setStorage("agentCode", ret.data.data.kunnr);
  113. $api.setStorage("agentName", ret.data.data.name);
  114. $api.setStorage("token",ret.data.data.token);
  115. $api.setStorage("kunnr",ret.data.data.kunnr);
  116. // 初始化极光推送
  117. // _this.initApush(ret.data.loginName);
  118. setTimeout(function() {
  119. _this.sendEvent("openFrameGroup", "");
  120. }, 500);
  121. }
  122. })
  123. },
  124. // 跳转注册页面
  125. goRegize : function() {
  126. this.goWin("regize_win", "regize_win.html", "");
  127. }
  128. },
  129. mounted : function() {
  130. var index = 0, _this = this;
  131. this.bodyH = document.documentElement.clientHeight;
  132. api.addEventListener({
  133. name : 'keyback'
  134. }, function(ret, err) {
  135. api.closeWidget({
  136. id : 'A6016069865772', //这里是应用id
  137. retData : {
  138. name : 'closeWidget'
  139. },
  140. animation : {
  141. type : 'flip',
  142. subType : 'from_bottom',
  143. duration : 500
  144. }
  145. });
  146. });
  147. }
  148. })
  149. };
  150. </script>
  151. </html>