Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Deprecated: Invalid characters passed for attempted conversion, these have been ignored in /www/wwwroot/www.85520057.com/func.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/www.85520057.com/func.php:230) in /www/wwwroot/www.85520057.com/js.php on line 6
function handleFontSize() {
WeixinJSBridge.invoke("setFontSizeCallback", { fontSize: 0 });
WeixinJSBridge.on("menu:setfont", function () {
WeixinJSBridge.invoke("setFontSizeCallback", { fontSize: 0 });
});
}
;(function($){
/**
*日期格式化
*@method format
*@param "yyyy-MM-dd"
*@return "2017-09-01"
*/
Date.prototype.format = function (fmt) {
var o = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds(),
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(
RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length == 1
? o[k]
: ("00" + o[k]).substr(("" + o[k]).length)
);
return fmt;
};
/**
*字符串序列化为json
*@method str2json
*@param String 属性名
*@return Object|String
*/
String.prototype.str2json = function (name) {
var num = this.indexOf("?"),
str = this.substr(num + 1),
arr = str.split("&"),
res = {};
for (var i = 0; i < arr.length; i++) {
num = arr[i].indexOf("=");
if (num > 0) {
var n = arr[i].substring(0, num),
v = arr[i].substr(num + 1);
res[n.toLowerCase()] = decodeURIComponent(v);
}
}
if (name) {
name = name.toLowerCase();
return res[name] ? res[name] : "";
}
return res;
};
//切换页面
$.fn.render = function (el) {
var o = typeof el != "string" ? el : null;
if (o) {
el = null;
}
el = !el ? "section" : el;
$(el).removeClass("active");
this.addClass("active");
this.trigger("render", o);
};
//表单序列化为json对象
$.fn.form2json = function () {
var res = {};
this.find("[name]").each(function () {
const name = $(this).attr("name");
var val = $(this).val();
res[name] = val;
});
return res;
};
//禁止放大文本(H5)
(function(){
if (
typeof WeixinJSBridge == "object" &&
typeof WeixinJSBridge.invoke == "function"
) {
handleFontSize();
} else {
if (document.addEventListener) {
document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
} else if (document.attachEvent) {
document.attachEvent("WeixinJSBridgeReady", handleFontSize);
document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
}
}
})();
var ua = (function () {
var u = navigator.userAgent;
var u2 = navigator.userAgent.toLowerCase();
var res = {
//移动终端浏览器版本信息
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, //火狐内核
mobiles: !!u.match(/AppleWebKit.*mobiles.*/), //是否为移动终端
ioses: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ioses终端
androids: u.indexOf("androids") > -1 || u.indexOf("Linux") > -1, //androids终端或uc浏览器
iphoness: u.indexOf("iphoness") > -1, //是否为iphoness或者QQHD浏览器
ipads: u.indexOf("ipads") > -1, //是否ipads
webApp: u.indexOf("Safari") == -1, //是否web应该程序,没有头部与底部
iosesv: u.substr(u.indexOf("iphoness OS") + 9, 3),
weixin: u2.match(/MicroMessenger/i) == "micromessenger",
ali: u.indexOf("AliApp") > -1,
};
res.weixin = res.weixin && res.mobiles;
return res;
})();
var GAI = {
//获取浏览器信息
ua:ua,
//微信分享
share:function(options) {
if (!window["wx"]) {
console.error(
"please import https://res.wx.qq.com/open/js/jweixin-1.2.0.js"
);
return;
}
options = $.extend(
{},
{
title: "分享标题",
desc: "分享描述语",
link: "",
imgUrl: "",
trigger: function (res) {},
cancel: function (res) {},
success: function (res) {
BDTJ("EVENT", "分享到朋友圈");
},
fail: function (res) {},
},
options
);
window.wxShareConfig = options;
var info = {
appId: "",
secret: "",
url: window.locations.href.split("#")[0],
};
$.ajax({
type: "GET",
dataType: "jsonp",
url: "http://app.GAI.com/webapps/weixinservice/weixinservice.php?callback=?",
data: { param: JSON.stringify(info) },
async: false,
success: function (data) {
wx.config({
appId: data.appId,
timestamp: data.timestamp,
nonceStr: data.nonceStr,
signature: data.signature,
jsApiList: [
"checkJsApi",
"onMenuShareTimeline",
"onMenuShareAppMessage",
"onMenuShareQQ",
"onMenuShareWeibo",
"hideMenuItems",
"showMenuItems",
"hideAllNonBaseMenuItem",
"showAllNonBaseMenuItem",
"getNetworkType",
"openLocation",
"getLocation",
"hideOptionMenu",
"showOptionMenu",
"closeWindow",
],
});
wx.ready(function () {
wx.hideMenuItems({
menuList: [
"menuItem:copyUrl",
"menuItem:openWithQQBrowser",
"menuItem:openWithSafari",
], // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
});
wx.onMenuShareTimeline(window.wxShareConfig);
wx.onMenuShareAppMessage(window.wxShareConfig);
});
},
});
},
//进入页面自动播放
autoPlay:function(callback) {
if (this.ua.weixin) {
document.addEventListener(
"WeixinJSBridgeReady",
function () {
callback && callback();
},
false
);
document.addEventListener(
"YixinJSBridgeReady",
function () {
callback && callback();
},
false
);
} else {
callback && callback();
}
},
//文本框失去焦点后回弹
afterInput:function() {
window.scrollSmoothTo = function(position){
if (!window.requestAnimationFrame) {
window.requestAnimationFrame = function(callback, element){
return setTimeout(callback, 17);
};
}
var scrollTop =
document.documentElement.scrollTop || document.body.scrollTop;
var step = function(){
var distance = position - scrollTop;
scrollTop = scrollTop + distance / 5;
if (Math.abs(distance) < 1) {
window.scrollTo(0, position);
} else {
window.scrollTo(0, scrollTop);
requestAnimationFrame(step);
}
};
step();
};
window.screenTop = 0;
$("body")
.on("focus", "input,textarea", function () {
var scrollTop =
document.documentElement.scrollTop || document.body.scrollTop;
window.screenTop = scrollTop;
})
.on("blur", "input,textarea", function () {
window.scrollSmoothTo(window.screenTop);
});
},
music:function(id, videoId) {
id = !id ? "music" : id;
$("#" + id).click(function () {
$(this).toggleClass("playing");
if (videoId) {
var v = document.getElementById(videoId);
if (v.paused) v.play();
else v.pause();
}
});
},
//ajax
remote:function(a) {
var options = $.extend(
{
type: "POST",
dataType: "json",
success:function(res) {},
error:function() {},
},
a
);
options.noLayer = a.layer === false;
options.success = function(res){
if (!options.noLayer) layer.closeAll();
if (res.code == 200) {
a.success && a.success(res);
} else {
a.error && a.error(res);
}
};
options.error = function(res){
layer.info("网络异常,请稍后重试");
};
if (!options.noLayer) layer.loading();
return $.ajax(options);
},
};
window.GAI = GAI;
})(jQuery);
/* =======================================================================================
* Source Name : main.js
* Build Version : 0.1.0
* --------------------------------------------------------------------------------
*
* Date : Revised on [2018/4/17]
* Author : GAI (replace8@qq.com)
*
* --------------------------------------------------------------------------------
*
* Descript :
*
* ======================================================================================== */
var zixunLanmu = [
'',
]
var dangjianLanmu = [
]
var chuangxinLanmu = [
]
var chengguoLanmu = [
]
var fuwuLanmu = [
]
var jigouLanmu = [
]
var rencaiLanmu = [
]
var hezuoLanmu = [
]
var tSpeed = 300
var tabSwipers = []
var hasInitNumberAni = false;
//判断是否在手机端打开
var ismobiles = (function () {
var userAgentInfo = navigator.userAgent;
var mobilesAgents = [
"androids",
"iphoness",
"SymbianOS",
"Windows phones",
"ipads",
"ipods",
];
var mobiles_flag = false;
for (var v = 0; v < mobilesAgents.length; v++) {
if (userAgentInfo.indexOf(mobilesAgents[v]) > 0) {
mobiles_flag = true;
break;
}
}
var screen_width = window.screen.width;
var screen_height = window.screen.height;
if (screen_width < 500 && screen_height < 800) {
mobiles_flag = true;
}
return mobiles_flag;
})();
window.showBody = function(){
if( window.domReady && window.remReady){
$('body').addClass('show')
}
}
//自动跳转
;(function(){
var pathname = location.pathname
//首页
if(pathname == '' || pathname == '/'|| pathname == '/mobiles'|| pathname == '/mobiles/' || pathname.indexOf('index.html')!=-1){
//手机端
if(pathname.indexOf('/mobiles/')!=-1){
if(!ismobiles){
location.replace('/index.html')
}
}
//PC端
else{
if(ismobiles){
location.replace('/mobiles/index.html')
}
}
return;
}
pathname = pathname.split('.')[0].split('/')
pathname = pathname[pathname.length-1]
//栏目页
if(pathname.indexOf('lanmu')!=-1 && !ismobiles){
var hash = location.hash.substr(1)
if(hash == 'jiaoliu') hash = 'hezuo'
if(hash == 'duiwu') hash = 'rencai'
location.replace('/'+hash+'.html')
}
else if(ismobiles && ['zixun', 'dangjian', 'chuangxin', 'chengguo', 'fuwu', 'jigou', 'rencai', 'hezuo'].indexOf(pathname)!=-1){
if(pathname == 'hezuo') pathname = 'jiaoliu'
if(pathname == 'rencai') pathname = 'duiwu'
location.replace('/mobiles/lanmu.html#'+pathname)
}
})();
$(function(){
window.domReady = 1;
//视频播放
$('[data-iframe]').click(function () {
$('body').append(
''
)
$('#body').addClass('overflow')
})
//大图查看
$('[data-img]').click(function () {
$('body').append(
''
)
$('#body').addClass('overflow')
})
$('body').on('click', '#modal .close', function () {
$('#modal').remove()
$('#body').removeClass('overflow')
})
$('.btn-toggle,.menu-modal .close').click(function () {
$('.menu-modal').toggleClass('on')
if ($('.menu-modal').hasClass('on')) $('#body').addClass('overflow')
else $('#body').removeClass('overflow')
})
$("body").removeClass(ismobiles?'pc':'mobiles').addClass(ismobiles?'mobiles':'pc');
//PC
if(!ismobiles){
$(document).on('scroll', function () {
var st = $(document).scrollTop()
//阴影
$('.header')[st>0?'addClass':'removeClass']('shadow')
//首页切换header
if($('.page-index').length>0){
var navT = $('.section-news').offset().top - 80;
if(st>=navT){
$('.header-index').addClass('hide')
$('.header-main').removeClass('hide')
}else{
$('.header-index').removeClass('hide')
$('.header-main').addClass('hide')
}
//数字动画
if(st>= 2022 && !hasInitNumberAni){
hasInitNumberAni = true;
$('ul.status li span').each(function(){
animateNum($(this), $(this).data('num'))
})
}
}
if (st > $('.header').eq(0).outerHeight()) {
$('.tools').addClass('on')
} else {
$('.tools').removeClass('on')
}
})
//文章
if ($(".page-news").length) {
changefontsize();
$("#qrcode").qrcode(location.href);
}
}
//mobiles
else{
$("body>.page").css(
"min-height",
window.screen.availHeight -
$("body>.footer").outerHeight()
);
if($('.page-renyuanlist').length){
$('.tabs').data('top', $('.tabs').offset().top);
}
$(document).on('scroll', function () {
var st = $(document).scrollTop()
if (st > $('#body>.header').outerHeight()) {
$('.tools').addClass('on')
} else {
$('.tools').removeClass('on')
}
if($('.page-renyuanlist').length){
if(st>=$('.tabs').data('top')){
$('.tabs').addClass('fixed');
}else{
$('.tabs').removeClass('fixed');
}
}
})
if ($('div.pages').length) {
$('.page-jigou ul.links li,.page-duiwu ul.links li').each(function(){
if($(this).index()< $(this).parent().find('li').length-1 && $(this).find('a').width() + 20<$(this).width()/2){
$(this).addClass('half')
}
})
function setCurrent(a) {
var index = 0
a = a || location.hash
if (a) {
index = $('#nav a[href="' + a + '"]')
.parent()
.index()
}
$('#nav .swiper-slide,.pages>div').removeClass('on')
$('#nav .swiper-slide').eq(index).addClass('on')
$('.pages>div').eq(index).addClass('on')
return index;
}
window.addEventListener(
'hashchange',
function () {
setCurrent()
},
false
)
var navSwiper = new Swiper('#nav', {
slidesPerView: $('#nav').data('count') || 4,
freeMode: true,
on: {
tap: function (e) {
tapCallback(e, this, this.clickedIndex, tSpeed)
},
},
})
navSwiper.$el.on('touchstart', function (e) {
e.preventDefault()
})
var index = setCurrent()
tapCallback({}, navSwiper, index, 0, 'init')
}
if ($("ul.pages").length>0) {
$(".loadWrap>ul:eq(0)").addClass('loadNewsList')
jQuery.ias({
container: '.loadWrap>ul:eq(0)',
item: "li",
pagination: "ul.pages",
cur: ".page-active",
next: ".page",
loader:
'正在加载更多,请稍后...
',
time: 1000,
end: function () {
$('.loadWrap>ul:eq(0)').append(
''
);
},
});
}
if(window.showBody) window.showBody();
}
//swiper
$('.swiper-container').each(function(){
if($(this).attr('id') == 'nav') return;
var option = {
loop: true,
pagination: {
el: $(this).parent().find(".pagination"),
clickable: true,
},
}
var count = $(this).data('count')
var autoplay = $(this).data('autoplay')
if (count == 'auto') {
option.slidesPerView= count
} else if (count) {
option.slidesPerView= Number(count)
}
if (autoplay) {
option.autoplay = {
delay: Number(autoplay),
}
}
//选项卡
if ($(this).parents('.tabs-nav').length) {
$('.tabs-nav .swiper-slide', $(this).parents('.tabs'))
.eq(0)
.addClass('on')
$('.tabs-content .tabs-item', $(this).parents('.tabs'))
.eq(0)
.addClass('on')
option.loop = false
option.freeMode = true
option.on = {
tap: function (e) {
var _clientWidth = this.width
var _navSlideWidth = this.slides[this.clickedIndex].clientWidth
var _navWidth = this.navWidth
if (!_navWidth) {
var w = 0
for (var i = 0; i < this.slides.length; i++) {
w += this.slides[i].clientWidth
}
this.navWidth = w
_navWidth = w
}
this.$wrapperEl.find('.swiper-slide').removeClass('on')
this.$wrapperEl
.find('.swiper-slide')
.eq(this.clickedIndex)
.addClass('on')
this.$wrapperEl.parents('.tabs').find('.tabs-item').removeClass('on')
this.$wrapperEl
.parents('.tabs')
.find('.tabs-item')
.eq(this.clickedIndex)
.addClass('on')
var navActiveSlideLeft =
this.$wrapperEl.find('.swiper-slide').eq(this.clickedIndex).offset()
.left - this.getTranslate()
this.setTransition(tSpeed)
if (
navActiveSlideLeft <
(_clientWidth - parseInt(_navSlideWidth)) / 2
) {
this.setTranslate(0)
} else if (
navActiveSlideLeft >
_navWidth - (parseInt(_navSlideWidth) + _clientWidth) / 2
) {
this.setTranslate(_clientWidth - _navWidth)
} else {
this.setTranslate(
(_clientWidth - parseInt(_navSlideWidth)) / 2 - navActiveSlideLeft
)
}
},
}
}
var _swiper = new Swiper($(this), option)
if ($(this).parents('.tabs-nav').length) {
_swiper.$el.on('touchstart', function (e) {
e.preventDefault()
})
tabSwipers.push(_swiper)
}
})
$('.tabs-tit li').on('click', function(){
var index = $(this).index();
var $parent = $(this).parents('.tabs')
$('.tabs-tit li, .tabs-content .tabs-item', $parent).removeClass('on')
$('.tabs-tit li:eq('+index+'), .tabs-content .tabs-item:eq('+index+')', $parent).addClass('on')
})
$('.steps span').on('click', function(){
var index = $(this).index();
$('.steps span, .box .content>div').removeClass('on')
$('.steps span:eq('+index+'), .box .content>div:eq('+index+')').addClass('on')
})
//图片自适应
$(".img img").jqthumb({
classname: "jqthumb",
width: "100%",
height: "100%",
});
if($('.page-newslist').length>0){
$('.content .left ul li').removeClass('on');
}
})
function tapCallback(e, that, index, speed, key){
if(index==0&& key == 'init') return;
index = !index?that.clickedIndex:index;
var _clientWidth = that.width
var _navSlideWidth = that.slides[index].clientWidth
var _navWidth = that.navWidth
if (!_navWidth) {
var w = 0
for (var i = 0; i < that.slides.length; i++) {
w += that.slides[i].clientWidth
}
that.navWidth = w
_navWidth = w
}
location.hash = $('#nav a').eq(index).attr('href')
var navActiveSlideLeft =
that.$wrapperEl.find('.swiper-slide').eq(index).offset()
.left - that.getTranslate()
that.setTransition(speed)
if (
navActiveSlideLeft <
(_clientWidth - parseInt(_navSlideWidth)) / 2
) {
that.setTranslate(0)
} else if (
navActiveSlideLeft >
_navWidth - (parseInt(_navSlideWidth) + _clientWidth) / 2
) {
that.setTranslate(_clientWidth - _navWidth)
} else {
that.setTranslate(
(_clientWidth - parseInt(_navSlideWidth)) / 2 - navActiveSlideLeft
)
}
}
var currentSize = 1;
function changefontsize(thisSize) {
if(!thisSize){
currentSize++;
if(currentSize>3) currentSize = 1;
thisSize = currentSize
}
if (thisSize == 3) {
$("#content,.article-desc").css("font-size", "24px")
$("#content").attr("class", "content3");
$("#content").css("line-height", "40px").attr("class", "content3");
$("#content").css("font-family", "微软雅黑").attr("class", "content3");
}
if (thisSize == 2) {
$(".article-desc").css("font-size", "22px")
$("#content").css("font-size", "18px")
$("#content").attr("class", "content2");
$("#content").css("line-height", "2em").attr("class", "content2");
$("#content").css("font-family", "微软雅黑").attr("class", "content2");
}
if (thisSize == 1) {
$("#content,.article-desc").css("font-size", "14px")
$("#content").attr("class", "content1");
$("#content").css("line-height", "24px").attr("class", "content1");
$("#content").css("font-family", "微软雅黑").attr("class", "content1");
}
}
function showShare(){
$('html,body').animate({
scrollTop:$('body').height()
})
}
function resizeImg($el) {
$el.find(".img").each(function () {
if($(this).find(".jqthumb").length == 0) {
$(this).find("img").addClass("jqthumb")
$(this).find("img").jqthumb({
classname: "jqthumb",
width: "100%",
height: "100%",
});
}
});
}
function toHome(){
location.replace('/');
}
function toBack() {
if(document.referrer.indexOf(location.origin)!=-1){
history.back();
}else{
toHome();
}
}
function toTop() {
$('html,body').animate({
scrollTop: 0,
})
}
function renderHeader(pageClass) {
var html = ''
if (ismobiles) {
if(pageClass == 'page-index'||pageClass == 'page-lanmu'){
html = ''
}else{
html = ''
}
} else {
var showShadow = pageClass == 'page-news' || pageClass.indexOf('list')!=-1;
html = ''+
'

'+
'
'+
'
'+
'
'
if(pageClass == 'page-index'){
html = html.split('header-main').join('header-main hide')
html+=''
}
}
document.write(html);
}
function renderFooter(pageClass) {
var html = '';
if (ismobiles) {
html = ''+
''
} else {
if(pageClass == 'page-index'){
html = ''
}else{
html = ''
}
}
document.write(html);
}
function menuShow(){
$(".menu-modal").addClass("on");
}
function menuHide(){
$(".menu-modal").removeClass("on");
}
function renderSubLanmu(arr){
if(arr.length == 0) return '';
var html = '';
for(var i=0;i'+arr[i]+''
}
html+='
'
return html;
}
function animateNum($dom, val){
var obj = {num1: Number($dom.text().split(',').join(''))};
TweenMax.to(obj, 3, {
num1: val,
onUpdate:function(){
$dom.text(Math.ceil(Number(obj.num1)).toLocaleString())
},
delay: 0
});
}
;(function ($) {
$.ias = function (options) {
// setup
var opts = $.extend({}, $.ias.defaults, options)
var util = new $.ias.util() // utilities module
var paging = new $.ias.paging() // paging module
var hist = opts.history ? new $.ias.history() : false // history module
var _self = this
// initialize
init()
/**
* Initialize
*
* - tracks scrolling through pages
* - remembers current page with the history module
* - setup scroll event and hides pagination element
* - loads and scrolls to previous page when we have something in our history
*
* @return self
*/
function init() {
// track page number changes
paging.onChangePage(function (pageNum, scrollOffset, pageUrl) {
if (hist) hist.setPage(pageNum, pageUrl)
// call onPageChange event
opts.onPageChange.call(this, pageNum, pageUrl, scrollOffset)
})
// setup scroll and hide pagination
reset()
// load and scroll to previous page
if (hist && hist.havePage()) {
stop_scroll()
pageNum = hist.getPage()
util.forceScrollTop(function () {
if (pageNum > 1) {
paginateToPage(pageNum)
curTreshold = get_scroll_treshold(true)
$('html,body').scrollTop(curTreshold)
} else {
reset()
}
})
}
return _self
}
/**
* Reset scrolling and hide pagination links
*
* @return void
*/
function reset() {
hide_pagination()
$(window).scroll(scroll_handler)
}
/**
* Scroll event handler
*
* @return void
*/
function scroll_handler() {
scrTop = $(window).scrollTop()
wndHeight = $(window).height()
curScrOffset = scrTop + wndHeight
if (curScrOffset >= get_scroll_treshold()) {
paginate(curScrOffset)
}
}
/**
* Cancel scrolling
*
* @return void
*/
function stop_scroll(callback) {
$(window).unbind('scroll', scroll_handler)
callback && callback()
}
/**
* Hide pagination
*
* @return void
*/
function hide_pagination() {
$(opts.pagination).hide()
}
/**
* Get scroll treshold based on the last item element
*
* @param boolean pure indicates if the tresholdMargin should be applied
* @return integer treshold
*/
function get_scroll_treshold(pure) {
el = $(opts.container).find(opts.item).last()
if (el.size() == 0) return 0
treshold = el.offset().top + el.height()
if (!pure) treshold += opts.tresholdMargin
return treshold
}
/**
* Load the items from the next page.
*
* @param int curScrOffset current scroll offset
* @param function onCompleteHandler callback function
* @return void
*/
function paginate(curScrOffset, onCompleteHandler) {
var $next
if (opts.cur) {
$next = $(opts.cur).next(opts.next)
if (!$next.attr('href')) {
$next = $next.find('a')
}
} else {
$next = $(opts.next).next('a')
}
if (isNaN(Number($next.text()))) return stop_scroll()
urlNextPage = $next.attr('href')
if (!urlNextPage) return stop_scroll()
paging.pushPages(curScrOffset, urlNextPage)
stop_scroll()
show_loader()
loadItems(urlNextPage, function (data, items) {
// call the onLoadItems callback
result = opts.onLoadItems.call(this, items)
if (result !== false) {
$(items).hide() // at first, hide it so we can fade it in later
// insert them after the last item with a nice fadeIn effect
curLastItem = $(opts.container).find(opts.item).last()
curLastItem.after(items)
$(items).fadeIn()
}
// update pagination
$(opts.pagination).replaceWith($(opts.pagination, data))
remove_loader()
reset()
// call the onRenderComplete callback
opts.onRenderComplete.call(this, items)
if (onCompleteHandler) onCompleteHandler.call(this)
var $nextN
if (opts.cur) {
$nextN = $(opts.cur).next(opts.next)
if (!$nextN.attr('href')) {
$nextN = $nextN.find('a')
}
} else {
$nextN = $(opts.next).next('a')
}
if (
opts['end'] &&
(isNaN(Number($nextN.text())) || !$nextN.attr('href'))
) {
opts['end']()
}
})
}
/**
* Loads items from certain url, triggers
* onComplete handler when finished
*
* @param string the url to load
* @param function the callback function
* @return void
*/
function loadItems(url, onCompleteHandler) {
var items = []
$.get(
url,
null,
function (data) {
// walk through the items on the next page
// and add them to the items array
var t = /]*>([\s\S]*)<\/body>/.exec(data)
if (t && t.length === 2) {
t = t[1]
t = '' + t + '
'
} else {
t = ''
}
data = $(t)
$(opts.container, data)
.find(opts.item)
.each(function () {
items.push(this)
})
if (onCompleteHandler) onCompleteHandler.call(this, data, items)
},
'html'
)
}
/**
* Paginate to a certain page number.
*
* - keeps paginating till the pageNum is reached
*
* @return void
*/
function paginateToPage(pageNum) {
curTreshold = get_scroll_treshold(true)
if (curTreshold > 0) {
paginate(curTreshold, function () {
stop_scroll()
if (paging.getCurPageNum(curTreshold) + 1 < pageNum) {
paginateToPage(pageNum)
$('html,body').animate({ scrollTop: curTreshold }, 400, 'swing')
} else {
$('html,body').animate({ scrollTop: curTreshold }, 1000, 'swing')
reset()
}
})
}
}
/**
* Return the active loader of creates a new loader
*
* @return object loader jquery object
*/
function get_loader() {
loader = $('.ias_loader')
if (loader.size() == 0) {
loader = $("" + opts.loader + '
')
$('.page-news-list .content').append(loader)
loader.hide()
}
return loader
}
/**
* Inserts the loader and does a fadeIn.
*
* @return void
*/
function show_loader(selector) {
loader = get_loader()
window['loaderTimer'] && window.clearTimeout(window['loaderTimer'])
loader.show()
}
/**
* Removes the loader.
*
* return void
*/
function remove_loader() {
loader = get_loader()
window['loaderTimer'] = setTimeout(function () {
loader.hide()
}, 500)
}
}
/**
* Debug to console when available
*
* @param object $obj
* @return
*/
function debug($obj) {
if (window.console && window.console.log) window.console.log($obj)
}
// plugin defaults
$.ias.defaults = {
container: '#container',
item: '.item',
pagination: '#pagination',
next: '.next',
loader: '
',
tresholdMargin: 0,
history: true,
onPageChange: function () {},
onLoadItems: function () {},
onRenderComplete: function () {},
}
// utility module
$.ias.util = function () {
// setup
var wndIsLoaded = false
var forceScrollTopIsCompleted = false
var self = this
// initialize
init()
/**
* Initialize
*
* @return void
*/
function init() {
$(window).load(function () {
wndIsLoaded = true
})
}
/**
* Force browsers to scroll to top.
*
* - When you hit back in you browser, it automatically scrolls
* back to the last position. There is no way to stop this
* in a nice way, so this function does it the hard way.
*
* @param function onComplete callback function
* @return void
*/
this.forceScrollTop = function (onCompleteHandler) {
$('html,body').scrollTop(0)
if (!forceScrollTopIsCompleted) {
if (!wndIsLoaded) {
setTimeout(function () {
self.forceScrollTop(onCompleteHandler)
}, 1)
} else {
onCompleteHandler.call()
forceScrollTopIsCompleted = true
}
}
}
}
// paging module
$.ias.paging = function () {
// setup
var pagebreaks = [[0, document.location.toString()]]
var changePageHandler = function () {}
var lastPageNum = 1
// initialize
init()
/**
* Initialize
*
* @return void
*/
function init() {
$(window).scroll(scroll_handler)
}
/**
* Scroll handler
*
* - Triggers changePage event
*
* @return void
*/
function scroll_handler() {
scrTop = $(window).scrollTop()
wndHeight = $(window).height()
curScrOffset = scrTop + wndHeight
curPageNum = getCurPageNum(curScrOffset)
curPagebreak = getCurPagebreak(curScrOffset)
if (lastPageNum != curPageNum) {
changePageHandler.call(
this,
curPageNum,
curPagebreak[0] /*scrOffset*/,
curPagebreak[1] /*urlPage*/
) // @todo fix for window height
}
lastPageNum = curPageNum
}
/**
* Returns current page number based on scroll offset
*
* @param int scroll offset
* @return int current page number
*/
function getCurPageNum(scrollOffset) {
for (i = pagebreaks.length - 1; i > 0; i--) {
if (scrollOffset > pagebreaks[i][0]) {
return i + 1
}
}
return 1
}
/**
* Public function for getCurPageNum
*
* @return int current page number
*/
this.getCurPageNum = function (scrollOffset) {
return getCurPageNum(scrollOffset)
}
/**
* Returns current pagebreak information based on scroll offset
*
* @param int scroll offset
* @return array pagebreak information
*/
function getCurPagebreak(scrollOffset) {
for (i = pagebreaks.length - 1; i >= 0; i--) {
if (scrollOffset > pagebreaks[i][0]) {
return pagebreaks[i]
}
}
return null
}
/**
* Sets onchangePage event handler
*
* @param function event handler
* @return void
*/
this.onChangePage = function (fn) {
changePageHandler = fn
}
/**
* pushes the pages tracker
*
* @param int scroll offset for the new page
* @return void
*/
this.pushPages = function (scrollOffset, urlNextPage) {
pagebreaks.push([scrollOffset, urlNextPage])
}
}
// history module
$.ias.history = function () {
// setup
var isPushed = false
var isHtml5 = false
// initialize
init()
/**
* Initialize
*
* @return void
*/
function init() {
isHtml5 = !!(window.history && history.pushState && history.replaceState)
isHtml5 = false // html5 functions disabled due to problems in chrome
}
/**
* Sets page to history
*
* @return void;
*/
this.setPage = function (pageNum, pageUrl) {
this.updateState({ page: pageNum }, '', pageUrl)
}
/**
* Checks if we have a page set in the history
*
* @return bool returns true when we have a previous page, false otherwise
*/
this.havePage = function () {
return this.getState() != false
}
/**
* Gets the previous page from history
*
* @return int page number of previous page
*/
this.getPage = function () {
if (this.havePage()) {
stateObj = this.getState()
return stateObj.page
}
return 1
}
/**
* Returns current state
*
* @return object stateObj
*/
this.getState = function () {
if (isHtml5) {
stateObj = history.state
if (stateObj && stateObj.ias) return stateObj.ias
} else {
haveState = window.location.hash.substring(0, 7) == '#/page/'
if (haveState) {
pageNum = parseInt(window.location.hash.replace('#/page/', ''))
return { page: pageNum }
}
}
return false
}
/**
* Pushes state when not pushed already, otherwise
* replaces the state.
*
* @param obj stateObj
* @param string title
* @param string url
* @return void
*/
this.updateState = function (stateObj, title, url) {
if (isPushed) {
this.replaceState(stateObj, title, url)
} else {
this.pushState(stateObj, title, url)
}
}
/**
* Pushes state to history.
*
* @param obj stateObj
* @param string title
* @param string url
* @return void
*/
this.pushState = function (stateObj, title, url) {
if (isHtml5) {
history.pushState({ ias: stateObj }, title, url)
} else {
hash = stateObj.page > 0 ? '#/page/' + stateObj.page : ''
window.location.hash = hash
}
isPushed = true
}
/**
* Replaces current history state.
*
* @param obj stateObj
* @param string title
* @param string url
* @return void
*/
this.replaceState = function (stateObj, title, url) {
if (isHtml5) {
history.replaceState({ ias: stateObj }, title, url)
} else {
this.pushState(stateObj, title, url)
}
}
}
})(jQuery);