123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <!DOCTYPE html>
- <html>
- <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.min.css" rel="stylesheet"/>
- <link href="css/main.css" rel="stylesheet"/>
-
- </head>
- <body>
- <header class="mui-bar mui-bar-nav">
- <h1 class="mui-title">新农宝盒V2</h1>
- </header>
-
- <div class="mui-content maze-content">
-
- <a type="button" class="mui-btn mui-btn-block mui-btn-outlined maze-login" id="login" style="display:;">登 录</a>
-
- <div id="main" style="display:none;">
- <a type="button" id="main_device" class="mui-btn mui-btn-block mui-btn-outlined maze-login" style="display:;">设备管理</a>
- </div>
-
- <div class="mui-slider">
- <div class="mui-slider-group">
- <div class="mui-slider-item"><a href="#"><img src="img/focus/1.jpg" /></a></div>
- <div class="mui-slider-item"><a href="#"><img src="img/focus/2.jpg" /></a></div>
- <div class="mui-slider-item"><a href="#"><img src="img/focus/3.jpg" /></a></div>
- </div>
- </div>
- <ul class="mui-table-view maze-foot">
- <li class="mui-table-view-cell">客服电话:187-0113-9598</li>
- </ul>
- </div>
-
- <script src="js/mui.min.js"></script>
- <script src="js/main.js"></script>
- <script src="js/login.js"></script>
- <script type="text/javascript" charset="utf-8">
-
- (function($, self) {
- $.init({
- preloadPages:[{
- id:'login',
- url:'login.html'
- }
- ]
- });
-
- $.plusReady(function()
- {
- var state = app.getState();
- if(state.token)
- {
- //self.getElementById('main_user').innerText = state.account + ',您好!';
- self.getElementById('login').style.display = 'none';
- self.getElementById('main').style.display = 'block';
- }
- else
- {
- self.getElementById('login').style.display = 'block';
- self.getElementById('main').style.display = 'none';
- }
- //获得slider插件对象
- var gallery = $('.mui-slider');
- gallery.slider({
- interval:1000//自动轮播周期,若为0则不自动播放,默认为0;
- });
-
- var loginButton = self.getElementById('login');
- loginButton.addEventListener('tap', function(event)
- {
- $.openWindow({
- url: 'login.html',
- id: 'login',
- preload: true,
- show: {
- aniShow: 'pop-in'
- },
- styles: {
- popGesture: 'hide'
- },
- waiting: {
- autoShow: false
- }
- });
- }, false);
- var mainButton = self.getElementById('main');
- mainButton.addEventListener('tap', function(event)
- {
- var v = plus.webview.getWebviewById('main');
- $.openWindow({
- url: 'main.html',
- id: 'main',
- //preload: true,
- show: {
- aniShow: 'pop-in'
- },
- styles: {
- popGesture: 'hide'
- },
- waiting: {
- autoShow: true
- }
- });
- }, false);
-
- window.addEventListener('resize', function() {
- oauthArea.style.display = document.body.clientHeight > 400 ? 'block' : 'none';
- }, false);
- //
- //处理逻辑:1秒内,连续两次按返回键,则退出应用;
- var first = null;
- plus.key.addEventListener('backbutton', function(){
- //首次按键,提示‘再按一次退出应用’
- if(!first){
- first = new Date().getTime();
- mui.toast('再按一次退出应用');
- setTimeout(function(){
- first = null;
- },1000);
- }else{
- if(new Date().getTime()-first<1000){
- plus.runtime.quit();
- }
- }
- }, false);
- });
-
- }(mui, document));
- </script>
- </body>
- </html>
|