/*var UserID = sessionStorage.getItem("MiaoMuUserID"); var userInfo = JSON.parse(sessionStorage.getItem("miaomuUserInfo"));*/ if(UserID!=null&&UserID!=""){ var forShow = userInfo.name; if(forShow==null||forShow==""){ forShow = userInfo.mobile; } } $(function () { loadInfo(); $("#searchAll").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 getCompany() { var IDArr = window.location.href.split("?id="); var info =null; if(IDArr.length==2){ IDs = window.location.href.split("?id=")[1]; }else{ var weburl = window.location.href; IDs = weburl.substring(weburl.lastIndexOf('/')+1).split(".")[0]; } if(parseInt(IDs)){ var id = parseInt(IDs); $(".com-Top-nav>div:first-child>a").attr("href","/company/vip/"+id+".html"); $(".com-Top-nav>div:nth-child(2)>a").attr("href","/company/vip/about/"+id+".html"); $(".com-Top-nav>div:nth-child(3)>a").attr("href","/company/vip/spzs/"+id+".html"); $(".com-Top-nav>div:nth-child(4)>a").attr("href","/company/vip/syjh/"+id+".html"); //$(".com-Top-nav>div:nth-child(5)>a").attr("href","companyMessage.html?id="+id); $(".com-Top-nav>div:last-child>a").attr("href","/company/vip/zzry/"+id+".html"); $("#searchThis").click(function () { var content = $("#Sou").val(); var type = $("#selectType").val(); if(content.trim().length<2){ layer.tips("请至少输入两个å—符","#Sou"); }else{ if(type=="供应"){ window.location.href="/company/vip/spzs/"+id+".html?search="+content; }else if(type=="采è´"){ window.location.href="/company/vip/syjh/"+id+".html?search="+content; }else if(type=="ä¼ä¸š"){ layer.tips("请选择供应或求è´","#selectType"); }else if(type=="资讯"){ layer.tips("请选择供应或求è´","#selectType"); }else if(type=="百科"){ layer.tips("请选择供应或求è´","#selectType"); } } }); $.ajax({ url:url+"/user2019/qyml/listchaxungongsi", data:{"id":id}, type: "post", dateType: "json", async: false, success: function success(response, status, xhr) { info = response[0]; document.title = info.qymc + info.qyjj; $("meta[name='keywords']").attr('content',info.zycp); $("meta[name='description']").attr('content',info.qyjj); }, error: function error(e) { layer.msg("系统错误,请è”系客æœï¼", { icon: 5 }); console.log("读å–ä¿¡æ¯ajax错误"); console.log(e.status); console.log(e.responseText); } }); } return info; } function loadInfo() { var info = getCompany(); if(info!=null){ getSwiper(info.id); var zz = ""; if(info.gs==1){ zz = "<img src='/images/三级详情页供应改danbao_23.png' title='已通过执照认è¯'>"; } var hy = ""; switch (info.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(info.shiming==1){ sm = "<img src='/images/三级详情页供应改身份验è¯.png' title='已通过实å认è¯'>"; } var db = ""; if(info.danbao==1){ db = "<img src='/images/三级详情页供应改danbao_30.png' title='已缴费担ä¿è®¤è¯'>" } var zycp = "æ— æ•°æ®"; if(info.zycp!=null&&info.zycp!=""){ zycp = info.zycp; } if(info.qymc){ document.title=info.qymc; $("#company").html(info.qymc); $("#zygy").html("主è¦ä¾›åº”:"+zycp); $("#qymc").html(info.qymc+" "+hy+" "+sm+" "+zz+" "+db); }else if(info.name){ $("#company").html(info.name); $("#zygy").hide(); $("#qymc").html(info.name+" "+hy+" "+sm+" "+zz+" "+db); }else{ $("#company").html(''); $("#zygy").hide(); $("#qymc").html(" "+hy+" "+sm+" "+zz+" "+db); } $("#linkman").html(info.name); $("#mobile").html(info.mobile); $("#address").html(info.address); /*var comPic = "/images/æ— å›¾ç‰‡.jpg"; if(info.picture!=null&&info.picture!=""){ comPic=info.picture; }*/ $("#JJ").html(/*"<img src='"+comPic+"'>"+*/info.qyjj.split('{{br}}').join('<br>')); var address = "未公开"; if(info.address!=null&&info.address!=""){ address = info.address; } var gslx = "未公开"; if(info.gslx!=null&&info.gslx!=""){ gslx = info.gslx; } var frdb = "未公开"; if(info.frdb!=null&&info.frdb!=""){ frdb = info.frdb; } var clsj = "未公开"; if(info.clsj!=null&&info.clsj!=""){ clsj = info.clsj; } var mcmj = "未公开"; if(info.mcmj!=null&&info.mcmj!=""){ mcmj = info.mcmj; } var ygrs = "未公开"; if(info.ygrs!=null&&info.ygrs!=""){ ygrs = info.ygrs; } var zzt = "未公开"; var yyzz = getYyzz(info.id); if(yyzz.flag==1){ zzt = "<img src='"+yyzz.pic+"' style='width: 300px'>"; } var qymc = "未公开"; if(info.qymc!=null&&info.qymc!=""){ qymc = info.qymc; } $(".tbl1").html("<tr><td>å…¬å¸å称:</td><td>"+qymc+"</td></tr>" + "<tr><td>主è¦ä¸šåŠ¡ï¼š</td><td>"+zycp+"</td></tr>" + "<tr><td>å…¬å¸åœ°å€ï¼š</td><td>"+address+"</td></tr>"); $(".tbl2").html("<tr><td>å…¬å¸ç±»åž‹ï¼š</td><td>"+gslx+"</td></tr>" + "<tr><td>法人代表:</td><td>"+frdb+"</td></tr>" + "<tr><td>æˆç«‹æ—¶é—´ï¼š</td><td>"+clsj+"</td></tr>" + "<tr><td>苗场é¢ç§¯ï¼š</td><td>"+mcmj+"</td></tr>" + "<tr><td>员工人数:</td><td>"+ygrs+"</td></tr>"); $.ajax({ url: url+'/info/supply/selectSupplySort', data: {"gsid": info.id}, type: "post", dateType: "json", async: false, success: function (res, status, xhr) { var result = ""; if (res.length > 0) { $.each(res, function (i, list) { result += "<li><a href='/company/vip/spzs/"+ info.id +".html?type="+list+"' target='_blank'>" + list + "</a></li>"; }); } else { result = "<li>æ— å†…å®¹</li>"; } $("#supplyLi").html(result); } }); }else{ window.location.href="/qyml/"; } } 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 getSwiper(id){ $.ajax({ url:url+"/gstp/gstp/selectByUser", data:{"gsid":id}, type: "get", dateType: "json", async: false, success: function (response, status, xhr) { if(response.length==1 && response[0].flag==1){ var arr = []; if(response[0].pic1){ arr.push(response[0].pic1); } if(response[0].pic2){ arr.push(response[0].pic2); } if(response[0].pic3){ arr.push(response[0].pic3); } if(response[0].pic4){ arr.push(response[0].pic4); } if(arr.length>0){ var content = ""; for (var i = 0; i < arr.length; i++) { content += "<div class='swiper-slide'><img src='"+formatImgUrl(arr[i])+"' style='width: 1200px;height: 400px'></div>"; } $(".swiper-wrapper").html(content); $(".upImg").hide(); $(".swiper-container").show(); var mySwiper = new Swiper('.swiper-container', { autoplay: true,//å¯é€‰é€‰é¡¹ï¼Œè‡ªåŠ¨æ»‘åŠ¨ loop:true, }); } } }, error: function (e) { console.log("addSeeTimes"); console.log(e.status); console.log(e.responseText); } }); }