| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <!DOCTYPE html>
- <html class="ui-page-login" style="height: 100%">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <title>登录</title>
- <link href="css/mui.css" rel="stylesheet" />
- <link href="css/iconfont.css" rel="stylesheet" />
- <link href="css/login.css" rel="stylesheet" />
- <script src="js/jquery.min.js"></script>
- <script src="Script/Common/huayi.http.js"></script>
- <script src="Script/Common/huayi.config.js"></script>
- </head>
- <body style="height: 100%">
- <div class="mui-content">
- <form id='login-form' class="mui-input-group">
- <!--logo-->
- <div class="mui-logo-box">
- <div class="mui-logo-img">
- <img src="img/logo.png"/>
- </div>
- <div class="mui-logo-text">欢迎来到三元财务</div>
- </div>
- <div class="mui-input-row">
- <input id='account' type="text" class="mui-input-clear mui-input" placeholder="请输入账号">
- </div>
- <div class="mui-input-row mui-password">
- <input id='password' type="password" class=" mui-input-password mui-input" placeholder="请输入密码">
- </div>
- </form>
- <div class="mui-content-padded">
- <button id='login' class="mui-btn mui-btn-block mui-btn-primary" style="font-size: 16px;">登录</button>
- </div>
- <div class="mui-content-padded oauth-area" style="width: 100%;">
- <a class="reg_href staff">员工登录</a>
- <a class="reg_href company">公司登录</a>
- <a class="reg_href" href="tel:037155373773">我要合作</a>
- </div>
- </div>
- <script src="js/mui.min.js"></script>
- <script>
- //var openid = helper.cookies.get("openid");
- var menucode = helper.request.queryString("menuCode");
- var code = helper.request.queryString("code");
- var openid = helper.request.queryString("openid");
- //var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
- var typeUser = helper.cookies.get("typeUser");
- if (typeUser) {
- typeUser = helper.cookies.get("typeUser");
- } else{
- typeUser=5;
- }
- if (typeUser==1) {
- $(".staff").hide();
- $(".company").show();
- } else if(typeUser==5){
- $(".staff").show();
- $(".company").hide();
- }
- //登陆验证
- $(".staff").on('tap', function() {
- $(this).hide();
- $(".company").show();
- typeUser=1; //员工
- });
- $(".company").on('tap', function() {
- $(this).hide();
- $(".staff").show();
- typeUser=5; //公司
- });
- $("#login").on('tap', function() {
- if(!$("#account").val()) {
- mui.alert("请输入账号");
- return;
- }
- if(!$("#password").val()) {
- mui.alert("密码不能为空")
- return;
- }
- login();
- })
- function login () {
- //请求
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + 'WxLogin/Login',
- async: true,
- dataType: 'json',
- data: {
- UserCode: $("#account").val(),
- Password: $("#password").val(),
- UserType:typeUser,
- openid: openid,
- //openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
- },
- success: function(data) {
- if(data.state == "success") {
- var UserWord=$("#password").val();
- helper.cookies.set("typeUser", typeUser, 7);
- helper.cookies.set("UserWord", UserWord, 7);
- helper.cookies.set("RoleCode", data.data.rolecode, 7);
- debugger
- if (openid) {
- helper.cookies.set("openid", openid, 7);
- debugger
- if (typeUser=="5") {
- gourl();
- } else if(typeUser=="1"){
- gourlStaff();
- }
- }
- }
- }
- })
- }
- function gourl() {
- switch(menucode) {
- case "WYKP":
- window.location.replace("content/AddInvoice.html");
- break; //我要开票
- case "WDGS":
- window.location.replace("content/company.html?menucode=WDGS");
- break; //我的公司
- case "WDCW":
- window.location.replace("content/finance.html");
- break; //我的财务
- case "XXCL":
- window.location.replace("content/personal.html");
- break; //首页
- case "FWJL":
- window.location.replace("content/invoiceList.html");
- break; //服务记录
- case "GDLB":
- window.location.replace("content/orderList.html");
- break; //工单列表
- case "GDXQ":
- window.location.replace("content/orderDetail.html");
- break; //工单详情
- default:
- window.location.replace("error.html");
- break;
- }
- }
- function gourlStaff() {
- switch(menucode) {
- case "WYKP":
- window.location.replace("content/AddInvoice.html");
- break; //我要开票
- case "WDGS":
- window.location.replace("content/company.html?menucode=WDGS");
- break; //我的公司
- case "WDCW":
- window.location.replace("content/personal.html");
- break; //我的财务
- case "XXCL":
- window.location.replace("content/personal.html");
- break; //首页
- case "FWJL":
- window.location.replace("content/invoiceList.html");
- break; //服务记录
- case "GDLB":
- window.location.replace("content/orderList.html");
- break; //工单列表
- case "GDXQ":
- window.location.replace("content/orderDetail.html");
- break; //工单详情
- default:
- window.location.replace("error.html");
- break;
- }
- }
-
- </script>
- </body>
- </html>
|