Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var checkLogin = function (url, params, isLogin, div, type) {
var json = $.parseJSON(params);
if (isLogin) {
// 验证是否登录
var checkLoginUrl = 'http://m.iask.sina.com.cn/checkLogin?m=' + Math.random();
$.get(checkLoginUrl,
function (e) {
if (e === null || e === 'null') {
// 跳转到登录页面
var thisHref = window.location.href;
window.location.href = 'http://m.iask.sina.com.cn/login?source=' + thisHref;
}
else {
ajaxPost(url, json, div, type);
}
});
}
else {
$.getJSON(adUrl, query, function (res) {
var isHasFhAd;
var data = $.parseJSON(res.result);
// 遍历直投广告ID
$.each(data, function (k, v) {
// 获取投放直销广告的节点
element = $('mip-fh-ad-plus[fh-ad-pid="' + k + '"]');
uid = element.attr('fh-ad-uid');
// 根据医生id判断物料类型
v = (query.uid && $.isPlainObject(v)) ? v[uid] : v;
// 有特定广告位id的直投广告 先隐藏网盟 再显示直投
if ($.trim(v)) {
element.children(':first-child').remove();
element.html(v);
$.getJSON(ajaxurl, query, function (json) {
var adObj = $.parseJSON(json.result);
// 遍历直投广告ID
$.each(adObj, function (k, v) {
// 有特定广告位id的直投广告
if ($.trim(v)) {
// 根据广告id,判断广告的显示位置
switch (+k) {
// 底部悬浮广告
case 1:
element.html('<div id="ad_position_1">' + v + '</div>');
break;
case 14:
$('#liveAdBlock').html(v);
break;
// 我要提问广告位
case 47:
function (data) {
var res = $.parseJSON(data);
if (type === '1') {
if (res.succ === 'Y' && res.jsonData === '1') {
var txt = $(div);
txt.text(parseInt(txt.text(), 0) + 1);
}
}
});
};
+ ' <div class="content">'
+ value.title
+ ' </div>'
+ ' <div class="eye">'
+ ' <span class="time">'
+ value.created_at
+ ' </span>'
+ ' </div>'
+ ' '
+ '';
}
else {
var imgnum = 0;
var dom = '';
var img = '';
value.thumbnail = $.parseJSON(value.thumbnail);
if ($.isArray(value.thumbnail)) {
imgnum = value.thumbnail.length;
}
switch (imgnum) {
case 0:
dom = '<a class="article-link" href="http://' + host + '/dc-admin/article/'
+ siteid + '/'
+ value.id
+ '">'
+ ' <div class="no-pic">'
+ ' <div class="content">'
+ value.title
+ ' </div>'
+ ' <div class="eye">'
+ ' <span class="time">'</span></div></div></a>
$.get(url, function (data) {
var base = new Base64();
var res = $.parseJSON(data);
if (res.succ === 'Y') {
var json = $.parseJSON(base.decode(res.html));
var basedata = json.adList;
var baiduStr = {type: 'click', data: ['_trackEvent', 'MIP_SY_103', 'skip', 'MIP_SY_103_ywk']};
var baiduObj = 'data-stats-baidu-obj="' + encodeURIStr(baiduStr) + '"';
for (var key in basedata) {
var obj = basedata[key];
if (obj.type === '1' && obj.materialType === '5') {
var nodeClass = isExistsNode();
$(nodeClass).append(centralBanner(obj.picLink, obj.picUrl, baiduObj, ''));
advLogInfoClick(ele, nodeClass + ' .href_log', ele.querySelector('.paramDiv'));
}
else if (obj.type === '3') {
var website = json.website;
var companyName = obj.companyName;
var drName = obj.descb;
putQiyeInfo(ele, companyName, drName, website, obj.picUrl, baiduObj, '');
}
$('script.tpl-json-data').each(function (i, script) {
var $s = $(script);
var dataStr = $s.text();
var dataKey = $s.attr('data-key');
var data;
try {
data = $.parseJSON(dataStr);
}
catch (ex) {
data = {};
}
if (fixFnMap[dataKey]) {
data = fixFnMap[dataKey](data);
}
tplData[dataKey] = data;
});
function (data) {
var res = $.parseJSON(data);
alert(res.desc);
});
effects.clearReport();
$.get(url, function (data) {
var base = new Base64();
var res = $.parseJSON(data);
if (res.succ === 'Y') {
var json = $.parseJSON(base.decode(res.html));
var basedata = json.adList;
var baiduStr = {type: 'click', data: ['_trackEvent', 'MIP_SY_103', 'skip', 'MIP_SY_103_ywk']};
var baiduObj = 'data-stats-baidu-obj="' + encodeURIStr(baiduStr) + '"';
for (var key in basedata) {
var obj = basedata[key];
if (obj.type === '1' && obj.materialType === '5') {
var nodeClass = isExistsNode();
$(nodeClass).append(centralBanner(obj.picLink, obj.picUrl, baiduObj, ''));
advLogInfoClick(ele, nodeClass + ' .href_log', ele.querySelector('.paramDiv'));
}
else if (obj.type === '3') {
var website = json.website;
var companyName = obj.companyName;
var drName = obj.descb;
function (data) {
var base = new Base64();
var res = $.parseJSON(data);
if (res.succ === 'Y') {
var json = $.parseJSON(base.decode(res.html));
if (type === 'YL') {
youLai(ele, json);
return;
}
if (type === 'TZ') {
soulew(ele, json, 300);
return;
}
if (type === 'PPYL') {
brandMedical(ele, json);
return;
}
if (type === 'SLW') {
soulew(ele, json, 101);
return;
};