From d1c3e02ba0f0179d3c041523fac155b1fb5941dd Mon Sep 17 00:00:00 2001 From: "xuhe@fangjia.com" Date: Thu, 15 Mar 2018 11:24:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=B5=84=E8=AE=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/yfindex.html | 101 +++++++++++++++++++++++++++++++------- 1 file changed, 82 insertions(+), 19 deletions(-) diff --git a/fangija-zsyf/yfindex.html b/fangija-zsyf/yfindex.html index da354ed..533faac 100644 --- a/fangija-zsyf/yfindex.html +++ b/fangija-zsyf/yfindex.html @@ -105,7 +105,7 @@
{{todayDate}}
-
+
@@ -1544,8 +1544,8 @@ function getPosition(){ ); } /* 获取#region字数,截取#region前4字,并添加... */ -city="上海" -init(); +/*city="上海" +init();*/ function init(){ //显示附近地址 var nearAddressParam = address; @@ -1570,7 +1570,6 @@ function init(){ } }) .then(function (response) { - alert("aa"); new Vue({ el: '#baseInfo', data: { @@ -1624,30 +1623,94 @@ function init(){ console.log(error); }); + //资讯列表 - /*axios.get(BASE_PATH+"/rest/news/list", { + axios.get(BASE_PATH+"/rest/news/list", { params: { city: cityParam, page:1 } }) .then(function (response) { - - //附近小区列表 - var html = '
'; - for(var i in response.data.data.dtos){ - html += '
'+response.data.data.dtos[i].name+ - '
'+response.data.data.dtos[i].avgPrice+'元/㎡
'; - } - html += '
'; - $("#nearDistricts").html(html); - $("#nearbyDistrictList").css("width",(7.5*response.data.data.dtos.length)+"rem"); - + var html = ''; + for(var i in response.data.data.list){ + if(response.data.data.list[i].type=="专题"){ + html += '
'+ + ''+ + '
'+ + '
'+response.data.data.list[i].title+'
'+ + ''+ + '
'; + } + /*if(response.data.data.list[i].type=="房源"){ + html += '
'+ + ''+ + '
'+ + '
'+response.data.data.list[i].title+'今日推荐
'+ + '
'+ + '
浦东-周康
'+ + '
'+ + ''+ + '
'; + }*/ + if(response.data.data.list[i].type=="活动"){ + html += '
'+ + ''+ + '
'+ + '
'+response.data.data.list[i].title+'
'+ + ''+ + '
'; + } + /*if(response.data.data.list[i].type=="城市"){ +
+ +
+
+
+
上海
+
+ +
+ }*/ + if(response.data.data.list[i].type=="新闻"){ + html += '
'+ + '
  • '+ + '
    '+ + '
    '+response.data.data.list[i].title+'
    '+ + '
    '+response.data.data.list[i].introduction+'
    '+ + '
    2022人'+ + /*'1245条'+*/ + '
'; + } + if(response.data.data.list[i].type=="投票"){ + html += '
'+response.data.data.list[i].title+ + '
'+ + '同意'+ + '
'+ + '
反对'+ + '
V.S
'; + } + } + $("#todayDate").append(html); }) .catch(function (error) { console.log(error); - });*/ + }); }