$(function () { showInfo(); $(".detailInfo").css("left", $("#XS").outerWidth() + 110 + "px"); $("#XS").mouseenter(function () { $(".detailInfo").show(); }); $(".detailInfo").mouseenter(function () { $(".detailInfo").show(); }); $("#XS").mouseleave(function () { $(".detailInfo").hide(); }); $(".detailInfo").mouseleave(function () { $(".detailInfo").hide(); }); $("#DL").click(function () { sessionStorage.setItem("miaomuLoginTo", window.location.href); window.location.href = "/reg201206/login06.html" }); $("#tj").click(function () { var info3 = loadInfo(); var gsid3 = info3.gsid; if (UserID == null || UserID == "") { layer.confirm('对ä¸èµ·ï¼Œæ‚¨å°šæœªç™»å½•ï¼', { btn: ['登录', '注册'] //按钮 }, function () { window.location.href = "/reg201206/login06.html"; }, function () { window.location.href = "/reg201206/register06.html"; }); } else if (gsid3 == null || gsid3 == "") { layer.msg("该产å“䏿”¯æŒçº¿ä¸ŠæŠ¥ä»·,请电è¯è”ç³»", {icon: 2}); } else { //if(userInfo.hyjb<2){ var times = checkTimes(); if (times) { releasePrice(times); } else { layer.confirm('对ä¸èµ·ï¼Œæ‚¨å·²åˆ°è¾¾å‘布上é™ï¼', { btn: ['å‡çº§ä¼šå‘˜', 'æ®‹å¿æ‹’ç»'] //按钮 }, function () { window.location.href = "/about/hyfw.html"; }, function () { //close }); } /*}else{ releasePrice(); }*/ } }); $("#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 loadInfo() { var IDArr = window.location.href.split("?info_id="); var info = null; var IDs = 0; if (IDArr.length == 2) { IDs = window.location.href.split("?info_id=")[1]; } else { var weburl = window.location.href; IDs = weburl.substring(weburl.lastIndexOf('/') + 1).split(".")[0]; } if (parseInt(IDs)) { var info_id = parseInt(IDs); $.ajax({ url: url + "/mysj/info/selectInfoById", data: {"id": info_id}, type: "post", dateType: "json", async: false, success: function (response, status, xhr) { info = response[0]; }, error: function (e) { layer.msg("系统错误,请è”系客æœï¼", {icon: 5}); console.log("读å–ä¿¡æ¯ajax错误"); console.log(e.status); console.log(e.responseText); } }); $("#ZF").click(function () { if (getStatus()) { layer.confirm("请选择支付方å¼", { btn: ['微信', '支付å®'], //按钮 btnAlign: 'c' }, function () { layer.closeAll(); toPay(telPrice, 'WX', '查看求è´ç”µè¯', info_id, 0); }, function () { layer.closeAll(); toPay(telPrice, 'ALI', '查看求è´ç”µè¯', info_id, 0); }); } else { window.location.href = '/reg201206/register06.html'; } }); } addSeeTimes(info_id); return info; } function showInfo() { var day = 0; var info = loadInfo(); if (info != null) { if (info.picture) { $("#gongdan").attr('src', info.picture); $("#gd").attr('href', info.picture); $("#d33").show(); } var show_gg = info.content; if (show_gg.indexOf('cm') !== -1) { var temp_arr = show_gg.split('cm'); show_gg = temp_arr[0] + '公分'; } else { show_gg = ''; } document.title = info.country + info.city + '求è´' + show_gg + info.showname + "|" + info.showname + '求è´ä¿¡æ¯-ä¸å›½è‹—木网miaomu.com'; $("meta[name='keywords']").attr('content', info.country + info.city + show_gg + info.showname + ',' + info.showname + '求è´ä¿¡æ¯,' + show_gg + info.showname + '采è´ä¿¡æ¯'); $("meta[name='description']").attr('content', 'ä¸å›½è‹—木网miaomu.comå‘布最新求è´ä¿¡æ¯ï¼š' + info.country + info.city + '求è´' + info.hits + info.danwei + show_gg + info.showname + "," + info.showname + '求è´ä¿¡æ¯ä¾›æ‚¨å‚考。'); $("#collect").click(function () { insertCollection(info.showname); }); $("#share").click(function () { var share = document.getElementById("share"); var clip = new ClipboardJS(share, { text: function () { return "我在苗木网看到求è´ï¼š" + info.showname + ",点击链接或å¤åˆ¶é“¾æŽ¥åˆ°æµè§ˆå™¨æŸ¥çœ‹â†’" + window.location.href; } }); clip.on('success', function (e) { console.log(e); clip.destroy();// å¤åˆ¶å®Œæ¯•åˆ é™¤ï¼Œå¦åˆ™ä¼šæœ‰åˆ›å»ºå¤šä¸ªclipboard对象 layer.msg("链接已å¤åˆ¶ï¼ŒåŽ»ç²˜è´´åˆ†äº«å§ï¼", {icon: 1}); }); clip.on('error', function (e) { console.log(e); layer.msg("æµè§ˆå™¨ç‰ˆæœ¬è¿‡ä½Žï¼Œè¯·æ‰‹åЍå¤åˆ¶é“¾æŽ¥", {icon: 2}); }); share.click(); clip.destroy(); }); getBuy(info.gsid); var gsid = info.gsid; var showName = info.showname; var hits = info.hits; var address = info.address; var gg = info.chanpinguige; var content = info.content; var price = info.price; var yx = info.period; var fb = info.dateandtime; var linkman = info.linkman; var phone = info.phone; if (price == null || price <= 0 || price == "") { price = "é¢è®®"; } else { price += "å…ƒ"; } if (!gg) { gg = "æ— æè¿°"; } $("#D1-title").html(showName); $("#XS").html(showName); $("#hits").html(hits); $("#address").html(address); $("#gg").html(content); $("#content").html(gg); $("#priceShow").html(price); $("#fb").html(fb.slice(0, 10)); $("#seeTimes").html(info.seeTimes + 1 + "次"); fb = fb.slice(0, 10); switch (yx) { case "一周": day = 7 * 24 * 60 * 60 * 1000; break; case "åŠæœˆ": day = 15 * 24 * 60 * 60 * 1000; break; case "一个月": day = 30 * 24 * 60 * 60 * 1000; break; case "三个月": day = 90 * 24 * 60 * 60 * 1000; break; case "å…个月": day = 180 * 24 * 60 * 60 * 1000; break; case "一年": day = 365 * 24 * 60 * 60 * 1000; break; default : day = 0; break; } if (day == 0) { $("#bj").html("报价长期有效"); $("#tj").removeAttr("disabled"); } else { var lastTime = new Date(new Date(fb).getTime() + day); var d1 = new Date().toLocaleDateString(); var d2 = new Date(d1.replace(/\//g, "-")); d2.setHours(0); lastTime.setHours(0); console.log("æœ€åŽæ—¥æœŸ:" + lastTime); console.log("当剿—¥æœŸ:" + d2); var last = ((lastTime - d2) / 1000 / 60 / 60 / 24); if (last <= 0) { $("#bj").html("报价已过期"); } else { $("#day").html(last); $("#tj").removeAttr("disabled"); } } var datainfo = { "country": '', "pdType": '', "page": 0, "showname": showName }; $.ajax({ url: url + "/mysj/info/listqg03", data: datainfo, type: "post", dateType: "json", async: false, success: function (res, status, xhr) { var result = ''; if (res.length > 1) { var temp = 0; $.each(res, function (i, list) { if (temp < 8) { result += "<div style='margin-bottom: 20px;'><a href='/syjh/bussiness_info/" + list.infoId + ".html' target='_blank'>" + list.showname + "<br>" + list.dateandtime.slice(0, 10) + "</a></div>"; temp++; } else { return false; } }); } else { $(".D8").hide(); $(".D8-text").hide(); } $(".D8-text").html(result); } }); if (gsid != null && gsid != "") { var companyInfo = loadCompany(gsid); if (companyInfo != null) { if (companyInfo.qymc != null && companyInfo.qymc != "") { $("#company,#company2").html(companyInfo.qymc); $("#zygy").html("主è¦ä¾›åº”:" + companyInfo.zycp); $(".com-Top-nav>div:first-child>a").attr("href", "/company/vip/" + gsid + ".html"); $(".com-Top-nav>div:nth-child(2)>a").attr("href", "/company/vip/about/" + gsid + ".html"); $(".com-Top-nav>div:nth-child(3)>a").attr("href", "/company/vip/spzs/" + gsid + ".html"); $(".com-Top-nav>div:nth-child(4)>a").attr("href", "/company/vip/syjh/" + gsid + ".html"); //$(".com-Top-nav>div:nth-child(5)>a").attr("href","companyMessage.html?id="+gsid); $(".com-Top-nav>div:last-child>a").attr("href", "/company/vip/zzry/" + gsid + ".html"); $("#company2").attr("href", "/company/vip/" + gsid + ".html"); $("#company3").attr("href", "/company/vip/spzs/" + gsid + ".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/" + gsid + ".html?search=" + content; } else if (type == "采è´") { window.location.href = "/company/vip/syjh/" + gsid + ".html?search=" + content; } else if (type == "ä¼ä¸š") { layer.tips("请选择供应或求è´", "#selectType"); } else if (type == "资讯") { layer.tips("请选择供应或求è´", "#selectType"); } else if (type == "百科") { layer.tips("请选择供应或求è´", "#selectType"); } } }); var zz = ""; var zzsm = "æ— "; if (info.gs == 1) { zz = "<img src='/images/三级详情页供应改danbao_23.png' title='已通过执照认è¯'>"; zzsm = " å…¬å¸è®¤è¯<br> " } var hy = ""; var hysm = "æ— "; switch (companyInfo.hyjb) { case 5: hy = "<img src='/images/çš‡å† çº§åˆ«.png' title='çš‡å† VIP'>"; hysm = " çš‡å† VIP"; break; case 4: hy = "<img src='/images/黄钻级别.png' title='黄钻VIP'>"; hysm = " 黄钻VIP"; break; case 3: hy = "<img src='/images/红钻级别.png' title='红钻VIP'>"; hysm = " 红钻VIP"; break; case 2: hy = "<img src='/images/绿钻级别.png' title='绿钻VIP'>"; hysm = " 绿钻VIP"; break; case 1: break; default: break; } var sm = ""; var smsm = ""; if (companyInfo.shiming == 1) { sm = "<img src='/images/三级详情页供应改身份验è¯.png' title='已通过实å认è¯'>"; smsm = " 实å认è¯<br> "; } var db = ""; var dbsm = ""; if (companyInfo.danbao == 1) { db = "<img src='/images/三级详情页供应改danbao_30.png' title='已缴费担ä¿è®¤è¯'>"; $(".D3-3").html(db + "求è´å•†å·²ç¼´çº³æ‹…ä¿é‡‘,平å°ç›‘ç£ï¼Œé˜²æ¢ä¸Šå½“å—骗,公平公æ£ã€‚"); dbsm = " æ‹…ä¿è®¤è¯"; } $("#tb").html(hy + sm + zz); $("#DE1").html(companyInfo.qymc); $("#DE2").html(hy + hysm); $("#DE3").html(companyInfo.sf + companyInfo.city); $("#DE4").html(zz + zzsm + sm + smsm + db + dbsm); if (companyInfo.touxiang != null && companyInfo.touxiang != "") { $("#tx").attr("src", companyInfo.touxiang); $("#tx").css("border-radius", "75px"); } } } } if (UserID != null && UserID != "" && userInfo != null) { //if(userInfo.hyjb>1){ $(".D5-1").html("è”系人:" + linkman); $(".D5-2").html("è”系方å¼ï¼š<a href='javascript:void(0);' id='showPhone' style='color: #ff774d' target='_blank'>点击查看è”系方å¼</a>"); $(".D5").css("background-color", "white"); $("#showPhone").click(function () { var IDArr = window.location.href.split("?info_id="); var IDs = 0; if (IDArr.length == 2) { IDs = window.location.href.split("?info_id=")[1]; } else { var weburl = window.location.href; IDs = weburl.substring(weburl.lastIndexOf('/') + 1).split(".")[0]; } if (parseInt(IDs)) { var info_id = parseInt(IDs); console.log(info_id); showTel(info_id); } }); /*}else{ $(".greenTexts").html("对ä¸èµ·ï¼Œæ‚¨ä¸æ˜¯æ£å¼ä¼šå‘˜ï¼Œ"); $(".D5-2").hide(); }*/ } } else { window.location.href = "/syjh/qiugou.htm"; } } function loadCompany(gsid) { var companyInfo = null; $.ajax({ url: url + "/user2019/qyml/listchaxungongsi", data: {"id": gsid}, type: "post", dateType: "json", async: false, success: function (response, status, xhr) { companyInfo = response[0]; }, error: function (e) { layer.msg("系统错误,请è”系客æœï¼", {icon: 5}); console.log("读å–å…¬å¸ä¿¡æ¯ajax错误"); console.log(e.status); console.log(e.responseText); } }); return companyInfo; } function addSeeTimes(id) { $.ajax({ url: url + "/mysj/info/addSeeTimes", data: {"infoId": id}, type: "get", dateType: "json", async: false, success: function (response, status, xhr) { if (response != 1) { console.log("addSeeTimes!=1 ===>" + response); } }, error: function (e) { console.log("addSeeTimes"); console.log(e.status); console.log(e.responseText); } }); } function getBuy(id) { var info_id = parseInt(window.location.href.split("?info_id=")[1]); $.ajax({ url: url + "/mysj/info/selectInfoForCompany", data: {"gsid": id, "type": "采è´", "page": 0}, type: "post", dateType: "json", async: false, success: function success(response, status, xhr) { var result = ""; if (response.length > 1) { var temp = 0; $.each(response, function (i, list) { if (temp < 8) { if (list.infoId != info_id) { result += "<div style='margin-bottom: 20px;'><a href='/syjh/bussiness_info/" + list.infoId + ".html' target='_blank'>" + list.showname + "<br>" + list.dateandtime.slice(0, 10) + "</a></div>"; temp++; } } else { return false; } }); } else { result = "æ— å†…å®¹"; } $(".D7").html(result); }, error: function error(e) { layer.msg("系统错误,请è”系客æœï¼", {icon: 5}); console.log("getBuy方法ajax错误"); console.log(e.status); console.log(e.responseText); } }); }