...
|
...
|
@@ -563,44 +563,46 @@ define('yohood', function(require, exports) { |
|
|
html = html.replace("{titleStyle}", titleStyle);
|
|
|
return html;
|
|
|
}
|
|
|
$.ajax({
|
|
|
url: "/news/getdetailnews",
|
|
|
type: "post",
|
|
|
data: {
|
|
|
id: id
|
|
|
},
|
|
|
success: function(data) {
|
|
|
var isVideo, isTitleStyle;
|
|
|
if (data.code == 200) {
|
|
|
//推荐资讯
|
|
|
$.each(data.data.recom, function(i, v) {
|
|
|
isVideo = (v.tag == '视频') ? 1 : 0;
|
|
|
isTitleStyle = (v.main_title_type == 1) ? 1 : 0;
|
|
|
recom += template(v.id, tools.limitWords(v.title, 48), common.getImages(v.thumb, '0230x0230', 'blogimg', 'primary'),
|
|
|
'/news/detail/id/' + v.id, isVideo, isTitleStyle, v.title);
|
|
|
});
|
|
|
$.ajax({
|
|
|
url: "/news/getdetailnews",
|
|
|
type: "post",
|
|
|
data: {
|
|
|
id: id
|
|
|
},
|
|
|
success: function(data) {
|
|
|
var isVideo, isTitleStyle;
|
|
|
if (data.code == 200) {
|
|
|
//推荐资讯
|
|
|
$.each(data.data.recom, function(i, v) {
|
|
|
isVideo = (v.tag == '视频') ? 1 : 0;
|
|
|
isTitleStyle = (v.main_title_type == 1) ? 1 : 0;
|
|
|
recom += template(v.id, tools.limitWords(v.title, 48), common.getImages(v.thumb, '0230x0230', 'blogimg', 'primary'),
|
|
|
'/news/detail/id/' + v.id, isVideo, isTitleStyle, v.title);
|
|
|
});
|
|
|
|
|
|
//热门视频
|
|
|
$.each(data.data.hotVideo, function(i, v) {
|
|
|
isTitleStyle = (v.main_title_type == 1) ? 1 : 0;
|
|
|
hotVideo += template(v.id, v.title, common.getImages(v.thumb, '0230x0230', 'blogimg', 'primary'),
|
|
|
'/news/detail/id/' + v.id, 2, isTitleStyle, v.title);
|
|
|
});
|
|
|
//最新视频
|
|
|
$.each(data.data.lastVideo, function(i, v) {
|
|
|
isTitleStyle = (v.main_title_type == 1) ? 1 : 0;
|
|
|
lastVideo += template(v.id, v.title, common.getImages(v.thumb, '0230x0230', 'blogimg', 'primary'),
|
|
|
'/news/detail/id/' + v.id, 2, isTitleStyle, v.title);
|
|
|
});
|
|
|
$(".post-list").html(recom);
|
|
|
$(".side-related-list").eq(0).html(hotVideo);
|
|
|
$(".side-related-list").eq(1).html(lastVideo);
|
|
|
}
|
|
|
//热门视频
|
|
|
$.each(data.data.hotVideo, function(i, v) {
|
|
|
isTitleStyle = (v.main_title_type == 1) ? 1 : 0;
|
|
|
hotVideo += template(v.id, v.title, common.getImages(v.thumb, '0230x0230', 'blogimg', 'primary'),
|
|
|
'/news/detail/id/' + v.id, 2, isTitleStyle, v.title);
|
|
|
});
|
|
|
//最新视频
|
|
|
$.each(data.data.lastVideo, function(i, v) {
|
|
|
isTitleStyle = (v.main_title_type == 1) ? 1 : 0;
|
|
|
lastVideo += template(v.id, v.title, common.getImages(v.thumb, '0230x0230', 'blogimg', 'primary'),
|
|
|
'/news/detail/id/' + v.id, 2, isTitleStyle, v.title);
|
|
|
});
|
|
|
$(".post-list").html(recom);
|
|
|
$(".side-related-list").eq(0).html(hotVideo);
|
|
|
$(".side-related-list").eq(1).html(lastVideo);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
//现场计划活动
|
|
|
exports.activityPlan = function() {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
//现场计划活动
|
|
|
exports.activityPlan = function()
|
|
|
{
|
|
|
var timestamp = new Date().getTime() / 1000;
|
|
|
$('.site-activity-content').find('.layout-item').each(function() {
|
|
|
$(this).imgZoom({
|
|
|
imgTag: 'pic-tip'
|
...
|
...
|
@@ -615,7 +617,7 @@ define('yohood', function(require, exports) { |
|
|
distance,
|
|
|
eleTop,
|
|
|
tabPositionTop;
|
|
|
$(window).on('scroll', function() {
|
|
|
$(window).on('scroll', function() {
|
|
|
if (tabTop <= $(this).scrollTop()) {
|
|
|
$('.site-activity-tab').css({
|
|
|
"position": "fixed",
|
...
|
...
|
@@ -625,15 +627,12 @@ define('yohood', function(require, exports) { |
|
|
"marginLeft": "356px",
|
|
|
"marginTop": "10px"
|
|
|
})
|
|
|
|
|
|
|
|
|
mainBodyOffsetTop = $('.bd').offset().top;
|
|
|
mainBodyHeight = $('.bd').outerHeight();
|
|
|
tabOffsetHeightTop = oTab.offset().top + oTab.outerHeight();
|
|
|
distance = mainBodyHeight + mainBodyOffsetTop;
|
|
|
eleTop = distance - oTab.outerHeight();
|
|
|
tabPositionTop = 10;
|
|
|
|
|
|
if (tabOffsetHeightTop >= distance) {
|
|
|
oTab.css({
|
|
|
'position': 'absolute',
|
...
|
...
|
@@ -650,11 +649,19 @@ define('yohood', function(require, exports) { |
|
|
$('.site-activity-tab').removeAttr('style');
|
|
|
};
|
|
|
});
|
|
|
//日期自动定位
|
|
|
$(".site-activity-time").each(function()
|
|
|
{
|
|
|
if(timestamp >= $(this).attr("start_time") && timestamp <= $(this).attr("end_time"))
|
|
|
{
|
|
|
$("body").animate({"scrollTop": $(this).offset().top - 50 }, 1000);
|
|
|
return;
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
//视频
|
|
|
exports.video = function() {
|
|
|
//图片转换
|
|
|
imgTransform(".image-box img");
|
|
|
}
|
|
|
}); |
|
|
\ No newline at end of file |
|
|
}); |
...
|
...
|
|