update
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 569 B After Width: | Height: | Size: 710 B |
Binary file not shown.
|
Before Width: | Height: | Size: 579 B After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 575 B After Width: | Height: | Size: 1.2 KiB |
@@ -276,6 +276,7 @@ function loadKLineData(city, region, name){
|
|||||||
//option01.series[0].data = counts
|
//option01.series[0].data = counts
|
||||||
option01.series[0].data = trends
|
option01.series[0].data = trends
|
||||||
curOption = option01;
|
curOption = option01;
|
||||||
|
var myChart01 = echarts.init(document.getElementById('chart01'));
|
||||||
myChart01.setOption(option01,true);
|
myChart01.setOption(option01,true);
|
||||||
// }else{
|
// }else{
|
||||||
// option02.xAxis[0].data = times
|
// option02.xAxis[0].data = times
|
||||||
@@ -763,8 +764,6 @@ function loadRentTrends(city, region, name){
|
|||||||
|
|
||||||
|
|
||||||
function showRentChart2(categories, series){
|
function showRentChart2(categories, series){
|
||||||
|
|
||||||
|
|
||||||
var option03 = {
|
var option03 = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
var city = ""
|
var city = ""
|
||||||
var myCollectCitys = [];
|
var myCollectCitys = [];
|
||||||
var lat;
|
var lat = 31.222578;
|
||||||
var lng;
|
var lng = 121.359555;
|
||||||
var allCity = []
|
var allCity = []
|
||||||
var myDatasVue = new Vue({
|
var myDatasVue = new Vue({
|
||||||
el: '#contentTabDiv',
|
el: '#contentTabDiv',
|
||||||
@@ -11,6 +11,13 @@ var myDatasVue = new Vue({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var citysVue = new Vue({
|
||||||
|
el: '#tabCityDiv',
|
||||||
|
data: {
|
||||||
|
citys:[]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
var year = date.getFullYear()+'年';
|
var year = date.getFullYear()+'年';
|
||||||
var month = date.getMonth()+1+'月';
|
var month = date.getMonth()+1+'月';
|
||||||
@@ -24,23 +31,7 @@ var month = date.getMonth()+1+'月';
|
|||||||
|
|
||||||
loadMyCollectCity();
|
loadMyCollectCity();
|
||||||
|
|
||||||
// 获取当前用户位置
|
|
||||||
function getPosition(){
|
|
||||||
plus.geolocation.getCurrentPosition(function(p){
|
|
||||||
city = p.address.city;
|
|
||||||
myCollectCitys.push(city);
|
|
||||||
lng = p.coords.longitude;//获取到当前位置的经度
|
|
||||||
lat = p.coords.latitude;//获取到当前位置的纬度;
|
|
||||||
}, function(e){
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provider:'baidu',
|
|
||||||
enableHighAccuracy:true,
|
|
||||||
coordsType:'bd09ll'
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -147,48 +138,70 @@ function loadMyCollectCity(){
|
|||||||
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)){
|
||||||
|
|
||||||
allCity.push(curCity)
|
allCity.push(curCity)
|
||||||
var j = 1;
|
myCollectCitys.push(curCity);
|
||||||
axios.all([loadCityPriceInfo(curCity), detail(curCity), loadCityPricesAndCounts(curCity)])
|
|
||||||
.then(axios.spread(function (acct, perms, trends) {
|
|
||||||
var cityObj = new Object();
|
|
||||||
var data1 = acct.data.data
|
|
||||||
cityObj.numId_up_chart = j+"_up_chart";
|
|
||||||
cityObj.numId_down_chart = j+"_down_chart";
|
|
||||||
cityObj.numId_price_chart = j+"_price_chart";
|
|
||||||
j = j+1;
|
|
||||||
if(data1){
|
|
||||||
cityObj.city = data1.city
|
|
||||||
cityObj.cityTopMonthAvgPrice = data1.cityTopMonthAvgPrice
|
|
||||||
cityObj.downChance = data1.downChance
|
|
||||||
cityObj.follow = data1.follow
|
|
||||||
cityObj.index = data1.index
|
|
||||||
cityObj.oneMonthUpDownRange = (data1.oneMonthUpDownRange*100).toFixed(2)
|
|
||||||
cityObj.oneYearUpDownRange = data1.oneYearUpDownRange
|
|
||||||
cityObj.rangeLevel = data1.rangeLevel
|
|
||||||
cityObj.time = year + month
|
|
||||||
}
|
|
||||||
var data2 = perms.data.data
|
|
||||||
if(data2){
|
|
||||||
cityObj.downRate = data2.downRate
|
|
||||||
cityObj.upRate = data2.upRate
|
|
||||||
}
|
|
||||||
var data3 = trends.data.data
|
|
||||||
if(data3){
|
|
||||||
cityObj.times = data3.times
|
|
||||||
cityObj.cityPriceMap = data3.cityPriceMap
|
|
||||||
cityObj.countMap = data3.countMap
|
|
||||||
}
|
|
||||||
ret.push(cityObj);
|
|
||||||
myDatasVue.$data.cityDatas = ret;
|
|
||||||
//console.log(myDatasVue.$data.cityDatas.length);
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//myDatasVue.$data.cityDatas = ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)])
|
||||||
|
.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";
|
||||||
|
m = m + 1;
|
||||||
|
if(data1){
|
||||||
|
cityObj.city = data1.city
|
||||||
|
cityObj.cityTopMonthAvgPrice = data1.cityTopMonthAvgPrice
|
||||||
|
cityObj.downChance = data1.downChance
|
||||||
|
cityObj.follow = data1.follow
|
||||||
|
cityObj.index = data1.index
|
||||||
|
cityObj.oneMonthUpDownRange = (data1.oneMonthUpDownRange*100).toFixed(2)
|
||||||
|
cityObj.oneYearUpDownRange = data1.oneYearUpDownRange
|
||||||
|
cityObj.rangeLevel = data1.rangeLevel
|
||||||
|
cityObj.time = year + month
|
||||||
|
}
|
||||||
|
var data2 = perms.data.data
|
||||||
|
if(data2){
|
||||||
|
cityObj.downRate = data2.downRate
|
||||||
|
cityObj.upRate = data2.upRate
|
||||||
|
}
|
||||||
|
var data3 = trends.data.data
|
||||||
|
if(data3){
|
||||||
|
cityObj.times = data3.times
|
||||||
|
cityObj.cityPriceMap = data3.cityPriceMap
|
||||||
|
cityObj.countMap = data3.countMap
|
||||||
|
}
|
||||||
|
var data4 = nearDists.data.data
|
||||||
|
if(data4){
|
||||||
|
var nears = []
|
||||||
|
for(var n in data4){
|
||||||
|
var v = data4[n]
|
||||||
|
var nearObj = new Object();
|
||||||
|
nearObj.city = v.city
|
||||||
|
nearObj.region = v.region
|
||||||
|
nearObj.name = v.name
|
||||||
|
nearObj.avgPrice = v.avgPrice
|
||||||
|
nears.push(nearObj);
|
||||||
|
}
|
||||||
|
cityObj.nears = nears
|
||||||
|
}
|
||||||
|
ret.push(cityObj);
|
||||||
|
myDatasVue.$data.cityDatas = ret;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
alert(error)
|
alert(error)
|
||||||
@@ -209,14 +222,11 @@ function loadCityPricesAndCounts(city){
|
|||||||
return axios.get("/rest/quotations/loadCityPriceTrends?city="+city+"&type=2")
|
return axios.get("/rest/quotations/loadCityPriceTrends?city="+city+"&type=2")
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadNearDistrict(){
|
function loadHotDistrict(city){
|
||||||
return axios.get("/rest/districts/nearDistrict?lat="+lat+"&lng="+lng)
|
return axios.get("/rest/districts/hotDistricts?city="+city+"&top=5")
|
||||||
}
|
}
|
||||||
|
|
||||||
$(".button").click(function(){
|
function clickTrend(city, type, num){
|
||||||
console.log("type:"+$(this).text())
|
|
||||||
var type = (this).attr("v")
|
|
||||||
var city = (this).attr("city")
|
|
||||||
axios.get("/rest/quotations/loadCityPriceTrends", {
|
axios.get("/rest/quotations/loadCityPriceTrends", {
|
||||||
params: {
|
params: {
|
||||||
city: city,
|
city: city,
|
||||||
@@ -224,7 +234,7 @@ $(".button").click(function(){
|
|||||||
}
|
}
|
||||||
}).then(function (response) {
|
}).then(function (response) {
|
||||||
|
|
||||||
var datas = trends.data.data
|
var datas = response.data.data
|
||||||
var prices = []
|
var prices = []
|
||||||
var counts = []
|
var counts = []
|
||||||
var times = datas.times
|
var times = datas.times
|
||||||
@@ -234,20 +244,32 @@ $(".button").click(function(){
|
|||||||
var pm = datas.cityPriceMap;
|
var pm = datas.cityPriceMap;
|
||||||
var cm = datas.countMap;
|
var cm = datas.countMap;
|
||||||
if(pm){
|
if(pm){
|
||||||
prices.push(pm[time])
|
if(pm[time]){
|
||||||
|
prices.push(pm[time])
|
||||||
|
}else{
|
||||||
|
prices.push(null)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(cm){
|
if(cm){
|
||||||
counts.push(cm[time]);
|
if(cm[time]){
|
||||||
|
counts.push(cm[time]);
|
||||||
|
}else{
|
||||||
|
counts.push(null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
showChart(num+"_price_chart", obj.times, prices, counts)
|
$("div[tid='"+num+"']").find("a").removeClass("active")
|
||||||
|
$("div[tid='"+num+"']").find("a[v='"+type+"']").addClass("active")
|
||||||
|
showChart(num+"_price_chart", times, prices, counts)
|
||||||
|
|
||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
alert(error)
|
alert(error)
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
|
||||||
|
|
||||||
function IsInArray(arr, val){
|
function IsInArray(arr, val){
|
||||||
@@ -261,14 +283,32 @@ function loadChart(){
|
|||||||
var d2 = allCity.length;
|
var d2 = allCity.length;
|
||||||
if(d2>0 && d2==d1){
|
if(d2>0 && d2==d1){
|
||||||
|
|
||||||
|
loadTabCity();
|
||||||
|
|
||||||
loadUpOrDownChart();
|
loadUpOrDownChart();
|
||||||
|
|
||||||
loadTrends();
|
loadTrends();
|
||||||
|
|
||||||
|
|
||||||
window.clearInterval(t1);
|
window.clearInterval(t1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function loadTabCity(){
|
||||||
|
var datas = myDatasVue.$data.cityDatas
|
||||||
|
var citys = []
|
||||||
|
for(var i in datas){
|
||||||
|
var obj = datas[i]
|
||||||
|
var numObj = new Object();
|
||||||
|
numObj.hrefId = "tabQuotation"+(parseInt(i)+2)
|
||||||
|
numObj.city = obj.city
|
||||||
|
citys.push(numObj)
|
||||||
|
}
|
||||||
|
citysVue.$data.citys = citys;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function loadUpOrDownChart(){
|
function loadUpOrDownChart(){
|
||||||
var datas = myDatasVue.$data.cityDatas
|
var datas = myDatasVue.$data.cityDatas
|
||||||
for(var i in datas){
|
for(var i in datas){
|
||||||
@@ -421,3 +461,22 @@ function showChart(idDom, categories, prices, counts){
|
|||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function showDistrictDetail(index, city){
|
||||||
|
var datas = myDatasVue.$data.cityDatas
|
||||||
|
if(datas){
|
||||||
|
for(var i in datas){
|
||||||
|
var obj = datas[i]
|
||||||
|
if(obj.name == city){
|
||||||
|
var dists = obj.nears
|
||||||
|
var dm = dists[index]
|
||||||
|
clicked('../district/detail.html',true,false,{},{city:dm.city,region:dm.region,name:dm.name});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function showRegionInfo(city){
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -282,7 +282,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="swiper-slide" v-for="(myCityMap,index) in cityDatas">
|
<div v-for="(myCityMap,index) in cityDatas">
|
||||||
<div class="card cardPrice cardPrice01 cardCity01">
|
<div class="card cardPrice cardPrice01 cardCity01">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<label>{{myCityMap.city}}</label>
|
<label>{{myCityMap.city}}</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user