update
This commit is contained in:
@@ -4,6 +4,9 @@ var lat = 31.222578;
|
|||||||
var lng = 121.359555;
|
var lng = 121.359555;
|
||||||
var allCity = []
|
var allCity = []
|
||||||
var collCount = 0;
|
var collCount = 0;
|
||||||
|
var collecteds = [];
|
||||||
|
var ret = []
|
||||||
|
|
||||||
var myDatasVue = new Vue({
|
var myDatasVue = new Vue({
|
||||||
el: '#contentTabDiv',
|
el: '#contentTabDiv',
|
||||||
data: {
|
data: {
|
||||||
@@ -33,9 +36,6 @@ var month = date.getMonth()+1+'月';
|
|||||||
//loadMyCollectCity();
|
//loadMyCollectCity();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function addUpChart(dataUp, num){
|
function addUpChart(dataUp, num){
|
||||||
/* 小区上涨 */
|
/* 小区上涨 */
|
||||||
//var dataUp = [];
|
//var dataUp = [];
|
||||||
@@ -134,10 +134,10 @@ function loadMyCollectCity(){
|
|||||||
axios.get("/rest/quotations/userCollectCitys",{}).then(function (response) {
|
axios.get("/rest/quotations/userCollectCitys",{}).then(function (response) {
|
||||||
var curDatas = response.data.data
|
var curDatas = response.data.data
|
||||||
|
|
||||||
var collecteds = [];
|
|
||||||
collCount = curDatas.length;
|
collCount = curDatas.length;
|
||||||
if(curDatas){
|
if(curDatas){
|
||||||
var ret = []
|
|
||||||
for(var i in curDatas){
|
for(var i in curDatas){
|
||||||
var curCity = curDatas[i]
|
var curCity = curDatas[i]
|
||||||
if(!IsInArray(myCollectCitys, curCity)){
|
if(!IsInArray(myCollectCitys, curCity)){
|
||||||
@@ -150,23 +150,40 @@ function loadMyCollectCity(){
|
|||||||
if(myCollectCitys && myCollectCitys.length>0){
|
if(myCollectCitys && myCollectCitys.length>0){
|
||||||
for(var j in myCollectCitys){
|
for(var j in myCollectCitys){
|
||||||
var curCity = myCollectCitys[j]
|
var curCity = myCollectCitys[j]
|
||||||
var m = 0;
|
createData(curCity, j);
|
||||||
axios.all([loadCityPriceInfo(curCity), detail(curCity), loadCityPricesAndCounts(curCity), loadHotDistrict(curCity)])
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}).catch(function (error) {
|
||||||
|
alert(error)
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function createData(curCity, i){
|
||||||
|
var len = parseInt(i)
|
||||||
|
if(len<10){
|
||||||
|
axios.all([loadCityPriceInfo(curCity), detail(curCity), loadCityPricesAndCounts(curCity), loadHotDistrict(curCity)])
|
||||||
.then(axios.spread(function (acct, perms, trends, nearDists) {
|
.then(axios.spread(function (acct, perms, trends, nearDists) {
|
||||||
|
|
||||||
var cityObj = new Object();
|
var cityObj = new Object();
|
||||||
var data1 = acct.data.data
|
var data1 = acct.data.data
|
||||||
cityObj.hrefId = "tabQuotation"+(parseInt(m)+2)
|
|
||||||
|
|
||||||
cityObj.numId_up_chart = (parseInt(m)+1)+"_up_chart";
|
|
||||||
cityObj.numId_down_chart = (parseInt(m)+1)+"_down_chart";
|
cityObj.hrefId = "tabQuotation"+(len+2)
|
||||||
cityObj.numId_price_chart = (parseInt(m)+1)+"_price_chart";
|
|
||||||
|
cityObj.numId_up_chart = (len+1)+"_up_chart";
|
||||||
|
cityObj.numId_down_chart = (len+1)+"_down_chart";
|
||||||
|
cityObj.numId_price_chart = (len+1)+"_price_chart";
|
||||||
|
|
||||||
cityObj.colled = false;
|
cityObj.colled = false;
|
||||||
if(IsInArray(collecteds, curCity)){
|
if(IsInArray(collecteds, curCity)){
|
||||||
cityObj.colled = true;
|
cityObj.colled = true;
|
||||||
}
|
}
|
||||||
m = m + 1;
|
|
||||||
if(data1){
|
if(data1){
|
||||||
cityObj.city = data1.city
|
cityObj.city = data1.city
|
||||||
cityObj.cityTopMonthAvgPrice = data1.cityTopMonthAvgPrice
|
cityObj.cityTopMonthAvgPrice = data1.cityTopMonthAvgPrice
|
||||||
@@ -207,15 +224,8 @@ function loadMyCollectCity(){
|
|||||||
ret.push(cityObj);
|
ret.push(cityObj);
|
||||||
myDatasVue.$data.cityDatas = ret;
|
myDatasVue.$data.cityDatas = ret;
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}).catch(function (error) {
|
|
||||||
alert(error)
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function nameConver(textName){
|
function nameConver(textName){
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Vue.component('near-dist-component', {
|
|||||||
<div class="cardNearbyWin">
|
<div class="cardNearbyWin">
|
||||||
|
|
||||||
<div class="card cardNearby" v-for="(dist,index) in nearDists" @click="showDistrict(index)">
|
<div class="card cardNearby" v-for="(dist,index) in nearDists" @click="showDistrict(index)">
|
||||||
<div class="card-header">{{dist.name}}</div>
|
<div class="card-header">{{dist.sname}}</div>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="card-content-inner">{{dist.avgPrice}}元/㎡</div>
|
<div class="card-content-inner">{{dist.avgPrice}}元/㎡</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -46,7 +46,7 @@ Vue.component('near-dist-component', {
|
|||||||
if(length > 5){
|
if(length > 5){
|
||||||
textStr = textName.substr(0,5)+ "...";
|
textStr = textName.substr(0,5)+ "...";
|
||||||
}
|
}
|
||||||
o.name=textStr;
|
o.sname=textStr;
|
||||||
if(ret.length <= 5){
|
if(ret.length <= 5){
|
||||||
ret.push(o);
|
ret.push(o);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -535,6 +535,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
$("a[href='#tabQuotation1'],a[href='#tabQuotation0']").click(function(){
|
$("a[href='#tabQuotation1'],a[href='#tabQuotation0']").click(function(){
|
||||||
$("#tabCityDiv a").removeClass("active");
|
$("#tabCityDiv a").removeClass("active");
|
||||||
|
$("#contentTabDiv > .tab").removeClass("active");
|
||||||
})
|
})
|
||||||
|
|
||||||
function clickCity(val){
|
function clickCity(val){
|
||||||
@@ -593,9 +594,12 @@ function markFocus(){
|
|||||||
|
|
||||||
function addFocus(city){
|
function addFocus(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){
|
|
||||||
|
createData(city, myDatasVue.$data.cityDatas.length);
|
||||||
|
|
||||||
|
}).catch(function(error){
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user