From ac965b90095c97050aea1cb575e433ca6ddec598 Mon Sep 17 00:00:00 2001 From: "xuhe@fangjia.com" Date: Fri, 13 Apr 2018 13:07:42 +0800 Subject: [PATCH 1/4] aa --- fangija-zsyf/views/house/detail.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fangija-zsyf/views/house/detail.html b/fangija-zsyf/views/house/detail.html index 2486e59..7d4a77a 100644 --- a/fangija-zsyf/views/house/detail.html +++ b/fangija-zsyf/views/house/detail.html @@ -383,7 +383,12 @@ function init(){ baseInfo.area= houseInfo.area; baseInfo.floor= houseInfo.floor; baseInfo.height= houseInfo.height; - baseInfo.liveStatus=houseInfo.liveStatus; + if(houseInfo.liveStatus){ + baseInfo.liveStatus=houseInfo.liveStatus; + }else{ + baseInfo.liveStatus='其它'; + } + baseInfo.estatetype=houseInfo.estatetype; baseInfo.totalPrice=houseInfo.totalPrice; baseInfo.price=houseInfo.price; From b018e1b40577de136160c3ef851f2faf2ac41f47 Mon Sep 17 00:00:00 2001 From: raoyanhui Date: Fri, 13 Apr 2018 13:09:23 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=97=B6=E5=80=99=20=E5=BC=B9=E5=87=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=92=8C=E8=B7=B3=E8=BD=AC=E9=A1=B5=E9=9D=A2=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/views/house/houseList.html | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fangija-zsyf/views/house/houseList.html b/fangija-zsyf/views/house/houseList.html index 3a89eeb..03789d7 100644 --- a/fangija-zsyf/views/house/houseList.html +++ b/fangija-zsyf/views/house/houseList.html @@ -323,9 +323,14 @@ function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xq tempTotalPricePercent = (parseFloat(tempTotalPrice)*0.7/10000).toFixed(2); tempTotalPrice = (parseFloat(tempTotalPrice)/10000).toFixed(2); } - html += '
  • '; + html += '
  • '; html += "
    "; - html += "
    "+result.name+" "+tempTotalPrice+"万"+result.liveStatus+"
    "; + html += "
    "+result.name+" "+tempTotalPrice+"万"; + if(result.liveStatus!=null && result.liveStatus.length>0){ + html += ""+result.liveStatus+"
    "; + }else{ + html += "其它
    "; + } html += "
    "; //对应城市地区小区30天涨跌幅 @@ -339,9 +344,8 @@ function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xq html += "
    近30天涨跌幅: "+Math.abs(xqOneMonthUpDownRangeValue)+"%
    "; } }else{ - html += "
    近30天涨跌幅: %
    "; + html += "
    近30天涨跌幅: 暂无
    "; } - //下跌概率 var xqPotentialIndexValue = xqPotentialIndexMap[xqOneMonthUpDownRangeKey]; if(!isNaN(xqPotentialIndexValue)){ @@ -352,7 +356,7 @@ function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xq html += "
    下跌概率: "+(parseInt(100)-parseInt(xqPotentialIndexValue))+"%
    "; } }else{ - html += "
    下跌概率: %
    "; + html += "
    下跌概率: 暂无
    "; } html += "
    抵押可贷额度: "+tempTotalPricePercent+"万
    "; @@ -368,7 +372,7 @@ function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xq }else if(result.level!=null && result.level == 5){ html += "山洞级"; }else{ - html += "其他"; + html += "其它"; } html += '立即申请
  • '; } From e5946f5f8e9f8325ca38582b995fa27a8cfb69cc Mon Sep 17 00:00:00 2001 From: raoyanhui Date: Fri, 13 Apr 2018 13:10:09 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=88=91=E7=9A=84=E6=88=BF=E4=BA=A7=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/user/myHouse.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/fangija-zsyf/js/user/myHouse.js b/fangija-zsyf/js/user/myHouse.js index 8f5f0bf..c4419ab 100644 --- a/fangija-zsyf/js/user/myHouse.js +++ b/fangija-zsyf/js/user/myHouse.js @@ -79,9 +79,14 @@ function mhAddItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, tempTotalPricePercent = (parseFloat(tempTotalPrice)*0.7/10000).toFixed(2); tempTotalPrice = (parseFloat(tempTotalPrice)/10000).toFixed(2); } - html += '
  • '; + html += '
  • '; html += "
    "; - html += "
    "+result.name+" "+tempTotalPrice+"万"+result.liveStatus+"
    "; + html += "
    "+result.name+" "+tempTotalPrice+"万"; + if(result.liveStatus!=null && result.liveStatus.length>0){ + html += ""+result.liveStatus+"
    "; + }else{ + html += "其它
    "; + } html += "
    "; //对应城市地区小区30天涨跌幅 @@ -95,7 +100,7 @@ function mhAddItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, html += "
    近30天涨跌幅: "+Math.abs(xqOneMonthUpDownRangeValue)+"%
    "; } }else{ - html += "
    近30天涨跌幅: %
    "; + html += "
    近30天涨跌幅: 暂无
    "; } //下跌概率 @@ -108,7 +113,7 @@ function mhAddItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, html += "
    下跌概率: "+(parseInt(100)-parseInt(xqPotentialIndexValue))+"%
    "; } }else{ - html += "
    下跌概率: %
    "; + html += "
    下跌概率: 暂无
    "; } html += "
    抵押可贷额度: "+tempTotalPricePercent+"万
    "; @@ -124,7 +129,7 @@ function mhAddItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, }else if(result.level!=null && result.level == 5){ html += "山洞级"; }else{ - html += "其他"; + html += "其它"; } html += '立即申请
  • '; } From a60fcf202cb28d1318f73744bb57a21e80fa0ceb Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 13 Apr 2018 13:30:31 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8D=95=E7=8B=AC?= =?UTF-8?q?=E7=9A=84=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/district/districtDetail.js | 1 - fangija-zsyf/js/quotations/cityDetail.js | 480 +++++++++++++++++++++ fangija-zsyf/js/quotations/collectCity.js | 3 +- fangija-zsyf/manifest.json | 7 +- fangija-zsyf/views/house/cityDetail.html | 184 ++++++++ fangija-zsyf/views/house/houseDetail.html | 15 +- 6 files changed, 681 insertions(+), 9 deletions(-) create mode 100644 fangija-zsyf/js/quotations/cityDetail.js create mode 100644 fangija-zsyf/views/house/cityDetail.html diff --git a/fangija-zsyf/js/district/districtDetail.js b/fangija-zsyf/js/district/districtDetail.js index a7b7b3d..4eb5ef7 100644 --- a/fangija-zsyf/js/district/districtDetail.js +++ b/fangija-zsyf/js/district/districtDetail.js @@ -356,7 +356,6 @@ var option01 = { res += '
    月末 : ' + params[0].value[2]; res += '
    最低 : ' + params[0].value[3]; res += '
    最高 : ' + params[0].value[4]; - res += '
    '+params[0].seriesName + ' : ' +params[0].value; return res; }, position: function (pos, params, el, elRect, size) { diff --git a/fangija-zsyf/js/quotations/cityDetail.js b/fangija-zsyf/js/quotations/cityDetail.js new file mode 100644 index 0000000..8c27744 --- /dev/null +++ b/fangija-zsyf/js/quotations/cityDetail.js @@ -0,0 +1,480 @@ +var ret = [] + +function loadMyCollectCity(){ + axios.get("/rest/quotations/userCollectCitys",{}).then(function (response) { + var curDatas = response.data.data + if(curDatas){ + if(IsInArray(curDatas, city)){ + cityInfoVue.$data.collecd = true; + }else{ + cityInfoVue.$data.collecd = false; + } + } + + }).catch(function (error) { + alert(error) + console.log(error); + }); +} + +function loadCityPriceInfo(city){ + + axios.get("/rest/quotations/cityPriceInfo", { + params: { + city: city + } + }).then(function (response) { + var data1 = response.data.data + if(data1){ + var cityObj = new Object(); + 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 + cityInfoVue.$data.myCityMap = cityObj; + } + }).catch(function (error) { + alert(error) + console.log(error); + }); + +} + +function loadUpOrDown(city){ + axios.get("/rest/quotations/hosueQuatations", { + params: { + city: city + } + }).then(function (response) { + var data2 = response.data.data + if(data2){ + loadUpOrDownChart(data2.downRate, data2.upRate); + } + }).catch(function (error) { + alert(error) + console.log(error); + }); +} + +function loadCityPricesAndCounts(city){ + axios.get("/rest/quotations/loadCityPriceTrends", { + params: { + city: city, + type:2 + } + }).then(function (response) { + var data3 = response.data.data + if(data3){ + loadTrends(data3.times, data3.cityPriceMap , data3.countMap); + } + }).catch(function (error) { + alert(error) + console.log(error); + }); +} + +function loadHotDistrict(city){ + + axios.get("/rest/districts/hotDistricts", { + params: { + city: city, + top:5 + } + }).then(function (response) { + var data4 = response.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.sname = nameConver(v.name) + nearObj.avgPrice = v.avgPrice + nears.push(nearObj); + } + cityInfoVue.$data.nears = nears; + } + }).catch(function (error) { + alert(error) + console.log(error); + }); +} + +/*点击走势TAB页*/ +function clickTrend(city, type){ + if(type == 5){ + if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") { + clicked('../user/codeSms.html',true,false,{},{},function(){ + clickTrend(city, type); + }) + return; + } else { + startingLoadCharts(city, type); + } + }else{ + startingLoadCharts(city, type); + } +} + +function startingLoadCharts(city, type){ + axios.get("/rest/quotations/loadCityPriceTrends", { + params: { + city: city, + type:type + } + }).then(function (response) { + + var datas = response.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){ + if(pm[time]){ + prices.push(pm[time]) + }else{ + prices.push(null) + } + + } + if(cm){ + if(cm[time]){ + counts.push(cm[time]); + }else{ + counts.push(null); + } + + } + } + + $("#trendDiv a").removeClass("active"); + $("a[v='"+type+"']").addClass("active") + showChart("price_chart", times, prices, counts) + + }).catch(function (error) { + alert(error) + console.log(error); + }); +} + + + + +function loadUpOrDownChart(downRate, upRate){ + if(upRate){ + var cityObj1 = new Object(); + cityObj1.name= "" + cityObj1.value = upRate + + var cityObj2 = new Object(); + cityObj2.name= "" + cityObj2.value = 100 - upRate + + dataUp = [cityObj1, cityObj2] + addUpChart(dataUp) + }else{ + $("#up_chart").parent().parent().hide() + } + + if(downRate){ + var cityObj3 = new Object(); + cityObj3.name= "" + cityObj3.value = downRate + + var cityObj4 = new Object(); + cityObj4.name= "" + cityObj4.value = 100 - downRate + + dataDown = [cityObj3, cityObj4] + addDownChart(dataDown) + }else{ + $("#down_chart").parent().parent().hide() + } + +} + + +function loadTrends(times, cityPriceMap, countMap){ + var prices = [] + var counts = [] + for(var i in times){ + var time = times[i] + time = parseInt(time.replace("-","")) + var pm = cityPriceMap; + var cm = countMap; + if(pm){ + prices.push(pm[time]) + } + if(cm){ + counts.push(cm[time]); + } + } + showChart("price_chart", times, prices, counts) +} + + + + +/*跳转区域列表*/ +function showRegionInfo(city){ + clicked('../house/regions.html',true,false,{},{city:city}); +} +/*跳转小区详情*/ +function showDistrictDetail(city, region, name){ + clicked('../district/detail.html',true,false,{},{city:city,region:region,name:name}); +} + + + +function showChart(idDom, categories, prices, counts){ + if(!prices){ + prices = [] + } + if(!counts){ + counts = [] + } + + if(prices.length==0 && counts.length == 0){ + $("#trendChartDiv").hide(); + }else{ + /* 城市均价及挂牌走势 */ + var chart = Highcharts.chart(idDom, { + 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 + }] + }); + + } + +} + + +function nameConver(textName){ + var length = textName.length; + var textStr = textName; + if(length > 5){ + textStr = textName.substr(0,5)+ "..."; + } + return textStr; +} + + +function IsInArray(arr, val){ +  var testStr=','+arr.join(",")+","; +  return testStr.indexOf(","+val+",")!=-1; +} + +function addUpChart(dataUp, num){ + /* 小区上涨 */ +//var dataUp = []; + optionUp = { + title: { + text: dataUp[0].value + '%', + subtext: '小区上涨', + x: 'center', + y: 'center', + itemGap: -8, + textStyle: { + fontFamily: 'Arial, Verdana, sans-serif', + fontSize: 30, + color: '#333', + fontWeight: 'normal' + }, + subtextStyle: { + fontFamily: '华文细黑', + fontSize: 12, + color: '#666' + } + }, + color: ['#EB5F34', '#e7e7e7'], + series: [ + { + name: '小区上涨', + type: 'pie', + radius: ['90%', '100%'], + itemStyle: { + normal: { + label: { + show: true + }, + labelLine: { + show: false + } + } + }, + data: dataUp + } + ] + }; + var myChartUp = echarts.init(document.getElementById('up_chart')); + myChartUp.setOption(optionUp,true); +} + +function addDownChart(dataDown){ + /* 小区下跌 */ + optionDown = { + title: { + text: dataDown[0].value + '%', + subtext: '小区下跌', + x: 'center', + y: 'center', + itemGap: -8, + textStyle: { + fontFamily: 'Arial, Verdana, sans-serif', + fontSize: 30, + color: '#333', + fontWeight: 'normal' + }, + subtextStyle: { + fontFamily: '华文细黑', + fontSize: 12, + color: '#666' + } + }, + color: ['#88D053', '#e7e7e7'], + series: [ + { + name: '小区下跌', + type: 'pie', + radius: ['90%', '100%'], + itemStyle: { + normal: { + label: { + show: true + }, + labelLine: { + show: false + } + } + }, + data: dataDown + } + ] + }; + + var myChartUp = echarts.init(document.getElementById('down_chart')); + myChartUp.setOption(optionDown,true); +} + + +function collectCity(city){ + if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") { + clicked('../user/codeSms.html',true,false,{},{},function(){ + collectCity(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){ + if(msg == "取消关注成功"){ + cityInfoVue.$data.collecd = false; + }else if(msg == "关注成功"){ + cityInfoVue.$data.collecd = true; + }else{ + $.toast(msg); + } + } + + }) + .catch(function (error) { + console.log(error); + }); +} + diff --git a/fangija-zsyf/js/quotations/collectCity.js b/fangija-zsyf/js/quotations/collectCity.js index 0b8c69a..bef734b 100644 --- a/fangija-zsyf/js/quotations/collectCity.js +++ b/fangija-zsyf/js/quotations/collectCity.js @@ -329,7 +329,6 @@ function loadChart(){ loadTrends(); - window.clearInterval(t1); } } @@ -531,7 +530,7 @@ function showRegionInfo(city){ function collectCity(city, index){ if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") { clicked('../user/codeSms.html',true,false,{},{},function(){ - docollectCity(city) + collectCity(city) }) return; } else { diff --git a/fangija-zsyf/manifest.json b/fangija-zsyf/manifest.json index 706ef27..8ed8840 100644 --- a/fangija-zsyf/manifest.json +++ b/fangija-zsyf/manifest.json @@ -1616,7 +1616,8 @@ ], "refer": [ "views/user/passLogin.html", - "views/district/detail.html" + "views/district/detail.html", + "views/setting/setting.html" ], "priority": 0 }, @@ -1667,7 +1668,9 @@ "resources": [], "refer": [ "views/house/regions.html", - "views/district/detail.html" + "views/district/detail.html", + "views/user/codeSms.html", + "views/house/cityDetail.html" ], "priority": 0 } diff --git a/fangija-zsyf/views/house/cityDetail.html b/fangija-zsyf/views/house/cityDetail.html new file mode 100644 index 0000000..f84dc38 --- /dev/null +++ b/fangija-zsyf/views/house/cityDetail.html @@ -0,0 +1,184 @@ + + + + + +房产行情 + + + + + + + + + + + + + + + + +
    +
    + +
    + +
    + +
    +
    +
    + + 取消 + 关注 + +
    +
    + 当前参考均价 +
    +
    +
    {{myCityMap.cityTopMonthAvgPrice}}元/㎡
    +
    + +
    + +
    +
    {{myCityMap.time}}楼市行情区县涨跌详情
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    城市均价及挂牌走势 +
    +
    + 半年 + 一年 + 三年 +
    +
    +
    +
    +
    +
    +
    + +
    +
    热门小区
    +
    +
    +
    +
    +
    {{nearDist.sname}}
    +
    +
    {{nearDist.avgPrice}}元/㎡
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fangija-zsyf/views/house/houseDetail.html b/fangija-zsyf/views/house/houseDetail.html index ed6cd92..75174c9 100644 --- a/fangija-zsyf/views/house/houseDetail.html +++ b/fangija-zsyf/views/house/houseDetail.html @@ -19,6 +19,9 @@ .cardInfo02 .item-subtitle{margin-top:0.2rem;} .cardCity01 .card-footer span:nth-child(2){text-align:center;} .cardNearbyBox01 .cardNearby .card-content-inner{padding-bottom:0.25rem;} + .tabs .topic{margin-bottom:0;} + .buttons-tab{overflow-x:auto;border-bottom:solid 1px #e7e7e7;} + .buttons-tab:after{height:0;} @@ -148,15 +151,15 @@
    房产热点城市
    -
    - +
    +

    北京

    -
    +

    上海

    -
    +

    深圳

    @@ -1476,6 +1479,10 @@ function addFocus(city){ }) } +function hotCity(city){ + clicked('../house/cityDetail.html',true,false,{},{city:city}); +} +