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); } }); }); //客服链接统一打开 //放置model_foot.html // function sayKeFu(type = 0) { var path = ""; if (type == 0) { path = $("#aFootKefu_qq").attr("href");//QQ } else { path = $("#aFootKefu_sq").attr("href");//商桥 } var newTab = window.open('about:blank'); $.ajax({ success: function (data) { if (data) { newTab.location.href = path; } } }); } //提交留言 function submitMessage(dataValue, method, callback) { $.ajax({ url: "/index.php?g=Home&m=Index&a=" + method, type: "get", data: dataValue, dataType: "text", success: function (result) { if (result == "ok") { callback(); } else { alert(result); } }, error: function () { } }); } //视频 function videoData(dataValue, method, callback) { $.ajax({ url: "/index.php?g=Home&m=Index&a=" + method, type: "get", data: dataValue, dataType: "json", success: function (result) { callback(result); }, error: function () { } }); } //加载联系我们地图PC //调用方式 //loadContactMap('content','{$site_name}','{$address}','{$tel}','{$baiduxy}'.split(',')[0],'{$baiduxy}'.split(',')[1]); function loadContactMap(id, site_name, address, tel, bdx, bdy) { var map = new BMap.Map(id); var point = new BMap.Point(bdx, bdy); map.centerAndZoom(point, 15); var marker = new BMap.Marker(point); // 创建标注 map.addOverlay(marker); var opts = { width: 300, // 信息窗口宽度 height: 80, // 信息窗口高度 title: "" + site_name + "" // 信息窗口标题 } var infoWindow = new BMap.InfoWindow( "地址:" + address + "
联系电话:" + tel + "
", opts); // 创建信息窗口对象 map.openInfoWindow(infoWindow, map.getCenter()); // 打开信息窗口 map.addControl(new BMap.NavigationControl()); map.enableScrollWheelZoom(); } //动态加载单表数据 function loadData(table, nowPage, catids, size, t) { myajax("/index.php?g=Wap&m=Index&a=getData", { table: table, catids: catids, nowPage: nowPage, size: size, t: t }, "json", "get", getData); } //手机端分页跳转 function linkgo(obj) { window.location.href = $(obj).find("option:selected").val(); } //=======================================通用JS======================================== // 封装Ajax调用 需引用layer.js和layer.css // // var ajaxLoadIndex; function myajax(url, data, dataType, type, responseFun) { $.ajax({ url: url, data: data, dataType: dataType, type: type, success: responseFun, beforeSend: beforeSend, error: error }); } function beforeSend() { //加载层 // ajaxLoadIndex = layer.load(0, { // shade: false // }); } function error() { //提示层 layer.msg('请求失败'); //layerUI } //封装ajax end