阜外心血管项目前端

login.html 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <!DOCTYPE html>
  2. <html class="ui-page-login" style="height: 100%">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  6. <title>登录</title>
  7. <link href="css/mui.css" rel="stylesheet" />
  8. <link href="css/iconfont.css" rel="stylesheet" />
  9. <link href="css/login.css" rel="stylesheet" />
  10. <script src="js/jquery.min.js"></script>
  11. <script src="Script/Common/huayi.http.js"></script>
  12. <script src="Script/Common/huayi.config.js"></script>
  13. </head>
  14. <body style="height: 100%">
  15. <div class="mui-content">
  16. <form id='login-form' class="mui-input-group">
  17. <!--logo-->
  18. <div class="mui-logo-box">
  19. <div class="mui-logo-img">
  20. <img src="img/logo.png"/>
  21. </div>
  22. <div class="mui-logo-text">欢迎来到三元财务</div>
  23. </div>
  24. <div class="mui-input-row">
  25. <input id='account' type="text" class="mui-input-clear mui-input" placeholder="请输入账号">
  26. </div>
  27. <div class="mui-input-row mui-password">
  28. <input id='password' type="password" class=" mui-input-password mui-input" placeholder="请输入密码">
  29. </div>
  30. </form>
  31. <div class="mui-content-padded">
  32. <button id='login' class="mui-btn mui-btn-block mui-btn-primary" style="font-size: 16px;">登录</button>
  33. </div>
  34. <div class="mui-content-padded oauth-area" style="width: 100%;">
  35. <a class="reg_href staff">员工登录</a>
  36. <a class="reg_href company">公司登录</a>
  37. <a class="reg_href" href="tel:037155373773">我要合作</a>
  38. </div>
  39. </div>
  40. <script src="js/mui.min.js"></script>
  41. <script>
  42. //var openid = helper.cookies.get("openid");
  43. var menucode = helper.request.queryString("menuCode");
  44. var code = helper.request.queryString("code");
  45. var openid = helper.request.queryString("openid");
  46. //var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
  47. var typeUser = helper.cookies.get("typeUser");
  48. if (typeUser) {
  49. typeUser = helper.cookies.get("typeUser");
  50. } else{
  51. typeUser=5;
  52. }
  53. if (typeUser==1) {
  54. $(".staff").hide();
  55. $(".company").show();
  56. } else if(typeUser==5){
  57. $(".staff").show();
  58. $(".company").hide();
  59. }
  60. //登陆验证
  61. $(".staff").on('tap', function() {
  62. $(this).hide();
  63. $(".company").show();
  64. typeUser=1; //员工
  65. });
  66. $(".company").on('tap', function() {
  67. $(this).hide();
  68. $(".staff").show();
  69. typeUser=5; //公司
  70. });
  71. $("#login").on('tap', function() {
  72. if(!$("#account").val()) {
  73. mui.alert("请输入账号");
  74. return;
  75. }
  76. if(!$("#password").val()) {
  77. mui.alert("密码不能为空")
  78. return;
  79. }
  80. login();
  81. })
  82. function login () {
  83. //请求
  84. $.ajax({
  85. type: "post",
  86. url: huayi.config.callcenter_url + 'WxLogin/Login',
  87. async: true,
  88. dataType: 'json',
  89. data: {
  90. UserCode: $("#account").val(),
  91. Password: $("#password").val(),
  92. UserType:typeUser,
  93. openid: openid,
  94. //openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
  95. },
  96. success: function(data) {
  97. if(data.state == "success") {
  98. var UserWord=$("#password").val();
  99. helper.cookies.set("typeUser", typeUser, 7);
  100. helper.cookies.set("UserWord", UserWord, 7);
  101. helper.cookies.set("RoleCode", data.data.rolecode, 7);
  102. debugger
  103. if (openid) {
  104. helper.cookies.set("openid", openid, 7);
  105. debugger
  106. if (typeUser=="5") {
  107. gourl();
  108. } else if(typeUser=="1"){
  109. gourlStaff();
  110. }
  111. }
  112. }
  113. }
  114. })
  115. }
  116. function gourl() {
  117. switch(menucode) {
  118. case "WYKP":
  119. window.location.replace("content/AddInvoice.html");
  120. break; //我要开票
  121. case "WDGS":
  122. window.location.replace("content/company.html?menucode=WDGS");
  123. break; //我的公司
  124. case "WDCW":
  125. window.location.replace("content/finance.html");
  126. break; //我的财务
  127. case "XXCL":
  128. window.location.replace("content/personal.html");
  129. break; //首页
  130. case "FWJL":
  131. window.location.replace("content/invoiceList.html");
  132. break; //服务记录
  133. case "GDLB":
  134. window.location.replace("content/orderList.html");
  135. break; //工单列表
  136. case "GDXQ":
  137. window.location.replace("content/orderDetail.html");
  138. break; //工单详情
  139. default:
  140. window.location.replace("error.html");
  141. break;
  142. }
  143. }
  144. function gourlStaff() {
  145. switch(menucode) {
  146. case "WYKP":
  147. window.location.replace("content/AddInvoice.html");
  148. break; //我要开票
  149. case "WDGS":
  150. window.location.replace("content/company.html?menucode=WDGS");
  151. break; //我的公司
  152. case "WDCW":
  153. window.location.replace("content/personal.html");
  154. break; //我的财务
  155. case "XXCL":
  156. window.location.replace("content/personal.html");
  157. break; //首页
  158. case "FWJL":
  159. window.location.replace("content/invoiceList.html");
  160. break; //服务记录
  161. case "GDLB":
  162. window.location.replace("content/orderList.html");
  163. break; //工单列表
  164. case "GDXQ":
  165. window.location.replace("content/orderDetail.html");
  166. break; //工单详情
  167. default:
  168. window.location.replace("error.html");
  169. break;
  170. }
  171. }
  172. </script>
  173. </body>
  174. </html>