function loadDspAd(e) {
if(renderStatus == 0){
uploadConfig.act = 'songheng_'+e.data.length;
uploadZhike(uploadConfig);
if (e.data && e.data.length > 0) {
var sh_data = e.data[0];
if( sh_data.adtype && sh_data.miniimg.length > 0){
if(sh_data.adtype == 104){ //单图广告类型adtype及图片资源miniimg是否正常
uploadConfig.act = 'load';
uploadZhike(uploadConfig);
var data = e.data[0];
$('.container').empty();
$('.container').append('
'+
''+
'快压-广告由嵩恒广告提供');
$(".close_big").html('');
$('.image-wrapper > img')[0].src = data.miniimg[0].src;
$('.image-wrapper')[0].href = data.url+"?needclose=1";
document.getElementById("ak0").onerror = function () {
ProjectConfig.loadBase();
};
getNews();
document.getElementById("ak0").onload = function () {
$(".container").css({"width":"370px"});
var page_size_h = document.getElementById('ak0').offsetHeight+144;
var page_size = 370+"," + page_size_h;
$("#ak0").css({"width":"370px"});
$('head').append('');
if (typeof window.external != 'undefined' && typeof window.external.CppCall != 'undefined') {
window.external.CppCall(page_size);
}
// // 渲染
ProjectConfig.uploadUrl(data.showbackurls[0]);
uploadConfig.act = 'show';
uploadZhike(uploadConfig);
};
//进入可视区s域上报
if (data.isinviewbackurl) {
ProjectConfig.uploadUrl(data.inviewbackurls[0]);
}
//关闭上报
$('.close').on('click', function () {
ProjectConfig.uploadUrl(data.closebackurls[0])
});
//点击上报
$('.image-wrapper').on('click', function () {
ProjectConfig.uploadUrl(data.clickbackurls[0]);
uploadConfig.act = 'click';
uploadZhike(uploadConfig);
})
} else {
render = true;
var start = currentIndex + 1;
getFor(start,dataRes);
}
}else{
render = true;
var start = currentIndex + 1;
getFor(start,dataRes);
}
} else {
render = true;
var start = currentIndex + 1;
getFor(start,dataRes);
}
}
};
function getNews(){
$.ajax({
url:'http://news.7654.com/api/tnews_news_list/tnews6/kuaiya101',
type:'get',
dataType:'json',
success:function(res){
var arr=res.data;
var newsDom='';
$.each(arr,function(index,val){
newsDom+=''+
''+val.title+'
新闻'
});
$(".box").append(newsDom);
}
})
}