integral_win.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title>APP</title>
  8. <link rel="stylesheet" type="text/css" href="../css/api.css" />
  9. <link rel="stylesheet" type="text/css" href="../css/aui-win.css" />
  10. <link rel="stylesheet" type="text/css" href="../css/iconfont.css" />
  11. <style type="text/css">
  12. body,
  13. html {
  14. width: 100%;
  15. height: 100%;
  16. }
  17. .aui-nav .aui-bar-tab {
  18. background: #fff;
  19. }
  20. /*.aui-bar {
  21. text-align: center;
  22. height: 3.3rem;
  23. }*/
  24. .btn-icon {
  25. width: 1.2rem;
  26. margin: 0 auto;
  27. margin-bottom: 3px;
  28. }
  29. .aui-bar-tab .aui-bar-tab-item {
  30. padding: 10px 0;
  31. box-sizing: border-box;
  32. }
  33. .aui-bar1 {
  34. position: relative;
  35. top: 0;
  36. right: 0;
  37. left: 0;
  38. z-index: 10;
  39. width: 100%;
  40. min-height: 2.25rem;
  41. font-size: 0.9rem;
  42. text-align: center;
  43. display: table;
  44. }
  45. /*底部切换栏*/
  46. .aui-bar-tab1 {
  47. position: fixed;
  48. top: auto;
  49. bottom: 0;
  50. table-layout: fixed;
  51. background-color: #ffffff;
  52. color: #757575;
  53. }
  54. .aui-bar-tab1 .aui-bar-tab-item {
  55. display: table-cell;
  56. position: relative;
  57. width: 1%;
  58. height: 2.5rem;
  59. text-align: center;
  60. vertical-align: middle;
  61. padding: 5px 0;
  62. }
  63. .aui-bar-tab-label {
  64. font-size: 0.8rem;
  65. margin-top: -5px;
  66. }
  67. </style>
  68. </head>
  69. <body>
  70. <header class="aui-bar aui-bar-nav aui-bar-info" id="aui-header">
  71. <!-- <div>
  72. <a class="aui-btn aui-btn-info aui-pull-left" tapmode onclick="closeWin()"> <span class="aui-iconfont aui-icon-left"></span> </a>
  73. <div class="aui-title" id="aui-title">
  74. 积分商场
  75. </div>
  76. </div> -->
  77. </header>
  78. <footer class="aui-bar1 aui-bar-tab1" id="footer">
  79. <div class="aui-bar-tab-item aui-active" tapmode>
  80. <img src="./img/images/tabar_home_active.png" id="index1" class="btn-icon" />
  81. <div class="aui-bar-tab-label">
  82. 首页
  83. </div>
  84. </div>
  85. <div class="aui-bar-tab-item" tapmode>
  86. <img src="./img/images/shop_inactive.png" id="index2" class="btn-icon" />
  87. <div class="aui-bar-tab-label">
  88. 购物车
  89. </div>
  90. </div>
  91. <div class="aui-bar-tab-item" tapmode>
  92. <img src="./img/images/wode.png" id="index3" class="btn-icon" />
  93. <div class="aui-bar-tab-label">
  94. 个人中心
  95. </div>
  96. </div>
  97. </footer>
  98. </body>
  99. <script type="text/javascript" src="../script/api.js"></script>
  100. <script type="text/javascript" src="../script/aui-tab.js"></script>
  101. <script type="text/javascript">
  102. function closeWin() {
  103. api.closeWin({});
  104. }
  105. apiready = function() {
  106. var header = $api.byId('aui-header');
  107. $api.fixStatusBar(header);
  108. var headerPos = $api.offset(header);
  109. var footer = $api.byId('footer');
  110. $api.fixTabBar(footer)
  111. var body_h = $api.offset($api.dom('body')).h;
  112. var footer_h = $api.offset($api.byId('footer')).h;
  113. openFrameGroup(headerPos, body_h, footer_h);
  114. /// 打开页面组
  115. var tab = new auiTab({
  116. element: document.getElementById("footer"),
  117. }, function(ret) {
  118. if (ret.index == 1) {
  119. $api.attr($api.byId('index1'), 'src', './img/images/tabar_home_active.png');
  120. $api.attr($api.byId('index2'), 'src', './img/images/shop_inactive.png');
  121. $api.attr($api.byId('index3'), 'src', './img/images/wode.png');
  122. api.sendEvent({
  123. name: 'refreshindex',
  124. extra: {
  125. }
  126. });
  127. } else if (ret.index == 2) {
  128. $api.attr($api.byId('index1'), 'src', './img/images/tabar_home_inactive.png');
  129. $api.attr($api.byId('index2'), 'src', './img/images/shop_active.png');
  130. $api.attr($api.byId('index3'), 'src', './img/images/wode.png');
  131. api.sendEvent({
  132. name: 'refreshshop',
  133. extra: {
  134. }
  135. });
  136. } else {
  137. $api.attr($api.byId('index1'), 'src', './img/images/tabar_home_inactive.png');
  138. $api.attr($api.byId('index2'), 'src', './img/images/shop_inactive.png');
  139. $api.attr($api.byId('index3'), 'src', './img/images/wode_active.png');
  140. api.sendEvent({
  141. name: 'refreshmy',
  142. extra: {
  143. }
  144. });
  145. }
  146. api.setFrameGroupIndex({
  147. name: 'indexGroup',
  148. index: (ret.index - 1),
  149. });
  150. });
  151. };
  152. // 打开页面组
  153. function openFrameGroup(headerPos, body_h, footer_h) {
  154. api.openFrameGroup({
  155. name: 'indexGroup',
  156. scrollEnabled: false,
  157. rect: {
  158. x: 0,
  159. y: 0,
  160. w: 'auto',
  161. h: body_h - footer_h
  162. },
  163. index: 0,
  164. reload: true,
  165. frames: [{
  166. name: 'main',
  167. url: 'integral_index.html',
  168. vScrollBarEnabled: false,
  169. hScrollBarEnabled: false,
  170. bounces: false,
  171. }, {
  172. name: 'shop',
  173. url: 'integral_shop.html',
  174. vScrollBarEnabled: false,
  175. hScrollBarEnabled: false,
  176. bounces: false,
  177. }, {
  178. name: 'my',
  179. url: 'integral_my.html',
  180. vScrollBarEnabled: false,
  181. hScrollBarEnabled: false,
  182. bounces: false,
  183. }],
  184. }, function(ret, err) {
  185. if (ret.index == 1) {
  186. $api.addCls($api.byId('aui-header'));
  187. } else {
  188. $api.removeCls($api.byId('aui-header'));
  189. }
  190. });
  191. }
  192. </script>
  193. </html>