YOUFANG 房产行情

This commit is contained in:
zongzhimin
2018-04-11 15:47:00 +08:00
parent b7eb17e750
commit 899f3724e4
5 changed files with 91 additions and 66 deletions
@@ -3,6 +3,7 @@
//var cityChooseOption = {markFocus:0,clickFocus:0}
Vue.component('city_choose',{
props:['city1'],
template:
' <div class="popup popup-about popup-about01"> '+
' <div class="bar"> '+
@@ -24,7 +25,7 @@ Vue.component('city_choose',{
' <div id="cityContainer" class="container"> '+
' <div class="cityGPS"> '+
' <div class="city-list01 close-popup"> '+
' <p class="nowCity">上海</p> '+
' <p class="nowCity">{{city1}}</p> '+
' <small>当前城市</small> '+
' </div> '+
' </div> '+
@@ -24,7 +24,7 @@ Vue.component('city_increase_ranking',{
'<div class="col-20">{{ci.city}}</div>'+
'<div class="col-25">{{!ci.cityTopMonthAvgPrice||ci.cityTopMonthAvgPrice==""?"暂无":""+ci.cityTopMonthAvgPrice+"元/㎡"}}</div>'+
'<div class="col-25">'+
'<em class="up">{{!ci.oneMonthUpDownRange||ci.oneMonthUpDownRange==""?"暂无":Math.abs(ci.oneMonthUpDownRange)+"%"}}<i class="icon" v-bind:class="[ci.oneMonthUpDownRange>0?&quot;icon-arrow-red&quot;:&quot;&quot;,ci.oneMonthUpDownRange<0?&quot;icon-arrow-green&quot;:&quot;&quot;]"></i></em>'+
'<em class="up">{{!ci.oneMonthUpDownRange||ci.oneMonthUpDownRange==""?"暂无":Math.abs(100*ci.oneMonthUpDownRange).toFixed(2)+"%"}}<i class="icon" v-bind:class="[ci.oneMonthUpDownRange>0?&quot;icon-arrow-red&quot;:&quot;&quot;,ci.oneMonthUpDownRange<0?&quot;icon-arrow-green&quot;:&quot;&quot;]"></i></em>'+
'</div>'+
'<div class="col-20">'+
'<i class="button theme collection collection01" v-on:click="follow(ci.city)">关注</i>'+
@@ -48,10 +48,16 @@ Vue.component('city_increase_ranking',{
})
},
follow:function(city){
alert(city)
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
}).catch(function(error){
console.log(error)
})
},
abolish:function(city){
alert(city)
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
}).catch(function(error){
console.log(error)
})
}
},
mounted:function(){
@@ -23,7 +23,7 @@ Vue.component('city_potential_ranking',{
'<div class="col-5">{{index+1}}</div>'+
'<div class="col-20">{{cp.city}}</div>'+
'<div class="col-25">'+
'<em class="up">{{!cp.oneYearUpDownRange||cp.oneYearUpDownRange==""?"暂无":Math.abs(cp.oneYearUpDownRange)+"%"}}<i class="icon" v-bind:class="[cp.oneYearUpDownRange>0?&quot;icon-arrow-red&quot;:&quot;&quot;,cp.oneYearUpDownRange<0?&quot;icon-arrow-green&quot;:&quot;&quot;]"></i></em>'+
'<em class="up">{{!cp.oneYearUpDownRange||cp.oneYearUpDownRange==""?"暂无":Math.abs(cp.oneYearUpDownRange*100).toFixed(2)+"%"}}<i class="icon" v-bind:class="[cp.oneYearUpDownRange>0?&quot;icon-arrow-red&quot;:&quot;&quot;,cp.oneYearUpDownRange<0?&quot;icon-arrow-green&quot;:&quot;&quot;]"></i></em>'+
'</div>'+
'<div class="col-25">'+
'<span class="star">'+
@@ -67,14 +67,12 @@ Vue.component('city_potential_ranking',{
})
},
follow:function(city){
alert(city)
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
}).catch(function(error){
console.log(error)
})
},
abolish:function(city){
alert(city)
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
}).catch(function(error){
console.log(error)
@@ -1,58 +1,69 @@
var myFocusDatas = {myFocusList: []};
Vue.component('my_focus',{
template:
'<div class="topic">'+
'<div class="topicTitle">我的关注</div>'+
'<div class="list-block media-list cityList" id="myFocus">'+
'<ul>'+
'<li>'+
'<a class="item-content">'+
'<div class="item-inner">'+
'<div class="item-subtitle row">'+
'<div class="col-5">&nbsp;</div>'+
'<div class="col-20">城市</div>'+
'<div class="col-25">上月均价</div>'+
'<div class="col-25">近30天涨跌幅</div>'+
'<div class="col-20">全国涨幅排名</div>'+
'</div>'+
'</div>'+
'</a>'+
'</li>'+
'<li v-for="(mf,index) in myFocusList">'+
'<a class="item-content">'+
'<div class="item-inner">'+
'<div class="item-subtitle row">'+
'<div class="col-5">{{index+1}}</div>'+
'<div class="col-20">{{mf.city}}</div>'+
'<div class="col-25">{{!mf.cityTopMonthAvgPrice||mf.cityTopMonthAvgPrice==""?"暂无":""+mf.cityTopMonthAvgPrice+"元/㎡"}}</div>'+
'<div class="col-25">'+
'<em class="up">{{!mf.oneMonthUpDownRange||mf.oneMonthUpDownRange==""?"暂无":mf.oneMonthUpDownRange+"%"}}<i class="icon icon-arrow-red"></i></em>'+
'</div>'+
'<div class="col-20">'+
'<em>{{mf.rangeLevel}}</em>'+
'</div>'+
'</div>'+
'</div>'+
'</a>'+
'</li>'+
'</ul>'+
'</div>'+
'</div>'
,
data:function(){
return myFocusDatas;
},
methods:{
loadMyFocus:function(){
axios.get("/rest/quotations/userCollectCityInfo").then(function(response){
myFocusDatas.myFocusList = response.data.data;
}).catch(function(error){
//alert(2)
console.log(error)
})
}
},mounted:function(){
this.loadMyFocus();
}
})
template:
'<div class="topic">'+
'<div class="topicTitle">我的关注</div>'+
'<div class="list-block media-list cityList">'+
'<ul>'+
'<li>'+
'<a class="item-content">'+
'<div class="item-inner">'+
'<div class="item-subtitle row">'+
'<div class="col-5">&nbsp;</div>'+
'<div class="col-20">城市</div>'+
'<div class="col-25">上月均价</div>'+
'<div class="col-25">近30天涨跌幅</div>'+
'<div class="col-20">全国涨幅排名</div>'+
'</div>'+
'</div>'+
'</a>'+
'</li>'+
'<li v-for="(mf,index) in myFocusList">'+
'<a class="item-content">'+
'<div class="item-inner">'+
'<div class="item-subtitle row">'+
'<div class="col-5">{{index+1}}</div>'+
'<div class="col-20">{{mf.city}}</div>'+
'<div class="col-25">{{!mf.cityTopMonthAvgPrice||mf.cityTopMonthAvgPrice==""?"暂无":""+mf.cityTopMonthAvgPrice+"元/㎡"}}</div>'+
'<div class="col-25">'+
'<em class="up">{{!mf.oneMonthUpDownRange||mf.oneMonthUpDownRange==""?"暂无":Math.abs(mf.oneMonthUpDownRange*100).toFixed(2)+"%"}}<i class="icon" v-bind:class="[mf.oneMonthUpDownRange>0?&quot;icon-arrow-red&quot;:&quot;&quot;,cp.oneYearUpDownRange<0?&quot;icon-arrow-green&quot;:&quot;&quot;]"></i></em>'+
'</div>'+
'<div class="col-20">'+
'<em>{{mf.rangeLevel}}</em>'+
'</div>'+
'</div>'+
'</div>'+
'</a>'+
'</li>'+
'</ul>'+
'</div>'+
'</div>'
,
data:function(){
return myFocusDatas;
},
methods:{
loadMyFocus:function(){
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
$("#myFocusFirstPage").hide()
$("#myFocus").hide();
}else{
axios.get("/rest/quotations/userCollectCityInfo").then(function(response){
if(response.data.data.length==0){
alert("aa");
$("#myFocusFirstPage").hide();
$("#myFocus").hide();
}else{
myFocusDatas.myFocusList = response.data.data;
}
}).catch(function(error){
//alert(2)
console.log(error)
})
}
}
},mounted:function(){
this.loadMyFocus();
}
})
+12 -3
View File
@@ -581,9 +581,9 @@
<!-- About Popup -->
<div id="cityChoose">
<city_choose></city_choose>
<city_choose v-bind:city1="city"></city_choose>
</div>
<script type="text/javascript" src="http://g.alicdn.com/sj/lib/zepto/zepto.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/zepto.js" charset="utf-8"></script>
<script>
@@ -606,6 +606,7 @@ $.config = {router: false}
<script type="text/javascript" src="../../js/log/log_stat.js" ></script>
<script type="text/javascript" src="../component/cityChooseComponent.js"></script>
<script>
var city = "上海1";
var myFocus = new Vue({
el:"#myFocus"
})
@@ -616,7 +617,10 @@ $.config = {router: false}
el:"#cityPotentialRanking"
})
var cityChoose = new Vue({
el:"#cityChoose"
el:"#cityChoose",
data:{
city:city
}
})
</script>
<script>
@@ -747,6 +751,11 @@ $(".popup-about01 p").on("click", function () {
$(".cityChoice a").text($(this).text());
$(".popup-about01 p").removeClass("active");
$(this).addClass("active");
var city = $(this).text()
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
}).catch(function(error){
console.log(error)
})
alert(2)
});