define("/Assets/enp/v2/js/ebg-module/ebg-module-direct-seeding.js", function (require, factory) {
if ($('.ebg-module-direct-seeding').length > 0) {
var winW = $(window).width();
$('.ebg-module-direct-seeding').each(function () {
// 获取对象
var _this = $(this);
var dConObjLength = _this.find('.d-con').length;
// 如果有多个视频,就添加class .multiple-videos控制样式显示。
if (dConObjLength > 1) {
_this.addClass('multiple-videos');
// 显示内容。默认不显示。off是控制整体高度。为防止内容左右显示的时候抖动问题
_this.addClass('off');
// pcdaunt获取高度
if (winW > 1200) {
// 获取左边高度,赋值给右边
var leftConH = _this.find('.direct-seeding').height();
// console.log(leftConH)
_this.find(".more-video").height(leftConH);
_this.find(".v-title").css("text-align", "left")
// 获取右边title高度
var titleH = _this.find('.more-video .more-title').outerHeight();
// 判断按钮是否有链接,如果没有就不显示。如果有就获取高度
if (_this.find('.more-video .living-now .now').attr('href') != '') {
// 有链接,显示
_this.find('.more-video .living-now').show();
// 获取按钮高度
var bthH = _this.find('.more-video .living-now').outerHeight();
_this.find('.more-video .more-list').height(leftConH - bthH - titleH);
} else {
// 没链接
_this.find('.more-video .more-list').height(leftConH - titleH - 20);
}
} else {
// 判断按钮是否有链接,如果没有就不显示。
if (_this.find('.more-video .living-now .now').attr('href') != '') {
// 有链接,显示
_this.find('.more-video .living-now').show();
_this.find('.direct').css("padding-bottom", "60px");
}
// 设置移动端list的横向width
_this.find('.scroll-list').width(dConObjLength * _this.find('.d-con').width()).addClass('wapflxd');
if (_this.find(".d-con").length === 2) {
_this.find(".d-con").css("width", "50%")
_this.find(".scroll-list").css("margin-right", "0")
_this.find(".wapflxd").css("width", "100%")
}
}
} else {
// 显示内容。默认不显示。off是控制整体高度。为防止内容左右显示的时候抖动问题
_this.addClass('off');
if (winW > 1200) {
_this.find(".annotation").css("padding-left", "13%")
}
// 下面的a链接是否存在
if (_this.find('.ebg-btn-box a').length > 0) {
// 显示a
_this.find('.ebg-btn-box').show();
}
}
// 添加点击事件
_this.find('.more-video .d-con').on('click', function () {
// 给当前点击添加高亮
$(this).addClass('active').siblings().removeClass('active');
// 点击当前的按钮链接是什么类型
var cType = $(this).data('type');
if (cType == 'iframe') {
// 先清空之前的内容再进行添加
_this.find('.direct-seeding .video-box').empty().append('');
} else if (cType == 'video') {
// 先清空之前的内容再进行添加
_this.find('.direct-seeding .video-box').empty().append('');
} else if (cType == 'link') {
window.location.href = $(this).data('url');
}
});
// 页面初始化,默认点击第一个按钮
_this.find('.more-video .d-con').eq(0).trigger('click');
})
}
});