图表修改
This commit is contained in:
@@ -77,20 +77,21 @@ function removeCollect(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//图表 初始化
|
||||||
function inintChart(){
|
function inintChart(){
|
||||||
|
var type = $("#trendDiv1 a.active").attr("t-v");
|
||||||
/* 小区均价分析 */
|
/* 小区均价分析 */
|
||||||
loadLineData(city, region, name, 6)
|
loadLineData(city, region, name, type)
|
||||||
/* 小区租金走势 */
|
/* 小区租金走势 */
|
||||||
loadRentTrends(city, region, name,2);
|
loadRentTrends(city, region, name,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickLineChart(e){
|
function clickLineChart(type){
|
||||||
$("#trendDiv1 a").removeClass("active")
|
|
||||||
$(e).addClass("active")
|
|
||||||
if(mode == "kLine"){
|
if(mode == "kLine"){
|
||||||
loadKLineData(city, region, name);
|
loadKLineData(city, region, name, type)
|
||||||
}else if(mode == "line"){
|
}else if(mode == "line"){
|
||||||
loadLineData(city, region, name);
|
loadLineData(city, region, name, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -102,7 +103,8 @@ function lineChart() {
|
|||||||
$(".icon-chart01").show();
|
$(".icon-chart01").show();
|
||||||
$("#chart01a").css("z-index","-1");
|
$("#chart01a").css("z-index","-1");
|
||||||
$("#chart01").css("z-index","1");
|
$("#chart01").css("z-index","1");
|
||||||
loadKLineData(city, region, name);
|
var type = $("#trendDiv1 a.active").attr("t-v");
|
||||||
|
loadKLineData(city, region, name, type);
|
||||||
}
|
}
|
||||||
function kLineChart() {
|
function kLineChart() {
|
||||||
mode = "line"
|
mode = "line"
|
||||||
@@ -110,7 +112,8 @@ function kLineChart() {
|
|||||||
$(".icon-chart01a").show();
|
$(".icon-chart01a").show();
|
||||||
$("#chart01").css("z-index","-1");
|
$("#chart01").css("z-index","-1");
|
||||||
$("#chart01a").css("z-index","1");
|
$("#chart01a").css("z-index","1");
|
||||||
|
var type = $("#trendDiv1 a.active").attr("t-v");
|
||||||
|
loadLineData(city, region, name, type);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -127,9 +130,41 @@ function showLoadRentTrends(type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function loadKLineData(city, region, name){
|
function loadKLineData(city, region, name, type){
|
||||||
var type = $("#trendDiv1 a.active").attr("t-v");
|
if(type == "36"){
|
||||||
axios.get("/rest/trend/kData", {
|
if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") {
|
||||||
|
clicked('../user/codeSms.html',true,false,{},{},function(){
|
||||||
|
|
||||||
|
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$("#trendDiv1 a").removeClass("active")
|
||||||
|
$("a[t-v='36']").addClass("active")
|
||||||
|
doLoadKLineData(city, region, name, type)
|
||||||
|
plus.webview.getWebviewById('views/user/userInfo.html').reload();
|
||||||
|
plus.webview.getWebviewById('views/house/houseDetail.html').reload();
|
||||||
|
plus.webview.getWebviewById('views/house/houseManageList.html').reload();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
$("#trendDiv1 a").removeClass("active")
|
||||||
|
$("a[t-v='36']").addClass("active")
|
||||||
|
doLoadKLineData(city, region, name, type)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$("#trendDiv1 a").removeClass("active")
|
||||||
|
if(type == 12){
|
||||||
|
$("a[t-v='12']").addClass("active")
|
||||||
|
}else{
|
||||||
|
$("a[t-v='6']").addClass("active")
|
||||||
|
}
|
||||||
|
doLoadKLineData(city, region, name, type)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function doLoadKLineData(city, region, name, type){
|
||||||
|
axios.get("/rest/trend/kData", {
|
||||||
params: {
|
params: {
|
||||||
city: city,
|
city: city,
|
||||||
region:region,
|
region:region,
|
||||||
@@ -522,6 +557,7 @@ function showRentChart2(categories, series, roomDatas){
|
|||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
|
scale: true,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#ccc'
|
color: '#ccc'
|
||||||
@@ -611,8 +647,42 @@ myChart03.setOption(option03,true);
|
|||||||
|
|
||||||
|
|
||||||
//曲线图
|
//曲线图
|
||||||
function loadLineData(city, region, name){
|
function loadLineData(city, region, name, type){
|
||||||
var type = $("#trendDiv1 a.active").attr("t-v");
|
//var type = $("#trendDiv1 a.active").attr("t-v");
|
||||||
|
if(type == "36"){
|
||||||
|
if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") {
|
||||||
|
clicked('../user/codeSms.html',true,false,{},{},function(){
|
||||||
|
|
||||||
|
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$("#trendDiv1 a").removeClass("active")
|
||||||
|
$("a[t-v='36']").addClass("active")
|
||||||
|
doLoadLineData(city, region, name, type)
|
||||||
|
plus.webview.getWebviewById('views/user/userInfo.html').reload();
|
||||||
|
plus.webview.getWebviewById('views/house/houseDetail.html').reload();
|
||||||
|
plus.webview.getWebviewById('views/house/houseManageList.html').reload();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
$("#trendDiv1 a").removeClass("active")
|
||||||
|
$("a[t-v='36']").addClass("active")
|
||||||
|
doLoadLineData(city, region, name, type)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$("#trendDiv1 a").removeClass("active")
|
||||||
|
if(type == 12){
|
||||||
|
$("a[t-v='12']").addClass("active")
|
||||||
|
}else{
|
||||||
|
$("a[t-v='6']").addClass("active")
|
||||||
|
}
|
||||||
|
doLoadLineData(city, region, name, type)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function doLoadLineData(city, region, name, type){
|
||||||
axios.get("/rest/trend/distTrends", {
|
axios.get("/rest/trend/distTrends", {
|
||||||
params: {
|
params: {
|
||||||
city: city,
|
city: city,
|
||||||
@@ -639,11 +709,7 @@ function loadLineData(city, region, name){
|
|||||||
|
|
||||||
//option01b.xAxis.data = times
|
//option01b.xAxis.data = times
|
||||||
//option01b.series.data = districtTrends
|
//option01b.series.data = districtTrends
|
||||||
|
|
||||||
showLineChart(times, districtTrends);
|
showLineChart(times, districtTrends);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|||||||
@@ -119,9 +119,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="content-block" id="trendDiv1">
|
<div class="content-block" id="trendDiv1">
|
||||||
<div class="buttons-row theme">
|
<div class="buttons-row theme">
|
||||||
<a class="tab-link button active" onclick="clickLineChart(this)" t-v="6">半年</a>
|
<a class="tab-link button active" onclick="clickLineChart(6)" t-v="6">半年</a>
|
||||||
<a class="tab-link button" onclick="clickLineChart(this)" t-v="12">一年</a>
|
<a class="tab-link button" onclick="clickLineChart(12)" t-v="12">一年</a>
|
||||||
<a class="tab-link button" onclick="clickLineChart(this)" t-v="36">三年</a>
|
<a class="tab-link button" onclick="clickLineChart(36)" t-v="36">三年</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -264,8 +264,8 @@ $.config = {router: false}
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
var city = "上海"
|
var city = "上海"
|
||||||
var region = "长宁"
|
var region = "青浦"
|
||||||
var name = "新泾三村"
|
var name = "南山雨果"
|
||||||
var mode = "line"
|
var mode = "line"
|
||||||
|
|
||||||
var lat;
|
var lat;
|
||||||
|
|||||||
@@ -226,7 +226,40 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="topic">
|
|
||||||
|
<div class="topic">
|
||||||
|
<div class="topicTitle">小区走势分析</div>
|
||||||
|
<div class="topicContent" style="padding:0;padding-bottom:0.75rem;">
|
||||||
|
<div class="topicTitle topicTitle01" style="position:relative;">均价
|
||||||
|
<div class="icon01Box">
|
||||||
|
<i class="icon icon-chart01a" onclick="lineChart()"></i>
|
||||||
|
<i class="icon icon-chart01 dn" onclick="kLineChart()"></i>
|
||||||
|
</div>
|
||||||
|
<div class="content-block" id="trendDiv1">
|
||||||
|
<div class="buttons-row theme">
|
||||||
|
<a class="tab-link button active" onclick="clickLineChart(6)" t-v="6">半年</a>
|
||||||
|
<a class="tab-link button" onclick="clickLineChart(12)" t-v="12">一年</a>
|
||||||
|
<a class="tab-link button" onclick="clickLineChart(36)" t-v="36">三年</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="chart01Box">
|
||||||
|
<div class="chart" id="chart01a"></div>
|
||||||
|
<div class="chart" id="chart01"></div>
|
||||||
|
</div>
|
||||||
|
<div class="topicTitle topicTitle01" style="position:relative;border-top:solid 1px #e7e7e7;">租金
|
||||||
|
<div class="content-block">
|
||||||
|
<div class="buttons-row theme" id="trendDiv2">
|
||||||
|
<a t-v="2" id="trendDivTab2" class="tab-link button active" onclick="showLoadRentTrends(2)">半年</a>
|
||||||
|
<a t-v="3" id="trendDivTab3" class="tab-link button" onclick="showLoadRentTrends(3)">一年</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="chart" id="chart02"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--<div class="topic">
|
||||||
<div class="topicTitle">小区走势分析</div>
|
<div class="topicTitle">小区走势分析</div>
|
||||||
<div class="topicContent" style="padding:0;padding-bottom:0.75rem;">
|
<div class="topicContent" style="padding:0;padding-bottom:0.75rem;">
|
||||||
<div class="topicTitle topicTitle01" style="position:relative;">均价
|
<div class="topicTitle topicTitle01" style="position:relative;">均价
|
||||||
@@ -249,7 +282,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="chart" id="chart02"></div>
|
<div class="chart" id="chart02"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>-->
|
||||||
|
|
||||||
<div class="topic" v-show="rentRooms.length>0">
|
<div class="topic" v-show="rentRooms.length>0">
|
||||||
<div class="topicTitle" style="border-bottom:solid 1px #e7e7e7;">小区本月租金</div>
|
<div class="topicTitle" style="border-bottom:solid 1px #e7e7e7;">小区本月租金</div>
|
||||||
<div class="topicContent" style="padding:0.5rem 0;">
|
<div class="topicContent" style="padding:0.5rem 0;">
|
||||||
@@ -329,6 +363,7 @@ var name;
|
|||||||
var oriCity;
|
var oriCity;
|
||||||
var oriRegion;
|
var oriRegion;
|
||||||
var oriName;
|
var oriName;
|
||||||
|
var mode = "line"
|
||||||
//扩展API加载完毕,现在可以正常调用扩展API
|
//扩展API加载完毕,现在可以正常调用扩展API
|
||||||
function onPlusReady(){
|
function onPlusReady(){
|
||||||
var self = plus.webview.currentWebview();
|
var self = plus.webview.currentWebview();
|
||||||
@@ -561,10 +596,7 @@ function loadMap(){
|
|||||||
}
|
}
|
||||||
function loadChart(){
|
function loadChart(){
|
||||||
if(city && region && name){
|
if(city && region && name){
|
||||||
/* 小区均价分析 */
|
inintChart(city, region, name);
|
||||||
loadKLineData(city, region, name);
|
|
||||||
/* 小区租金走势 */
|
|
||||||
loadRentTrends(city, region, name);
|
|
||||||
window.clearInterval(t2);
|
window.clearInterval(t2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user