This commit is contained in:
zongzhimin
2018-04-11 14:17:05 +08:00
parent f5c287ed0d
commit aecad0be45
27 changed files with 1868 additions and 588 deletions
File diff suppressed because it is too large Load Diff
+94 -27
View File
@@ -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
}
]
}
+41
View File
@@ -0,0 +1,41 @@
/**
* 日志记录,依赖于axios.min.js,axiosPlugin.js
* @author yinjihuan
*/
document.addEventListener('plusready', function() {
savePageLog()
}, false);
/**
* 记录页面访问日志
*/
function savePageLog() {
var page = document.getElementsByTagName("title")[0].innerHTML;
var device = plus.device.uuid;
var model = plus.device.model;
plus.geolocation.getCurrentPosition(function(p){
province = p.address.province;
city = p.address.city;
region = p.address.district;
lng = p.coords.longitude;
lat = p.coords.latitude;
address = p.address.street;
doSavePageLog({page:page, lng:lng, lat:lat, province:province, city:city, region:region, address:address, device:device, model:model});
}, function(e){
doSavePageLog({page:page, device:device, model:model});
},
{
provider:'baidu',
enableHighAccuracy:true,
coordsType:'bd09ll'
}
);
}
function doSavePageLog(data) {
axios.post("/rest/log/save", data).then(function (response) {
}).catch(function (error) {
console.log(error);
});
}