三元财务UI

login.html 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. debugger
  84. //请求
  85. $.ajax({
  86. type: "post",
  87. url: huayi.config.callcenter_url + 'WxLogin/Login',
  88. async: true,
  89. dataType: 'json',
  90. data: {
  91. UserCode: $("#account").val(),
  92. Password: $("#password").val(),
  93. UserType:typeUser,
  94. openid: openid,
  95. openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
  96. },
  97. success: function(data) {
  98. if(data.state == "success") {
  99. var UserWord=$("#password").val();
  100. helper.cookies.set("typeUser", typeUser, 365);
  101. helper.cookies.set("UserWord", UserWord, 365);
  102. // debugger
  103. if (openid) {
  104. helper.cookies.set("openid", openid, 365);
  105. // debugger
  106. if (typeUser=="5") {
  107. if(data.data.usertype==2){
  108. // debugger
  109. window.location.replace('content/AdminList.html');
  110. helper.cookies.set("username", data.data.username, 7);
  111. }else{
  112. gourl();
  113. }
  114. } else if(typeUser=="1"){
  115. gourlStaff();
  116. }
  117. }
  118. }
  119. }
  120. })
  121. }
  122. function gourl() {
  123. debugger
  124. switch(menucode) {
  125. case "WYKP":
  126. window.location.replace("content/AddInvoice.html");
  127. break; //我要开票
  128. case "WDGS":
  129. window.location.replace("content/company.html?menucode=WDGS");
  130. break; //我的公司
  131. case "WDCW":
  132. window.location.replace("content/finance.html");
  133. break; //我的财务
  134. case "XXCL":
  135. window.location.replace("content/personal.html");
  136. break; //首页
  137. case "FWJL":
  138. window.location.replace("content/invoiceList.html");
  139. break; //服务记录
  140. case "GDLB":
  141. window.location.replace("content/orderList.html");
  142. break; //工单列表
  143. case "GDXQ":
  144. window.location.replace("content/orderDetail.html");
  145. break; //工单详情
  146. case "WZDA":
  147. window.location.replace("content/borrowList.html");
  148. break; //物资档案列表
  149. default:
  150. window.location.replace("error.html");
  151. break;
  152. }
  153. }
  154. function gourlStaff() {
  155. switch(menucode) {
  156. case "WYKP":
  157. window.location.replace("content/AddInvoice.html");
  158. break; //我要开票
  159. case "WDGS":
  160. window.location.replace("content/company.html?menucode=WDGS");
  161. break; //我的公司
  162. case "WDCW":
  163. window.location.replace("content/personal.html");
  164. break; //我的财务
  165. case "XXCL":
  166. window.location.replace("content/personal.html");
  167. break; //首页
  168. case "FWJL":
  169. window.location.replace("content/invoiceList.html");
  170. break; //服务记录
  171. case "GDLB":
  172. window.location.replace("content/orderList.html");
  173. break; //工单列表
  174. case "GDXQ":
  175. window.location.replace("content/orderDetail.html");
  176. break; //工单详情
  177. case "WZDA":
  178. window.location.replace("content/borrowList.html");
  179. break; //物资档案列表
  180. default:
  181. window.location.replace("error.html");
  182. break;
  183. }
  184. }
  185. </script>
  186. </body>
  187. </html>