; (function ($) { window.HomeHandler = {}; HomeHandler.ServiceTimeOutId; HomeHandler.InterfaceTimeOutId; HomeHandler.ServiceShowDefaultTimeOutId; //初始化 首页Banner 数据 HomeHandler.getBannerData = function (catalogId, selectorId, urlString) { UserWeb.AjaxHandler.post({ url: urlString, data: { catalogId: catalogId, number: 20 }, noAlert: true, success: function (data) { var $parent = $(selectorId); if (data.length > 0) { $.each(data, function (key, value) { var $html = $('
'); var tempImgUrl = value.ListImage == null || value.ListImage == "" ? "/nami/Content/images/nami-banner.png" : "/nami"+value.ListImage; var tempLinkUrl = value.Chain == null ? "/nami/ArticleDetail/Index?combId=" + value.CategoryId + ',' + value.CategoryId + '&articleId=' + value.Id : value.Chain; $html.find('img').attr('src', tempImgUrl); $html.find('a').attr('href', tempLinkUrl); $parent.append($html); }); } HomeHandler.InitialBannerCarousel($parent); } }); }; //初始化 Banner UX HomeHandler.InitialBannerCarousel = function ($parent) { //banner $parent.owlCarousel({ navSpeed: 300, dotsSpeed: 400, items: 1, autoplay: true, autoplayTimeout: 3000, loop: true, dots: true }); // Custom Navigation Events $(".banner-next,.banner-next-btn").click(function () { $parent.trigger('next.owl.carousel'); }); $(".banner-prev,.banner-prev-btn").click(function () { $parent.trigger('prev.owl.carousel'); }); }; //初始化 首页纳米所介绍 数据 HomeHandler.getSingleArticleData = function (comboId, selectorId, urlString) { UserWeb.AjaxHandler.post({ url: urlString, data: { comboId: comboId }, noAlert: true, success: function (data) { var tempDescription = data.Description != null ? data.Description : "暂无"; if (data.Description != null && data.Description.length > 150) { tempDescription = data.Description.substring(0, 140) + '...'; } $(selectorId).html(tempDescription); } }); }; HomeHandler.getSingleArticleData1 = function (comboId, selectorId, urlString) { UserWeb.AjaxHandler.post({ url: urlString, data: { comboId: comboId }, noAlert: true, success: function (data) { $(selectorId).find('.index-main-panel-info').append(data.Introduction); } }); }; //初始化 首页快捷方式 数据 HomeHandler.getShortcutData = function (catalogId, selectorId, urlString) { UserWeb.AjaxHandler.post({ url: urlString, data: { catalogId: catalogId, number: 4 }, noAlert: true, success: function (data) { var $html = $(''); $.each(data, function (index, value) { var $htmlA = $(''); $htmlA.html(value.Title); $htmlA.attr('href', value.Chain); $html.append($htmlA); }); $(selectorId).append($html); $(selectorId).children('div').first().fadeIn(200); } }); }; // 初始化 新闻资讯 数据 HomeHandler.getNewsInfoData = function (catalogId, selectorId, urlString) { UserWeb.AjaxHandler.post({ url: urlString, data: { catalogId: catalogId, number: 8, level: 2 }, noAlert: true, success: function (data) { var $html = $(''); var $htmlnewsfirst = $(''); var $htmlul = $('作者:' + value.AuthorName + ' 发表于:' + value.AddDateString + '