123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- <!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">
- <script src="../js/flexible.js"></script>
- <script src="../js/api.js"></script>
- <script src="../js/checkLanguage.js"></script>
- <style>
- html,body{
- height: 100%;
- overflow: hidden;
- }
- .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{
- height: 1.4rem;
- line-height: 1.4rem;
- background-color: #51c4d4;
- display: none;
- }
- header h2{
- width: 100%;
- height: 100%;
- font-size: .5rem;
- color: #fff;
- font-weight: normal;
- text-align: center;
- position: relative;
- }
- main{
- height: calc(100% - 1.4rem);
- padding-top: 1.5rem;
- }
- .banner{
- width: 7.7rem;
- height: 5.77rem;
- margin: .3rem auto 1rem;
- }
- .banner img{
- display: block;
- width: 100%;
- height: 100%;
- }
- .inputDiv{
- padding: 0 1.02rem;
- }
- .inputDiv label{
- display: block;
- height: 1.1rem;
- border: 1px solid rgba(255,255,255,0.6);
- border-radius: 1rem;
- padding-left: .6rem;
- margin-bottom: .4rem;
- position: relative;
- }
- label>input{
- width: 100%;
- height: .5rem;
- color: rgba(255,255,255,0.8);
- background-color: rgba(0,0,0,0);
- border: none;
- outline: none;
- font-size: .4rem;
- padding-left: .4rem;
- margin-top: .34rem;
- }
- .inputDiv label>i{
- display: inline-block;
- position: absolute;
- left: .33rem;
- top: 50%;
- -webkit-transform: translateY(-50%);
- transform: translateY(-50%);
- }
- .inputDiv label.userName>i{
- width: .37rem;
- height: .54rem;
- top: 60%;
- }
- .inputDiv label.password>i{
- width: .33rem;
- height: .49rem;
- }
- .loginBtn{
- width: 100%;
- height: 1.1rem;
- line-height: 1.1rem;
- text-align: center;
- font-size: .48rem;
- color: #00b2e0;
- background-color: rgba(255,255,255,0.9);
- border-radius: .6rem;
- margin: .6rem 0;
- }
- .other{
- padding: .3rem 1.02rem 0;
- font-size: .36rem;
- color:rgba(255,255,255,0.8);
- }
- ::-webkit-input-placeholder{
- color: rgba(255,255,255,0.8);
- }
- </style>
- </head>
- <body>
- <header>
- <h2 class="headTit"></h2>
- </header>
- <main class="flex-con">
- <div class="banner">
- <img src="../images/loginLogo.png" alt="">
- </div>
- <div class="inputDiv">
- <form action="#">
- <label class="userName"><i><img src="../images/login1.png" alt=""></i><input type="text" value="" class="login1Input" id="username" placeholder="请输入手机号/邮箱"></label>
- <label class="password"><i><img src="../images/login2.png" alt=""></i><input type="password" value="" class="login2Input" id="password" placeholder="请输入密码"></label>
- </form>
- <div class="loginBtn btn1"></div>
- </div>
- <div class="other clearFix">
- <span class="left register btn2"></span>
- <span class="right findPW btn3"></span>
- </div>
- </main>
- <script type="text/javascript">
- try {
- var text=languages.login;
- $api.dom(".headTit").innerText=text.tit;
- $api.dom(".login1Input").setAttribute("placeholder",text.login1Input);
- $api.dom(".login2Input").setAttribute("placeholder",text.login2Input);
- $api.dom(".btn1").innerText=text.btn1;
- $api.dom(".btn2").innerText=text.btn2;
- $api.dom(".btn3").innerText=text.btn3;
- }catch (e){
- alert(languages.all.list5)
- }
- </script>
- <script src="../js/publicData.js"></script>
- <script src="../js/jquery-3.1.0.min.js"></script>
- <script src="../js/pinyin.js" type="text/javascript" charset="utf-8"></script>
- <script>
- try{
- var userInfo=$api.getStorage("thisUP");
- if(userInfo&&userInfo.username){
- $api.dom('#username').value=userInfo.username;
- $api.dom('#password').value=userInfo.password;
- }
- }catch (e){console.log('err')}
- apiready=function () {
- $(".loginBtn").on('click',function () {
- if(!$("#username").val()){
- api.toast({
- msg: languages.login.remind1,
- duration: 1000,
- location: 'bottom'
- });
- return;
- }
- if(!$("#password").val()){
- api.toast({
- msg: languages.login.remind2,
- duration: 1000,
- location: 'bottom'
- });
- return;
- }
- api.toast({
- msg: languages.login.remind3+'...',
- duration: 1000,
- location: 'bottom'
- });
- $api.setStorage("orderIndex",0);
- $api.setStorage("issueIndex",0);
- var postData={
- number:$("#username").val(),
- repwd:$("#password").val()
- }
- api.ajax({
- url: pageUrl+"login/login",
- method: 'post',
- timeout: 30,
- dataType: 'json',
- returnAll: false,
- data: {
- values: postData
- }
- }, function (ret, err) {
- var data=ret;
- console.log(JSON.stringify(data))
- if(data.status=="200"){
- //更新运价数据
-
- $(".loginBtn").off('click').text(languages.login.remind4+"...");
- $api.setStorage("user",data.data);
- $api.setStorage("thisUP",{"username":postData.number,"password":postData.repwd});
- var services={
- "shop":data['data']['user_singel']?data['data']['user_singel']['Isshop']:0,
- "assurance":data['data']['user_singel']?data['data']['user_singel']['IsGuarantee']:0,
- "recommend":data['data']['user_singel']?data['data']['user_singel']['IsRecommend']:0,
- "partner":data['data']['user_singel']?data['data']['user_singel']['IsTeam']:0
- }
- $api.setStorage("serviceStatus",services);
- $api.setStorage("issueName","Putaway");
-
- //登陆后加载初始化数据
- setTimeout(function () {
- api.execScript({
- name: 'root',
- frameName: 'orderUntreated',
- script: 'getdata(true,0);'
- });
- api.execScript({
- name: 'root',
- frameName: 'orderNav',
- script: 'getTotal();'
- });
- api.sendEvent({
- name: 'loginInit',
- extra: {key: 'yes'}
- });
- },200)
- setTimeout(function () {
- api.closeToWin({
- name: 'root',
- animation: {
- type: 'reveal',
- subType: 'from_left',
- duration: 400
- },
- delay:200
- });
- },2500)
-
-
-
-
-
- }else {
- api.toast({
- msg: data.message,
- duration: 2000,
- location: 'bottom'
- });
- }
- })
- })
- $(".findPW").click(function () {
- api.openWin({
- name: 'findPW',
- url: './findPW.html',
- animation: {
- type: 'push',
- subType: 'from_right',
- duration: 400
- },
- delay:200
- });
- })
- $(".register").click(function () {
- api.openWin({
- name: 'register',
- url: './register.html',
- bgColor:"widget://images/loginBG.jpg",
- animation: {
- type: 'push',
- subType: 'from_left',
- 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: languages.all.list29,
- duration: 2000,
- location: 'bottom'
- });
- } else {
- api.closeWidget({
- id: 'A6050144312590', //这里改成自己的应用ID
- retData: {
- name: 'closeWidget'
- },
- silent: true
- });
- }
- });
- }
- function changePW(val) {
- $api.dom('#password').value=val;
- }
- </script>
- </body>
- </html>
|