Commit a1a8d008 by 谭新宇

居民端支持广告

parent 0501a6ff
...@@ -723,4 +723,34 @@ function compressImage(file, callback) { ...@@ -723,4 +723,34 @@ function compressImage(file, callback) {
reader.onload = function(e) { reader.onload = function(e) {
img.src = e.target.result; img.src = e.target.result;
}; };
}
// 添加进入N秒广告
function appendAdvertisement() {
$("#adImgdiv").remove();
// 广告时间
var time = getQueryString('adtime');
var imgUrl = "http://qnfile.icareyou.net/9cf70c2d689c440cb5a426020fc571021567692920411.jpg?imageMogr2/size-limit/100k";
// 广告模板
var tpl = "<div id='adImgdiv' style='position: fixed;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;'>"
+"<img id='adImg' src='http://qnfile.icareyou.net/9cf70c2d689c440cb5a426020fc571021567692920411.jpg?imageMogr2/size-limit/100k' style='width: 100%;display:none;'>"
+"</div>";
// 添加广告
if(time !== null) {
time = parseInt(time)
$("body").append(tpl);
// 图片加载完成
$("#adLoading").on("load",function(){
$("#adImg").on("load",function(){
$("#adLoading").hide();
// N秒后关闭
setTimeout(function(){
$("#adImgdiv").fadeOut(function(){
$("#adImgdiv").remove();
});
}, time*1000);
}).show();
});
}
} }
\ No newline at end of file
// 加载html结构 // 加载html结构
loadHtmlJson(); loadHtmlJson();
// 加载广告
appendAdvertisement();
var gb_player_loaded = false var gb_player_loaded = false
var gb_rank_loaded = false var gb_rank_loaded = false
......
var uploadFile = ''; var uploadFile = '';
// 加载广告
appendAdvertisement();
// 加载html结构 // 加载html结构
loadHtmlJson(function(){ loadHtmlJson(function(){
// 判断是否需要移除机构名称 // 判断是否需要移除机构名称
......
// 加载html结构 // 加载html结构
loadHtmlJson(); loadHtmlJson();
// 加载广告
appendAdvertisement();
$(function(){ $(function(){
setToken(); setToken();
......
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