login.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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. .getCodeBtn {
  24. width: 100px;
  25. background-color: #00a0ea;
  26. padding: 5px;
  27. color: #fff !important;
  28. border-radius: 8px 5px;
  29. text-align: center !important;
  30. }
  31. .dontSend {
  32. background-color: #ccc !important;
  33. color: #999 !important;
  34. }
  35. .login .goEnter {
  36. font-size: 0.30rem;
  37. }
  38. </style>
  39. <body>
  40. <div id="app">
  41. <div class="login" id="aui-header">
  42. <div class="logo"></div>
  43. <div class="loginBox">
  44. <div class="labelTitle flex a-center" style="margin-top: 0;">
  45. <b class="i1"></b> 手机号
  46. </div>
  47. <div class="labelValue flex a-center">
  48. <input type="text" placeholder="请输入手机号" v-model="userCode" />
  49. </div>
  50. <div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
  51. <b class="i2"></b> 验证码
  52. </div>
  53. <div class="labelValue flex a-center">
  54. <input type="text" placeholder="请输入验证码" v-model="userPassword" />
  55. <div class="labelToolbel a-center getCodeBtn" v-bind:class="wait < 60 ? 'dontSend' : ''"
  56. v-on:click="getPhoneCode">
  57. {{ wait == 60 ? '获取验证码' : (wait + "s 后重发") }}
  58. </div>
  59. </div>
  60. <!--<div class="labelTitle flex a-center" style="margin-top: 0.3rem;">
  61. <b class="i2"></b>
  62. 密码
  63. </div>
  64. <div class="labelValue flex a-center">
  65. <input :type="type?'password':'text'" placeholder="请输入密码" v-model="userPassword"/>
  66. <div class="labelToolbel flex a-center">
  67. <van-icon name="clear" size="0.3rem" v-if="userPassword.length" @click="userPassword=''"></van-icon>
  68. <div>
  69. <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">
  70. <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>
  71. </svg>
  72. <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">
  73. <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>
  74. </svg>
  75. </div>
  76. </div>
  77. </div>-->
  78. <div class="loginBtns flex a-center j-center" v-on:click="login">
  79. 登录
  80. </div>
  81. <div class="goEnter flex a-center j-center" v-on:click="regize">
  82. 还没有账号? <a href="javascript:;">立即注册</a>
  83. </div>
  84. </div>
  85. <div class="loginFix">
  86. 赛轮集团
  87. </div>
  88. </div>
  89. </div>
  90. </body>
  91. <script type="text/javascript" src="../script/api.js"></script>
  92. <script type="text/javascript" src="../script/httpRequest.js"></script>
  93. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  94. <script type="text/javascript">
  95. apiready = function () {
  96. var header = $api.byId('aui-header');
  97. $api.fixStatusBar(header);
  98. var headerPos = $api.offset(header);
  99. if (api.systemType == 'android') {
  100. $api.css($api.byId('aui-header'), 'padding-top:2.1rem');
  101. } else {
  102. $api.css($api.byId('aui-header'), 'padding-top:2.1rem');
  103. }
  104. new Vue({
  105. el: '#app',
  106. data: {
  107. userCode: '', // 用户名
  108. userPassword: '', // 用户密码
  109. loginUrl: 'loginUrl',
  110. getPhoneCodeUrl: 'getPhoneCode',
  111. checked: true,
  112. type: true,
  113. setinvate: 0,
  114. wait: 60,
  115. },
  116. methods: {
  117. init: function () {
  118. this.getcheckVersion()
  119. },
  120. // 检查更新
  121. getcheckVersion: function () {
  122. var data = '',
  123. url = "checkVersionU",
  124. _this = this;
  125. this.$get(url, data, function (ret) {
  126. if (ret.code == 0 || ret.code == '0') {
  127. _this.version=ret.version
  128. }
  129. })
  130. },
  131. // 点击登录
  132. login: function () {
  133. if (this.checked == false) {
  134. this.showToast("请同意用户协议");
  135. return;
  136. }
  137. var _this = this;
  138. if (this.userCode == "") {
  139. this.showToast("请输入用户手机号");
  140. return;
  141. }
  142. if (this.userPassword == "") {
  143. this.showToast("验证码不能为空");
  144. return;
  145. }
  146. if(this.version!=parseFloat(api.appVersion)){
  147. _this.getNewVersionUrl(function () {
  148. });
  149. return;
  150. }
  151. var data = {
  152. mobile: this.userCode,
  153. mobileCode: this.userPassword,
  154. url: 'json',
  155. type: 'body'
  156. }
  157. this.$post(this.loginUrl, data, function (ret) {
  158. if (ret.code == 0 || ret.code == '0') {
  159. _this.showToast("登录成功");
  160. // 将loginid 保存到本地
  161. $api.setStorage("kunnr", ret.data.kunnr);
  162. $api.setStorage("loginid", ret.data.loginId);
  163. $api.setStorage("userid", ret.data.userId);
  164. $api.setStorage("token", ret.data.token);
  165. setTimeout(function () {
  166. _this.sendEvent("startLogin", "");
  167. }, 200);
  168. setTimeout(function () {
  169. _this.sendEvent("refushMeber", "");
  170. }, 400);
  171. setTimeout(function () {
  172. _this.sendEvent("getIcon", "");
  173. }, 600);
  174. setTimeout(function () {
  175. _this.sendEvent("openFrameGroup", "");
  176. }, 600);
  177. }
  178. })
  179. },
  180. // 查看协议pdf
  181. lookPdf: function () {
  182. this.pdfReader.open({
  183. path: this.ptfurl,
  184. hidden: {
  185. print: true,
  186. export: true,
  187. bookmark: true,
  188. email: true
  189. },
  190. backBtn: {
  191. size: { //JSON对象;左上角按钮的大小配置
  192. w: 20, //数字类型;左上角按钮的宽;默认:60
  193. h: 20//数字类型;左上角按钮的高;默认:40
  194. },
  195. title: { //JSON对象;按钮标题配置
  196. text: "返回", //字符串类型;标题文本;默认:‘’
  197. },
  198. corner: 5 //数字类型;左上角按钮圆角大小;默认值:5.0
  199. }
  200. });
  201. },
  202. // 获取短信验证码
  203. getPhoneCode: function () {
  204. if (this.wait < 60) {
  205. return;
  206. }
  207. var data = {
  208. "mobile": this.userCode,
  209. "validType": "1",
  210. url: 'json',
  211. type: 'body'
  212. },
  213. _this = this,
  214. url = "getPhoneCode";
  215. this.$post(url, data, function (ret) {
  216. if (ret.code == 0 || ret.code == '0') {
  217. api.toast({
  218. msg: '验证码发送成功'
  219. });
  220. _this.startResod();
  221. }
  222. })
  223. },
  224. // 点击注册
  225. regize: function () {
  226. this.goWin("regize_win", "regize_win.html", "");
  227. },
  228. // 开始倒计时
  229. startResod: function () {
  230. var _this = this;
  231. if (this.wait == 0) {
  232. this.wait = 60;
  233. } else {
  234. this.wait--;
  235. setTimeout(function () {
  236. _this.startResod();
  237. }, 1000)
  238. }
  239. }
  240. },
  241. filters: {},
  242. mounted: function () {
  243. this.init();
  244. api.addEventListener({
  245. name: 'keyback'
  246. }, function (ret, err) {
  247. api.closeWidget({
  248. id: 'A6040771066321', //这里是应用id
  249. retData: {
  250. name: 'closeWidget'
  251. },
  252. animation: {
  253. type: 'flip',
  254. subType: 'from_bottom',
  255. duration: 500
  256. }
  257. });
  258. });
  259. }
  260. })
  261. }
  262. </script>
  263. </html>