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