This commit is contained in:
2018-04-12 11:35:13 +08:00
parent 87806ab6f0
commit 594b356a08
6 changed files with 80 additions and 45 deletions
+32
View File
@@ -215,6 +215,38 @@ function loadNearDistrict(){
$(".button").click(function(){
console.log("type:"+$(this).text())
var type = (this).attr("v")
var city = (this).attr("city")
axios.get("/rest/quotations/loadCityPriceTrends", {
params: {
city: city,
type:type
}
}).then(function (response) {
var datas = trends.data.data
var prices = []
var counts = []
var times = datas.times
for(var i in times){
var time = times[i]
time = parseInt(time.replace("-",""))
var pm = datas.cityPriceMap;
var cm = datas.countMap;
if(pm){
prices.push(pm[time])
}
if(cm){
counts.push(cm[time]);
}
}
showChart(num+"_price_chart", obj.times, prices, counts)
}).catch(function (error) {
alert(error)
console.log(error);
});
})