var sf = ""; var ttArr = window.location.href.split("?search="); var title = decodeURI(window.location.href.split("?search=")[1]); if(title==null||title.trim().length<2||ttArr.length!=2){ title = ""; } $(function () { $("#Sou").val(title); loadCompany(1); loadAll(); VIP(); SP(); region_init("capital","city","area"); $("#capital").on("change",function () { $("#more1").html($("#capital option:selected").text()+"â–¼"); $("#more1").css("color","#7AAC4B"); $(".address").css("color", "#333333"); sf = $("#capital option:selected").text(); loadCompany(1); loadAll(); }); $("#mm-type").mouseleave(function () { $("#mm-type-list").hide(); }); $("#mm-type-list").mouseleave(function () { $("#mm-type-list").hide(); $("#mm-type-more").hide(); }); $("#mm-type-more").mouseleave(function () { $("#mm-type-list").hide(); $("#mm-type-more").hide(); }); $(".address").click(function () { if ($(this).css("color") != "rgb(122, 172, 75)") { $("#more1").html("更多▼"); $("#more1").css("color","#333333"); $(this).css("color", "#7AAC4B"); $(this).parent().siblings().children().css("color", "#333333"); if($(this).html() == "ä¸é™"){ sf = ""; }else{ sf = $(this).html(); document.title=$(this).html()+"苗圃|苗木基地|è‹—æœ¨ç§æ¤åœ°|苗木ç»é”€å•†-ä¸å›½è‹—木网miaomu.com"; $("meta[name='keywords']").attr('content',$(this).html()+'è‹—åœƒï¼Œè‹—æœ¨åŸºåœ°ï¼Œè‹—æœ¨ç§æ¤åœ°ï¼Œè‹—木ç»é”€å•†'); $("meta[name='description']").attr('content','ä¸å›½è‹—木网miaomu.com为您æä¾›'+$(this).html()+'最新苗木ä¼ä¸šå¤§å…¨ï¼Œè‹—åœƒï¼Œè‹—æœ¨ç§æ¤åŸºåœ°ï¼Œè‹—木ç»é”€å•†ç‰è‹—木ä¼ä¸šå录。'); } loadCompany(1); loadAll(); } }); $(".logo button").click(function () { var content = $("#Sou").val(); var type = $("#selectType").val(); if(content.trim().length<2){ layer.tips("请至少输入两个å—符","#Sou"); }else{ if(type=="供应"){ window.location.href="../spzs/?search="+content; }else if(type=="采è´"){ window.location.href="../syjh/qiugou.htm?search="+content; }else if(type=="ä¼ä¸š"){ window.location.href="../qyml/?search="+content; }else if(type=="资讯"){ window.location.href="../hyxx/informationSearch.html?search="+content; }else if(type=="百科"){ window.location.href="../qyfw/encyclopediaSearch.html?search="+content; } } }); }); function loadCompany(page) { var limit = (page-1)*10; console.log("limit:"+limit); $.ajax({ url:url+"/user2019/qyml/qymlchaxunfenye", data: {"sf":sf,"page":limit,"qymc":title}, type: "post", dateType: "json", async: false, success: function success(response, status, xhr) { var result = ""; $.each(response,function (i, list) { var zz = ""; if(list.gs==1){ zz = "<img src='../images/三级详情页供应改danbao_23.png' title='已通过执照认è¯'>"; } var db = ""; if(list.danbao==1){ db = "<img src='../images/三级详情页供应改danbao_30.png' title='已缴费担ä¿è®¤è¯'>" } var hy = ""; switch (list.hyjb) { case 5: hy="<img src='../images/çš‡å† çº§åˆ«.png' title='çš‡å† VIP'>"; break; case 4: hy="<img src='../images/黄钻级别.png' title='黄钻VIP'>"; break; case 3: hy="<img src='../images/红钻级别.png' title='红钻VIP'>"; break; case 2: hy="<img src='../images/绿钻级别.png' title='绿钻VIP'>"; break; case 1: break; default: break; } var sm = ""; if(list.shiming==1){ sm = "<img src='../images/三级详情页供应改身份验è¯.png' title='已通过实å认è¯'>"; } var picArr = setPic(list.id); var pic1 = ""; var pic2 = ""; if(picArr[3]==1){ pic1 = "<img src='"+picArr[0]+"'>"; }else if(picArr[3]==2){ pic1 = "<img src='"+picArr[0]+"'>"; pic2 = "<img src='"+picArr[1]+"'>"; } result += "<div class='list'><div><ul><li><p><img src='../images/店铺.png'> <a href='../company/vip/"+list.id+".html' target='_blank'>"+list.qymc+"</a> "+hy+" "+zz+" "+db+" "+sm+"</p></li><li>主è¦ä¸šåŠ¡ï¼š"+list.zycp+"</li><li>è”系人:"+list.name+" 电è¯ï¼š"+list.mobile+"</li><li>å…¬å¸åœ°å€ï¼š"+list.address+"</li><li><a href='/company/vip/"+list.id+".html' target='_blank'>进入店铺></a></li></ul></div><div><div>"+pic1+"</div><div>"+pic2+"</div></div></div>"; }); $(".left-info").html(result); }, error: function error(e) { layer.msg("系统错误,请è”系客æœï¼", {icon: 5}); console.log("loadCompany方法ajax错误"); console.log(e.status); console.log(e.responseText); } }); } function loadAll() { var total = 0; $.ajax({ url:url+"/user2019/qyml/qymlchaxunfenyecount", data: {"sf":sf,"qymc":title}, type: "get", dateType: "json", async: false, success: function (response, status, xhr) { total = response; }, error: function (e) { layer.msg("系统错误,请è”系客æœï¼", { icon: 5 }); console.log("查询总数ajax错误"); console.log(e.status); console.log(e.responseText); } }); $("#myPage").sPage({ page: 1, //当å‰é¡µç ,必填 total: total, //æ•°æ®æ€»æ¡æ•°ï¼Œå¿…å¡« pageSize: 10, //æ¯é¡µæ˜¾ç¤ºå¤šå°‘æ¡æ•°æ®ï¼Œé»˜è®¤10æ¡ showTotal: false, //æ˜¯å¦æ˜¾ç¤ºæ€»æ¡æ•°ï¼Œé»˜è®¤å…³é—:false totalTxt: "å…±{total}æ¡", //æ•°æ®æ€»æ¡æ•°æ–‡å—æè¿°ï¼Œ{total}为å ä½ç¬¦ï¼Œé»˜è®¤"å…±{total}æ¡" noData: true, //æ²¡æœ‰æ•°æ®æ—¶æ˜¯å¦æ˜¾ç¤ºåˆ†é¡µï¼Œé»˜è®¤false䏿˜¾ç¤ºï¼Œtrue显示第一页 showSkip: true, //æ˜¯å¦æ˜¾ç¤ºè·³é¡µï¼Œé»˜è®¤å…³é—:false showPN: true, //æ˜¯å¦æ˜¾ç¤ºä¸Šä¸‹ç¿»é¡µï¼Œé»˜è®¤å¼€å¯ï¼štrue prevPage: "上一页", //ä¸Šç¿»é¡µæ–‡å—æè¿°ï¼Œé»˜è®¤â€œä¸Šä¸€é¡µâ€ nextPage: "下一页", //ä¸‹ç¿»é¡µæ–‡å—æè¿°ï¼Œé»˜è®¤â€œä¸‹ä¸€é¡µâ€ backFun: function backFun(page) { //点击分页按钮回调函数,返回当å‰é¡µç //$("#pNum").text(page); scrollTo(0, 0); loadCompany(page); } }); } function VIP() { $.get(url+"/user2019/qyml/tjsp", function (List) { var result = ""; $.each(List, function (i, list) { if (i == 9) { return false; } result += "<li><a href='../company/vip/"+list.id+".html' target='_blank'>" + list.qymc + "</a></li>"; }); $("#VIP").html("<ul>"+result+"</ul>"); }); } function SP() { $.get(url+"/user2019/qyml/zxsp", function (List) { var result = ""; $.each(List, function (i, list) { if (i == 9) { return false; } result += "<li><a href='../company/vip/"+list.id+".html' target='_blank'>" + list.qymc + "</a></li>"; }); $("#latest").html("<ul>"+result+"</ul>"); }); } function ZZ(id) { var result = false; $.ajax({ url:url+"/user/qyzz/selectqyzz", data:{"userid":id}, type: "post", dateType: "json", async: false, success:function (response, status, xhr) { if(response.length!=0){ if(response[0].flag==1){ result = true; } } }, error:function (e) { layer.msg("系统错误,请è”系客æœï¼", { icon: 5 }); console.log("ZZ"); console.log(e.status); console.log(e.responseText); } }); return result; } function setPic(id) { var result = ["","","0"]; $.ajax({ url:url+"/info/supply/selectForPic", data:{"gsid":id}, type: "post", dateType: "json", async: false, success: function (response, status, xhr) { if(response.length==1){ var pic = response[0].picture; if(pic!=null){ pic = formatImgUrl(pic); } result[0] = pic; result[3] = "1"; }else if(response.length>1){ var pic1 = response[0].picture; if(pic1!=null){ pic1 = formatImgUrl(pic1); } var pic2 = response[1].picture; if(pic2!=null){ pic2 = formatImgUrl(pic2); } result[0] = pic1; result[1] = pic2; result[3] = "2"; } }, error: function (e) { layer.msg("系统错误,请è”系客æœï¼", { icon: 5 }); console.log("setPic方法ajax错误"); console.log(e.status); console.log(e.responseText); } }); return result; }