代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
<title>LoyDgIk</title>
<style>
.search-from{
overflow: visible;
}
.input-bg{
line-height: 50px;
height: 50px;
display: flex;
overflow: visible;
font-size:14px;
margin: 14px 18px;
border-radius: 14px;
opacity: 0;
transition: opacity .3s;
will-change: opacity;
border: 2px solid transparent;
opacity: 1;
}
.search-input{
outline:none;
font-size: 17px;
flex: 1;
border:0;
padding-left: 20px;
background-color: transparent;
caret-color: #2196F3;
color: var(--dark);
width: 0;
line-height: 1;
}
.search-btn{
-webkit-user-select: none;
margin-right: 20px;
color: var(--dark);
font-size: 16px;
line-height: 49px;
padding-left: 15px;
font-weight: bold;
border-left:2px solid black;
}
</style>
<body style="overflow:hidden;">
<div class="search-from">
<div class="input-bg animation" style="border-color: var(--dark);">
<input type="text" class="search-input" id="search-input"placeholder="搜索内容 . . .">
<div class="search-btn"id="search-ok">
搜索
</div>
</div>
</div>
<script>
document.getElementById("search-ok").onclick=function(){
var k=document.getElementById("search-input").value
var work=fy_bridge_app.fetch("hiker://files/searchwork.json");
if(work==""){
work=[];
}else{
work=JSON.parse(work);
}
if(work.length<11&&k){
work.unshift(k);
work=Array.from(new Set(work))
//alert(work)
fy_bridge_app.writeFile("hiker://files/searchwork.json",JSON.stringify(work));
}
fy_bridge_app.putVar("searchKeyword",k);
fy_bridge_app.refreshPage(true);
//fy_bridge_app.putVar("searchKeyword",k);
}
if(fy_bridge_app.getVar("searchKeyword")!=""){
document.getElementById("search-input").value=fy_bridge_app.getVar("searchKeyword");
}
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。