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} //var cityChooseOption = {markFocus:0,clickFocus:0}
Vue.component('city_choose',{ Vue.component('city_choose',{
props:['city1'],
template: template:
' <div class="popup popup-about popup-about01"> '+ ' <div class="popup popup-about popup-about01"> '+
' <div class="bar"> '+ ' <div class="bar"> '+
@@ -24,7 +25,7 @@ Vue.component('city_choose',{
' <div id="cityContainer" class="container"> '+ ' <div id="cityContainer" class="container"> '+
' <div class="cityGPS"> '+ ' <div class="cityGPS"> '+
' <div class="city-list01 close-popup"> '+ ' <div class="city-list01 close-popup"> '+
' <p class="nowCity">上海</p> '+ ' <p class="nowCity">{{city1}}</p> '+
' <small>当前城市</small> '+ ' <small>当前城市</small> '+
' </div> '+ ' </div> '+
' </div> '+ ' </div> '+
@@ -24,7 +24,7 @@ Vue.component('city_increase_ranking',{
'<div class="col-20">{{ci.city}}</div>'+ '<div class="col-20">{{ci.city}}</div>'+
'<div class="col-25">{{!ci.cityTopMonthAvgPrice||ci.cityTopMonthAvgPrice==""?"暂无":""+ci.cityTopMonthAvgPrice+"元/㎡"}}</div>'+ '<div class="col-25">{{!ci.cityTopMonthAvgPrice||ci.cityTopMonthAvgPrice==""?"暂无":""+ci.cityTopMonthAvgPrice+"元/㎡"}}</div>'+
'<div class="col-25">'+ '<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>'+
'<div class="col-20">'+ '<div class="col-20">'+
'<i class="button theme collection collection01" v-on:click="follow(ci.city)">关注</i>'+ '<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){ 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){ abolish:function(city){
alert(city) axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
}).catch(function(error){
console.log(error)
})
} }
}, },
mounted:function(){ mounted:function(){
@@ -23,7 +23,7 @@ Vue.component('city_potential_ranking',{
'<div class="col-5">{{index+1}}</div>'+ '<div class="col-5">{{index+1}}</div>'+
'<div class="col-20">{{cp.city}}</div>'+ '<div class="col-20">{{cp.city}}</div>'+
'<div class="col-25">'+ '<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>'+
'<div class="col-25">'+ '<div class="col-25">'+
'<span class="star">'+ '<span class="star">'+
@@ -67,14 +67,12 @@ Vue.component('city_potential_ranking',{
}) })
}, },
follow:function(city){ follow:function(city){
alert(city)
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){ axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
}).catch(function(error){ }).catch(function(error){
console.log(error) console.log(error)
}) })
}, },
abolish:function(city){ abolish:function(city){
alert(city)
axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){ axios.get("/rest/quotations/collectCity",{params:{city:city}}).then(function(response){
}).catch(function(error){ }).catch(function(error){
console.log(error) console.log(error)
@@ -1,58 +1,69 @@
var myFocusDatas = {myFocusList: []}; var myFocusDatas = {myFocusList: []};
Vue.component('my_focus',{ Vue.component('my_focus',{
template: template:
'<div class="topic">'+ '<div class="topic">'+
'<div class="topicTitle">我的关注</div>'+ '<div class="topicTitle">我的关注</div>'+
'<div class="list-block media-list cityList" id="myFocus">'+ '<div class="list-block media-list cityList">'+
'<ul>'+ '<ul>'+
'<li>'+ '<li>'+
'<a class="item-content">'+ '<a class="item-content">'+
'<div class="item-inner">'+ '<div class="item-inner">'+
'<div class="item-subtitle row">'+ '<div class="item-subtitle row">'+
'<div class="col-5">&nbsp;</div>'+ '<div class="col-5">&nbsp;</div>'+
'<div class="col-20">城市</div>'+ '<div class="col-20">城市</div>'+
'<div class="col-25">上月均价</div>'+ '<div class="col-25">上月均价</div>'+
'<div class="col-25">近30天涨跌幅</div>'+ '<div class="col-25">近30天涨跌幅</div>'+
'<div class="col-20">全国涨幅排名</div>'+ '<div class="col-20">全国涨幅排名</div>'+
'</div>'+ '</div>'+
'</div>'+ '</div>'+
'</a>'+ '</a>'+
'</li>'+ '</li>'+
'<li v-for="(mf,index) in myFocusList">'+ '<li v-for="(mf,index) in myFocusList">'+
'<a class="item-content">'+ '<a class="item-content">'+
'<div class="item-inner">'+ '<div class="item-inner">'+
'<div class="item-subtitle row">'+ '<div class="item-subtitle row">'+
'<div class="col-5">{{index+1}}</div>'+ '<div class="col-5">{{index+1}}</div>'+
'<div class="col-20">{{mf.city}}</div>'+ '<div class="col-20">{{mf.city}}</div>'+
'<div class="col-25">{{!mf.cityTopMonthAvgPrice||mf.cityTopMonthAvgPrice==""?"暂无":""+mf.cityTopMonthAvgPrice+"元/㎡"}}</div>'+ '<div class="col-25">{{!mf.cityTopMonthAvgPrice||mf.cityTopMonthAvgPrice==""?"暂无":""+mf.cityTopMonthAvgPrice+"元/㎡"}}</div>'+
'<div class="col-25">'+ '<div class="col-25">'+
'<em class="up">{{!mf.oneMonthUpDownRange||mf.oneMonthUpDownRange==""?"暂无":mf.oneMonthUpDownRange+"%"}}<i class="icon icon-arrow-red"></i></em>'+ '<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>'+
'<div class="col-20">'+ '<div class="col-20">'+
'<em>{{mf.rangeLevel}}</em>'+ '<em>{{mf.rangeLevel}}</em>'+
'</div>'+ '</div>'+
'</div>'+ '</div>'+
'</div>'+ '</div>'+
'</a>'+ '</a>'+
'</li>'+ '</li>'+
'</ul>'+ '</ul>'+
'</div>'+ '</div>'+
'</div>' '</div>'
, ,
data:function(){ data:function(){
return myFocusDatas; return myFocusDatas;
}, },
methods:{ methods:{
loadMyFocus:function(){ loadMyFocus:function(){
axios.get("/rest/quotations/userCollectCityInfo").then(function(response){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
myFocusDatas.myFocusList = response.data.data; $("#myFocusFirstPage").hide()
}).catch(function(error){ $("#myFocus").hide();
//alert(2) }else{
console.log(error) axios.get("/rest/quotations/userCollectCityInfo").then(function(response){
}) if(response.data.data.length==0){
} alert("aa");
},mounted:function(){ $("#myFocusFirstPage").hide();
this.loadMyFocus(); $("#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 --> <!-- About Popup -->
<div id="cityChoose"> <div id="cityChoose">
<city_choose></city_choose> <city_choose v-bind:city1="city"></city_choose>
</div> </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> <script>
@@ -606,6 +606,7 @@ $.config = {router: false}
<script type="text/javascript" src="../../js/log/log_stat.js" ></script> <script type="text/javascript" src="../../js/log/log_stat.js" ></script>
<script type="text/javascript" src="../component/cityChooseComponent.js"></script> <script type="text/javascript" src="../component/cityChooseComponent.js"></script>
<script> <script>
var city = "上海1";
var myFocus = new Vue({ var myFocus = new Vue({
el:"#myFocus" el:"#myFocus"
}) })
@@ -616,7 +617,10 @@ $.config = {router: false}
el:"#cityPotentialRanking" el:"#cityPotentialRanking"
}) })
var cityChoose = new Vue({ var cityChoose = new Vue({
el:"#cityChoose" el:"#cityChoose",
data:{
city:city
}
}) })
</script> </script>
<script> <script>
@@ -747,6 +751,11 @@ $(".popup-about01 p").on("click", function () {
$(".cityChoice a").text($(this).text()); $(".cityChoice a").text($(this).text());
$(".popup-about01 p").removeClass("active"); $(".popup-about01 p").removeClass("active");
$(this).addClass("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) alert(2)
}); });