25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

98 satır
2.7 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  6. <title></title>
  7. <link href="css/mui.min.css" rel="stylesheet" />
  8. <style>
  9. ul {
  10. font-size: 14px;
  11. color: #8f8f94;
  12. }
  13. .mui-btn {
  14. padding: 10px;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19. <header class="mui-bar mui-bar-nav" style="padding-right: 15px;">
  20. <h1 class="mui-title">登录模板</h1>
  21. <button id='setting' class=" mui-pull-right mui-btn-link">设置</button>
  22. </header>
  23. <div class="mui-content">
  24. <div class="mui-content-padded">
  25. <p>
  26. 您好 <span id='account'></span>,您已成功登录。
  27. <ul>
  28. <li>这是mui带登录和设置模板的示例App首页。</li>
  29. <li>您可以点击右上角的 “设置” 按钮,进入设置模板,体验div窗体切换示例。</li>
  30. <li>在 “设置” 中点击 “退出” 可以 “注销当前账户” 或 “直接关闭应用”。</li>
  31. <li>你可以设置 “锁屏图案”,这样可通过手势密码代替输入账号、密码;</li>
  32. </ul>
  33. </p>
  34. <!--<button class="mui-btn mui-btn-block mui-btn-primary">设置</button>-->
  35. <!--
  36. <button id='exit' class="mui-btn mui-btn-block mui-btn-green">关闭</button>
  37. <button id='logout' class="mui-btn mui-btn-red mui-btn-block">注销登录</button>
  38. -->
  39. </div>
  40. </div>
  41. <script src="js/mui.min.js"></script>
  42. <script src="js/app.js"></script>
  43. <script>
  44. (function($, doc) {
  45. $.init();
  46. var settings = app.getSettings();
  47. var account = doc.getElementById('account');
  48. //
  49. window.addEventListener('show', function() {
  50. var state = app.getState();
  51. account.innerText = state.account;
  52. }, false);
  53. $.plusReady(function() {
  54. var settingPage = $.preload({
  55. "id": 'setting',
  56. "url": 'setting.html'
  57. });
  58. //设置
  59. var settingButton = doc.getElementById('setting');
  60. //settingButton.style.display = settings.autoLogin ? 'block' : 'none';
  61. settingButton.addEventListener('tap', function(event) {
  62. $.openWindow({
  63. id: 'setting',
  64. show: {
  65. aniShow: 'pop-in'
  66. },
  67. styles: {
  68. popGesture: 'hide'
  69. },
  70. waiting: {
  71. autoShow: false
  72. }
  73. });
  74. });
  75. //--
  76. $.oldBack = mui.back;
  77. var backButtonPress = 0;
  78. $.back = function(event) {
  79. backButtonPress++;
  80. if (backButtonPress > 1) {
  81. plus.runtime.quit();
  82. } else {
  83. plus.nativeUI.toast('再按一次退出应用');
  84. }
  85. setTimeout(function() {
  86. backButtonPress = 0;
  87. }, 1000);
  88. return false;
  89. };
  90. });
  91. }(mui, document));
  92. </script>
  93. </body>
  94. </html>