• 周二. 10 月 8th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

mui 关键词查询

admin

11 月 28, 2021

<div class=”pop-schwrap”>
<div class=”ui-scrollview”>
<div class=”mui-bar mui-bar-nav clone”>
<a class=”btn btn-back” href=”javascript:;”></a>
<div class=”top-sch-box flex-col”>
<div class=”centerflex”>
<input class=”sch-input mui-input-clear” type=”text” name=”” id=”search-keyword” placeholder=”万千优惠券等待您去发现” />
</div>
</div>
<a class=”mui-btn sch-submit” href=”javascript:void(0)” onclick=”searchGood()”>搜索</a>
</div>
<div class=”scroll-wrap”>
<div class=”mui-scroll”>
<div class=”sch-cont”>
<div class=”section ui-border-b”>
<div class=”tit”><i class=”iconfont icon-hot”></i>热门搜索</div>
<div class=”tags”>
<span class=”tag” name=”tag-keyword”>外套</span><span class=”tag” name=”tag-keyword”>连衣裙</span><span class=”tag”>运动鞋</span><span class=”tag” name=”tag-keyword”>睡衣</span>
<span class=”tag” name=”tag-keyword”>面膜</span><span class=”tag” name=”tag-keyword”>保健</span><span class=”tag”>皮鞋</span><span class=”tag” name=”tag-keyword”>西装</span>
<span class=”tag” name=”tag-keyword”>棉服</span><span class=”tag” name=”tag-keyword”>手套</span><span class=”tag” name=”tag-keyword”>口红</span>
</div>
</div>
<div class=”section”>
<div class=”tit”><i class=”iconfont icon-time”></i>最近搜索</div>
<div class=”tags”>
<span class=”tag”>外套</span><span class=”tag”>连衣裙</span><span class=”tag”>运动鞋</span><span class=”tag”>睡衣</span>
<span class=”tag”>外套</span><span class=”tag”>连衣裙</span><span class=”tag”>运动鞋</span><span class=”tag”>睡衣</span>
<span class=”tag”>外套</span><span class=”tag”>连衣裙</span><span class=”tag”>运动鞋</span>
</div>
</div>
</div>
<div class=”sch-clear”>
<a href=”javascript:void”><i class=”iconfont icon-shanchu”></i>清除搜索历史</a>
</div>
</div>
</div>
</div>
</div>

var btns = document.getElementsByTagName(“span”);
for(var i = 0; i < btns.length; i++) {
btns[i].onclick = function(){
var classname = btns[i].getAttribute(‘class’);
if(classname == ‘tag’){
$(‘#search-keyword’).val(this.innerHTML);
}
}
}
function searchGood(){
if($(‘#search-keyword’).val() == ”){
mui.toast(‘查询关键词为空’);
}else{
mui.ajax(__test_api_url+’/Tbk/optionalMaterial’, {
data:{
‘token’:__tbk_token,
‘page’:1,
‘adzoneId’:__adzone_id,
‘keyword’:$(‘#search-keyword’).val(),
},
dataType: ‘json’,
type: ‘post’,
async: false,
headers: {‘Content-Type’: ‘application/json’},
success: function (jsondata) {
console.log(jsondata);
},
});
}
}

发表回复