';
});
$('#item-pc').html(html);
$('#item-phone').html(html_mobile);
//建造实例
layui.carousel.render({
elem: '#divCarouselPC'
, width: '100%' //设置容器宽度
, height: '100%'
, arrow: 'hover' //始终显示箭头
, indicator: 'none'
, interval: 6000
});
//建造实例
layui.carousel.render({
elem: '#divCarouselPhone'
, width: '100%' //设置容器宽度
, height: '100%'
, arrow: 'always' //始终显示箭头
, indicator: 'none'
, interval: 6000
});
SetHeight();
var img = new Image();
img.src = _ImgSrcURI + res.data[0].Phone_ImgPath;
img.onload = function () {
$('#divPhoneBanner').height($('.bgADBannerPhone').height());
SetHeight();
}
} else {
$('.bgADBanner').height(0);
SetHeight();
}
},
error: function () {
}
});
}
function GeteBookTitle() {
$.get('data/ebookapi.aspx?action=GeteBookTitle&id=' + $.getUrlVar('id'), function (res) {
if (res.Result) {
$('title').html(res.title + ' — Bio-protocol');
$('#hideBookTitle').val(res.title);
$('#iframe').attr('src', 'viewer.aspx?dtype=' + res.DisplayType + '&id=' + $.getUrlVar('id') + '&_=' + (new Date()).getTime());
}
CheckFormByCookie();
}, 'json');
}
//显示登录弹窗
function ShowLogin(way, position) {
if (SearchIsCheckedMobileToLogin(position, way)) {
var way = way ? '&way=' + way : '';
var p = position ? '&p=' + position : '';//位置
location.href = '/nlogin.aspx?uri=' + encodeURIComponent(location.pathname + location.search) + p + way;
}
}
//判断是否是移动端 跳转登录
function SearchIsCheckedMobileToLogin(position, way) {
var IsPhone = false;
var shebei = $.trim(GetSheBei().toLowerCase());
if (shebei.indexOf('iphone') >= 0 || shebei.indexOf('android') >= 0) {
IsPhone = true;
var p = position ? '&p=' + position : '';
var w = way ? '&way=' + way : '';
//移动端访问, 跳转
if (languageid == 1) {
location.href = '/mv2/loginreg.aspx?url=' + encodeURIComponent(location.pathname + location.search) + p + w;
} else {
location.href = '/mv2/loginreg.aspx?url=' + encodeURIComponent(location.pathname + location.search) + p + w;
}
}
return IsPhone;
}
//判断是否提交过调研, 用户登录, 根据userid判断, 暂停使用
function CheckFormDY() {
$.ajax({
url: 'data/ebookapi.aspx?action=CheckFormDY',
type: 'get',
data: {
id: $.getUrlVar('id')
},
dataType: 'json',
success: function (res) {
if (res.Result) {
//参加过调研
} else {
//没参加过调研
if (!res.msg) {//没有信息, 没参加过调研
layer.open({
type: 1,
title: false,
closeBtn: 0,
shadeClose: false,
area: ['600px', '330px'], //宽高
content: 'html内容'
});
} else {
if (res.offline == 1) {//掉线了
ShowLogin(0, 36);
}
}
}
},
error: function () { }
});
}
//根据缓存, 判断是否提交过调研
function CheckFormByCookie() {
$.ajax({
url: 'data/ebookapi.aspx?action=CheckFormByCookie',
type: 'get',
data: {
id: $.getUrlVar('id')
},
dataType: 'json',
success: function (res) {
if (res.Result) {
//参加过调研, 只有中文版有弹窗提示
if (IP_lang == 1 && $.getUrlVar('id') != 5) {
PC_MobileWin(1);
}
} else {
//没参加过调研
PC_MobileWin(2);
}
},
error: function () { }
});
}
//判断是PC还是移动端弹窗 type=1, 参加过调研, type=2,没参加过 $.trim($('#hideBookTitle').val())
function PC_MobileWin(type) {
var height = '';
var btnText = '';
var html_pc = '
';
var html = '';
var eBookTitle = $.trim($('#hideBookTitle').val());
if (type == 2) {
btnText = getLangStr('Go to the survey', '参与调研,免费阅读');
if (IP_lang == 1) {
html += '
亲爱的读者,
';
} else {
html += ' ';
}
html += '
';
if (IP_lang == 1) {
//html += ' 谢谢您对《' + eBookTitle + '精选集》电子书感兴趣。我们很高兴为您带来2018年和2019年发布的绝大部分得到广泛应用的' + eBookTitle + '相关实验方案。';
html += ' 谢谢您对《' + eBookTitle + '精选集》电子书感兴趣。我们很高兴为您带来得到广泛应用的' + eBookTitle + '相关实验方案。';
} else {
html += ' We are happy to bring you the most widely used ' + eBookTitle + ' protocols published in Bio-protocol from 2018-2019. We hope this Selection of high-quality peer-reviewed protocols will help you make progress in your research. ';
}
html += '
';
html += '
';
if (IP_lang == 1) {
html += ' 本电子书免费分发,但在首次阅读前需要您抽出2分钟时间参与一次简单调研,请点击下方按钮参与活动, 谢谢!';
} else {
html += ' The digital edition is free to access, but first you need to complete a quick survey (~2 min). Please click on the button below to take the survey. Thank you!';
}
html += '