// document.write("");
// document.write("");
// document.write("");
document.write("");
$(function () {
// 领导团队
$(".odf li").hover(function () {
var index = $(this).index();
$(this).addClass("active").siblings().removeClass("active");
$(".reo .reokk").eq(index).show().siblings().hide();
})
// -------------------------------- 网站群----------------------------------------------------------------------//
$(".wzq-lanmu span").click(function (e) {
if ($(this).parents(".wzq-title").next(".wzq-sub")[0].style.display == "none" || $(this).parents(".wzq-title").next(".wzq-sub")[0].style.display == "") {
$(this).parents("li").siblings("li").find(".wzq-title").removeClass("active")
$(this).parents("li").siblings("li").find(".wzq-sub").slideUp(300)
$(this).parents(".wzq-title").addClass("active")
$(this).parents(".wzq-title").next(".wzq-sub").slideDown(300)
} else {
$(this).parents(".wzq-title").removeClass("active")
$(this).parents(".wzq-title").next(".wzq-sub").slideUp(300)
}
ba
})
// ---------------------------------- 首页-------------------------------------------------------------//
if ($("body.sy").length == 1) {
// 删除阻止移动端滑动的样式
if ($(window).width() <= 768) {
$(".swiper-no-swiping").removeClass("swiper-no-swiping");
$(".xwzx-rt .swiper-wrapper .swiper-slide:last-child").remove();
$(".content4-lf .swiper-wrapper .swiper-slide:last-child").remove()
}
// banner
if ($(".banner .swiper-slide").length = 1) {
$(".banner .swiper-button-next,.swiper-button-prev").addClass("rmdk");
var bannerswiper = new Swiper('.banner .swiper-container', {
slidesPerView: 1,
loop: false,
});
}
if ($(".banner .swiper-slide").length > 1) {
$(".banner .swiper-button-next,.swiper-button-prev").removeClass("rmdk");
var bannerswiper = new Swiper('.banner .swiper-container', {
slidesPerView: 1,
loop: true,
autoplay: {
delay: 2500,
disableOnInteraction: false,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
}
if ($(".banner").length > 0) {
bannerswiper.el.onmouseover = function () {
bannerswiper.autoplay.stop();
}
bannerswiper.el.onmouseout = function () {
bannerswiper.autoplay.start();
}
}
// 通知公告
var newsletterswiper = new Swiper('.txtScroll-left1', {
slidesPerView: 1,
loop: true,
autoplay: {
delay: 2500,
disableOnInteraction: false,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
newsletterswiper.el.onmouseover = function () {
newsletterswiper.autoplay.stop();
}
newsletterswiper.el.onmouseout = function () {
newsletterswiper.autoplay.start();
}
// 新闻资讯
$(".xwzx-title").each(function () {
$(this).find("li:first-child").addClass("active");
$(this).next(".xwzx-m").find("li:first-child").addClass("block");
})
// 轮播
var xwswiper = new Swiper('.picScrolls1', {
slidesPerView: 1,
loop: true,
pagination: {
el: '.swiper-pagination',
clickable: true,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
if ($(window).width() <= 768) {
var dian = -$(".xwzx-lf .swiper-pagination").width() / 2;
$(".xwzx-lf .swiper-pagination").css("margin-left", dian)
}
// 新闻列表
var tabItem = $('.tab .xwzx-title li');
var tabItems = $('.tab .xwzx-m li');
var xwzxSwiper = new Swiper('.xwzx-rt .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
changeTab(n);
}
}
})
//tab点击切换silde
tabItem.hover(function () {
var ind = $(this).index();
changeTab(ind);
xwzxSwiper.slideTo(ind);
})
//tab切换样式
function changeTab(index) {
tabItem.removeClass('active').eq(index).addClass('active');
tabItems.removeClass('block').eq(index).addClass('block');
}
// 专题专栏
var wid = $(window).width();
if (wid <= 480) {
var slideBoxswiper = new Swiper('.swiper-container.slideBox', {
slidesPerView: 2,
loop: true,
spaceBetween: 10,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
} else {
var slideBoxswiper = new Swiper('.swiper-container.slideBox', {
slidesPerView: 3,
loop: true,
spaceBetween: 10,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
}
// 主营业务
$(".zyyw-lf ul").each(function () {
$(this).find("li:first-child").addClass("active");
$(this).find(".active").css("opacity", "1");
})
if ($(window).width() > 768) {
$(".zyyw-lf ul li").hover(function () {
$(this).addClass("active").siblings().removeClass("active");
var index = $(this).index();
$(this).parents(".zyyw-lf").next(".zyyw-rt").find(".swiper-slide").eq(index).show().siblings().hide();
})
}
if ($(window).width() <= 768) {
var zyyw = $('.zyyw-lf ul li');
var zyywSwiper = new Swiper('.zyyw-rt', {
autoplay: false,
loop: true,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex - 1;//过渡后的slide索引
if (n == 6) {
changeTabs(0);
} else {
changeTabs(n);
}
}
}
})
zyyw.click(function () {
var ind = $(this).index();
changeTabs(ind);
zyywSwiper.slideTo(ind + 1);
})
function changeTabs(index) {
zyyw.removeClass('active').eq(index).addClass('active');
}
}
// 企业推介
$(".qytj-title").each(function () {
$(this).find("li:first-child").addClass("active");
$(this).next(".qytj-m").find("li:first-child").addClass("block");
})
if ($(window).width() <= 768) {
$(".qytj-list").find("li:first-child").removeClass("active")
}
// 左侧
var qytjlf = $('.content4-lf .qytj-title li');
var qytjlfs = $('.content4-lf .qytj-m li');
var qytjlfSwiper = new Swiper('.content4-lf .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
qytjlfTab(n);
}
}
})
qytjlf.hover(function () {
var ind = $(this).index();
qytjlfTab(ind);
qytjlfSwiper.slideTo(ind);
})
function qytjlfTab(index) {
qytjlf.removeClass('active').eq(index).addClass('active');
qytjlfs.removeClass('block').eq(index).addClass('block');
}
// 右侧
var qytjrt = $('.content4-rt .qytj-title li');
var qytjrts = $('.content4-rt .qytj-m li');
var qytjrtSwiper = new Swiper('.content4-rt .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
qytjrtTab(n);
}
}
})
qytjrt.hover(function () {
var ind = $(this).index();
qytjrtTab(ind);
qytjrtSwiper.slideTo(ind);
})
function qytjrtTab(index) {
qytjrt.removeClass('active').eq(index).addClass('active');
qytjrts.removeClass('block').eq(index).addClass('block');
}
// 图片中心
$(".pic-title").each(function () {
$(this).find("li:first-child").addClass("active");
$(this).next(".pic-m").find("li:first-child").addClass("block");
})
var pic = $('.content5 .pic-title li');
var pics = $('.content5 .pic-m li');
var picSwiper = new Swiper('.content5 .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
picTab(n);
}
}
})
pic.hover(function () {
var ind = $(this).index();
picTab(ind);
picSwiper.slideTo(ind);
})
function picTab(index) {
pic.removeClass('active').eq(index).addClass('active');
pics.removeClass('block').eq(index).addClass('block');
}
// 股票切换
var newsletterswiper2 = new Swiper('.txtScroll-left2', {
slidesPerView: 1,
loop: true,
autoplay: {
delay: 2500,
disableOnInteraction: false,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
newsletterswiper2.el.onmouseover = function () {
newsletterswiper2.autoplay.stop();
}
newsletterswiper2.el.onmouseout = function () {
newsletterswiper2.autoplay.start();
}
// 股票A股
var elementsa = v_s_sh601868.split("~");
var nowValuea = elementsa[3];
var NnowValuea = new Number(nowValuea).toFixed(2);
var changeValue1a = elementsa[5];
var NchangeValue1a = new Number(changeValue1a).toFixed(2);
if (changeValue1a >= 0) {
$(".newsletter-rt .swiper-slide").each(function () {
$(this).find(".ag1").html(NnowValuea + '(CNY)');
$(this).find(".ag2").html(NchangeValue1a + ' %');
})
} else {
$(".newsletter-rt .swiper-slide").each(function () {
$(this).find(".ag1").html(NnowValuea + '(CNY)');
$(this).find(".ag2").html(NchangeValue1a + ' %');
$(this).find(".ag2").css("color", "#1db336");
$(this).find(".ag1").css({
"color": "#1db336",
"background": "url(/picture/886/2109071056309479229.png)no-repeat right",
"background-size": "contain"
});
})
}
// 股票H股
var elements = v_s_hk03996.split("~");
var nowValue = elements[3];
var NnowValue = new Number(nowValue).toFixed(2);
var changeValue1 = elements[5];
var NchangeValue1 = new Number(changeValue1).toFixed(2);
if (changeValue1 >= 0) {
$(".newsletter-rt .swiper-slide").each(function () {
$(this).find(".hg1").html(NnowValue + '(HKD)');
$(this).find(".hg2").html(NchangeValue1 + ' %');
})
} else {
$(".newsletter-rt .swiper-slide").each(function () {
$(this).find(".hg1").html(NnowValue + '(HKD)');
$(this).find(".hg2").html(NchangeValue1 + ' %');
$(this).find(".hg2").css("color", "#1db336");
$(this).find(".hg1").css({
"color": "#1db336",
"background": "url(/picture/886/2109071056309479229.png)no-repeat right",
"background-size": "contain"
});
})
}
}
// ---------------------------------- 企业推介-------------------------------------------------------------//
if ($("body.qytj").length == 1) {
// 企业推介子栏目
$(".content-nav").each(function () {
$(this).find("li:first-child").addClass("active");
$(this).find(".active").css("opacity", "1");
})
if ($(window).width() <= 768) {
var qytj = $('.content-nav li');
var qytjSwiper = new Swiper('.content-detail', {
autoplay: false,
loop: true,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex - 1;//过渡后的slide索引
if (n == 4) {
qytjTab(0);
} else {
qytjTab(n);
}
}
}
})
qytj.hover(function () {
var ind = $(this).index();
qytjTab(ind);
qytjSwiper.slideTo(ind + 1);
})
function qytjTab(index) {
qytj.removeClass('active').eq(index).addClass('active');
qytj.css("opacity", "1")
}
} else {
$(".content-nav li").hover(function () {
$(this).addClass("active").siblings().removeClass("active");
$(this).css("opacity", "1")
var index = $(this).index();
$(this).parents(".content-nav").next(".content-detail").find("li").eq(index).show().siblings().hide();
})
}
}
// ---------------------------------- 主营业务-------------------------------------------------------------//
if ($("body.zyyws").length == 1) {
// 主营业务子栏目
if ($(window).width() <= 540) {
$(".zyyw > ul").each(function () {
$(this).find("li:nth-child(2n+2)").css("margin-right", "0")
})
} else {
$(".zyyw > ul").each(function () {
$(this).find("li:nth-child(3n+3)").css("margin-right", "0")
})
}
if ($(window).width() <= 768) {
$(".zyyw > ul li").click(function () {
if ($(this).find(".zyyw-li")[0].style.top == "" || $(this).find(".zyyw-li")[0].style.top == "100%") {
$(this).siblings().find(".zyyw-li").css("top", "100%")
$(this).siblings().css("background", "#f4f7f9 url(images/zyyw-foot.png) no-repeat left bottom")
$(this).css("background", "#f4f7f9 url(images/zyyw-foots.png) no-repeat left bottom")
$(this).find(".zyyw-li").css("top", "0px")
} else {
$(this).css("background", "#f4f7f9 url(images/zyyw-foot.png) no-repeat left bottom")
$(this).find(".zyyw-li").css("top", "100%")
}
})
} else {
$(".zyyw > ul li").hover(function () {
$(this).css("background", "#f4f7f9 url(images/zyyw-foots.png) no-repeat left bottom")
$(this).find(".zyyw-li").css("top", "0")
}, function () {
$(this).css("background", "#f4f7f9 url(images/zyyw-foot.png) no-repeat left bottom")
$(this).find(".zyyw-li").css("top", "100%")
})
}
}
// ---------------------------------- 新闻资讯-------------------------------------------------------------//
if ($("body.xwzxs").length == 1) {
// 删除阻止移动端滑动的样式
if ($(window).width() <= 768) {
$(".swiper-no-swiping").removeClass("swiper-no-swiping")
}
// 删除企业新闻
if ($(window).width() <= 768) {
// $(".xwzx-rt .xwzx-title li:first-child").remove()
// $(".xwzx-rt .xwzx-m li:first-child").remove()
$(".xwzx-rt .swiper-wrapper .swiper-slide:last-child").remove()
}
// 添加class名
$(".xwzx-title").each(function () {
$(this).find("li:first-child").addClass("active");
$(".xwzx-rt .swiper-slide:first-child .xwzx-list").find("li:first-child").addClass("hot");
$(this).next(".xwzx-m").find("li:first-child").addClass("block");
})
if ($(window).width() <= 768) {
$(".xwzx-rt .swiper-slide:first-child .xwzx-list").find("li:first-child").removeClass("hot")
}
// 新闻资讯
// 轮播
var xwswiper = new Swiper('.picScrolls1', {
slidesPerView: 1,
loop: true,
pagination: {
el: '.swiper-pagination',
clickable: true,
},
});
// 新闻列表
var xwzxrt = $('.xwzx-rt .xwzx-title li');
var xwzxrts = $('.xwzx-rt .xwzx-m li');
var xwzxrtSwiper = new Swiper('.xwzx-rt .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
xwzxrtTab(n);
}
}
})
xwzxrt.hover(function () {
var ind = $(this).index();
xwzxrtTab(ind);
xwzxrtSwiper.slideTo(ind);
})
function xwzxrtTab(index) {
xwzxrt.removeClass('active').eq(index).addClass('active');
xwzxrts.removeClass('block').eq(index).addClass('block');
}
// 基层动态
var jcdt = $('.jcdt .xwzx-title li');
var jcdts = $('.jcdt .xwzx-m li');
var jcdtSwiper = new Swiper('.jcdt .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
jcdtTab(n);
}
}
})
jcdt.hover(function () {
var ind = $(this).index();
jcdtTab(ind);
jcdtSwiper.slideTo(ind);
})
function jcdtTab(index) {
jcdt.removeClass('active').eq(index).addClass('active');
jcdts.removeClass('block').eq(index).addClass('block');
}
// 媒体聚焦
var mtjj = $('.mtjj .xwzx-title li');
var mtjjs = $('.mtjj .xwzx-m li');
var mtjjSwiper = new Swiper('.mtjj .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
mtjjTab(n);
}
}
})
mtjj.hover(function () {
var ind = $(this).index();
mtjjTab(ind);
mtjjSwiper.slideTo(ind);
})
function mtjjTab(index) {
mtjj.removeClass('active').eq(index).addClass('active');
mtjjs.removeClass('block').eq(index).addClass('block');
}
// 专题专栏
var wid = $(window).width();
if (wid <= 480) {
var slideBoxswiper = new Swiper('.slideBox', {
slidesPerView: 2,
loop: true,
spaceBetween: 10,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
} else {
var slideBoxswiper = new Swiper('.slideBox', {
slidesPerView: 3,
loop: true,
spaceBetween: 10,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
}
// 行业资讯
var hyzx = $('.content3-lf .xwzx-title li');
var hyzxs = $('.content3-lf .xwzx-m li');
var hyzxSwiper = new Swiper('.content3-lf .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
hyzxTab(n);
}
}
})
hyzx.hover(function () {
var ind = $(this).index();
hyzxTab(ind);
hyzxSwiper.slideTo(ind);
})
function hyzxlfTab(index) {
hyzx.removeClass('active').eq(index).addClass('active');
hyzxs.removeClass('block').eq(index).addClass('block');
}
// 员工风采
var ygfc = $('.content3-rt .xwzx-title li');
var ygfcs = $('.content3-rt .xwzx-m li');
var ygfcSwiper = new Swiper('.content3-rt .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
ygfcTab(n);
}
}
})
ygfc.hover(function () {
var ind = $(this).index();
ygfcTab(ind);
ygfcSwiper.slideTo(ind);
})
function ygfcTab(index) {
ygfc.removeClass('active').eq(index).addClass('active');
ygfcs.removeClass('block').eq(index).addClass('block');
}
// 图片中心
$(".pic-title").each(function () {
$(this).find("li:first-child").addClass("active");
$(this).next(".pic-m").find("li:first-child").addClass("block");
})
var pic = $('.content4 .pic-title li');
var pics = $('.content4 .pic-m li');
var picSwiper = new Swiper('.content4 .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
picTab(n);
}
}
})
pic.hover(function () {
var ind = $(this).index();
picTab(ind);
picSwiper.slideTo(ind);
})
function picTab(index) {
pic.removeClass('active').eq(index).addClass('active');
pics.removeClass('block').eq(index).addClass('block');
}
}
// ---------------------------------- 主营业务-------------------------------------------------------------//
if ($("body.zyyws").length == 1) {
$(".zyyw-title").each(function () {
$(this).find("li:first-child").addClass("active");
})
var zyyw = $('.zyyw-content .zyyw-title li');
var zyywSwiper = new Swiper('.zyyw-text', {
autoplay: false,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
zyywTab(n);
}
}
})
zyyw.hover(function () {
var ind = $(this).index();
zyywTab(ind);
zyywSwiper.slideTo(ind);
})
function zyywTab(index) {
zyyw.removeClass('active').eq(index).addClass('active');
}
}
// ---------------------------------- 信息公开-------------------------------------------------------------//
if ($("body.xxgk").length == 1) {
// 删除阻止移动端滑动的样式
if ($(window).width() <= 768) {
$(".swiper-no-swiping").removeClass("swiper-no-swiping")
}
// 添加class名
$(".xxgk-title").each(function () {
$(this).find("li:first-child").addClass("active");
$(this).next(".xxgk-m").find("li:first-child").addClass("block");
})
// 企业基本信息
// 自适应高度
if ($(window).width() <= 768) {
$(".xxgk .jbxx-txt .gsxx td").each(function (index, obj) {
$(".xxgk .jbxx-txt .gsxx th")[index].style.height = $(obj).innerHeight() + "px"
$(".xxgk .jbxx-txt .gsxx th")[index].style.lineHeight = $(obj).innerHeight() + "px"
});
}
var jbxx = $('.jbxx-sub li');
var oSwiper = new Swiper('#o-c', {
autoHeight: true,
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
jbxxTab(n);
},
setTransition: function (swiper) {
if (this.activeIndex == 1) {
oSwiper.allowTouchMove = false;
// oSwiper.mousewheel.enable();
} else {
oSwiper.allowTouchMove = true;
// oSwiper.mousewheel.disable();
}
}
}
})
var iSwiper = new Swiper('#i-c1', {
scrollbar: {
el: '.swiper-scrollbar',
},
slidesPerView: 'auto',
freeMode: true,
freeModeMomentum: false,
mousewheelSensitivity: 0.5,
on: {
setTransition: function (swiper, translate) {
//translate 一直为0,不可直接用
nowTranslate = swiper.translate;
if (typeof (beforeTranslate) == "undefined") {
beforeTranslate = 0
}
slideWidth = iSwiper.slides[0].scrollWidth;
swiperWidth = iSwiper.width
if (nowTranslate > -2 && nowTranslate > beforeTranslate) {
oSwiper.slideTo(0);
}
if (slideWidth - swiperWidth + nowTranslate < 2 && nowTranslate < beforeTranslate) {
oSwiper.slideTo(2);
}
beforeTranslate = nowTranslate;
},
touchEnd: function (swiper) {
if (iSwiper.translate > 0) {
oSwiper.slideTo(0);
}
if (iSwiper.translate < (iSwiper.width - iSwiper.slides[0].scrollWidth)) {
oSwiper.slideTo(2);
}
}
}
});
jbxx.hover(function () {
var ind = $(this).index();
jbxxTab(ind);
oSwiper.slideTo(ind);
})
$('.jbxx-sub li').eq(0).addClass('active');
function jbxxTab(index) {
jbxx.removeClass('active').eq(index).addClass('active');
}
// 重要人事变动 电子采购平台
var jcdt = $('.jcdt .xxgk-title li');
var jcdts = $('.jcdt .xxgk-m li');
var jcdtSwiper = new Swiper('.jcdt .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
jcdtTab(n);
}
}
})
jcdt.hover(function () {
var ind = $(this).index();
jcdtTab(ind);
jcdtSwiper.slideTo(ind);
})
function jcdtTab(index) {
jcdt.removeClass('active').eq(index).addClass('active');
jcdts.removeClass('block').eq(index).addClass('block');
}
// 改制与重组 产权转让及增资
var mtjj = $('.mtjj .xxgk-title li');
var mtjjs = $('.mtjj .xxgk-m li');
var mtjjSwiper = new Swiper('.mtjj .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
mtjjTab(n);
}
}
})
mtjj.hover(function () {
var ind = $(this).index();
mtjjTab(ind);
mtjjSwiper.slideTo(ind);
})
function mtjjTab(index) {
mtjj.removeClass('active').eq(index).addClass('active');
mtjjs.removeClass('block').eq(index).addClass('block');
}
// 社会责任报告
var wid = $(window).width();
if (wid <= 480) {
var slideBoxswiper = new Swiper('.slideBox', {
slidesPerView: 2,
loop: true,
spaceBetween: 10,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
} else if (wid <= 768) {
var slideBoxswiper = new Swiper('.slideBox', {
slidesPerView: 3,
loop: true,
spaceBetween: 10,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
} else {
var slideBoxswiper = new Swiper('.slideBox', {
slidesPerView: 5,
loop: true,
spaceBetween: 22,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
}
}
// ---------------------------------- 投资者关系-------------------------------------------------------------//
if ($("body.tzzgx").length == 1) {
// 删除阻止移动端滑动的样式
if ($(window).width() <= 768) {
$(".swiper-no-swiping").removeClass("swiper-no-swiping")
}
// 添加class名
$(".tzzgx-title").each(function () {
$(this).find("li:first-child").addClass("active");
$(this).next(".tzzgx-m").find("li:first-child").addClass("block");
})
$(".qxt-title").each(function () {
$(this).find("li:first-child").addClass("active");
})
// 股票信息A股H股切换
var qxt1 = $('.qxt-title2 li');
var qxtSwiper1 = new Swiper('.swiperq', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
qxtTab1(n);
}
}
})
qxt1.hover(function () {
var ind = $(this).index();
qxtTab1(ind);
qxtSwiper1.slideTo(ind);
})
function qxtTab1(index) {
qxt1.removeClass('active').eq(index).addClass('active');
}
// 公告及通函 定期报告 证券变动月报表
var jcdt1 = $('.jcdt1 .tzzgx-title li');
var jcdts1 = $('.jcdt1 .tzzgx-m li');
var jcdtSwiper1 = new Swiper('.jcdt1 .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
jcdtTab1(n);
}
}
})
jcdt1.hover(function () {
var ind = $(this).index();
jcdtTab1(ind);
jcdtSwiper1.slideTo(ind);
})
function jcdtTab1(index) {
jcdt1.removeClass('active').eq(index).addClass('active');
jcdts1.removeClass('block').eq(index).addClass('block');
}
// 分析师研报 投资者服务
var mtjj1 = $('.mtjj1 .tzzgx-title li');
var mtjjs1 = $('.mtjj1 .tzzgx-m li');
var mtjjSwiper1 = new Swiper('.mtjj1 .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
mtjjTab1(n);
}
}
})
mtjj1.hover(function () {
var ind = $(this).index();
mtjjTab1(ind);
mtjjSwiper1.slideTo(ind);
})
function mtjjTab1(index) {
mtjj1.removeClass('active').eq(index).addClass('active');
mtjjs1.removeClass('block').eq(index).addClass('block');
}
// 公告及通函 定期报告 证券变动月报表
var jcdt2 = $('.jcdt2 .tzzgx-title li');
var jcdts2 = $('.jcdt2 .tzzgx-m li');
var jcdtSwiper2 = new Swiper('.jcdt2 .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
jcdtTab2(n);
}
}
})
jcdt2.hover(function () {
var ind = $(this).index();
jcdtTab2(ind);
jcdtSwiper2.slideTo(ind);
})
function jcdtTab2(index) {
jcdt2.removeClass('active').eq(index).addClass('active');
jcdts2.removeClass('block').eq(index).addClass('block');
}
// 分析师研报 投资者服务
var mtjj2 = $('.mtjj2 .tzzgx-title li');
var mtjjs2 = $('.mtjj2 .tzzgx-m li');
var mtjjSwiper2 = new Swiper('.mtjj2 .swiper-containers', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
mtjjTab2(n);
}
}
})
mtjj2.hover(function () {
var ind = $(this).index();
mtjjTab2(ind);
mtjjSwiper2.slideTo(ind);
})
function mtjjTab2(index) {
mtjj2.removeClass('active').eq(index).addClass('active');
mtjjs2.removeClass('block').eq(index).addClass('block');
}
// 股票信息
var qxt = $('.qxt-title1 li');
var qxtSwiper = new Swiper('.tzzgx-rt .swiperm', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
qxtTab(n);
}
}
})
qxt.hover(function () {
var ind = $(this).index();
qxtTab(ind);
qxtSwiper.slideTo(ind);
})
function qxtTab(index) {
qxt.removeClass('active').eq(index).addClass('active');
}
// 股票信息
var qxts = $('.qxt-titles li');
var qxtSwipers = new Swiper('.swipern', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
qxtTabs(n);
}
}
})
qxts.hover(function () {
var ind = $(this).index();
qxtTabs(ind);
qxtSwipers.slideTo(ind);
})
function qxtTabs(index) {
qxts.removeClass('active').eq(index).addClass('active');
}
// 股价A股
var elementsa = v_sh601868.split("~");
var der = v_sh601868.split("~");
// console.log(elementsa)
var da = der[30];
var timeformart = da.substring(0, 4) + "/" + da.substring(4, 6) + "/" + da.substring(6, 8) + " " + da.substring(8, 10) + ":" + da.substring(10, 12) + ":" + da.substring(12, 14);
var timea = der[1] + ' ' + timeformart;
var namea = elementsa[1] + '(601868.SH)';
var changeValuea = new Number(elementsa[32]).toFixed(2);
// var chajiaa = Math.round(elementsa[2] * 10000) / 10000;
var chajiaa = der[31];
var yestodaya = der[4];
var zuigaoa = der[33];
var lowa = der[34];
var amounta = elementsa[6] + '手';
var nowValuea = elementsa[3];
$('.timen').html(timea);
$('.namen').html(namea);
$('.yestodayn').html(yestodaya);
$('.zuigaon').html(zuigaoa);
$('.lown').html(lowa);
$('.amountn').html(amounta);
if (changeValuea >= 0) {
$('.nowValuen').html(nowValuea);
$('.chajian').html('+' + chajiaa);
$('.changeValuen').html('+' + changeValuea + '%');
} else {
$('.nowValuen').html(nowValuea);
$('.chajian').html(chajiaa);
$('.changeValuen').html(changeValuea + '%');
$(".nowValuen").css({
"color": "#1db336",
"background": "url(/picture/886/2109071056309479229.png)no-repeat right"
})
$(".changeValuen").css("color", "#1db336")
$(".chajian").css("color", "#1db336")
}
// 股价H股
var elements = v_hk03996.split("~");
var time = elements[1] + ' ' + elements[30];
var name = elements[1] + '(03996.HK)';
var changeValue = new Number(elements[32]).toFixed(2);
// var chajia = Math.round(elements[7] * 10000) / 10000;
var chajia = new Number(elements[31]).toFixed(2);
var yestoday = elements[4];
var zuigao = elements[33];
var low = elements[34];
var amount = elements[6] + '手';
var nowValue = elements[3];
$('.timek').html(time);
$('.namek').html(name);
$('.yestodayk').html(yestoday);
$('.zuigaok').html(zuigao);
$('.lowk').html(low);
$('.amountk').html(amount);
if (changeValue >= 0) {
$('.nowValuek').html(nowValue);
$('.chajiak').html('+' + chajia);
$('.changeValuek').html('+' + changeValue + '%');
} else {
$('.nowValuek').html(nowValue);
$('.chajiak').html(chajia);
$('.changeValuek').html(changeValue + '%');
$(".nowValuek").css({
"color": "#1db336",
"background": "url(/picture/886/2109071056309479229.png)no-repeat right"
})
$(".changeValuek").css("color", "#1db336")
$(".chajiak").css("color", "#1db336")
}
}
// ---------------------------------- 栏目页-------------------------------------------------------------//
if ($("#lanmu").length == 1) {
if ($(".lanmu-siji ul").eq($(".lanmu-sanji .active").index()).find("li").length > 0) {
$(".lanmu-siji").show()
$(".lanmu-siji ul").eq($(".lanmu-sanji .active").index()).show()
var nub = $(".lanmu-siji ul").eq($(".lanmu-sanji .active").index()).find("li").length
if (nub <= 4) {
$(".lanmu-siji ul").eq($(".lanmu-sanji .active").index()).find("li").width(100 / nub + "%")
} else {
$(".lanmu-siji ul").eq($(".lanmu-sanji .active").index()).find("li").width("25%")
}
}
$(".ldr-name").click(function () {
var num = $(this).parents("li").index()
$(this).parents(".lanmu-ldr").next(".ldr-wz").show()
$(".background").show()
$(this).parents(".lanmu-ldr").next(".ldr-wz").find("li").eq(num).show().siblings().hide()
var height = $(this).parents(".lanmu-ldr").next(".ldr-wz").innerHeight()
$(this).parents(".lanmu-ldr").next(".ldr-wz").css("margin-top", -height / 2)
})
$('.close12').bind('click', function () {
$('.ldr-wz').hide();
$('.background').hide();
});
// 投资者关系
if ($(".lanmu-tzzgx").length == 2) {
// 股价A股
var elementsa = v_sh601868.split("~");
var der = v_sh601868.split("~");
var da = der[30];
var timeformart = da.substring(0, 4) + "/" + da.substring(4, 6) + "/" + da.substring(6, 8) + " " + da.substring(8, 10) + ":" + da.substring(10, 12) + ":" + da.substring(12, 14);
var timea = der[1] + ' ' + timeformart;
var namea = elementsa[1] + '(601868.SH)';
var changeValuea = new Number(elementsa[32]).toFixed(2);
// var chajiaa = Math.round(elementsa[2] * 10000) / 10000;
var chajiaa = der[31];
var yestodaya = der[4];
var zuigaoa = der[33];
var lowa = der[34];
var amounta = elementsa[6] + '手';
var nowValuea = elementsa[3];
$('.timen').html(timea);
$('.namen').html(namea);
$('.yestodayn').html(yestodaya);
$('.zuigaon').html(zuigaoa);
$('.lown').html(lowa);
$('.amountn').html(amounta);
if (changeValuea >= 0) {
$('.nowValuen').html(nowValuea);
$('.chajian').html('+' + chajiaa);
$('.changeValuen').html('+' + changeValuea + '%');
} else {
$('.nowValuen').html(nowValuea);
$('.chajian').html(chajiaa);
$('.changeValuen').html(changeValuea + '%');
$(".nowValuen").css({
"color": "#1db336",
"background": "url(/picture/886/2109071056309479229.png)no-repeat right"
})
$(".changeValuen").css("color", "#1db336")
$(".chajian").css("color", "#1db336")
}
// 股价H股
var elements = v_hk03996.split("~");
var time = elements[1] + ' ' + elements[30];
var name = elements[1] + '(03996.HK)';
var changeValue = new Number(elements[32]).toFixed(2);
var chajia = new Number(elements[31]).toFixed(2);
var yestoday = elements[4];
var zuigao = elements[33];
var low = elements[34];
var amount = elements[6] + '手';
var nowValue = elements[3];
$('.timek').html(time);
$('.namek').html(name);
$('.yestodayk').html(yestoday);
$('.zuigaok').html(zuigao);
$('.lowk').html(low);
$('.amountk').html(amount);
if (changeValue >= 0) {
$('.nowValuek').html(nowValue);
$('.chajiak').html('+' + chajia);
$('.changeValuek').html('+' + changeValue + '%');
} else {
$('.nowValuek').html(nowValue);
$('.chajiak').html(chajia);
$('.changeValuek').html(changeValue + '%');
$(".nowValuek").css({
"color": "#1db336",
"background": "url(/picture/886/2109071056309479229.png)no-repeat right"
})
$(".changeValuek").css("color", "#1db336")
$(".chajiak").css("color", "#1db336")
}
var qxtb = $('.tmbn li');
var qxtSwiper3 = new Swiper('.mnb', {
autoplay: false,
on: {
//swiper从当前slide开始过渡到另一个slide时执行
slideChangeTransitionStart: function () {
var n = this.activeIndex;//过渡后的slide索引
qxtTabb(n);
}
}
})
qxtb.hover(function () {
var ind = $(this).index();
qxtTabb(ind);
qxtSwiper3.slideTo(ind);
})
function qxtTabb(index) {
qxtb.removeClass('active').eq(index).addClass('active');
}
var qxt = $('.qxt-titlembb li');
var qxtSwiper = new Swiper('.mbb', {
autoplay: false,
on: {
slideChangeTransitionStart: function () {
var n = this.activeIndex;
qxtTab(n);
}
}
})
qxt.hover(function () {
var ind = $(this).index();
qxtTab(ind);
qxtSwiper.slideTo(ind);
})
function qxtTab(index) {
qxt.removeClass('active').eq(index).addClass('active');
}
var qxtd = $('.qxt-titlernb li');
var qxtSwiperd = new Swiper('.rnb', {
autoplay: false,
on: {
slideChangeTransitionStart: function () {
var n = this.activeIndex;
qxtTabd(n);
}
}
})
qxtd.hover(function () {
var ind = $(this).index();
qxtTabd(ind);
qxtSwiperd.slideTo(ind);
})
function qxtTabd(index) {
qxtd.removeClass('active').eq(index).addClass('active');
}
}
}
// ---------------------------------- 网站地图-------------------------------------------------------------//
if ($(".wzdt").length > 1) {
$(".wzdt-ej").each(function () {
$(this).find("li").each(function () {
var index = $(this).index()
$(this).parents(".wzdt-ej").next(".wzdt-sj").find("ul").eq(index).css("display", "block")
var eheight = $(this).height()
var sheight = $(this).parents(".wzdt-ej").next(".wzdt-sj").find("ul").eq(index).height()
if (eheight > sheight) {
$(this).parents(".wzdt-ej").next(".wzdt-sj").find("ul").eq(index).height(eheight)
} else {
$(this).height(sheight)
}
})
})
}
// 解决访问为https时无法加载到写死的http路径
https = window.location.protocol;
// if (https === 'https:') {
// const addMeta = (httpEquiv, content) => {
// const meta = document.createElement('meta');
// meta.httpEquiv = httpEquiv;
// meta.content = content;
// document.getElementsByTagName('head')[0].prepend(meta)
// };
//
// addMeta(
// 'content-security-policy',
// 'upgrade-insecure-requests',
// );
// }
if (https === 'https:') {
let meta = document.createElement('meta');
meta.httpEquiv = "content-security-policy";
meta.content = "upgrade-insecure-requests";
document.getElementsByTagName('head')[0].prepend(meta)
}
})