var pc_menuid = 0; var nopicpath = "/Jzw/Tpl/Home/Default/Public/nopic.jpg"; //默认图片 $(function () { //显示默认图片 $(".pics").find("img").each(function () { if ($(this).attr("src") == "") { $(this).attr("src", nopicpath); } }); if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE6.0" || navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace( /[ ]/g, "") == "MSIE7.0" || navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.split( ";")[1].replace(/[ ]/g, "") == "MSIE8.0") { checkBowerTip(); } $('#checkBowerTip').click(function(){ $(this).hide(); }); }); //客服链接统一打开 //放置model_foot.html // function sayKeFu() { var path = $("#aFootKefu").attr("href"); var newTab = window.open('about:blank'); $.ajax({ success: function (data) { if (data) { newTab.location.href = path; } } }); } //加载联系我们地图PC //调用方式 //loadContactMap('content','{$site_name}','{$address}','{$tel}','{$baiduxy}'.split(',')[0],'{$baiduxy}'.split(',')[1]); function loadContactMap(id, markerArr, map) { // console.log(poin); // map = new BMap.Map(id); // map.centerAndZoom(new BMap.Point(poin), 18); map.enableScrollWheelZoom(true); //向地图中添加缩放控件 var ctrlNav = new window.BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_LARGE }); map.addControl(ctrlNav); //向地图中添加缩略图控件 var ctrlOve = new window.BMap.OverviewMapControl({ anchor: BMAP_ANCHOR_BOTTOM_RIGHT, isOpen: 1 }); map.addControl(ctrlOve); //向地图中添加比例尺控件 var ctrlSca = new window.BMap.ScaleControl({ anchor: BMAP_ANCHOR_BOTTOM_LEFT }); map.addControl(ctrlSca); //绘制点 for (var i = 0; i < markerArr.length; i++) { var maker = addMarker(new window.BMap.Point(markerArr[i].point.split(",")[0], markerArr[i].point.split(",")[1]), i); addInfoWindow(maker, markerArr[i], i); } } function addMarker(point, index) { var myIcon = new BMap.Icon("http://api.map.baidu.com/img/markers.png", new BMap.Size(23, 25), { offset: new BMap.Size(10, 25), imageOffset: new BMap.Size(0, 0 - index * 25) }); var marker = new BMap.Marker(point, { icon: myIcon }); map.addOverlay(marker); return marker; } // 添加信息窗口 function addInfoWindow(marker, poi) { //pop弹窗标题 var title = '
' + poi.title + '
'; //pop弹窗信息 var html = []; html.push('' + '' + '' + '' + '
地址:' + poi.address + '
电话:' + poi.tel + '
'); var infoWindow = new BMap.InfoWindow(html.join(""), { title: title, width: 200 }); var openInfoWinFun = function () { marker.openInfoWindow(infoWindow); }; marker.addEventListener("click", openInfoWinFun); map.openInfoWindow(infoWindow, map.getCenter()); return openInfoWinFun; } //=======================================通用JS======================================== // 封装Ajax调用 需引用layer.js和layer.css // // //封装ajax var ajaxLoadIndex; var ajaxLoadOpen = 1; function myajax(url, data, dataType, type, async, responseFun) { // if(lang_mark != "") url += "&l="+lang_mark; $.ajax({ url: url, data: data, dataType: dataType, type: type, async: async, success: responseFun, beforeSend: beforeSend, error: error }); } function beforeSend() { //Loading层 if (ajaxLoadOpen == 1) { ajaxLoadIndex = layer.load(1, { shade: [0.1, '#fff'] //0.1透明度的白色背景 }); } } function error() { //提示层 myajax_close(); layer.msg('请求失败'); } function myajax_close() { if (ajaxLoadOpen == 1) { layer.close(ajaxLoadIndex); } else { ajaxLoadOpen = 1; } } var la_open_time = 0; var la_open_title = ""; function la_open(content, icon, callback) { if (la_open_title == "") { la_open_title = "提示"; } if (la_open_time == 0) la_open_time = 2000; if (typeof (callback) == "undefined") { layer.open({ content: content, icon: icon, title: la_open_title, time: la_open_time }); la_open_time = 0; } else { layer.open({ content: content, icon: icon, title: la_open_title, time: la_open_time, end: function () { callback() } }); la_open_time = 0; } } //询问框 function la_confirm(msg, b1, b2, btn1, btn2) { if (b1 == "") { b1 = "确认"; } if (b2 == "") { b2 = "取消"; } layer.confirm(msg, { btn: [b1, b2] //按钮 }, function (index) { btn1(); layer.close(index); }, function (index) { btn2(); layer.close(index); }); } //封装ajax end function checkBowerTip() { var $checkbower = $('
' + '当前浏览器版本过低,影响整体的访问体验。建议升级到IE9以上版本,或者切换极速模式,或者下载360浏览器谷歌浏览器' + '' + '
'); $('body').prepend($checkbower); $checkbower.width(window.innerWidth); $checkbower.find('img').eq(0).click(function () { $checkbower.addClass('hidden'); }); if ($checkbower.width() < 400) $checkbower.css({ 'font-size': '12px', 'padding': '5px 0', 'text-align': 'left' }).find('span').eq(0).css('padding-right', '10px') }