Merge branch 'YOUFANGAPP1.1' of http://192.168.0.27/dev0/youfang-app into YOUFANGAPP1.1
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,815 @@
|
||||
var colorList = ['#c23531', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83', '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'];
|
||||
var labelFont = 'bold 12px Sans-serif';
|
||||
|
||||
var dates;
|
||||
var data;
|
||||
var volumes;
|
||||
var curOption;
|
||||
|
||||
|
||||
/* 关注&已关注切换 */
|
||||
$(".collection01").on("click", function () {
|
||||
|
||||
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){
|
||||
$.toast(msg);
|
||||
}else{
|
||||
$(".collection01").hide();
|
||||
$(".collection02").show();
|
||||
$.toast("随时掌握小区动态");
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
$(".collection02").on("click", function () {
|
||||
|
||||
axios.post("/rest/districts/removeCollect",{city:city,region:region,name:name}).then(function (response) {
|
||||
var msg = response.data.message
|
||||
if(msg){
|
||||
$.toast(msg);
|
||||
}else{
|
||||
$(".collection02").hide();
|
||||
$(".collection01").show();
|
||||
$.toast("取消关注");
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/* button状态切换 */
|
||||
$(".content-block .button").on("click", function () {
|
||||
$(this).parent().children().removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
|
||||
//小区详情
|
||||
function loadDistrictInfo(){
|
||||
axios.get("/rest/districts/detail", {
|
||||
params: {
|
||||
city: city,
|
||||
region:region,
|
||||
name: name
|
||||
}
|
||||
}).then(function (response) {
|
||||
var vo = response.data.data.detail
|
||||
var cityPrice = response.data.data.cityPrice
|
||||
var collected = response.data.data.collected
|
||||
if(cityPrice){
|
||||
baseInfo.cityPrice = cityPrice
|
||||
}
|
||||
if(collected){
|
||||
$(".collection02").show();
|
||||
$(".collection01").hide();
|
||||
}else{
|
||||
$(".collection02").hide();
|
||||
$(".collection01").show();
|
||||
}
|
||||
if(vo){
|
||||
if(vo.avgPrice){
|
||||
lat = vo.lat2;
|
||||
lng = vo.lng2;
|
||||
|
||||
//loadMapPoi();
|
||||
|
||||
baseInfo.city = vo.city
|
||||
baseInfo.region = vo.region
|
||||
baseInfo.address = vo.address;
|
||||
baseInfo.name = vo.name
|
||||
baseInfo.avgPrice = vo.avgPrice;
|
||||
baseInfo.oneMonthUpDownRange = vo.oneMonthUpDownRange;
|
||||
|
||||
if(vo.rank){
|
||||
baseInfo.priceRate = vo.rank.substring(0, vo.rank.indexOf("/"));
|
||||
}
|
||||
|
||||
//baseInfo.cityPrice = vo.cityPrice;
|
||||
|
||||
var finishDate = ""
|
||||
if(vo.finishBuildingDate){
|
||||
if(vo.finishBuildingDate.indexOf("~")!=-1){
|
||||
finishDate = vo.finishBuildingDate.replace("年","");
|
||||
}else{
|
||||
finishDate = vo.finishBuildingDate.substring(0,4)+"年"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
baseInfo.finishBuildingDate = finishDate;
|
||||
baseInfo.householdCount = vo.householdCount;
|
||||
baseInfo.cubagePercent = vo.cubagePercent;
|
||||
baseInfo.carSiteCount = vo.carSiteCount;
|
||||
baseInfo.virescencePercent = vo.virescencePercent;
|
||||
baseInfo.estateCharge = vo.estateCharge;
|
||||
baseInfo.moreArea = vo.moreArea;
|
||||
baseInfo.developer = vo.developer;
|
||||
baseInfo.estateCompany = vo.estateCompany;
|
||||
|
||||
address = vo.address;
|
||||
tags = vo.poiTags;
|
||||
|
||||
if(vo.poiTags){
|
||||
if(vo.poiTags.length>=3){
|
||||
baseInfo.tags = vo.poiTags.slice(0,3);
|
||||
}else{
|
||||
baseInfo.tags = vo.poiTags;
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
$("#noDataDiv").show()
|
||||
baseInfo.name = "小区详情"
|
||||
}
|
||||
}
|
||||
|
||||
}).catch(function (error) {
|
||||
alert(error)
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
//附近小区
|
||||
/*function loadNearDistrict(lat, lng){
|
||||
axios.get("/rest/districts/nearDistrict", {
|
||||
params: {
|
||||
lat: lat,
|
||||
lng:lng
|
||||
}
|
||||
}).then(function (response) {
|
||||
var datas = response.data.data
|
||||
if(datas){
|
||||
var ret = []
|
||||
for(var v in datas){
|
||||
var o = datas[v]
|
||||
if(o.city == city && o.district == region && o.name == name){
|
||||
continue;
|
||||
}else{
|
||||
if(ret.length <= 5){
|
||||
ret.push(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
baseInfo.nearDists = ret;
|
||||
|
||||
$("#nearDistDiv .cardNearbyWin").css("width",(7.5*ret.length)+"rem");
|
||||
}else{
|
||||
$("#nearDistDiv").hide()
|
||||
}
|
||||
|
||||
}).catch(function (error) {
|
||||
alert(error)
|
||||
console.log(error);
|
||||
});
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
function loadKLineData(city, region, name){
|
||||
axios.get("/rest/trend/kData", {
|
||||
params: {
|
||||
city: city,
|
||||
region:region,
|
||||
name:name
|
||||
}
|
||||
}).then(function (response) {
|
||||
var datas = response.data.data
|
||||
if(datas){
|
||||
var trends = [];
|
||||
var counts = [];
|
||||
var times = []
|
||||
var haveCount = false;
|
||||
for(var d in datas){
|
||||
times.push(d);
|
||||
|
||||
var prices = new Array();
|
||||
for(var m in datas[d]){
|
||||
prices.push(datas[d][m]);
|
||||
}
|
||||
trends.push(prices);
|
||||
if(haveCount==false && datas[d][4]){
|
||||
haveCount = true;
|
||||
}
|
||||
counts.push(datas[d][4]);
|
||||
}
|
||||
|
||||
// if(haveCount){
|
||||
option01.xAxis[0].data = times
|
||||
option01.xAxis[1].data = times
|
||||
//option01.series[0].data = counts
|
||||
option01.series[0].data = trends
|
||||
curOption = option01;
|
||||
myChart01.setOption(option01,true);
|
||||
// }else{
|
||||
// option02.xAxis[0].data = times
|
||||
// option02.xAxis[1].data = times
|
||||
// option02.series[0].data = trends
|
||||
// curOption = option02;
|
||||
// myChart01.setOption(option02,true);
|
||||
// }
|
||||
}
|
||||
}).catch(function (error) {
|
||||
alert(error)
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
$("#trendDiv1 a").click(function(){
|
||||
$("#trendDiv1 a").removeClass("active")
|
||||
$(this).addClass("active")
|
||||
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);
|
||||
});
|
||||
|
||||
|
||||
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 += '<br/> 月初 : ' + params[0].value[1];
|
||||
res += '<br/> 月末 : ' + params[0].value[2];
|
||||
res += '<br/> 最低 : ' + params[0].value[3];
|
||||
res += '<br/> 最高 : ' + params[0].value[4];
|
||||
res += '<br/> '+params[0].seriesName + ' : ' +params[0].value;
|
||||
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: 50,
|
||||
end: 100,
|
||||
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' } },
|
||||
axisLabel: {
|
||||
formatter: function (value) {
|
||||
return echarts.format.formatTime('MM-dd', value);
|
||||
}
|
||||
},
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
axisPointer: {
|
||||
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: 'shadow',
|
||||
label: {show: false},
|
||||
triggerTooltip: true,
|
||||
handle: {
|
||||
show: true,
|
||||
margin: -20,
|
||||
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: {
|
||||
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: 'black',
|
||||
color0: '#333',
|
||||
borderColor: 'black',
|
||||
borderColor0: '#333'
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
/*var option02 = {
|
||||
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 += '<br/> 月初 : ' + params[0].value[1]
|
||||
res += '<br/> 月末 : ' + params[0].value[2];
|
||||
res += '<br/> 最低 : ' + params[0].value[3];
|
||||
res += '<br/> 最高 : ' + 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: 50,
|
||||
end: 100,
|
||||
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: '#999' } },
|
||||
axisLabel: {
|
||||
formatter: function (value) {
|
||||
return echarts.format.formatTime('yy-MM', value);
|
||||
}
|
||||
},
|
||||
min: 'dataMin',
|
||||
max: 'dataMax',
|
||||
axisPointer: {
|
||||
show: true
|
||||
}
|
||||
}, {
|
||||
type: 'category',
|
||||
gridIndex: 1,
|
||||
data: dates,
|
||||
scale: true,
|
||||
boundaryGap : false,
|
||||
splitLine: {show: false},
|
||||
axisLabel: {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: 30,
|
||||
color: '#B80C00'
|
||||
}
|
||||
}
|
||||
}],
|
||||
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: [ {
|
||||
type: 'candlestick',
|
||||
name: '均价',
|
||||
data: data,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#ff4500',
|
||||
color0: '#22ac38',
|
||||
borderColor: '#ff4500',
|
||||
borderColor0: '#22ac38'
|
||||
},
|
||||
emphasis: {
|
||||
color: 'black',
|
||||
color0: '#444',
|
||||
borderColor: 'black',
|
||||
borderColor0: '#444'
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
$("#trendDiv2 a").click(function(){
|
||||
$("#trendDiv2 a").removeClass("active")
|
||||
$(this).addClass("active")
|
||||
//var v = $(this).attr("t-v");
|
||||
loadRentTrends(city, region, name);
|
||||
});
|
||||
|
||||
/* 小区租金走势 */
|
||||
|
||||
function loadRentTrends(city, region, name){
|
||||
var type = $("#trendDiv2 a.active").attr("t-v")
|
||||
axios.get("/rest/trend/distRentTrends", {
|
||||
params: {
|
||||
city: city,
|
||||
region:region,
|
||||
name:name,
|
||||
type:type
|
||||
}
|
||||
}).then(function (response) {
|
||||
var re = response.data.data
|
||||
|
||||
|
||||
var categories = new Array();
|
||||
var series = new Array();
|
||||
|
||||
var m = re.times;
|
||||
var pm = re.distMap
|
||||
var rooms = re.rooms;
|
||||
|
||||
if(m && rooms.length>0){
|
||||
|
||||
for(var i=0;i<m.length;i++){
|
||||
categories.push(m[i]);
|
||||
}
|
||||
|
||||
for(var k in rooms){
|
||||
var room = rooms[k]
|
||||
var distM = pm[room];
|
||||
var distObj = new Object();
|
||||
var distDatas = new Array();
|
||||
|
||||
for(var i=0;i<m.length;i++){
|
||||
if(distM[m[i]] == undefined){
|
||||
distDatas.push(null);
|
||||
} else {
|
||||
distDatas.push(distM[m[i]]);
|
||||
}
|
||||
}
|
||||
distObj.name = room+"室"
|
||||
distObj.data = distDatas;
|
||||
distObj.type = 'line';
|
||||
distObj.symbolSize = 0;
|
||||
series.push(distObj);
|
||||
}
|
||||
|
||||
//showRentChart(categories, series);
|
||||
showRentChart2(categories, series);
|
||||
}else{
|
||||
//没数据
|
||||
$("#tabRentDiv").addClass("dn");
|
||||
}
|
||||
}).catch(function (error) {
|
||||
alert(error)
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function showRentChart2(categories, series){
|
||||
|
||||
|
||||
var option03 = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
textStyle: {
|
||||
fontFamily: 'arial,华文细黑',
|
||||
fontSize: 12
|
||||
}
|
||||
},
|
||||
grid:{
|
||||
x: 54,
|
||||
y: 10,
|
||||
x2: 16,
|
||||
y2: 60,
|
||||
borderWidth: 1
|
||||
},
|
||||
color: ['#F88C9F', '#FFBF5C', '#AAD672', '#78CDE6', '#AE94E9'],
|
||||
legend: {
|
||||
y: 'bottom',
|
||||
textStyle: {
|
||||
fontFamily: '华文细黑',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
itemWidth: 16,
|
||||
itemHeight: 8
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#ccc'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
fontFamily: 'arial',
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
data: categories,
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#ccc'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
fontFamily: 'arial',
|
||||
color: '#666'
|
||||
}
|
||||
}
|
||||
},
|
||||
series:series
|
||||
};
|
||||
|
||||
var myChart02 = echarts.init(document.getElementById('chart02'));
|
||||
myChart02.setOption(option03,true);
|
||||
}
|
||||
|
||||
/* 小区评级 */
|
||||
function loadDistrictLevel(){
|
||||
var option03 = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: '{d} : {c}'
|
||||
},
|
||||
calculable: true,
|
||||
radar: [
|
||||
{
|
||||
indicator: [
|
||||
{text: '活跃度评级', max: 100},
|
||||
{text: '板块评级', max: 100},
|
||||
{text: '教育评级', max: 100},
|
||||
{text: '物业评级', max: 100},
|
||||
],
|
||||
radius: 70,
|
||||
name: {
|
||||
textStyle: {
|
||||
color: '#333'
|
||||
}
|
||||
},
|
||||
splitArea: {
|
||||
areaStyle: {
|
||||
color: ['rgba(136,208,83,0.20)',
|
||||
'rgba(255,255,255,1)', 'rgba(136,208,83,0.20)',
|
||||
'rgba(255,255,255,1)', 'rgba(136,208,83,0.20)'],
|
||||
shadowColor: 'rgba(136,208,83,0.20)',
|
||||
shadowBlur: 10
|
||||
}
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: 'rgba(136,208,83,0.50)'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: 'rgba(136,208,83,0.25)'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '',
|
||||
type: 'radar',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
areaStyle: {
|
||||
type: 'default'
|
||||
},
|
||||
color: 'rgba(136,208,83,0.9)'
|
||||
}
|
||||
},
|
||||
data: [
|
||||
{
|
||||
name: '',
|
||||
value: [25.29, 85.13, 36.42, 57.23]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
var myChart03 = echarts.init(document.getElementById('chart03'));
|
||||
myChart03.setOption(option03,true);
|
||||
}
|
||||
@@ -70,28 +70,33 @@ $("#login_btn").on("click", function () {
|
||||
$.toast("请同意服务协议");
|
||||
return false;
|
||||
}
|
||||
plus.nativeUI.showWaiting();
|
||||
axios.post("/rest/user/smsLogin",
|
||||
{mobile: phoneNum,smsCode:code,province:province,city:city,region:region,pushClientId:getPushInfo(),deviceId:plus.device.uuid}
|
||||
).then(function (response) {
|
||||
var resData = response.data;
|
||||
if (resData.status) {
|
||||
// 用户登录成功的TOKEN
|
||||
var data = resData.data;
|
||||
localStorage.setItem("user_token", data.token);
|
||||
localStorage.setItem("user_token_add_time", new Date().getTime());
|
||||
$.toast(resData.message);
|
||||
if (data.firstLogin) {
|
||||
// 显示设置密码页面
|
||||
clicked('../user/updatePass.html',true,false,{},{},function(){
|
||||
back();
|
||||
})
|
||||
} else {
|
||||
back();
|
||||
}
|
||||
|
||||
} else {
|
||||
$.toast(resData.message);
|
||||
}
|
||||
})
|
||||
var resData = response.data;
|
||||
if (resData.status) {
|
||||
// 用户登录成功的TOKEN
|
||||
var data = resData.data;
|
||||
localStorage.setItem("user_token", data.token);
|
||||
localStorage.setItem("user_token_add_time", new Date().getTime());
|
||||
$.toast(resData.message);
|
||||
if (data.firstLogin) {
|
||||
// 显示设置密码页面
|
||||
clicked('../user/updatePass.html',true,false,{},{},function(){
|
||||
back();
|
||||
})
|
||||
} else {
|
||||
back();
|
||||
}
|
||||
|
||||
} else {
|
||||
$.toast(resData.message);
|
||||
}
|
||||
plus.nativeUI.closeWaiting();
|
||||
}).catch(function (error) {
|
||||
$.toast(error);
|
||||
plus.nativeUI.closeWaiting();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -72,7 +72,28 @@ function userinfo(a){
|
||||
});
|
||||
}
|
||||
|
||||
function utf16toEntities(str) {
|
||||
var patt = /[\ud800-\udbff][\udc00-\udfff]/g; // 检测utf16字符正则
|
||||
str = str.replace(patt, function(char) {
|
||||
var H, L, code;
|
||||
if (char.length === 2) {
|
||||
H = char.charCodeAt(0);
|
||||
// 取出高位
|
||||
L = char.charCodeAt(1);
|
||||
// 取出低位
|
||||
code = (H - 0xD800) * 0x400 + 0x10000 + L - 0xDC00;
|
||||
//转换算法
|
||||
return "&#" + code + ";";
|
||||
} else {
|
||||
return char;
|
||||
}
|
||||
});
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
function login(openid, unionid, accessToken, nickname, headImg, loginFrom, uri) {
|
||||
nickname = utf16toEntities(nickname)
|
||||
axios.post(uri, {loginFrom:loginFrom,openid:openid, unionid:unionid, accessToken: accessToken, nickname:nickname,headImg:headImg})
|
||||
.then(function (response) {
|
||||
$.hidePreloader();
|
||||
|
||||
@@ -6,7 +6,12 @@ var searchDistVue = new Vue({
|
||||
},methods: {
|
||||
openDistrictDetail:function(index) {
|
||||
saveHistory({district:this.searchDistricts[index].region,name:this.searchDistricts[index].name,city:this.searchDistricts[index].city})
|
||||
clicked(BASE_PATH+'/district/details?city='+this.searchDistricts[index].city+'®ion='+this.searchDistricts[index].region+'&name='+this.searchDistricts[index].name,true);
|
||||
//clicked(BASE_PATH+'/district/details?city='+this.searchDistricts[index].city+'®ion='+this.searchDistricts[index].region+'&name='+this.searchDistricts[index].name,true);
|
||||
if(cat=="district"){
|
||||
clicked('views/district/detail.html',true,false,{},{city:this.searchDistricts[index].city,region:this.searchDistricts[index].region,name:this.searchDistricts[index].name});
|
||||
}else if(cat == "rent"){
|
||||
clicked('views/rent/rent.html',true,false,{},{city:this.searchDistricts[index].city,region:this.searchDistricts[index].region,name:this.searchDistricts[index].name})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -91,11 +96,21 @@ function recover() {
|
||||
}
|
||||
/* 弹出搜索小区页面 */
|
||||
$("body").delegate(".open-about02", "click", function () {
|
||||
alert("ssss");
|
||||
$("#districtName").val("");
|
||||
if($("#input_city").text()==""){
|
||||
$.toast("请选择城市")
|
||||
return false;
|
||||
}
|
||||
|
||||
var text = $(this).text().trim();
|
||||
|
||||
if(text=="房价查询"){
|
||||
cat = "district"
|
||||
}else if(text=="房租查询"){
|
||||
cat = "rent"
|
||||
}
|
||||
alert("test:"+text+" cat:"+cat)
|
||||
$('.historyList').show();
|
||||
$("#notFound").hide();
|
||||
$('.hotList').show();
|
||||
@@ -145,7 +160,11 @@ var historyVue = new Vue({
|
||||
histories: histories
|
||||
},methods: {
|
||||
openHistoryDetail:function(index) {
|
||||
clicked(BASE_PATH+'/district/details?city='+this.histories[index].city+'®ion='+this.histories[index].region+'&name='+this.histories[index].name,true);
|
||||
if(cat=="district"){
|
||||
clicked('views/district/detail.html',true,false,{},{city:this.searchDistricts[index].city,region:this.searchDistricts[index].region,name:this.searchDistricts[index].name});
|
||||
}else if(cat == "rent"){
|
||||
clicked('views/rent/rent.html',true,false,{},{city:this.searchDistricts[index].city,region:this.searchDistricts[index].region,name:this.searchDistricts[index].name})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user