123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384 |
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
- <title></title>
- <link rel="stylesheet" type="text/css" href="./css/api.css" />
- <link rel="stylesheet" type="text/css" href="./css/iconfont.css" />
- <link rel="stylesheet" type="text/css" href="./css/style.css" />
- <style>
- html,body{
- height:100%;
- }
- .bot-input {
- width: 95%;
- }
- .hotel-top-back {
- background-color: #fff;
- }
- a, a:hover, a:active, a:hover, a:visited, a:link {
- color: #D9251C;
- }
- </style>
- <script>
- console.log(0.28*100);
- (function(w, d, m) {
- function r() {
- var t = 100,
- o = 750,
- e = d.documentElement.clientWidth || w.innerWidth,
- n = m.max(m.min(e, 480), 320),
- h = 50;
- 320 >= n && (h = m.floor(n / o * t * .99)),
- n > 320 && 362 >= n && (h = m.floor(n / o * t * 1)),
- n > 362 && 375 >= n && (h = m.floor(n / o * t * 1)),
- n > 375 && (h = m.floor(n / o * t * .97)),
- d.querySelector("html").style.fontSize = h + "px"
- };
- r();
- d.querySelector("html").style.height = w.innerHeight + "px"
- w.onresize = function() {
- r()
- }
- })(window, document, Math);
- </script>
- </head>
- <body>
- <div class="topbar"></div>
- <header class="back-header">
- <ul>
- <li class="padding-20"><div class="hotel-top-back mask-hidden back-btn"><span class="iconfont" style="color: #000;font-size: 0.35rem;background-color: #fff;"></span></div></li>
- <li class="back-header-title"></li>
- <li class="more-btn">注册</li>
- </ul>
- </header>
- <section class="new-list">
- <div class="login-logo"><img src="image/logo2.png" /></div>
- <div>
- <input class="bot-input" id="username" type="text" placeholder="手机号/用户名" />
- <div class="h5"></div>
- <input class="bot-input" id="password" type="password" placeholder="登录密码" />
- <div class="h20"></div>
- <div class="h20"></div>
- <div class="m-bottom">登 录</div>
- <div class="h20" style="height: 0.5rem;"></div>
- <div class="">
- <div class="find-pad">找回密码</div>
- <div class="code-login">验证码登录</div>
- </div>
- <div class="h50"></div>
- </div>
- <div class="h50"></div>
- </section>
- <div class="setting-item" style="text-align: center;font-size: 0.28rem;border-bottom:none;position: absolute;bottom: 0.2rem;text-align: center;width: 100%;">
- <div>登录即代表同意<a href="javascript:go_privacy();">《用户协议》</a>和<a href="javascript:go_private();">《隐私政策》</a></div>
- </div>
- <div class="more-landing" style="bottom: 1rem;position: absolute;">
- <ul>
- <li> </li>
- <li style="width:70%;">
- <img id="qq-login" src="image/qq_login.png" style="margin-right: 0.15rem;" />
- <img id="wx-login" src="image/wx_login.png" style="margin-left: 0.15rem;" />
- </li>
- <li> </li>
- </ul>
- </div>
- </body>
- <script type="text/javascript" src="./script/api.js"></script>
- <script type="text/javascript" src="script/jquery.min.js"></script>
- <script type="text/javascript" src="script/jquery.tap.js"></script>
- <script type="text/javascript">
- var _isjump = false;
- apiready = function() {
- setFixStatusBar();
- setBackDisable();
- _isjump = api.pageParam.keyid;
- isinwx();
- isinqq();
- isjump();
- };
- $(".m-bottom").on("tap", function() {
- getRouteData();
- return false;
- })
- function isjump() {
- // body...
- if (_isjump) {
- $(".hotel-top-back").removeClass("mask-hidden");
- }
- }
- function getRouteData() {
- if ($("#username").val() == "" || $("#password").val() == "") {
- api.toast({ msg: '用户名或密码不能为空!' });
- return false;
- }
- $.ajax({
- url: siteurl + 'v1/entry/login',
- data: {
- account: $("#username").val(),
- pwd: $("#password").val()
- },
- dataType: 'json',
- type: 'post',
- success: function(datas) {
- if (datas.result) {
- $api.setStorage("memberid", datas.data.member_id);
- $api.setStorage("accesstoken", datas.data.token);
- $api.setStorage("storeid", datas.data.store_id);
- $api.setStorage("agent_id", datas.data.agent_id);
- dologin(datas);
- setTimeCloseWin("login");
- } else {
- $api.rmStorage("memberid");
- $api.rmStorage("accesstoken");
- $api.rmStorage("storeid");
- $api.rmStorage("agent_id");
- }
- api.toast({ msg: datas.msg });
- }
- });
- }
- function dologin(e) {
- // body...
- if (e.data.is_store == 1) {
- $api.rmStorage("memberid");
- $api.rmStorage("agent_id");
- api.openWin({
- name: 'hotelindex',
- url: './html/hotel/index.html',
- bounces: false
- })
- return false;
- } if (e.data.is_agent == 1) {
- $api.rmStorage("storeid");
- $api.rmStorage("memberid");
- api.openWin({
- name: 'agentindex',
- url: './html/agent/index.html',
- bounces: false
- })
- return false;
- } else {
- $api.rmStorage("agent_id");
- $api.rmStorage("storeid");
- if (_isjump) {
- api.closeWin();
- }
- api.openWin({
- name: 'index',
- url: 'index.html',
- bounces: false
- })
- return false;
- }
- }
- function go_privacy() {
- api.openWin({
- name: 'privacy',
- url: './html/my/privacy.html',
- bounces: false
- });
- return false;
- }
- function go_private() {
- api.openWin({
- name: 'private',
- url: './html/my/private.html',
- bounces: false
- });
- return false;
- }
- $(".find-pad").on("tap", function() {
- api.openWin({
- name: 'findpad',
- allowEdit: true,
- url: 'findpad.html',
- bounces: false
- });
- })
- $(".code-login").on("tap", function() {
- api.openWin({
- name: 'codelogin',
- allowEdit: true,
- url: 'codelogin.html',
- bounces: false
- });
- })
- $(".more-btn").on("tap", function() {
- api.openWin({
- name: 'register',
- allowEdit: true,
- url: 'register.html',
- bounces: false
- });
- })
- ///
- function isinwx(){
- var wx = api.require('wx');
- wx.isInstalled(function(ret, err) {
- if (ret.installed) {
- $("#wx-login").fadeIn();
- } else {
- $("#wx-login").fadeOut();
- }
- })
- }
- function isinqq(){
- var qq = api.require('QQPlus');
- qq.installed(function(ret, err) {
- if (ret.status) {
- $("#qq-login").fadeIn();
- } else {
- $("#qq-login").fadeOut();
- }
- })
- }
- $("#wx-login").on("tap", function() {
- var wx = api.require('wx');
- wx.isInstalled(function(ret, err) {
- if (ret.installed) {
- wx.auth({
- apiKey: ''
- }, function(ret, err) {
- if (ret.status) {
- wx.getToken({
- code: ret.code
- }, function(ret, err) {
- if (ret.status) {
- $.ajax({
- url: siteurl + 'v1/entry/account',
- data: {
- openid: ret.openId,
- auth: 'wx'
- },
- dataType: 'json',
- type: 'post',
- success: function(datas) {
- if (datas.result) {
- api.toast({ msg: '登录成功!' });
- $api.setStorage("memberid", datas.data.member_id);
- $api.setStorage("accesstoken", datas.data.token);
- $api.setStorage("storeid", datas.data.store_id);
- $api.setStorage("agent_id", datas.data.agent_id);
- dologin(datas);
- setTimeCloseWin("login");
- } else {
- api.openWin({
- name: 'register',
- url: 'register.html',
- bounces: false,
- pageParam: {
- openid: ret.openId,
- auth: 'wx'
- }
- });
- $api.rmStorage("storeid");
- $api.rmStorage("agent_id");
- $api.rmStorage("accesstoken");
- $api.rmStorage("memberid");
- }
- }
- });
- } else {
- api.toast({ msg: '获取授权失败!' });
- }
- });
- } else {
- api.toast({ msg: '获取code失败!' });
- }
- });
- } else {
- api.toast({ msg: '系统没有安装微信!' });
- }
- });
- })
- ///
- $("#qq-login").on("tap", function() {
- var qq = api.require('QQPlus');
- qq.installed(function(ret, err) {
- if (ret.status) {
- qq.login(function(ret, err) {
- if (ret.openId) {
- $.ajax({
- url: siteurl + 'v1/entry/account',
- data: {
- openid: ret.openId,
- auth: 'qq'
- },
- dataType: 'json',
- type: 'post',
- success: function(datas) {
- if (datas.result) {
- api.toast({ msg: '登录成功!' });
- $api.setStorage("memberid", datas.data.member_id);
- $api.setStorage("accesstoken", datas.data.token);
- $api.setStorage("storeid", datas.data.store_id);
- $api.setStorage("agent_id", datas.data.agent_id);
- dologin(datas);
- setTimeCloseWin("login");
- } else {
- api.openWin({
- name: 'register',
- url: 'register.html',
- bounces: false,
- pageParam: {
- openid: ret.openId,
- auth: 'qq'
- }
- });
- $api.rmStorage("storeid");
- $api.rmStorage("agent_id");
- $api.rmStorage("accesstoken");
- $api.rmStorage("memberid");
- }
- }
- });
- } else {
- api.toast({ msg: '获取授权失败!' });
- }
- });
- } else {
- api.toast({ msg: "系统没有安装QQ!" });
- }
- });
- })
- var windowInnerHeight = window.innerHeight; //获取当前浏览器窗口高度
- document.body.style.height = window.innerHeight + "px"
- $(window).resize(function() {
- setTimeout(function(){
- if (window.innerHeight < windowInnerHeight) {
- $('.more-landing').css('position', 'static'); //当内部高度变小时
- } else {
- $('.more-landing').css('position', 'fixed');
- $(".more-landing").show();
- $(".setting-item").show();
- }
- }, 50)
- });
- document.body.addEventListener('click', function (e) {
- if (e.target.type == 'textarea' || e.target.type == 'text' || e.target.type == 'password' || e.target.type == 'search') {
- $(".more-landing").hide();
- $(".setting-item").hide();
- }
- e.target.addEventListener('blur', function(){
- $(".more-landing").show();
- $(".setting-item").show();
- })
- })
- </script>
- </html>
|