(function () { var pageType = $(document).find('[data-page-type]').attr('data-page-type'); var targetName = $(document).find('[data-target-name]').attr('data-target-name'); var isoformsName = $(document).find('[data-isoforms-name]').attr('data-isoforms-name') || ''; var categoryaAlias = $(document).find('[data-category-alias]').attr('data-category-alias') || ''; var targetAntibodyPage = Number(1); var getCurrentDate = function getCurrentDate() { var date = new Date(), year = date.getFullYear(), month = date.getMonth() + 1, strDate = date.getDate(); if (month >= 1 && month <= 9) month = '0' + month; if (strDate >= 0 && strDate <= 9) strDate = '0' + strDate; var currentDate = "".concat(year).concat(month).concat(strDate); return currentDate + ''; }; var date = getCurrentDate(); var prevPage2 = function prevPage2(obj) { var type = $(obj).parent().parent().parent().hasClass('pageTop') ? 0 : 1; if ($(obj).parent().parent().attr("data-page-type") === 'target-antibodies') { targetAntibodyPage -= 1; getTargetAntibodyProducts(type); } }; var nextPage2 = function nextPage2(obj) { var type = $(obj).parent().parent().parent().hasClass('pageTop') ? 0 : 1; if ($(obj).parent().parent().attr("data-page-type") === 'target-antibodies') { targetAntibodyPage += 1; getTargetAntibodyProducts(type); } }; var goPage2 = function goPage2(obj, pageNum) { var type = $(obj).parent().parent().parent().hasClass('pageTop') ? 0 : 1; if ($(obj).parent().parent().attr("data-page-type") === 'target-antibodies') { targetAntibodyPage = pageNum; getTargetAntibodyProducts(type); } }; window.prevPage2 = prevPage2; window.nextPage2 = nextPage2; window.goPage2 = goPage2; var getAntibodyProductsHtml = function getAntibodyProductsHtml(products) { var listHtml = ''; $.each(products, function (i, item) { var description = typeof item.chineseDescription !== 'undefined' && item.chineseDescription !== '' ? item.chineseDescription : typeof item.description !== 'undefined' && item.description !== '' ? item.description : ""; listHtml += '
  • ' + '
    ' + '
    ' + item.catalogNo + '
    ' + '
    ' + '' + '' + '' + '' + '' + '' + (description !== '' ? '' + '' + '' : '') + '
    ' + '' + item.name + '' + (typeof item.synonyms !== 'undefined' && item.synonyms !== '' || typeof item.chineseName !== 'undefined' && item.chineseName !== '' ? (typeof item.chineseName !== 'undefined' && item.chineseName !== '' ? '

    ' + item.chineseName + '

    ' : '') + '

    ' + (typeof item.synonyms !== 'undefined' && item.synonyms !== '' ? categoryaAlias !== '' ? item.synonyms.replace(categoryaAlias, '' + categoryaAlias + '') : item.synonyms : '') + '

    ' : '') + '
    ' + (typeof item.application !== 'undefined' ? item.application : '') + '' + (typeof item.reactivity !== 'undefined' ? item.reactivity : '') + '
    ' + description + '
    ' + '
    ' + '
    ' + '
  • '; }); return listHtml; }; var $demo = $('#target-antibody-products'); var $targetAntibodyProducts = $('#target-antibody-products>.sub_ctg_list_con'); var $targetAntibodyPage = $(document).find('[data-target-antibody-products-page]'); var getTargetAntibodyProducts = function getTargetAntibodyProducts(type) { $demo.parent().find('.loading-gif').show(); $.ajax({ url: '/mce_category!antibodyProducts.shtml?mcenow=' + new Date().getTime(), data: { 'categoryName': targetName, 'isoformsName': isoformsName, 'categoryType': pageType, 'page': targetAntibodyPage }, cache: false, dataType: 'json', type: "post", success: function success(data) { if (data.success) { var products = data.products; var listHtml = getAntibodyProductsHtml(products); $targetAntibodyProducts.html(listHtml); if (listHtml === '') { noResultShow(); } else { noResultHide(); } $(document).find('[data-target-antibody-products-number]').html(data.productsNumber); } else { noResultShow(); $(document).find('[data-target-antibody-products-number]').html(0); } getPages2($targetAntibodyPage, targetAntibodyPage, data.pageTotal); }, error: function error(request) { noResultShow(); $(document).find('[data-target-antibody-products-number]').html(0); $targetAntibodyPage.html(''); }, complete: function complete(XMLHttpRequest, textStatus) { if (type) { positioning($('.tab-con-1')); } $demo.parent().find('.loading-gif').hide(); } }); }; window.AntibodyInit = function AntibodyInit() { getTargetAntibodyProducts(0); $(this).addClass("actived").siblings().removeClass(); $(".tab-con-1>div").hide().eq($('.tab-tit-1>li').index(this)).show(); }; $('#target-antibody_tit').on('click', function () { getTargetAntibodyProducts(0); }); var noResultHide = function noResultHide() { $demo.show(); $demo.parent().find('.loading-gif').hide(); }; var noResultShow = function noResultShow() { $demo.hide(); $demo.parent().find('.loading-gif').hide(); }; })();