diff --git a/fangija-zsyf/config.js b/fangija-zsyf/config.js index 4e04bd9..2abd5c9 100644 --- a/fangija-zsyf/config.js +++ b/fangija-zsyf/config.js @@ -3,8 +3,8 @@ //var BASE_PATH = "http://192.168.10.47:8086"; //var BASE_PATH = "http://192.168.10.161:8084"; //var BASE_PATH = "http://192.168.10.47:8086"; -var BASE_PATH = "http://192.168.10.161:8084"; -//var BASE_PATH = "http://192.168.10.53:8084"; +//var BASE_PATH = "http://192.168.10.161:8084"; +var BASE_PATH = "http://192.168.10.53:8084"; //var BASE_PATH = "http://192.168.10.171:8084"; /**是否显示过启动页面**/ var lauchFlag = false; \ No newline at end of file diff --git a/fangija-zsyf/css/main.css b/fangija-zsyf/css/main.css index e675534..edb2105 100644 --- a/fangija-zsyf/css/main.css +++ b/fangija-zsyf/css/main.css @@ -971,7 +971,7 @@ input::-webkit-input-placeholder{ .topicContent.cityImgBox{padding-top:0;padding-bottom:0;} .topicContent.cityImgBox p{font-size:0.7rem;color:#333;margin-top:0.2rem;} -.chartBox .chart{height:100px;margin-bottom:0.5rem;} +.chartBox .chart{width:100px;height:100px;margin:0 auto;margin-bottom:0.5rem;} .chartBox span{text-align:center;} .chartBox span em{font-size:0.75rem;} .chartBox span em strong{font-size:1rem;} diff --git a/fangija-zsyf/js/quotations/collectCity.js b/fangija-zsyf/js/quotations/collectCity.js index 29ad655..41578df 100644 --- a/fangija-zsyf/js/quotations/collectCity.js +++ b/fangija-zsyf/js/quotations/collectCity.js @@ -3,6 +3,7 @@ var myCollectCitys = []; var lat = 31.222578; var lng = 121.359555; var allCity = [] +var collCount = 0; var myDatasVue = new Vue({ el: '#contentTabDiv', data: { @@ -29,7 +30,7 @@ var month = date.getMonth()+1+'月'; // //} -loadMyCollectCity(); +//loadMyCollectCity(); @@ -133,6 +134,8 @@ 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){ @@ -141,9 +144,9 @@ function loadMyCollectCity(){ allCity.push(curCity) myCollectCitys.push(curCity); } + collecteds.push(curCity); } } - if(myCollectCitys && myCollectCitys.length>0){ for(var j in myCollectCitys){ var curCity = myCollectCitys[j] @@ -158,6 +161,11 @@ function loadMyCollectCity(){ 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.colled = false; + if(IsInArray(collecteds, curCity)){ + cityObj.colled = true; + } m = m + 1; if(data1){ cityObj.city = data1.city @@ -189,7 +197,8 @@ function loadMyCollectCity(){ var nearObj = new Object(); nearObj.city = v.city nearObj.region = v.region - nearObj.name = v.name + nearObj.name = v.name; + nearObj.sname = nameConver(v.name) nearObj.avgPrice = v.avgPrice nears.push(nearObj); } @@ -209,6 +218,14 @@ function loadMyCollectCity(){ }); } +function nameConver(textName){ + var length = textName.length; + var textStr = textName; + if(length > 5){ + textStr = textName.substr(0,5)+ "..."; + } + return textStr; +} function loadCityPriceInfo(city){ return axios.get("/rest/quotations/cityPriceInfo?city="+city); @@ -227,6 +244,22 @@ function loadHotDistrict(city){ } function clickTrend(city, type, num){ + + if(type == 5){ + if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") { + clicked('../user/codeSms.html',true,false,{},{},function(){ + startingLoadCharts(city, type, num); + }) + return; + } else { + startingLoadCharts(city, type, num); + } + }else{ + startingLoadCharts(city, type, num); + } +} + +function startingLoadCharts(city, type, num){ axios.get("/rest/quotations/loadCityPriceTrends", { params: { city: city, @@ -280,8 +313,7 @@ function IsInArray(arr, val){ var t1 = window.setInterval(loadChart,1000); function loadChart(){ var d1 = myDatasVue.$data.cityDatas.length - var d2 = allCity.length; - if(d2>0 && d2==d1){ + if(d1>0 && d1>=collCount){ loadTabCity(); @@ -315,28 +347,38 @@ function loadUpOrDownChart(){ var obj = datas[i] var num = parseInt(i)+1; - var cityObj1 = new Object(); - cityObj1.name= "" - cityObj1.value = obj.upRate - - var cityObj2 = new Object(); - cityObj2.name= "" - cityObj2.value = 100 - obj.upRate - - dataUp = [cityObj1, cityObj2] - addUpChart(dataUp, num) + if(obj.upRate){ + var cityObj1 = new Object(); + cityObj1.name= "" + cityObj1.value = obj.upRate + + var cityObj2 = new Object(); + cityObj2.name= "" + cityObj2.value = 100 - obj.upRate + + dataUp = [cityObj1, cityObj2] + addUpChart(dataUp, num) + }else{ + $("#"+num+"_up_chart").parent().parent().hide() + } - var cityObj3 = new Object(); - cityObj3.name= "" - cityObj3.value = obj.downRate - var cityObj4 = new Object(); - cityObj4.name= "" - cityObj4.value = 100 - obj.downRate + if(obj.downRate){ + var cityObj3 = new Object(); + cityObj3.name= "" + cityObj3.value = obj.downRate + + var cityObj4 = new Object(); + cityObj4.name= "" + cityObj4.value = 100 - obj.downRate + + dataDown = [cityObj3, cityObj4] + addDownChart(dataDown, num) + }else{ + $("#"+num+"_down_chart").parent().parent().hide() + } - dataDown = [cityObj3, cityObj4] - addDownChart(dataDown, num) } } @@ -377,89 +419,85 @@ function showChart(idDom, categories, prices, counts){ } /* 城市均价及挂牌走势 */ var chart = Highcharts.chart(idDom, { - title: { - text: '城市均价及挂牌走势', - y: -30 - }, - colors: ['#F88C9F', '#78CDE6'], - xAxis: { - type: 'datetime', - categories: categories, - boundaryGap: false, - tickInterval: 2, - tickLength: 6, - crosshair: true - }, - yAxis: [{ // 第一个Y轴,放置在左边 - title: { - text: '元/㎡', - align: 'high', - offset: 4, - rotation: 0, - y: -20 - }, - plotLines: [{ - value: 0, - width: 1, - color: '#808080' - }], - allowDecimals: false - }, { // 第二个Y轴,放置在右边 - linkedTo: 0, - opposite: true, // 通过此参数设置坐标轴显示在对立面 - title: { - text: '套', - align: 'high', - offset: 25, - rotation: 0, - y: -20 - }, - plotLines: [{ - value: 0, - width: 1, - color: '#808080' - }], - allowDecimals: false - }], - credits: { - enabled: false - }, - plotOptions: { - line: { - connectNulls: true //该设置会连接空值点 - }, - series: { - events: { - legendItemClick: function(e) { - return false; - } - }, - marker: { - radius: 3, //曲线点半径,默认是4 - symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" - } - } - }, - tooltip: { - shared: true - }, - series: [{ - name: '均价', - zIndex: 1, - data: prices, - tooltip: { - valueSuffix: '元/㎡' - } - }, { - name: '挂牌量', - type: 'column', - borderColor: null, - data: counts, - tooltip: { - valueSuffix: '套' - } - }] -}); + colors: ['#ff7f50','#87cefa'], + title: { + text: '城市楼市均价及挂牌走势', + y: -30 + }, + + xAxis: [{ + categories:categories, + crosshair: true + }], + yAxis: [{ + + title: { + text: '元/㎡', + align: 'high', + offset: 4, + rotation: 0, + y: -20 + }, + + allowDecimals: false, + plotLines: [{ + value: 0, + width: 1, + color: '#808080' + }] + }, { // Secondary yAxis + title: { + text: '套', + align: 'high', + offset: 25, + rotation: 0, + y: -20 + }, + + allowDecimals: false, + opposite: true + }], + tooltip: { + shared: true + }, + credits: { + enabled: false + }, + plotOptions: { + line: { + connectNulls: true //该设置会连接空值点 + }, + + series: { + events: { + legendItemClick: function(e) { + return false; + } + }, + marker: { + radius: 3, //曲线点半径,默认是4 + symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" + } + } + }, + series: [{ + name: '均价', + type: 'line', + zIndex: 1, + tooltip: { + valueSuffix: ' 元/㎡' + }, + data: prices + },{ + name: '挂牌量', + type: 'column', + yAxis: 1, + tooltip: { + valueSuffix: ' 套' + }, + data: counts + }] + }); } @@ -468,7 +506,7 @@ function showDistrictDetail(index, city){ if(datas){ for(var i in datas){ var obj = datas[i] - if(obj.name == city){ + if(obj.city == city){ var dists = obj.nears var dm = dists[index] clicked('../district/detail.html',true,false,{},{city:dm.city,region:dm.region,name:dm.name}); @@ -479,4 +517,64 @@ function showDistrictDetail(index, city){ function showRegionInfo(city){ + clicked('../house/regions.html',true,false,{},{city:city}); +} + +function collectCity(city, index){ + if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") { + clicked('../user/codeSms.html',true,false,{},{},function(){ + docollectCity(city) + }) + return; + } else { + docollectCity(city) + } + +} + +function docollectCity(city){ + axios.get("/rest/quotations/collectCity",{ + params:{ + city : city + } + }).then(function (response) { + var msg = response.data.message; + if(msg){ + var newRet1 = [] + var newRet2 = [] + if(msg == "取消关注成功"){ + var datas = myDatasVue.$data.cityDatas + for(var i in datas){ + var obj = datas[i] + if(obj.city != city){ + newRet1.push(obj) + } + } + + var data2s = citysVue.$data.citys + var isLast = false; + for(var i in data2s){ + var obj = data2s[i] + if(obj.city != city){ + newRet2.push(obj) + }else{ + if(parseInt(i)+1==data2s.length){ + isLast = true; + } + } + } + if(isLast){ + window.location.reload(); + } + myDatasVue.$data.cityDatas = newRet1; + citysVue.$data.citys = newRet2 + }else{ + alert(msg); + } + } + + }) + .catch(function (error) { + console.log(error); + }); } diff --git a/fangija-zsyf/views/component/mapComponent.js b/fangija-zsyf/views/component/mapComponent.js index b9064f9..c668508 100644 --- a/fangija-zsyf/views/component/mapComponent.js +++ b/fangija-zsyf/views/component/mapComponent.js @@ -8,7 +8,6 @@ Vue.component('map-component', { }, methods: { loadMap:function(){ - alert("map:"+lat+"address:"+address); baseInfo.address = address; if(lat && lng && address){ @@ -37,7 +36,6 @@ Vue.component('map-component', { } }, mounted:function(){ - alert("map start.....") this.loadMap(); } }) \ No newline at end of file diff --git a/fangija-zsyf/views/house/detail.html b/fangija-zsyf/views/house/detail.html index fb8b242..2486e59 100644 --- a/fangija-zsyf/views/house/detail.html +++ b/fangija-zsyf/views/house/detail.html @@ -102,7 +102,7 @@ 我要置换 --> -