From 23951480e732e457e44975ef78a65185b6639bed Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 11 Apr 2018 13:16:10 +0800 Subject: [PATCH 1/3] update --- fangija-zsyf/js/district/districtDetail.js | 3 ++- fangija-zsyf/manifest.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fangija-zsyf/js/district/districtDetail.js b/fangija-zsyf/js/district/districtDetail.js index 6b6b8f8..723b81f 100644 --- a/fangija-zsyf/js/district/districtDetail.js +++ b/fangija-zsyf/js/district/districtDetail.js @@ -746,7 +746,8 @@ function loadRentTrends(city, region, name){ showRentChart2(categories, series); }else{ //没数据 - $("#tabChart2").hide(); + //$("#tabChart2").hide(); + $("#tabRentDiv").addClass("dn") } }).catch(function (error) { alert(error) diff --git a/fangija-zsyf/manifest.json b/fangija-zsyf/manifest.json index 4b545fd..101a051 100644 --- a/fangija-zsyf/manifest.json +++ b/fangija-zsyf/manifest.json @@ -1491,7 +1491,8 @@ "refer": [ "start.html", "views/user/userInfo.html", - "views/evaluate/evaluateList.html" + "views/evaluate/evaluateList.html", + "views/house/houseManageList.html" ], "priority": 0 }, From 74c811818d6aea2cfa535a60bcb07f75b2e77a22 Mon Sep 17 00:00:00 2001 From: "xuhe@fangjia.com" Date: Wed, 11 Apr 2018 13:25:04 +0800 Subject: [PATCH 2/3] aa --- fangija-zsyf/views/house/houseManageList.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fangija-zsyf/views/house/houseManageList.html b/fangija-zsyf/views/house/houseManageList.html index 980d483..78ca7e9 100644 --- a/fangija-zsyf/views/house/houseManageList.html +++ b/fangija-zsyf/views/house/houseManageList.html @@ -266,7 +266,9 @@ $(document).ready(function () { }); function openaddWindow(){ - clicked('/views/house/add.html',true,false,{},{}) + clicked('/views/house/add.html',true,false,{},{},function(){ + alert("aa"); + }) } From d55ad1ddc9e64e4d73614481df4e5728f812a809 Mon Sep 17 00:00:00 2001 From: "xuhe@fangjia.com" Date: Wed, 11 Apr 2018 13:26:13 +0800 Subject: [PATCH 3/3] aa --- fangija-zsyf/js/district/districtDetail.js | 121 ++++++++++++++---- .../views/component/baseInfoComponent.js | 67 +++++++++- fangija-zsyf/views/component/nearDist.js | 7 +- fangija-zsyf/views/district/detail.html | 47 ++++--- fangija-zsyf/views/house/houseList.html | 14 +- fangija-zsyf/views/rent/rent.html | 62 ++++----- 6 files changed, 239 insertions(+), 79 deletions(-) diff --git a/fangija-zsyf/js/district/districtDetail.js b/fangija-zsyf/js/district/districtDetail.js index bf6c3fc..723b81f 100644 --- a/fangija-zsyf/js/district/districtDetail.js +++ b/fangija-zsyf/js/district/districtDetail.js @@ -9,7 +9,21 @@ var curOption; /* 关注&已关注切换 */ $(".collection01").on("click", function () { - + doAddCollect() +}); + +function doAddCollect(){ + if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") { + clicked('../user/codeSms.html',true,false,{},{},function(){ + doAddCollect(); + }) + return; + } else { + addCollect(); + } +} + +function addCollect(){ axios.post("/rest/districts/addCollect",{city:city,region:region,name:name,lat:lat,lng:lng,address:address, poiTags:tags}).then(function (response) { var msg = response.data.message if(msg){ @@ -24,11 +38,24 @@ $(".collection01").on("click", function () { .catch(function (error) { console.log(error); }); - - -}); +} + $(".collection02").on("click", function () { - + removeCollect(); +}); + +function doRemoveCollect(){ + if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") { + clicked('../user/codeSms.html',true,false,{},{},function(){ + doRemoveCollect(); + }) + return; + } else { + removeCollect(); + } +} + +function removeCollect(){ axios.post("/rest/districts/removeCollect",{city:city,region:region,name:name}).then(function (response) { var msg = response.data.message if(msg){ @@ -43,8 +70,7 @@ $(".collection02").on("click", function () { .catch(function (error) { console.log(error); }); - -}); +} /* button状态切换 */ $(".content-block .button").on("click", function () { @@ -52,6 +78,16 @@ $(".content-block .button").on("click", function () { $(this).addClass("active"); }); +/* 图表切换 */ +$("#tabAvgDiv").on("click", function () { + $("#tabChart1").css("z-index","1"); + $("#tabChart2").css("z-index","-1"); +}); +$("#tabRentDiv").on("click", function () { + $("#tabChart2").css("z-index","1"); + $("#tabChart1").css("z-index","-1"); +}); + var t1 = window.setTimeout(loadMap,1000); function loadMap(){ if(lng && lat){ @@ -133,6 +169,28 @@ function loadDistrictInfo(){ } } + var starScore = response.data.data.starScore + if(starScore && starScore > 0){ + var regionIndex = response.data.data.regionIndex + var districtPoiCount = response.data.data.districtPoiCount + + var schoolIndex = response.data.data.schoolIndex + var arroundIndex = response.data.data.arroundIndex + + var indexs = [] + indexs.push(vo.index); + indexs.push(regionIndex); + indexs.push(schoolIndex); + indexs.push(arroundIndex); + + /* 小区评级 */ + loadDistrictLevel(indexs); + }else{ + $("#distLevelDiv").hide() + } + + + }else{ $("#noDataDiv").show() baseInfo.name = "小区详情" @@ -183,11 +241,13 @@ function loadDistrictInfo(){ function loadKLineData(city, region, name){ + var type = $("#trendDiv1 a.active").attr("t-v"); axios.get("/rest/trend/kData", { params: { city: city, region:region, - name:name + name:name, + type: type } }).then(function (response) { var datas = response.data.data @@ -234,23 +294,29 @@ function loadKLineData(city, region, name){ $("#trendDiv1 a").click(function(){ $("#trendDiv1 a").removeClass("active") $(this).addClass("active") + //showTrends(); var v = $(this).attr("t-v"); - if(v == "1"){ - curOption.dataZoom[0].start = 95 - }else if(v == "3"){ - curOption.dataZoom[0].start = 90 - }else if(v == "6"){ - curOption.dataZoom[0].start = 80 - }else if(v == "12"){ - curOption.dataZoom[0].start = 50 - }else if(v == "24"){ - curOption.dataZoom[0].start = 0 - }else if(v == "36"){ - curOption.dataZoom[0].start = 0 - } - myChart01.setOption(curOption,true); + showTrends(v) }); +function showTrends(v){ + + + if(v == "36"){ + if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") { + clicked('../user/codeSms.html',true,false,{},{},function(){ + showTrends(v); + }) + return; + } else { + //curOption.dataZoom[0].start = 0 + loadKLineData(city, region, name) + } + } + //myChart01.setOption(curOption,true); + loadKLineData(city, region, name) +} + var option01 = { animation: false, @@ -680,7 +746,8 @@ function loadRentTrends(city, region, name){ showRentChart2(categories, series); }else{ //没数据 - $("#tabRentDiv").addClass("dn"); + //$("#tabChart2").hide(); + $("#tabRentDiv").addClass("dn") } }).catch(function (error) { alert(error) @@ -755,7 +822,7 @@ function showRentChart2(categories, series){ } /* 小区评级 */ -function loadDistrictLevel(){ +function loadDistrictLevel(datas){ var option03 = { tooltip: { trigger: 'axis', @@ -765,10 +832,10 @@ function loadDistrictLevel(){ radar: [ { indicator: [ - {text: '活跃度评级', max: 100}, + {text: '楼盘潜力评级', max: 100}, {text: '板块评级', max: 100}, {text: '教育评级', max: 100}, - {text: '物业评级', max: 100}, + {text: '生活便利评级', max: 100}, ], radius: 70, name: { @@ -812,7 +879,7 @@ function loadDistrictLevel(){ data: [ { name: '', - value: [25.29, 85.13, 36.42, 57.23] + value: datas } ] } diff --git a/fangija-zsyf/views/component/baseInfoComponent.js b/fangija-zsyf/views/component/baseInfoComponent.js index f8ddedf..b272aa6 100644 --- a/fangija-zsyf/views/component/baseInfoComponent.js +++ b/fangija-zsyf/views/component/baseInfoComponent.js @@ -117,6 +117,7 @@ Vue.component('base-info-component', { $(".collection02").hide(); $(".collection01").show(); } + $(".loadingBg").hide(); if(vo){ if(vo.avgPrice){ lat = vo.lat2; @@ -165,7 +166,48 @@ Vue.component('base-info-component', { dataParam.developer = vo.developer; dataParam.estateCompany = vo.estateCompany; -// loadNearDistrict(vo.lat2, vo.lng2); + var starScore = response.data.data.starScore + + var starHtml = $("#distLevelDiv .star") + if(starHtml.length>0){ + if(starScore && starScore > 0){ + + var html = getStarContent(starScore); + $("#distLevelDiv .star").html(html); + + + + var regionIndex = response.data.data.regionIndex + var districtPoiCount = response.data.data.districtPoiCount + + var schoolIndex = response.data.data.schoolIndex + var arroundIndex = response.data.data.arroundIndex + + var indexs = [] + indexs.push(vo.index); + indexs.push(regionIndex); + indexs.push(schoolIndex); + indexs.push(arroundIndex); + + /* 小区评级 */ + loadDistrictLevel(indexs); + }else{ + $("#distLevelDiv").hide() + } + }else{ + var ht = $("#arroundLevelDiv") + if(ht.length>0){ + var score = response.data.data.arroundIndexStar + if(score > 0){ + var html = getStarContent(score); + $("#arroundLevelDiv .star").html("生活便利 "+html); + }else{ + $("#arroundLevelDiv").hide(); + } + + } + } + }else{ $("#noDataDiv").show() baseInfo.name = "小区详情" @@ -182,3 +224,26 @@ Vue.component('base-info-component', { } }) +function getStarContent(starScore){ + var mod = starScore - parseInt(starScore); + var num = parseInt(starScore); + var nn = 5 - num; + + var html = "" + for(var i=1;i<=num;i++){ + html +="" + } + if(mod==0.5){ + html +="" + } + if(nn >0){ + if(mod==0.5){ + nn = nn -1 + } + for(var j=1;j<=nn;j++){ + html +="" + } + } + return html; +} + diff --git a/fangija-zsyf/views/component/nearDist.js b/fangija-zsyf/views/component/nearDist.js index 4584432..9a860e4 100644 --- a/fangija-zsyf/views/component/nearDist.js +++ b/fangija-zsyf/views/component/nearDist.js @@ -7,7 +7,7 @@ Vue.component('near-dist-component', {
-
+
{{dist.name}}
{{dist.avgPrice}}元/㎡
@@ -56,8 +56,11 @@ Vue.component('near-dist-component', { alert(error) console.log(error); }); + }, + showDistrict:function(index){ + clicked('../district/detail.html',true,false,{},{city:distDatas.nearDists[index].city,region:distDatas.nearDists[index].region,name:distDatas.nearDists[index].name}); } - }, + }, mounted:function(){ this.loadNearDistrict(); } diff --git a/fangija-zsyf/views/district/detail.html b/fangija-zsyf/views/district/detail.html index d5861c0..5cd732f 100644 --- a/fangija-zsyf/views/district/detail.html +++ b/fangija-zsyf/views/district/detail.html @@ -33,7 +33,12 @@ .tabs{width:100%;height:350px;} .tabChart1{z-index:1;} .tabChart2{z-index:-1;} + + .mark-icon-box {width:24px;height:30px;position:absolute;z-index:98;} .mark-icon-box .mark-icon {width: 20px;height: 30px;display: block;cursor: pointer;font-size: 14px; color: #fff;font-weight: bold;text-align: center;line-height: 24px;background: url(../../images/dw.png) no-repeat;} + + .loadingBg{width:100%;height:100%;background:#fff;overflow:hidden;position:absolute;top:11px;left:0;z-index:100;} + .loadingBg .infinite-scroll-preloader{margin-top:30%;} @@ -42,7 +47,14 @@
-
+ +
+
+
+
+
+ +
@@ -112,7 +124,7 @@
@@ -129,7 +141,7 @@
-
+ + +
+
小区评级结果:
@@ -225,8 +238,8 @@ $.config = {router: false} diff --git a/fangija-zsyf/views/house/houseList.html b/fangija-zsyf/views/house/houseList.html index e6616b0..ae39ab1 100644 --- a/fangija-zsyf/views/house/houseList.html +++ b/fangija-zsyf/views/house/houseList.html @@ -205,6 +205,12 @@ function selectHouseInfoList(){ lastIndex = $('.cardInfo').length; //每次加载添加多少条目 itemsPerLoad = resultList.length; + //登录状态,但没有数据 + if(lastIndex == 0 && resultList.length ==0){ + //控制显示 + $('#page-group-nologin').hide(); + $('#page-group-login').show(); + } //请求后对page进行赋值 page = resultsMap.houseInfoPageList.currentPage; pageSize = resultsMap.houseInfoPageList.limit; @@ -224,13 +230,15 @@ function checkIsLogin(){ }else{ selectHouseInfoList(); //控制显示 - $('#page-group-nologin').hide(); - $('#page-group-login').show(); + /*$('#page-group-nologin').hide(); + $('#page-group-login').show();*/ } } function gotoAddHouse(){ - clicked('/views/house/add.html',true,false,{},{type:0},function(){}); + clicked('/views/house/add.html',true,false,{},{type:0},function(){ + checkIsLogin(); + }) } //界面加载 diff --git a/fangija-zsyf/views/rent/rent.html b/fangija-zsyf/views/rent/rent.html index 354f200..b895e0d 100644 --- a/fangija-zsyf/views/rent/rent.html +++ b/fangija-zsyf/views/rent/rent.html @@ -24,6 +24,8 @@ .topicContent .list-block ul:after{height:0;} .districtMap + .list-block.media-list span{line-height:1.2rem;} .cardNearbyBox01 .cardNearby .card-header:nth-child(2){padding-top:0;} + + .mark-icon-box {width:24px;height:30px;position:absolute;z-index:98;} .mark-icon-box .mark-icon {width: 20px;height: 30px;display: block;cursor: pointer;font-size: 14px; color: #fff;font-weight: bold;text-align: center;line-height: 24px;background: url(../../images/dw.png) no-repeat;} @@ -59,9 +61,9 @@
-
- 小区关注 - 生活便利 +
+ +
@@ -154,9 +156,9 @@ $.config = {router: false}