123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta
- name="viewport"
- content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
- />
- <meta
- name="format-detection"
- content="telephone=no,email=no,date=no,address=no"
- />
- <meta http-equiv="X-UA-Compatible" content="ie=edge" />
- <link rel="stylesheet" href="../../css/api.css" />
- <!--<link rel="stylesheet" href="../../css/aui.css">-->
- <link rel="stylesheet" href="../../css/projeck.css" />
- <title></title>
- <style>
- .aui-searchbar {
- width: 86%;
- height: 50px;
- margin-left: 40px;
- background-color: transparent;
- }
- .aui-searchbar .aui-searchbar-btn {
- color: #fff;
- }
- #search-input::placeholder {
- color: #fff;
- }
- .search_ico {
- width: 16px;
- height: 16px;
- display: block;
- position: absolute;
- background: url('../../image/seacrh001.png') no-repeat;
- background-size: cover;
- top: 7px;
- left: 17px;
- }
- .backBtn {
- margin-left: 5px;
- }
- .aui-searchbar-btn {
- font-size: 14px !important;
- }
- #search-input {
- font-size: 14px;
- }
- </style>
- </head>
- <body>
- <div class="api_layout">
- <header class="header-login">
- <img
- class="backBtn"
- src="../../image/btn_back.png"
- alt=""
- onclick="backIndex()"
- />
- <div class="aui-searchbar" id="search">
- <div class="aui-searchbar-input aui-border-radius">
- <i class="search_ico"></i>
- <form>
- <input type="text" id="search-input" disabled />
- </form>
- </div>
- </div>
- </header>
- </div>
- <script src="../../script/api.js"></script>
- <!-- <script src="../../script/fastclick.min.js"></script> -->
- <script src="../../script/config.js"></script>
- <script>
- var UIInputId;
- apiready = function () {
- $api.fixStatusBar($api.dom('header'));
- openFrameFun();
- fnInitUIInput();
- openSeachList();
- };
- function openFrameFun() {
- api.openFrame({
- name: 'personnelList',
- url: 'personnelList.html',
- rect: {
- x: 0,
- y: $api.dom('header').offsetHeight,
- w: 'auto',
- h: 'auto',
- },
- bounces: false,
- bgColor: 'rgba(0,0,0,0)',
- vScrollBarEnabled: true,
- hScrollBarEnabled: false,
- scrollEnabled: false,
- progress: {
- type: 'page',
- },
- });
- }
- function backIndex() {
- api.closeWin();
- }
- // input
- function fnInitUIInput() {
- var searchText = $api.byId('search-input');
- var rect = $api.offset(searchText);
- var UIInput = api.require('UIInput');
- UIInput.open(
- {
- rect: {
- x: rect.l,
- y: rect.t + 1,
- w: rect.w,
- h: rect.h - 1,
- },
- styles: {
- bgColor: 'rgba(255, 255, 255, 0)',
- size: 14,
- color: '#fff',
- placeholder: {
- color: '#fff',
- },
- },
- autoFocus: false,
- maxRows: 1,
- placeholder: '搜索井下人员',
- keyboardType: 'search',
- fixedOn: api.frameName,
- },
- function (ret, err) {
- if (ret) {
- var uiInputId = ret.id;
- if (ret.eventType == 'search') {
- UIInput.value(
- {
- id: uiInputId,
- },
- function (ret, err) {
- if (ret) {
- if (ret.status) {
- if (ret.msg == '') {
- var UIListSearch = api.require('UIListSearch');
- UIListSearch.hide();
- } else {
- selectPersonal(ret.msg);
- // functionName()
- }
- }
- }
- }
- );
- }
- }
- }
- );
- }
- // 查询
- function openSeachList() {
- var UIListSearch = api.require('UIListSearch');
- UIListSearch.open(
- {
- rect: {
- x: 0,
- y: $api.dom('header').offsetHeight,
- w: api.winWidth,
- h: api.winHeigh,
- },
- contacts: [],
- fixedOn: api.frameName,
- },
- function (ret, err) {
- if (ret) {
- UIListSearch.hide();
- var UIInput = api.require('UIInput');
- UIInput.closeKeyboard({
- id: UIInputId,
- });
- openDetails(ret.contact.people_id);
- }
- }
- );
- UIListSearch.hide();
- }
- // 查询
- function selectPersonal(names) {
- $http.fnReuestDataNologing(
- zaoquanUrlRouter.searchPeople,
- '',
- 'post',
- {name: names},
- function (ret, err) {
- if (ret.code === 0) {
- functionName(JSON.stringify(ret.data));
- }
- }
- );
- }
- // 数据更新
- function functionName(arr) {
- var UIListSearch = api.require('UIListSearch');
- UIListSearch.show();
- UIListSearch.reloadData({
- contacts: JSON.parse(arr),
- });
- }
- // 点击人员列表看详情
- function openDetails(ids) {
- $event.openPopup('auto', 'auto', 'personalInfo', {id: ids});
- }
- </script>
- </body>
- </html>
|