persnoalLocation.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta
  6. name="viewport"
  7. content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
  8. />
  9. <meta
  10. name="format-detection"
  11. content="telephone=no,email=no,date=no,address=no"
  12. />
  13. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  14. <link rel="stylesheet" href="../../css/api.css" />
  15. <!--<link rel="stylesheet" href="../../css/aui.css">-->
  16. <link rel="stylesheet" href="../../css/projeck.css" />
  17. <title></title>
  18. <style>
  19. .aui-searchbar {
  20. width: 86%;
  21. height: 50px;
  22. margin-left: 40px;
  23. background-color: transparent;
  24. }
  25. .aui-searchbar .aui-searchbar-btn {
  26. color: #fff;
  27. }
  28. #search-input::placeholder {
  29. color: #fff;
  30. }
  31. .search_ico {
  32. width: 16px;
  33. height: 16px;
  34. display: block;
  35. position: absolute;
  36. background: url('../../image/seacrh001.png') no-repeat;
  37. background-size: cover;
  38. top: 7px;
  39. left: 17px;
  40. }
  41. .backBtn {
  42. margin-left: 5px;
  43. }
  44. .aui-searchbar-btn {
  45. font-size: 14px !important;
  46. }
  47. #search-input {
  48. font-size: 14px;
  49. }
  50. </style>
  51. </head>
  52. <body>
  53. <div class="api_layout">
  54. <header class="header-login">
  55. <img
  56. class="backBtn"
  57. src="../../image/btn_back.png"
  58. alt=""
  59. onclick="backIndex()"
  60. />
  61. <div class="aui-searchbar" id="search">
  62. <div class="aui-searchbar-input aui-border-radius">
  63. <i class="search_ico"></i>
  64. <form>
  65. <input type="text" id="search-input" disabled />
  66. </form>
  67. </div>
  68. </div>
  69. </header>
  70. </div>
  71. <script src="../../script/api.js"></script>
  72. <!-- <script src="../../script/fastclick.min.js"></script> -->
  73. <script src="../../script/config.js"></script>
  74. <script>
  75. var UIInputId;
  76. apiready = function () {
  77. $api.fixStatusBar($api.dom('header'));
  78. openFrameFun();
  79. fnInitUIInput();
  80. openSeachList();
  81. };
  82. function openFrameFun() {
  83. api.openFrame({
  84. name: 'personnelList',
  85. url: 'personnelList.html',
  86. rect: {
  87. x: 0,
  88. y: $api.dom('header').offsetHeight,
  89. w: 'auto',
  90. h: 'auto',
  91. },
  92. bounces: false,
  93. bgColor: 'rgba(0,0,0,0)',
  94. vScrollBarEnabled: true,
  95. hScrollBarEnabled: false,
  96. scrollEnabled: false,
  97. progress: {
  98. type: 'page',
  99. },
  100. });
  101. }
  102. function backIndex() {
  103. api.closeWin();
  104. }
  105. // input
  106. function fnInitUIInput() {
  107. var searchText = $api.byId('search-input');
  108. var rect = $api.offset(searchText);
  109. var UIInput = api.require('UIInput');
  110. UIInput.open(
  111. {
  112. rect: {
  113. x: rect.l,
  114. y: rect.t + 1,
  115. w: rect.w,
  116. h: rect.h - 1,
  117. },
  118. styles: {
  119. bgColor: 'rgba(255, 255, 255, 0)',
  120. size: 14,
  121. color: '#fff',
  122. placeholder: {
  123. color: '#fff',
  124. },
  125. },
  126. autoFocus: false,
  127. maxRows: 1,
  128. placeholder: '搜索井下人员',
  129. keyboardType: 'search',
  130. fixedOn: api.frameName,
  131. },
  132. function (ret, err) {
  133. if (ret) {
  134. var uiInputId = ret.id;
  135. if (ret.eventType == 'search') {
  136. UIInput.value(
  137. {
  138. id: uiInputId,
  139. },
  140. function (ret, err) {
  141. if (ret) {
  142. if (ret.status) {
  143. if (ret.msg == '') {
  144. var UIListSearch = api.require('UIListSearch');
  145. UIListSearch.hide();
  146. } else {
  147. selectPersonal(ret.msg);
  148. // functionName()
  149. }
  150. }
  151. }
  152. }
  153. );
  154. }
  155. }
  156. }
  157. );
  158. }
  159. // 查询
  160. function openSeachList() {
  161. var UIListSearch = api.require('UIListSearch');
  162. UIListSearch.open(
  163. {
  164. rect: {
  165. x: 0,
  166. y: $api.dom('header').offsetHeight,
  167. w: api.winWidth,
  168. h: api.winHeigh,
  169. },
  170. contacts: [],
  171. fixedOn: api.frameName,
  172. },
  173. function (ret, err) {
  174. if (ret) {
  175. UIListSearch.hide();
  176. var UIInput = api.require('UIInput');
  177. UIInput.closeKeyboard({
  178. id: UIInputId,
  179. });
  180. openDetails(ret.contact.people_id);
  181. }
  182. }
  183. );
  184. UIListSearch.hide();
  185. }
  186. // 查询
  187. function selectPersonal(names) {
  188. $http.fnReuestDataNologing(
  189. zaoquanUrlRouter.searchPeople,
  190. '',
  191. 'post',
  192. {name: names},
  193. function (ret, err) {
  194. if (ret.code === 0) {
  195. functionName(JSON.stringify(ret.data));
  196. }
  197. }
  198. );
  199. }
  200. // 数据更新
  201. function functionName(arr) {
  202. var UIListSearch = api.require('UIListSearch');
  203. UIListSearch.show();
  204. UIListSearch.reloadData({
  205. contacts: JSON.parse(arr),
  206. });
  207. }
  208. // 点击人员列表看详情
  209. function openDetails(ids) {
  210. $event.openPopup('auto', 'auto', 'personalInfo', {id: ids});
  211. }
  212. </script>
  213. </body>
  214. </html>