searchWin.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <meta name="format-detection"content="telephone=no">
  8. <title>index</title>
  9. <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
  10. <link rel="stylesheet" href="../../css/projeck.css">
  11. <style media="screen">
  12. body,html{
  13. margin: 0;
  14. background: #fff;
  15. }
  16. .aui-searchbar{
  17. width: 86%;
  18. height: 50px;
  19. margin-left: 40px;
  20. background-color: transparent;
  21. }
  22. .aui-searchbar .aui-searchbar-btn{
  23. color: #fff;
  24. }
  25. .aui-searchbar-input{
  26. background: #fff;
  27. }
  28. .aui-searchbar-input input{
  29. color: #000;
  30. }
  31. #search-input::placeholder{
  32. color: #ccc;
  33. font-size: 14px;
  34. }
  35. .search_ico{
  36. width: 16px;
  37. height: 16px;
  38. display: block;
  39. position: absolute;
  40. background: url("../../image/search.png") no-repeat;
  41. background-size: cover;
  42. top: 8px;
  43. left: 17px;
  44. }
  45. .backBtn{
  46. margin-left: 5px;
  47. }
  48. #search-input{
  49. font-size: 14px;
  50. height: 28px;
  51. }
  52. .aui-searchbar-input{
  53. margin-right: 60px;
  54. }
  55. .search_btn{
  56. position: absolute;
  57. bottom: 9px;
  58. right: 10px;
  59. width: 54px;
  60. height: 31px;
  61. line-height: 31px;
  62. -webkit-border-radius: 50px;
  63. -moz-border-radius: 50px;
  64. border-radius: 50px;
  65. color: #000;
  66. background: #fff;
  67. font-size: 13px;
  68. }
  69. nav{
  70. background: #009fe8;
  71. position: relative;
  72. }
  73. .row{
  74. padding: 0 30px 24px 30px;
  75. }
  76. .row li{
  77. padding: 5px;
  78. color: #72e5ff;
  79. font-size: 16px;
  80. position: relative;
  81. }
  82. .row li.selectIndex{
  83. color: #fff;
  84. }
  85. .row li.selectIndex:after{
  86. content: '';
  87. position: absolute;
  88. bottom: 0;
  89. left: 0;
  90. width: 100%;
  91. height: 2px;
  92. background: #fff;
  93. }
  94. .radius_top{
  95. width: 100%;
  96. height: 10px;
  97. background: #fff;
  98. border-top-left-radius: 10px;
  99. border-top-right-radius: 10px;
  100. -webkit-border-top-left-radius: 10px;
  101. -webkit-border-top-right-radius: 10px;
  102. position: absolute;
  103. bottom: 0;
  104. left: 0;
  105. }
  106. </style>
  107. </head>
  108. <body>
  109. <div class="api_layout">
  110. <header class="header-login">
  111. <img class="backBtn" src="../../image/btn_back.png" alt="" onclick="backIndex()">
  112. <div class="aui-searchbar" id="search">
  113. <div class="aui-searchbar-input aui-border-radius">
  114. <i class="search_ico"></i>
  115. <form>
  116. <input type="search" placeholder="搜索" id="search-input">
  117. </form>
  118. </div>
  119. <span class="search_btn" onclick="seacrhWinFun(inputValue)">搜索</span>
  120. </div>
  121. </header>
  122. </div>
  123. </body>
  124. </html>
  125. <script type="text/javascript" src="../../script/api.js"></script>
  126. <!-- <script src="../../script/fastclick.min.js" charset="utf-8"></script> -->
  127. <script type="text/javascript" src="../../script/config.js"></script>
  128. <script type="text/javascript">
  129. var inputValue = ''
  130. apiready = function () {
  131. $api.fixStatusBar($api.dom('header') );
  132. // api.parseTapmode();
  133. // var info = $api.getStorage('data'),
  134. // token = JSON.parse(info).data.access_token;
  135. fnInitUIInput();
  136. funIniGroup();
  137. };
  138. var eHeaderLis,index = 0;
  139. function funIniGroup(){
  140. $event.openFrame('searchFrame','header','','','')
  141. };
  142. function backIndex() {
  143. api.closeWin();
  144. }
  145. // input
  146. function fnInitUIInput() {
  147. var searchText = $api.byId('search-input');
  148. var rect = $api.offset(searchText);
  149. var UIInput = api.require('UIInput');
  150. UIInput.open({
  151. rect: {
  152. x: rect.l,
  153. y: rect.t+1,
  154. w: rect.w,
  155. h: rect.h-1
  156. },
  157. styles: {
  158. bgColor: '#fff',
  159. size: 14,
  160. color: '#000',
  161. placeholder: {
  162. color: '#ccc'
  163. }
  164. },
  165. autoFocus: false,
  166. maxRows: 1,
  167. placeholder: '搜索',
  168. keyboardType: 'default',
  169. fixedOn: api.frameName
  170. }, function(ret, err) {
  171. if (ret) {
  172. var uiInputId = ret.id;
  173. if (ret && ret.eventType == "show") {
  174. setTimeout(function() {
  175. UIInput.popupKeyboard({id: uiInputId});
  176. }, 300)
  177. } else if (ret.eventType == "change") {
  178. UIInput.value({
  179. id: uiInputId
  180. }, function(ret, err) {
  181. if (ret) {
  182. if (ret.status) {
  183. inputValue = ret.msg;
  184. seacrhWinFun(ret.msg);
  185. }
  186. }
  187. });
  188. }
  189. }
  190. });
  191. }
  192. // 查询
  193. function seacrhWinFun(text) {
  194. var pageNum = 1;
  195. api.execScript({
  196. name: 'searchWin',
  197. frameName: 'searchFrame',
  198. script: 'searchData("'+text+'","'+pageNum+'");'
  199. });
  200. }
  201. </script>