2 Star 1 Fork 2

徐子玉/品贷网

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
search_head.html 9.14 KB
一键复制 编辑 原始数据 按行查看 历史
徐子玉 提交于 2017-07-05 11:21 . + pdw
<!--logo-->
<div id="topbannerSecond">
<!--logo-->
<div id="site_header" class="wrap_1200 hd_header clearfix">
<!--logo-->
<div class="hd_logo">
<a href="index.php"><img src="images/head/logo.png"></a>
</div>
<!--搜索-->
<div class="hd_search">
<div class="hd_search_div clearfix">
<div id="type_input" class="hd_search_input1 clearfix"><span class="hd_search_input1span" id="3">厂家</span><i class="icon_caret"></i>
</div>
<div class="searchdropdown" style="display:none;">
<div class="searchdropdown_til" id="1">厂家</div>
<div class="searchdropdown_til" id="2">产品</div>
</div>
<input class="hd_search_input" type="text" placeholder="请输入您需要的厂家"/>
<a href="javascript:;" class="hd_search_inputBtn">&nbsp;&nbsp;</a>
</div>
<div class="hd_search_hot">
<span>热门搜索:</span>
<a href="store.php?id=1067">东生管业</a>
<a href="store.php?id=1057">上海融星</a>
<a href="store.php?id=50">浙江万家友</a>
<a href="store.php?id=25">浙江雨龙</a>
<a href="store.php?id=1056">上海瑞河</a>
</div>
</div>
<!--<div class="hd_search_right">
<ul>
<li><a href="cart.php"><img src="images/head/myCart.jpg" class="search_cart"/>购物车结算</a></li>
</ul>
</div>-->
<!--品代、建材7号店小轮播-->
<div class="hd_lunbo">
<ul class="hd_lunbo_slider">
<li class="hd_lunbo_pd" >
<a href="javascript:;">
<img src="images/head/hd_lunbo_pd.png" class="hd_lunbo_img" />
<div class="hd_lunbo_text">
<span>品代网全新上线</span>
<p>互联网+实体营销</br>品牌代理一站式服务</p>
</div>
</a>
</li>
<li class="hd_lunbo_jc">
<a href="javascript:;">
<img src="images/head/hd_lunbo_jc.png" class="hd_lunbo_img" />
<div class="hd_lunbo_text">
<span>买建材找7号店</span>
<p>线上线下多渠道销售</br>同城销售,售后便利</p>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
<!--<script type="text/javascript" src="js/jquery-1.8.3.min.js" ></script>-->
<script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js" type="text/ecmascript"></script>
<script type="text/javascript" src="js/pyQuery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var curIndex = 0, //当前index
imgLen = $(".hd_lunbo_slider li").length; //图片总数
//定时器自动变换3.5秒每次
var autoChange = setInterval(function(){
if(curIndex <= imgLen-1){
curIndex ++;
}else{
curIndex = 0;
}
// 调用变换处理函数
changeTo(curIndex);
},3500);
function changeTo(num){
var goLeft = (num-1) * 215;
$(".hd_lunbo_slider").animate({left: "-" + goLeft + "px"},1000);
}
});
</script>
<script type="text/javascript">
(function ($) {
$.getUrlParam = function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null)
return unescape(r[2]);
return null;
};
})(jQuery);
var city = $.getUrlParam('city');
city = decodeURI(city);
if (city == "null" || city == "") {
city = remote_ip_info["city"] + "";
$('.now_province').html(city);
}
else {
$('.now_province').html(city);
}
$.post("api.php?act=setCity", {
city: city
}, function (data) {
//不执行
});
$('.hd_search_hot a').each(function () {
$(this).attr("href", $(this).attr("href") + encodeURI(encodeURI("&city=" + city)));
});
$('.hd_city_mask_til li').each(function () {
var htmlLetter = "";
var count = $(this).index();
if (count != 0) {
htmlLetter += '<div class="hd_city_mask_boxcon" id="citymask' + ++count + '" style="display: none;">';
var letters = $(this).html();
for (var i = 0; i < letters.length; i++) {
var letter = letters.substr(i, 1);
htmlLetter += '<div class="hd_city_mask_boxLine clearfix">';
htmlLetter += '<div class="city_boxLine_alphabet">' + letter + '</div>';
htmlLetter += '<ul class="city_boxLine_city" letter="' + letter + '">';
htmlLetter += '</ul>';
htmlLetter += '</div>';
}
htmlLetter += '</div>';
}
$('.hd_city_mask_box').append(htmlLetter);
});
$.post("api.php?act=city", {
pid: 0
}, function (data, status) {
if (status == 'success') {
data = $.parseJSON(data);
var fstLetter = '';
$.each(data, function (n, value) {
fstLetter = makePy(value.name.substr(0, 1));
$("[letter='" + fstLetter + "']").append('<li><a href="javascript:;" class="cityname">' + value.name + '</a></li>');
});
//城市选择
//城市选择出现
$('.hd_province').toggle(function () {
$('.hd_city_mask').toggle();
}, function () {
$('.hd_city_mask').toggle();
});
$('.hd_city_mask_til li').click(function () {
$('.hd_city_mask_til li').removeClass('current');
$(this).addClass('current');
});
var $cityli = $('.hd_city_mask_til li');
var $citycon = $('.hd_city_mask_boxcon');
$citycon.eq(0).show();
$cityli.click(function () {
var $this = $(this);
var $n = $this.index();
$cityli.removeClass('current');
$this.addClass('current');
$citycon.css('display', 'none');
$citycon.eq($n).css('display', 'block');
});
//源城市
var now_province = $('.now_province');
$('.cityname').click(function () {
var newCity = $(this).html();
now_province.html(newCity);
$('.hd_city_mask').hide();
var url = window.location.href;
var url2 = url;
url = url.substr(0, url.lastIndexOf ('&'));
if( url == '' ){
url= url2;
url += "?t=1&city=" + newCity;
}else{
url += "&city=" + newCity;
}
url = encodeURI(encodeURI(url));
if (url.indexOf('search.php') > 0 || url.indexOf('seekMaster.php') > 0 || url.indexOf('masterSeekJob.php') > 0) {
window.location.href = url;
}
else{
window.location.href = url;
}
});
}
$(function () {
$(".hd_search_input").keyup(function (e) {
if (e.keyCode == 13) {
$(".hd_search_inputBtn").click();//模拟button的click事件
}
});
//搜索厂家
$('.hd_search_inputBtn').live('click', function () {
var search_txt = $('.hd_search_input').val();
var type = $('#type_input').find('span').html();
if (search_txt == '')
{
alert('请输入搜索关键字');
}
else if(type == '厂家')
{
var search_txt = $('.hd_search_input').val();
var city = $('.now_province').html();
city = escape(city);
var url = "search.php?keys=" + search_txt + "&city=" + city;
window.open(url);
}
else if( type == '产品'){
var search_txt = $('.hd_search_input').val();
search_txt = escape(search_txt);
var city = $('.now_province').html();
city = escape(city);
var url = "productList.php?keys=" + search_txt + "&city=" + city;
window.open(url);
}
});
});
});
$(function(){
//厂家或者产品选择
var hd_search_input1 = $('.hd_search_input1');
var searchdropdown = $('.searchdropdown');
hd_search_input1.click(function(){
$('.searchdropdown').show();
});
$('.searchdropdown').mouseleave(function(){
$('.searchdropdown').hide();
});
$('.searchdropdown_til').click(function(){
var til1 = $(this).html();
$('.hd_search_input1 span').html(til1);
$('.searchdropdown').hide();
if($(this).html()=="产品"){
$('.hd_search_input').attr('placeholder','请输入您需要的产品');
}
else if($(this).html()=="厂家"){
$('.hd_search_input').attr('placeholder','请输入您需要的厂家');
}
});
});
</script>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xuqipeter/pdw.git
[email protected]:xuqipeter/pdw.git
xuqipeter
pdw
品贷网
master

搜索帮助