123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333 |
- <!DOCTYPE html>
- <html lang="zh-cn">
- <head>
- <meta charset="UTF-8">
- <meta name="format-detection" content="email=no" />
- <meta name="format-detection" content="telephone=no" />
- <title>登录</title>
- <link rel="stylesheet" href="../css/reset.css">
- <link rel="stylesheet" href="../css/style.css">
- <script src="../script/flexible.js"></script>
- <style>
- html,body{
- height: 100%;
- overflow: hidden;
- background-color: #f3f3f3;
- }
- .flex-wrap{
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- }
- .flex-con{
- -webkit-box-flex: 1;
- -webkit-flex: 1;
- flex: 1;
- }
- body{
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-orient: vertical;
- -webkit-flex-flow: column;
- flex-flow: column;
- }
- header{
- min-height: 1.4rem;
- line-height: 1.4rem;
- background-color: #096a6c;
- }
- header h2{
- width: 100%;
- height: 100%;
- font-size: .5rem;
- color: #fff;
- font-weight: normal;
- text-align: center;
- position: relative;
- }
- main{
- height: calc(100% - 1.3rem);
- /*background: url("../image/BG.jpg") no-repeat 100%/100%;*/
- }
- .newBack{
- width: 100%;
- height: 1.2rem;
- }
- .logoHead{
- background-color: #55b539;
- }
- .banner{
- width: 2.4rem;
- height: 2.4rem;
- margin: .8rem auto .1rem;
- }
- .banner img{
- display: block;
- width: 100%;
- height: 100%;
- }
- .appName{
- margin-top: .18rem;
- font-size: .52rem;
- text-align: center;
- color: #096a6c;
- }
- .tab span{
- display: inline-block;
- height: 1.4rem;
- line-height: 1.3rem;
- text-align: center;
- color: #fff;
- font-size: .42rem;
- position: relative;
- }
- .tab span.active:after{
- display: block;
- content: "";
- width: 0;
- height: 0;
- border-width: .16rem;
- border-style: solid;
- border-color: transparent transparent white transparent;
- position: absolute;
- left: calc(50% - .11rem);
- bottom: 0;
- }
- .inputDiv{
- background-color: #fff;
- }
- .inputDiv label{
- display: block;
- height: 1.3rem;
- line-height: 1.4rem;
- padding-left: .42rem;
- }
- .inputDiv label:last-of-type{
- border-bottom: 1px solid #f0f0f0;
- }
- .inputDiv label:last-of-type input{
- padding-left: .9rem;
- }
- label>input{
- width: 100%;
- height: 100%;
- color: #818181;
- background-color: rgba(0,0,0,0);
- border: none;
- outline: none;
- font-size: .38rem;
- padding-left: .8rem;
- }
- label:first-of-type>input{
- border-bottom: 1px solid #f0f0f0;
- }
- .userName{
- background: url("../image/login1.png") no-repeat 5%/5%;
- }
- .password{
- background: url("../image/login2.png") no-repeat 5%/4.5%;
- }
- .loginBtn{
- width: 90%;
- height: 1.2rem;
- line-height: 1.2rem;
- text-align: center;
- font-size: .48rem;
- color: #55b539;
- background-color: #fff;
- border: 1px solid #55b539;
- border-radius: .66rem;
- margin: .41rem auto .5rem;
- }
- .other{
- font-size: .35rem;
- color:#b3b3b3;
- text-align: center;
- }
- ::-webkit-input-placeholder{
- color: #d0d0d0;
- }
- </style>
- </head>
- <body>
- <!--<header>
- <h2>登录</h2>
- </header>-->
- <main class="flex-con">
- <div class="logoHead">
- <div class="newBack"></div>
- <div class="banner"><img src="../image/new_logo.png" alt=""></div>
- <div class="tab flex-wrap"><span class="znms flex-con active">智能检修</span></div>
- </div>
- <div class="inputDiv">
- <form action="#">
- <label class="userName"><input type="text" id="username" placeholder="请输入手机号码" value="123456"></label>
- <label class="password"><input type="password" id="password" placeholder="请输入密码" value="123123"></label>
- </form>
- </div>
- <div class="loginBtn">登 录</div>
- <div class="other clearFix">
- <!--<span class="left register">立即注册</span>-->
- <span class="findPW">忘记密码?</span>
- </div>
- </main>
- <script src="../script/cryptoJs.js"></script>
- <script src="../script/publicData.js"></script>
- <script src="../script/jqueryMin.js"></script>
- <script src="../script/api.js"></script>
- <script>
- apiready=function () {
- api.ajax({
- url: pageUrl+"/index/login/admin-phone",
- method: 'get',
- timeout: 30,
- dataType: 'text',
- returnAll: false,
- data: {
- values: {}
- }
- }, function (data, err) {
- var data=JSON.parse(data);
- $api.setStorage("admin",data)
- });
- $(".tab span").click(function () {
- $(this).addClass("active").siblings().removeClass("active")
- })
- $api.setStorage("imgOpen",null);
- $(".loginBtn").on('click',function () {
- if(!$("#username").val()){
- api.toast({
- msg: '账号不能为空1',
- duration: 1000,
- location: 'bottom'
- });
- return;
- }
- if(!$("#password").val()){
- api.toast({
- msg: '密码不能为空',
- duration: 1000,
- location: 'bottom'
- });
- return;
- }
- api.toast({
- msg: '正在登录中...',
- duration: 1000,
- location: 'bottom'
- });
- var data={
- phone:$("#username").val(),
- pwd:$("#password").val()
- }
- function Encrypt() {
- var para = JSON.stringify(data);
- var pwd="a20f9c17c542ec22b4b968b47985c294";
- var iv = CryptoJS.enc.Utf8.parse('1234567812345678');
- var mipassword = CryptoJS.AES.encrypt(para, pwd, { iv: iv,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.ZeroPadding});
- return {
- phone:$("#username").val(),
- pwd:mipassword.toString(),
- jiamicode:para,
- _token:"gLhRQY00Zgpv3eNV987uFQ0G2ymQLt5DUYBAT3To"
- }
- }
- api.ajax({
- url: pageUrl+"/index/login/index",
- method: 'post',
- timeout: 30,
- dataType: 'text',
- returnAll: false,
- data: {
- values: Encrypt()
- }
- }, function (data, err) {
- data=JSON.parse(data)
- console.log(JSON.stringify(data))
- if(data.status){
- $(".loginBtn").off('click').text("登录成功...");
- $api.setStorage("user",data.user);
- $api.rmStorage("luIndex");
- $api.rmStorage("luIndex2");
- var jsfun3 = 'toFrame(0)';
- api.execScript({
- name:"root",
- script: jsfun3
- });
- var jsfun = 'setData();';
- api.execScript({
- name: 'root',
- frameName: 'home',
- script: jsfun
- });
- setTimeout(function () {
- api.closeToWin({
- name: 'root',
- animation: {
- type: 'reveal',
- subType: 'from_left',
- duration: 400
- },
- delay:200
- });
- },2500)
- }else {
- api.toast({
- msg: data.msg,
- duration: 2000,
- location: 'bottom'
- });
- }
- api.execScript({
- name: 'root',
- script: 'totalTime(0);'
- });
- });
- })
- $(".findPW").click(function () {
- api.openWin({
- name: 'findPW',
- url: './findPW.html',
- animation: {
- type: 'movein',
- subType: 'from_bottom',
- duration: 400
- },
- delay:200
- });
- })
- var backSecond = 0;
- api.addEventListener({
- name: 'keyback'
- }, function(ret, err) {
- var curSecond = new Date().getSeconds();
- if (Math.abs(curSecond - backSecond) > 2) {
- backSecond = curSecond;
- api.toast({
- msg: '双击退出应用',
- duration: 2000,
- location: 'bottom'
- });
- } else {
- api.removePrefs({
- key: 'mesOpen'
- });
- api.removePrefs({
- key: 'taskOpen'
- });
- api.closeWidget({
- id: 'A6934101949817', //这里改成自己的应用ID
- retData: {
- name: 'closeWidget'
- },
- silent: true
- });
- }
- });
- }
- </script>
- </body>
- </html>
|