From 699b535d8cbc0047a027fd675c6ca726b7265d02 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 17 Apr 2018 11:30:59 +0800 Subject: [PATCH 1/3] update --- fangija-zsyf/js/quotations/cityDetail.js | 8 +- .../component/cityIncreaseRankingComponent.js | 101 ++++++++---------- .../cityPotentialRankingComponent.js | 38 +++---- fangija-zsyf/views/house/cityDetail.html | 26 ++--- 4 files changed, 82 insertions(+), 91 deletions(-) diff --git a/fangija-zsyf/js/quotations/cityDetail.js b/fangija-zsyf/js/quotations/cityDetail.js index 33f09e9..2d05ef8 100644 --- a/fangija-zsyf/js/quotations/cityDetail.js +++ b/fangija-zsyf/js/quotations/cityDetail.js @@ -15,11 +15,12 @@ function loadMyCollectCity(){ if(positionCity){ cityDetaiVue.$data.citys.push(positionCity); } - - $("#cityInfo").hide() } + $("#cityInfo").hide() plus.nativeUI.closeWaiting(); + }).catch(function (error) { + plus.nativeUI.closeWaiting(); console.log(error); }); } @@ -36,8 +37,10 @@ function loadCurCity(city){ cityInfoVue.$data.collecd = false; } } + plus.nativeUI.closeWaiting(); }).catch(function (error) { + plus.nativeUI.closeWaiting(); console.log(error); }); } @@ -62,6 +65,7 @@ function loadCityPriceInfo(city){ cityObj.rangeLevel = data1.rangeLevel cityObj.time = year + month cityInfoVue.$data.myCityMap = cityObj; + $("#priceDiv").removeClass("dn"); } }).catch(function (error) { console.log(error); diff --git a/fangija-zsyf/views/component/cityIncreaseRankingComponent.js b/fangija-zsyf/views/component/cityIncreaseRankingComponent.js index 6998105..e06f0e1 100644 --- a/fangija-zsyf/views/component/cityIncreaseRankingComponent.js +++ b/fangija-zsyf/views/component/cityIncreaseRankingComponent.js @@ -27,8 +27,8 @@ Vue.component('city_increase_ranking',{ '{{!ci.oneMonthUpDownRange||ci.oneMonthUpDownRange==""?"暂无":Math.abs(100*ci.oneMonthUpDownRange).toFixed(2)+"%"}}'+ ''+ '
'+ - '关注'+ - '取消'+ + '关注'+ + '取消'+ '
'+ ''+ ''+ @@ -48,53 +48,39 @@ Vue.component('city_increase_ranking',{ }) }, follow:function(city,event, type){ + if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ clicked('/views/user/passLogin.html',true,false,{},{},function(){ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ }else{ - axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ - var msg = response.data.message; - if(msg != "取消关注成功" && msg != "关注成功"){ - $.toast(msg); - }else{ - $(event.target).parent().children().removeClass("dn"); - $(event.target).addClass("dn"); - reloadMyFocus() - reloadCityPotentialRanking() - plus.webview.getWebviewById('views/house/houseDetail.html').reload(); - plus.webview.getWebviewById('views/house/houseManageList.html').reload(); - plus.webview.getWebviewById('views/user/userInfo.html').reload(); - } - - //cityDetaiVue.$data.citys.push(city); - }).catch(function(error){ - console.log(error) - }) + } }) }else{ - axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ - var msg = response.data.message; - if(msg != "取消关注成功" && msg != "关注成功"){ - $.toast(msg); - }else{ - $(event.target).parent().children().removeClass("dn"); - $(event.target).addClass("dn"); - reloadMyFocus() - reloadCityPotentialRanking() - if(type == 0){ - var curDatas = cityDetaiVue.$data.citys - if(curDatas && curDatas.length>0){ - if(!IsInArray(curDatas, city)){ - cityDetaiVue.$data.citys.push(city); + $.confirm('您确定要关注'+city+"?", function () { + axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ + var msg = response.data.message; + if(msg != "取消关注成功" && msg != "关注成功"){ + $.toast(msg); + }else{ + $(event.target).parent().children().removeClass("dn"); + $(event.target).addClass("dn"); + reloadMyFocus() + reloadCityPotentialRanking() + if(type == 0){ + var curDatas = cityDetaiVue.$data.citys + if(curDatas && curDatas.length>0){ + if(!IsInArray(curDatas, city)){ + cityDetaiVue.$data.citys.push(city); + } } } } - } - - }).catch(function(error){ - console.log(error) - }) + + }).catch(function(error){ + console.log(error) + }) + }); } }, @@ -108,23 +94,26 @@ Vue.component('city_increase_ranking',{ } }) }else{ - axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ - $(event.target).parent().children().removeClass("dn"); - $(event.target).addClass("dn"); - reloadMyFocus(); - reloadCityPotentialRanking() - //plus.webview.getWebviewById('views/user/userInfo.html').reload() - var da = cityDetaiVue.$data.citys - if(da && da.length>0){ - var index = da.indexOf(city) - if(index>0){ - da.splice(index, 1) - cityDetaiVue.$data.citys = da; - } - } - }).catch(function(error){ - console.log(error) - }) + + $.confirm("您确定要取消关注?", function () { + axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ + $(event.target).parent().children().removeClass("dn"); + $(event.target).addClass("dn"); + reloadMyFocus(); + reloadCityPotentialRanking() + //plus.webview.getWebviewById('views/user/userInfo.html').reload() + var da = cityDetaiVue.$data.citys + if(da && da.length>0){ + var index = da.indexOf(city) + if(index>0){ + da.splice(index, 1) + cityDetaiVue.$data.citys = da; + } + } + }).catch(function(error){ + console.log(error) + }) + }); } } diff --git a/fangija-zsyf/views/component/cityPotentialRankingComponent.js b/fangija-zsyf/views/component/cityPotentialRankingComponent.js index 7591787..0c58bca 100644 --- a/fangija-zsyf/views/component/cityPotentialRankingComponent.js +++ b/fangija-zsyf/views/component/cityPotentialRankingComponent.js @@ -71,24 +71,26 @@ Vue.component('city_potential_ranking',{ if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){ }else{ - axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ - - var msg = response.data.message; - if(msg != "取消关注成功" && msg != "关注成功"){ - $.toast(msg); - }else{ - $(event.target).parent().children().removeClass("dn"); - $(event.target).addClass("dn"); - plus.webview.getWebviewById('views/house/houseDetail.html').reload(); - plus.webview.getWebviewById('views/house/houseManageList.html').reload(); - plus.webview.getWebviewById('views/user/userInfo.html').reload(); - reloadMyFocus() - reloadCityIncreaseRanking() - //cityDetaiVue.$data.citys.push(city); - } - }).catch(function(error){ - console.log(error) - }) + $.confirm('您确定要关注'+city+"?", function () { + axios.get("/rest/quotations/collectCity",{params:{city:city, type:type}}).then(function(response){ + + var msg = response.data.message; + if(msg != "取消关注成功" && msg != "关注成功"){ + $.toast(msg); + }else{ + $(event.target).parent().children().removeClass("dn"); + $(event.target).addClass("dn"); + plus.webview.getWebviewById('views/house/houseDetail.html').reload(); + plus.webview.getWebviewById('views/house/houseManageList.html').reload(); + plus.webview.getWebviewById('views/user/userInfo.html').reload(); + reloadMyFocus() + reloadCityIncreaseRanking() + //cityDetaiVue.$data.citys.push(city); + } + }).catch(function(error){ + console.log(error) + }) + }); } }) }else{ diff --git a/fangija-zsyf/views/house/cityDetail.html b/fangija-zsyf/views/house/cityDetail.html index f116ae3..062f95d 100644 --- a/fangija-zsyf/views/house/cityDetail.html +++ b/fangija-zsyf/views/house/cityDetail.html @@ -35,7 +35,7 @@
-
+
取消关注 @@ -45,7 +45,7 @@
当前参考均价
-
+
{{myCityMap.cityTopMonthAvgPrice}}元/㎡
暂无
@@ -151,8 +151,14 @@ $.config = {router: false} var date = new Date(); var year = date.getFullYear()+'年'; var month = date.getMonth()+1+'月'; -var city = "神农架" -var cityInfoVue = new Vue({ +var city = "普洱" +var cityInfoVue; + +document.addEventListener('plusready', onPlusReady, false); +function onPlusReady() { + var self = plus.webview.currentWebview(); + city = self.city + cityInfoVue = new Vue({ el: '#cityInfo', data: { city:"", @@ -162,12 +168,7 @@ var cityInfoVue = new Vue({ myCityMap : [] } }); - -document.addEventListener('plusready', onPlusReady, false); -function onPlusReady() { - var self = plus.webview.currentWebview(); - var city = self.city - cityInfoVue.$data.city = city; + cityInfoVue.$data.city = city; loadCurCity(city); loadCityPriceInfo(city) loadUpOrDown(city); @@ -176,11 +177,6 @@ function onPlusReady() { } -//loadCurCity(city); -// loadCityPriceInfo(city) -// loadUpOrDown(city); -// loadHotDistrict(city) -// loadCityPricesAndCounts(city) From 27852e6018e3eb6a6bd9a51e9b01f6cb42e7917d Mon Sep 17 00:00:00 2001 From: gongjin Date: Tue, 17 Apr 2018 11:31:15 +0800 Subject: [PATCH 2/3] update --- fangija-zsyf/js/district/districtDetail.js | 359 +++++++++++---------- fangija-zsyf/views/district/detail.html | 2 +- fangija-zsyf/views/house/detail.html | 42 +-- 3 files changed, 200 insertions(+), 203 deletions(-) diff --git a/fangija-zsyf/js/district/districtDetail.js b/fangija-zsyf/js/district/districtDetail.js index d625c0a..70c6ffc 100644 --- a/fangija-zsyf/js/district/districtDetail.js +++ b/fangija-zsyf/js/district/districtDetail.js @@ -334,194 +334,199 @@ function showTrends(v){ var option01 = { - animation: false, - color: colorList, - title: { - text: null, - left: 'center' - }, - legend: { - show: false, - top: 30, - data: ['均价'] - }, - tooltip: { - triggerOn: 'none', - transitionDuration: 0, - confine: true, - bordeRadius: 4, - borderWidth: 1, - borderColor: '#333', - backgroundColor: 'rgba(255,255,255,0.9)', - textStyle: { - fontSize: 12, - color: '#333' - }, - formatter: function (params) { - var res = params[0].seriesName + ' ' + params[0].name; - res += '
月初 : ' + params[0].value[1]; - res += '
月末 : ' + params[0].value[2]; - res += '
最低 : ' + params[0].value[3]; - res += '
最高 : ' + params[0].value[4]; - return res; - }, - position: function (pos, params, el, elRect, size) { - var obj = { - top: 60 - }; - obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 5; - return obj; + animation: false, + color: colorList, + title: { + text: null, + left: 'center' + }, + legend: { + show: false, + top: 30, + data: ['均价'] + }, + tooltip: { + triggerOn: 'none', + transitionDuration: 0, + confine: true, + bordeRadius: 4, + borderWidth: 1, + borderColor: '#333', + backgroundColor: 'rgba(255,255,255,0.9)', + textStyle: { + fontSize: 12, + color: '#333' + }, + formatter: function (params) { + var res = params[0].seriesName + ' ' + params[0].name; + res += '
月初 : ' + params[0].value[1]; + res += '
月末 : ' + params[0].value[2]; + res += '
最低 : ' + params[0].value[3]; + res += '
最高 : ' + params[0].value[4]; + return res; + }, + position: function (pos, params, el, elRect, size) { + var obj = { + top: 60 + }; + obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 5; + return obj; + } + }, + axisPointer: { + link: [{ + xAxisIndex: [0, 1] + }] + }, + dataZoom: [{ + type: 'slider', + xAxisIndex: [0, 1], + realtime: false, + start: 1, + end: 99, + top: 5, + height: 20, + handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z', + handleSize: '120%' + }, { + type: 'inside', + xAxisIndex: [0, 1], + start: 40, + end: 70, + top: 30, + height: 20 + }], + xAxis: [{ + type: 'category', + data: dates, + boundaryGap : false, + axisLine: { lineStyle: { color: '#666' } }, + axisLabel: { + formatter: function (value) { + return echarts.format.formatTime('MM-dd', value); } }, + min: 'dataMin', + max: 'dataMax', axisPointer: { - link: [{ - xAxisIndex: [0, 1] - }] - }, - dataZoom: [{ - type: 'slider', - xAxisIndex: [0, 1], - realtime: false, - start: 5, - end: 95, - top: 65, - height: 20, - handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z', - handleSize: '120%' - }, { - type: 'inside', - xAxisIndex: [0, 1], - start: 40, - end: 70, - top: 30, - height: 20 - }], - xAxis: [{ - type: 'category', - data: dates, - boundaryGap : false, - axisLine: { lineStyle: { color: '#666' } }, + show: true + } + }, { + type: 'category', + gridIndex: 1, + data: dates, + scale: false, + boundaryGap : false, + splitLine: {show: false}, + axisLabel: {show: false}, + axisTick: {show: false}, + axisLine: {lineStyle: { color: '#fff' } }, + splitNumber: 20, + min: 'dataMin', + max: 'dataMax', + axisPointer: { + type: 'line', + lineStyle: { + color: '#fff', + width: 1, + type: 'solid' + }, + label: {show: false}, + triggerTooltip: true, + handle: { + show: true, + margin: -70, + color: '#F18D00' + } + } + }], + yAxis: [{ + name: '均价(元/㎡)', + nameRotate: 90, + nameLocation: 'center', + nameGap: 5, + position: 'right', + nameTextStyle: { + color: '#999' + }, + scale: true, + splitNumber: 2, + axisLine: { lineStyle: { color: '#999' } }, + splitLine: { show: true }, + axisTick: { show: false }, axisLabel: { - formatter: function (value) { - return echarts.format.formatTime('MM-dd', value); - } - }, - min: 'dataMin', - max: 'dataMax', - axisPointer: { - show: true + inside: true, + formatter: '{value}\n' } }, { - type: 'category', + name: '', + nameRotate: 90, + nameLocation: 'center', + nameGap: 5, + position: 'right', + nameTextStyle: { + color: '#999' + }, + scale: true, gridIndex: 1, - data: dates, - scale: false, - boundaryGap : false, - splitLine: {show: false}, + splitNumber: 2, axisLabel: {show: false}, + axisLine: {show: false}, axisTick: {show: false}, - axisLine: {lineStyle: { color: '#fff' } }, - splitNumber: 20, - min: 'dataMin', - max: 'dataMax', - axisPointer: { - //type: 'shadow', - label: {show: false}, - triggerTooltip: true, - handle: { - show: true, - margin: -20, - color: '#F18D00' + splitLine: {show: false} + }], + grid: [{ + left: 20, + right: 20, + top: 60, + height: 120 + }, { + left: 20, + right: 20, + height: 40, + top: 260 + }], + graphic: [{ + type: 'group', + left: 'center', + top: 70, + width: 300, + bounding: 'raw' + }], + series: [/*{ + name: '成交量', + type: 'bar', + xAxisIndex: 1, + yAxisIndex: 1, + itemStyle: { + normal: { + color: '#87cefa' + }, + emphasis: { + color: 'black' + } + }, + data: volumes + }, */{ + type: 'candlestick', + name: '均价', + data: data, + itemStyle: { + normal: { + color: '#EB5F34', + color0: '#88D053', + borderColor: '#EB5F34', + borderColor0: '#88D053' + }, + emphasis: { + color: '#F18D00', + color0: '#666', + borderColor: '#F18D00', + borderColor0: '#666' } } - }], - yAxis: [{ - name: '均价(元/㎡)', - nameRotate: 90, - nameLocation: 'center', - nameGap: 5, - position: 'right', - nameTextStyle: { - color: '#999' - }, - scale: true, - splitNumber: 2, - axisLine: { lineStyle: { color: '#999' } }, - splitLine: { show: true }, - axisTick: { show: false }, - axisLabel: { - inside: true, - formatter: '{value}\n' - } - }, { - name: '', - nameRotate: 90, - nameLocation: 'center', - nameGap: 5, - position: 'right', - nameTextStyle: { - color: '#999' - }, - scale: true, - gridIndex: 1, - splitNumber: 2, - axisLabel: {show: false}, - axisLine: {show: false}, - axisTick: {show: false}, - splitLine: {show: false} - }], - grid: [{ - left: 20, - right: 20, - top: 110, - height: 120 - }, { - left: 20, - right: 20, - height: 40, - top: 260 - }], - graphic: [{ - type: 'group', - left: 'center', - top: 70, - width: 300, - bounding: 'raw' - }], - series: [/*{ - name: '成交量', - type: 'bar', - xAxisIndex: 1, - yAxisIndex: 1, - itemStyle: { - normal: { - color: '#87cefa' - }, - emphasis: { - color: 'black' - } - }, - data: volumes - }, */{ - type: 'candlestick', - name: '均价', - data: data, - itemStyle: { - normal: { - color: '#EB5F34', - color0: '#88D053', - borderColor: '#EB5F34', - borderColor0: '#88D053' - }, - emphasis: { - color: '#F18D00', - color0: '#666', - borderColor: '#F18D00', - borderColor0: '#666' - } - } - }] - }; + }] +}; /*$("#trendDiv2 a").click(function(){ diff --git a/fangija-zsyf/views/district/detail.html b/fangija-zsyf/views/district/detail.html index 8008351..56c906e 100644 --- a/fangija-zsyf/views/district/detail.html +++ b/fangija-zsyf/views/district/detail.html @@ -118,7 +118,7 @@
-
+
租金
diff --git a/fangija-zsyf/views/house/detail.html b/fangija-zsyf/views/house/detail.html index dbf255e..33ff91f 100644 --- a/fangija-zsyf/views/house/detail.html +++ b/fangija-zsyf/views/house/detail.html @@ -228,34 +228,26 @@
小区走势分析
-
-
-
- 均价 - 租金 -
-
-
-
-
-
- 半年 - 一年 - 三年 -
-
-
-
-
-
-
- 半年 - 一年 -
-
+
+
均价 +
+
+
+
租金 +
+
+ 半年 + 一年 +
+
+
+
From 2a52adc4d17f2e16c4d0e1bba1f9bf106cf7f050 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 17 Apr 2018 11:48:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=85=B3=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fangija-zsyf/js/quotations/cityDetail.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/fangija-zsyf/js/quotations/cityDetail.js b/fangija-zsyf/js/quotations/cityDetail.js index 2d05ef8..1dd4e75 100644 --- a/fangija-zsyf/js/quotations/cityDetail.js +++ b/fangija-zsyf/js/quotations/cityDetail.js @@ -53,6 +53,7 @@ function loadCityPriceInfo(city){ } }).then(function (response) { var data1 = response.data.data + if(data1){ var cityObj = new Object(); cityObj.city = data1.city @@ -67,6 +68,7 @@ function loadCityPriceInfo(city){ cityInfoVue.$data.myCityMap = cityObj; $("#priceDiv").removeClass("dn"); } + }).catch(function (error) { console.log(error); }); @@ -486,7 +488,18 @@ function collectCity(city, type){ }) return; } else { - docollectCity(city, type) + + var title = "" + if(type == 0){ + title = "您确定要添加关注?" + }else{ + title = "您确定要取消关注?" + } + + $.confirm(title, function () { + docollectCity(city, type) + }); + } }