Aucune description

search-home.html 4.4KB

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> <title></title> <link href="../css/mui.min.css" rel="stylesheet"/> <link href="../css/app.css" rel="stylesheet"/> <link href="../css/iconfont.css" rel="stylesheet" /> </head> <body> <!-- 主页面标题 --> <header class="mui-bar mui-bar-nav toptitbox"> <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left topback"></a> <div class="searchbox2 mui-pull-right"> <div class="mui-pull-left searchselect"> <div class="simuselect"> <div class="ulbox lookwho" id="div_select">专家</div> <ul id="li_show" class="lishow"> <li data-num="1">专家</li> <li data-num="0">资源</li> </ul> </div> <em class="mui-icon mui-icon-arrowdown"></em> </div> <input type="text" class="mui-input-clear mui-pull-right searchtxt2" placeholder="输入专家姓名、研究方向等关键字" id="searchval"> </div> </header> <!-- 主页面内容容器 --> <div class="mui-content" id="dd"> <!-- 主界面具体展示内容 --> <div class="historybox" style=" position: absolute; top:45px;left:0; z-index:2; " id="historybox"> <!--<ul class="hisrecord"> <li> <span class="histicon mui-pull-left"></span> <span class="mui-pull-left">搜索历史词</span> <span class="mui-icon mui-icon-closeempty delrecord"></span> </li> <li> <span class="histicon mui-pull-left"></span> <span class="mui-pull-left">搜索历史词</span> <span class="mui-icon mui-icon-closeempty delrecord"></span> </li> <li> <span class="histicon mui-pull-left"></span> <span class="mui-pull-left">搜索历史词</span> <span class="mui-icon mui-icon-closeempty delrecord"></span> </li> <li class="trashrecord"><em class="mui-icon mui-icon-trash"></em>清除历史记录</li> </ul>--> <div class="hotsearchbox"> <div>热门搜索</div> <ul class="hotsearch"> <li>材料检测</li> <li>防腐蚀</li> <li>材料表面与界面</li> <li>微晶金属材料</li> <li>黑色金属</li> <li>金属基复合材料</li> </ul> </div> </div> </div> <script src="../js/public/mui.min.js"></script> <script src="../js/public/base.js"></script> <script type="text/javascript"> var showblock = document.getElementById("li_show"); var selectblock = document.getElementById("div_select"); var searchVal = document.getElementById("searchval"); var key,bigClass=1; //searchVal.focus(); /*搜专家搜资源的下拉选择框*/ selectblock.addEventListener('tap', function() { showblock.style.display = 'block'; }); mui("#li_show").on('tap', 'li', function() { bigClass = this.getAttribute("data-num"); //console.log(bigClass) selectblock.innerHTML = this.innerHTML; showblock.style.display = 'none'; if(bigClass==1){ searchVal.setAttribute("placeholder","输入专家姓名、研究方向等关键字"); }else{ searchVal.setAttribute("placeholder","输入资源名称、应用用途等关键字"); } }); /*点击热门搜索*/ mui(".hotsearch").on('tap', 'li', function() { key = this.innerHTML; //plus.nativeUI.showWaiting();//显示原生等待框 // plus.webview.create("../html/search.html",'search.html',{},{key:key,bigClass:bigClass}); mui.openWindow({ url: '../html/search.html', id: '../html/search.html', show:{ //autoShow:false, aniShow:"slide-in-right", }, extras:{ key:key, bigClass:bigClass } }); }); /*按键字搜索*/ searchval.addEventListener("keyup", function() { var e = event || window.event || arguments.caller.arguments[0]; if(e.keyCode == 13) { key = searchVal.value; plus.nativeUI.showWaiting(); mui.openWindow({ url: '../html/search.html', id: '../html/search.html', show:{ autoShow:false, aniShow:"fade-in", }, extras:{ key:key, bigClass:bigClass } }); } }) </script> </body> </html>