var browser={ versions:function(){ try{ var u = navigator.userAgent, app = navigator.appVersion; return { //移动终端浏览器版本信息 trident: u.indexOf('Trident') > -1, //IE内核 presto: u.indexOf('Presto') > -1, //opera内核 webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核 gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核 mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端 ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端 android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器 iPhone: u.indexOf('iPhone') > -1 , //是否为iPhone或者QQHD浏览器 iPad: u.indexOf('iPad') > -1, //是否iPad webApp: u.indexOf('Safari') == -1, //是否web应该程序,没有头部与底部 windowsPhone:u.indexOf('Windows Phone') > -1, weiXin: u.toLowerCase().indexOf('micromessenger') > -1 }; }catch(e){ } return {}; }(), language:(navigator.browserLanguage || navigator.language).toLowerCase(), userAgent: navigator.userAgent }; (function(win){ function CNameSpace(){ if(typeof CNameSpace.initialized === "undefined"){ CNameSpace.prototype.init = function(){ if(!CNameSpace.instance){ CNameSpace.instance = this; } }; CNameSpace.prototype.defineSpace = function(spaceName,member,parentSpace){ if(!spaceName){ return; } var parentN = parentSpace; if(!parentN){ parentN = window; } if(!parentN[spaceName]){ parentN[spaceName] = new Object(); } var object = parentN[spaceName]; if(member){ for(m in member){ object[m] = member[m]; } } }; CNameSpace.initialized = true; } return this; } win.NameSpace = new CNameSpace(); NameSpace.defineSpace("DataManager",{ getObject:function(){ var xmlhttp = null; try { xmlhttp = new XMLHttpRequest(); } catch (e) { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlhttp; }, get:function(url,success,fail){ if(!url){ if(fail && typeof fail == "function"){ fail("url error"); } return; } var xmlHttp = this.getObject(); try{ xmlHttp.open("get", url, true); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4){ if (xmlHttp.status == 200){ if(success && typeof success === "function"){ var response = xmlHttp.response || xmlHttp.responseText; success(response); } }else{ if(fail && typeof fail === "function"){ fail(xmlHttp.status); } } } }; xmlHttp.send(null); }catch(e){ if(fail && typeof fail === "function"){ fail(e.message); } } }, getLocalData : function(dataName,defaultVal){ if(window.localStorage){ return IsNullOrUnDefined(localStorage[dataName])?defaultVal:localStorage[dataName]; } return null; }, saveLocalData : function(dataName,value){ if(window.localStorage){ localStorage[dataName] = value; return true; } return false; } }); NameSpace.defineSpace("WeiXinManager",{ m_mapPara:{ "appid": "", "img_url": "", "img_width": "300", "img_height": "300", "link": "", "desc":"" , "title": "", "timeLineDesc":"" , "timeLineTitle": "", "content":"" , "errorPage":"error.html", "type":"link", "dataUrl":"", "jsUrl":"http://58.68.146.12/weixin/JS.js" }, init:function(para){ try{ this.setPara(para); if(wx){ } document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() { try{ if(WeixinJSBridge && WeixinJSBridge.on){ WeixinJSBridge.on('menu:share:appmessage', function(argv){ try{ WeiXinManager.shareFriend(); }catch(e){ } }); WeixinJSBridge.on('menu:share:timeline', function(argv){ try{ WeiXinManager.shareTimeline(); }catch(e){ } }); WeixinJSBridge.on('menu:share:weibo', function(argv){ try{ WeiXinManager.shareWeibo(); }catch(e){ } }); } }catch(e){ } }); }catch(e){ } }, setPara:function(key,value){ if(!key){ return; } if(typeof key == "string"){ this.m_mapPara[key] = value; }else if(typeof key == "object"){ for(var k in key){ this.m_mapPara[k] = key[k]; } } var para = this.m_mapPara; if(typeof wx != "undefined" && wx){ wx.onMenuShareTimeline({ title: para.timeLineTitle?para.timeLineTitle:para.title, link: para.link, imgUrl: para.img_url, success: function () { if(para.shareTimeLineSuccessProc){ para.shareTimeLineSuccessProc(); } }, cancel: function () { if(para.shareTimeLineCancelProc){ para.shareTimeLineCancelProc(); } } }); wx.onMenuShareAppMessage({ title: para.title, desc: para.desc , link: para.link, imgUrl: para.img_url, type: para.type, dataUrl: para.dataUrl, success: function () { if(para.shareAppMessageSuccessProc){ successProc(); } }, cancel: function () { if(para.shareAppMessageCancelProc){ cancelProc(); } } }); wx.onMenuShareWeibo({ title: para.title, desc: para.desc , link: para.link, imgUrl: para.img_url, success: function () { if(para.shareWeiBoSuccessProc){ para.shareWeiBoSuccessProc(); } }, cancel: function () { if(para.shareWeiBoCancelProc){ para.shareWeiBoCancelProc(); } } }); wx.onMenuShareQQ({ title: para.title, desc: para.desc , link: para.link, imgUrl: para.img_url, success: function () { if(para.shareQQSuccessProc){ para.shareQQSuccessProc(); } }, cancel: function () { if(para.shareQQCancelProc){ para.shareQQCancelProc(); } } }); } }, getPara:function(key){ if(typeof key == "undefined" || !key){ return this.m_mapPara; }else if(typeof key == "string"){ return this.m_mapPara[key]; } return null; }, shareFriend:function (successProc,cancelProc){ try{ var para = this.getPara(); if(wx){ wx.onMenuShareAppMessage({ title: para.title, desc: para.desc , link: para.link, imgUrl: para.img_url, type: para.type, dataUrl: para.dataUrl, success: function () { if(successProc){ successProc(); } }, cancel: function () { if(cancelProc){ cancelProc(); } } }); return; } WeixinJSBridge.invoke('sendAppMessage',{ "appid": para.appid, "img_url": para.img_url, "img_width": para.img_width, "img_height": para.img_height, "link": para.link, "desc":para.desc , "title": para.title }, function(res) { }); }catch(e){ } }, shareTimeline:function (successProc,cancelProc) { try{ var para = this.getPara(); if(wx){ wx.onMenuShareTimeline({ title: para.timeLineTitle?para.timeLineTitle:para.title, link: para.link, imgUrl: para.img_url, success: function () { if(successProc){ successProc(); alert(wx.onMenuShareTimeline); } }, cancel: function () { if(cancelProc){ cancelProc(); alert(wx.onMenuShareTimeline); } } }); return; } WeixinJSBridge.invoke('shareTimeline',{ "img_url": para.img_url, "img_width": para.img_width, "img_height": para.img_height, "link": para.link, "desc":para.timeLineDesc? para.timeLineDesc:para.desc , "title": para.timeLineTitle?para.timeLineTitle:para.title }, function(res) { }); }catch(e){ } }, shareWeibo:function (successProc,cancelProc) { try{ var para = this.getPara(); if(wx){ wx.onMenuShareWeibo({ title: para.title, desc: para.desc , link: para.link, imgUrl: para.img_url, success: function () { if(successProc){ successProc(); } }, cancel: function () { if(cancelProc){ cancelProc(); } } }); return; } WeixinJSBridge.invoke('shareWeibo',{ "content": para.content, "url": para.ink }, function(res) { }); }catch(e){ } }, shareQQ:function (successProc,cancelProc) { try{ var para = this.getPara(); if(wx){ wx.onMenuShareQQ({ title: para.title, desc: para.desc , link: para.link, imgUrl: para.img_url, success: function () { if(successProc){ successProc(); } }, cancel: function () { if(cancelProc){ cancelProc(); } } }); return; } }catch(e){ } }, checkWeiXin:function(){ var para = this.getPara(); return browser.versions.weiXin || browser.versions.windowsPhone; }, checkCanTouch:function(){ return browser.versions.iPad ||browser.versions.iPhone || browser.versions.android || browser.versions.windowsPhone || browser.versions.weiXin; }, config:function(config){ if(wx && config){ wx.config(config); } }, remoteProcess:function(url,callBack,callBackName){ try{ if(!url || !callBack){ return; } var cbName = callBackName; if( !cbName){ cbName = "callBack"; } var date = new Date(); var dateId = date.getTime(); var callBackProcName = "callBack"+dateId; var callBackStr = ""; var scriptId = "script"+dateId; var dataUrl = url; if(dataUrl.indexOf("?")< 0){ dataUrl = dataUrl+"?t="+dateId; } if(typeof callBack == "string"){ callBackProcName=callBack; callBackStr = "&"+cbName+"="+callBackProcName; }else if(callBack){ window[callBackProcName]= callBack; callBackStr = "&"+cbName+"="+callBackProcName; } dataUrl = dataUrl+callBackStr; var s = document.createElement("script"); s.id=scriptId; document.body.appendChild(s); s.src=dataUrl; }catch(e){ var msg=e.message; } }, register:function(regPara){ var para = this.getPara(); var jsUrl = para.jsUrl; var apiList = para.apiList; var rPara = regPara?regPara:{}; var url = window.location; jsUrl = jsUrl + "?url="+encodeURIComponent(url); if(this.remoteProcess){ this.remoteProcess(jsUrl,function(wxConfig){ try{ if(!wxConfig){ wxConfig = peopleWXConfig; } if(!wxConfig || !wx){ alert("不支持微信接口功能,请升级微信!"); } wxConfig.jsApiList = apiList; wxConfig.debug = false; wx && wx.config(wxConfig); wx.ready(function(){ if(rPara.success){ rPara.success(wxConfig); } }); wx.error(function(){ if(rPara.fail){ rPara.fail(wxConfig); } }); }catch(e){ alert(e.message); } }); } } }); })(window); function addTouchProc(object,config){ if(!object){ return; } var con = config ? config :{}; var bNotProp = !!con.bNotProp; var bPreventDefault = !!con.bPreventDefault; var bNotTouch = !!con.bNotTouch; var bNotClick = !!con.bNotClick; var xThred = document.documentElement.clientWidth / 2; var yThred = document.documentElement.clientHeight / 2; if(object.addEventListener){ !bNotClick && object.addEventListener("mousedown",function(e){ try{ e || (e = window.event); if(!this.touchAble){ this.startX = e.pageX; this.startY = e.pageY; this.endX = e.pageX; this.endY = e.pageY; } if(!!bNotProp){ if(e.stopPropagation) { e.stopPropagation(); } else { e.cancelBubble = true; } } bPreventDefault && e.preventDefault(); }catch(e){ } },false); !bNotClick && object.addEventListener("mousemove",function(e){ try{ e || (e = window.event); if(!this.touchAble){ this.endX = e.pageX; this.endY = e.pageY; } if(!!bNotProp){ if(e.stopPropagation) { e.stopPropagation(); } else { e.cancelBubble = true; } } e.preventDefault(); }catch(e){ } },false); !bNotClick && object.addEventListener("mouseup",function(e){ try{ e || (e = window.event); if(!this.touchAble){ var dx = this.startX - this.endX; var dy = this.startY - this.endY; if( Math.abs(dx) < 10 && Math.abs(dy) < 10){ if(config.click){ config.click(e,object); } }else if( Math.abs(dx)>xThred){ if(config.slideX){ config.slideX(e,object,dx); } }else if(Math.abs(dy) > yThred){ if(config.slideY){ config.slideY(e,object,dy); } } } this.startX = -1; this.startY = -1; this.endX = -1; this.endY = -1; if(!!bNotProp){ if(e.stopPropagation) { e.stopPropagation(); } else { e.cancelBubble = true; } } bPreventDefault && e.preventDefault(); }catch(e){ } },false); !bNotTouch && object.addEventListener("touchstart",function(e){ try{ this.touchAble = true; e || (e = window.event); var touch = e.touches[0]; this.startX = touch.pageX; this.startY = touch.pageY; this.endX = touch.pageX; this.endY = touch.pageY; if(!!bNotProp){ if(e.stopPropagation) { e.stopPropagation(); } else { e.cancelBubble = true; } } bPreventDefault && e.preventDefault(); }catch(e){ } },false); !bNotTouch && object.addEventListener("touchmove",function(e){ try{ e || (e = window.event); var touch = e.touches[0]; this.endX = touch.pageX; this.endY = touch.pageY; var dx = this.endX - this.startX ; var dy = this.endY - this.startY; if(( Math.abs(dx)>xThred)||(Math.abs(dy) > yThred)){ } if(!!bNotProp){ if(e.stopPropagation) { e.stopPropagation(); } else { e.cancelBubble = true; } } bPreventDefault && e.preventDefault(); }catch(e){ } },false); !bNotTouch && object.addEventListener("touchend",function(e){ try{ e || (e = window.event); var touch = e.touches[0]; var dx = this.endX - this.startX ; var dy = this.endY - this.startY; if( Math.abs(dx) < 10 && Math.abs(dy) < 10 ){ if(config.click){ config.click(e,object); } }else if( Math.abs(dx)>xThred){ if(config.slideX){ config.slideX(e,object,dx); } }else if(Math.abs(dy) > yThred){ if(config.slideY){ config.slideY(e,object,dy); } } if(!!bNotProp){ if(e.stopPropagation) { e.stopPropagation(); } else { e.cancelBubble = true; } } bPreventDefault && e.preventDefault(); }catch(e){ } },false); !bNotTouch && object.addEventListener("touchcancel",function(e){ try{ e || (e = window.event); var touch = e.touches[0]; var dx = this.endX - this.startX ; var dy = this.endY - this.startY; if( Math.abs(dx) < 10 && Math.abs(dy) < 10 ){ if(config.click){ config.click(e,object); } }else if( Math.abs(dx)>20){ if(config.slideX){ config.slideX(e,object,dx); } }else if(Math.abs(dy) > yThred){ if(config.slideY){ config.slideY(e,object,dy); } } if(!!bNotProp){ if(e.stopPropagation) { e.stopPropagation(); } else { e.cancelBubble = true; } } bPreventDefault && e.preventDefault(); }catch(e){ } },false); } } (function(){ /* ******************************************************************* * * file name: js/winxin.js * log: * Date Name Description * 2011/11/03 Wang Yong New ******************************************************************* */ if(typeof window.g_bUseSelf == "undefined"){ window.g_bUseSelf = true; }else{ return; } if(!!window.g_bUseThisIndex){ return; } window.g_bUseThisIndex = true; window.g_bUseLocationAccess = typeof window.g_bUseLocationAccess == "undefined"?true:!!window.g_bUseLocationAccess; window.g_nGlobalListIndex = -1; window.g_oGlobalList = null; window.g_nGlobalListStep = 3; window.g_bLoadingMore = false; window.g_nChannelListTotal = 0; window.g_nChannelListCurrent = 0; window.g_strChannelId = ""; window.g_oContentMap = { totalPageNum:0, currentPage:0, data:null }; var currentDataName = null; var maxPageNum = (typeof g_maxPageNum != "undefined") && g_maxPageNum && g_maxPageNum > 0 ?g_maxPageNum:5; function getParas(){ try{ var paraStr= window.location.href.substring(window.location.href.indexOf("?")+1); var pagePara = null; var channelId = null; var newsId = null; var paraArr = paraStr.split("&"); var searchStr = ""; if(paraArr && paraArr.length > 0){ for(var i = 0 ; i < paraArr.length ; i++){ var item = paraArr[i]; var itemArr = item.split("="); if(itemArr.length == 2){ var name = itemArr[0].trim(); var value= itemArr[1].trim(); if(name == "nI"){ newsId = decodeURIComponent(value); } if(name == "cI"){ channelId = decodeURIComponent(value); } if(name == "keyword"){ searchStr = decodeURIComponent(value); } } } } var pageName = typeof g_pageName == "undefined"?"index":g_pageName; switch(pageName){ case "newsList": initNewsList(channelId); break; case "imageNewsList": initImageNewsList(pagePara); break; case "content": initNewsContent({"channelId":channelId,"newsId":newsId}); break; case "search": initSearchList(searchStr); break; default: initIndex(); break; } }catch(e){ } } function bindNav(cNav){ var exNav = typeof cNav == "string"?cNav:""; $("#navWrapper").hide(); $("#navWrapper").empty(); var navHTML = ""; var navStr = '
'; for(var i=0; i < navSortArr.length;i++){ var cn = navSortArr[i]; var cItem = navNameMap[cn]; if(!cItem || cItem.id == exNav){ continue; } var cId = cItem.id; var str = navStr; str = str.replace("$channelId",cId); str = str.replace("$channelName",cn); var path = "list.html?cI="+cId+"&at=m"; if(cId=="1000"){ path = "index.html"; } str = str.replace("$path",path); navHTML += str; } navHTML += '
'; navHTML += '
'; navHTML += '
'; $("#navWrapper").append(navHTML); setTimeout(function(){ $("#navWrapper").show(); console.log($('.swiper-container').html()); var mySwiper = new Swiper('.swiper-container',{ pagination: '.pagination', paginationClickable: true, slidesPerView: 4 }); },200); $("#navDetail").append(navHTML); $("#navMore").click(function(){ $("#navMore").hide(); $(".navContainer").hide(); $("#navClose").show(); $("#navDetail").show(); }); $("#navClose").click(function(){ $("#navMore").show(); $(".navContainer").show(); $("#navClose").hide(); $("#navDetail").hide(); }); } function statistic(cataLogStr){ try{ var cataLogEle = document.getElementById("catalogs"); if(cataLogEle){ if(!cataLogStr){ cataLogStr = "XTW_0005059"; } cataLogEle.content = cataLogStr; } }catch(e){ } try{ var date = new Date(); var currentTime = date.getTime(); var scriptStr = defaultScriptStr + "?ttt="+currentTime; var statisticEle = document.getElementById("statistic" ); if(statisticEle){ statisticEle.src = scriptStr; } var frameStr = '