From 2d460841116f6f575cede118009b554c884dccea Mon Sep 17 00:00:00 2001 From: bayi Date: Tue, 8 May 2018 18:05:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B9=BF=E5=91=8A=E4=BD=8D=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/ad_position_image.js | 32 ++++++++++++++++++++++++++++ fangija-zsyf/views/house/detail.html | 6 ++++++ 2 files changed, 38 insertions(+) create mode 100644 fangija-zsyf/js/ad_position_image.js diff --git a/fangija-zsyf/js/ad_position_image.js b/fangija-zsyf/js/ad_position_image.js new file mode 100644 index 0000000..8c77f1c --- /dev/null +++ b/fangija-zsyf/js/ad_position_image.js @@ -0,0 +1,32 @@ +function add_imgage(imageId,adPosition,device){ + axios.get("/rest/ad/position",{ + params:{position : adPosition} + }).then(function(response){ + if(response.data.status){ + h = response.data.data; + if(typeof(h.imgId)!="undefined"&&h.imgId!=null&&$.trim(h.imgId)!=""){ + $("#"+imageId).attr("src",BASE_PATH+"/img/"+h.imgId); + } + if(typeof(h.link)!="undefined"&&h.link!=null&&$.trim(h.link)!=""){ + var uid = localStorage.getItem("user_id"); + var aId=h.id; + $("#"+imageId).parent().click(function(){ + //1.记录点击日志 + axios.post("/rest/ad/adUrlLoad",{ + id : aId + }).then(function(res){ + console.log(res); + }).catch(function(error){ + console.log(error); + }); + //2.跳转 + url=h.link+"?uid="+uid+"&device="+device; + //window.location.href=url; + clicked("/views/webview_embed.html", true,false,{},{url:url}); + }); + } + } + }).catch(function(error){ + console.log(error); + }); +} diff --git a/fangija-zsyf/views/house/detail.html b/fangija-zsyf/views/house/detail.html index 6f6c999..8deb742 100644 --- a/fangija-zsyf/views/house/detail.html +++ b/fangija-zsyf/views/house/detail.html @@ -109,6 +109,8 @@ + +
@@ -352,6 +354,8 @@ $.config = {router: false} + +