Commit 72702036 by 谭新宇

广告只在扫描二维码进入时显示一次

parent 22f3750a
...@@ -107,6 +107,12 @@ function transPage(_pageNumber, _activityCode, _token, _addParam) { ...@@ -107,6 +107,12 @@ function transPage(_pageNumber, _activityCode, _token, _addParam) {
// _form.appendChild(inputToken); // _form.appendChild(inputToken);
// document.body.appendChild(_form); // document.body.appendChild(_form);
// _form.submit(); // _form.submit();
// 活动页面内返回到首页不显示广告
if(_pageNumber === '1' && url.indexOf('noshowad=1') === -1) {
url = url + '&noshowad=1';
}
window.location.href = url; window.location.href = url;
} }
...@@ -728,40 +734,44 @@ function compressImage(file, callback) { ...@@ -728,40 +734,44 @@ function compressImage(file, callback) {
/* ---------------------补充功能逻辑--------------------- */ /* ---------------------补充功能逻辑--------------------- */
// 添加进入N秒广告 // 添加进入N秒广告
function appendAdvertisement() { function appendAdvertisement() {
$("#adImgdiv").remove(); // 活动页内跳转不显示广告
// 广告时间 var noshowad = getQueryString('noshowad');
var time = getQueryString('adtime'); if(noshowad === null) {
// 临时处理,需要移除 $("#adImgdiv").remove();
var acCode = getQueryString('activityCode'); // 广告时间
time = (acCode === 'HD1190904172515' || acCode === 'HD1190904175331') ? '3': time; var time = getQueryString('adtime');
// 临时处理,需要移除
var imgUrl = "http://qnfile.icareyou.net/9cf70c2d689c440cb5a426020fc571021567692920411.jpg?imageMogr2/size-limit/100k"; var acCode = getQueryString('activityCode');
// 广告模板 time = (acCode === 'HD1190904172515' || acCode === 'HD1190904175331') ? '3': time;
var tpl = "<div id='adImgdiv' style='position: absolute;top: 0;left: 0;right: 0;bottom: 0;z-index: 9999;background-color: #fff;'>"
+"<img id='adLoading' src='http://qnfile.icareyou.net/d357016fff92448ebeb6cebf5e73bcd81567699077002' style='left: 50%;width: 0.96rem;top: 40%;position: absolute;margin-left: -0.48rem;'>" var imgUrl = "http://qnfile.icareyou.net/9cf70c2d689c440cb5a426020fc571021567692920411.jpg?imageMogr2/size-limit/100k";
+"<img id='adImg' src='http://qnfile.icareyou.net/9cf70c2d689c440cb5a426020fc571021567692920411.jpg?imageMogr2/size-limit/100k' style='width: 100%;display:none;'>" // 广告模板
+"</div>"; var tpl = "<div id='adImgdiv' style='position: absolute;top: 0;left: 0;right: 0;bottom: 0;z-index: 9999;background-color: #fff;'>"
// 添加广告 +"<img id='adLoading' src='http://qnfile.icareyou.net/d357016fff92448ebeb6cebf5e73bcd81567699077002' style='left: 50%;width: 0.96rem;top: 40%;position: absolute;margin-left: -0.48rem;'>"
if(time !== null || acCode === 'HD1190904172515' || acCode === 'HD1190904175331') { +"<img id='adImg' src='http://qnfile.icareyou.net/9cf70c2d689c440cb5a426020fc571021567692920411.jpg?imageMogr2/size-limit/100k' style='width: 100%;display:none;'>"
// 隐藏首页页面 +"</div>";
$("#html-template-1").hide(); // 添加广告
if(time !== null || acCode === 'HD1190904172515' || acCode === 'HD1190904175331') {
time = parseInt(time) // 隐藏首页页面
$("body").append(tpl); $("#html-template-1").hide();
// 图片加载完成
$("#adLoading").on("load",function(){ time = parseInt(time)
$("#adImg").on("load",function(){ $("body").append(tpl);
$("#adLoading").hide(); // 图片加载完成
// N秒后关闭 $("#adLoading").on("load",function(){
setTimeout(function(){ $("#adImg").on("load",function(){
$("#adImgdiv").fadeOut(function(){ $("#adLoading").hide();
$("#adImgdiv").remove(); // N秒后关闭
$(document).scrollTop(0); setTimeout(function(){
$("#html-template-1").show(); $("#adImgdiv").fadeOut(function(){
}); $("#adImgdiv").remove();
}, time*1000); $(document).scrollTop(0);
}).show(); $("#html-template-1").show();
}); });
}, time*1000);
}).show();
});
}
} }
} }
......
...@@ -261,6 +261,7 @@ function getPlayerList(playerListData) { ...@@ -261,6 +261,7 @@ function getPlayerList(playerListData) {
var i = 0 var i = 0
var item = $(".item",list)[0]; var item = $(".item",list)[0];
var tempItem = list.clone(); var tempItem = list.clone();
// 清空子元素 // 清空子元素
tempItem.empty().show(); tempItem.empty().show();
if(playerListData.records.length) { if(playerListData.records.length) {
...@@ -272,7 +273,8 @@ function getPlayerList(playerListData) { ...@@ -272,7 +273,8 @@ function getPlayerList(playerListData) {
// 名称替换 // 名称替换
$('.user-name',item).text(playerListData.records[i].name); $('.user-name',item).text(playerListData.records[i].name);
// 机构名称替换 // 机构名称替换
if(rules.acActivityOrgs.length === 0){ // 特殊处理
if(rules.acActivityOrgs.length === 0 || activityCode === 'HD1190904175331' || activityCode === 'HD1190904172515'){
$('.vote-struct',item).remove(); $('.vote-struct',item).remove();
}else { }else {
$('.vote-struct',item).text(playerListData.records[i].orgName); $('.vote-struct',item).text(playerListData.records[i].orgName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment