Files
youfang-app/fangija-zsyf/views/evaluate/evaluateReport.html
T
2018-05-30 14:56:08 +08:00

577 lines
16 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>评估报告</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="../../css/sm.css">
<link rel="stylesheet" href="../../css/main.css">
<link rel="stylesheet" href="../../css/theme-orange.css">
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=0a7eM0lkIvpKGPiq1bMCfeH7"></script>
<style>
.list-block ul:before{height:0;}
.priceRecovery + .list-block ul:after{height:0;}
</style>
</head>
<body>
<div class="page-group">
<div class="page page-current">
<header class="bar bar-nav barBorder">
<button class="button button-link button-nav pull-left" onclick="back(),plus.nativeUI.closeWaiting();">
<span class="icon icon-left"></span>
</button>
<button class="button button-link button-nav pull-right open-popover" onclick="share()">
<span class="icon icon-share"></span>
</button>
<h1 class="title">评估报告</h1>
</header>
<div class="content">
<div class="list-block media-list" id="house_info" v-cloak>
<ul>
<li>
<div class="item-content">
<div class="item-inner">
<div class="item-title-row">
<div class="item-title"><label><b>{{name}}</b></label><span class="span01">{{city_region}}</span></div>
</div>
<div class="item-title-row">
<div class="item-title"><small>{{house_room_num}}</small></div>
</div>
</div>
</div>
<a class="add add01 button theme" onclick="openaddWindow()">再估一套</a>
</li>
</ul>
</div>
<div class="card cardPrice cardPrice01" id="house_price" v-cloak>
<div class="card-header">
<span>评估总价</span>
<span>均价:<em>{{avg_price}}</em></span>
</div>
<div class="card-content">
<div class="card-content-inner">{{total_price}}<span>{{w}}</span></div>
</div>
<div class="card-footer">
<span>
<em><strong>{{percentage_30}}</strong>{{p}}<i v-bind:class="arrow"></i></em>
<label>近30天涨跌幅</label>
</span>
<span>
<em>{{compare_word}} <strong>{{compare_money}}</strong> {{words}}</em>
<label>相比{{city}}均价</label>
</span>
</div>
</div>
<!--<div class="card cardPrice cardPrice02" id="evaluate_msg">
<div class="card-footer">
<span>
<em><strong>{{evaluate_percent}}</strong>%<i v-bind:class="arrow"></i></em>
<label>{{evaluate_words}}</label>
</span>
<span>
<label style="color:#666;">{{msg}}</label>
</span>
</div>
</div>-->
<div class="content-block priceRecovery" id="price_feedback" v-bind:style="{display:isShow}">
<p><label>估的准吗?</label></p>
<p><small>您的反馈很重要,是我们努力的动力</small></p>
<div class="row">
<div class="col-50"><a class="button" v-on:click="feedback(1,$event)">高了</a></div>
<div class="col-50"><a class="button" v-on:click="feedback(0,$event)">低了</a></div>
</div>
</div>
<div class="list-block media-list mb05" id="addToMyHouse">
<ul>
<li>
<div class="item-content">
<div class="item-inner" style="padding:0.75rem 0;">
<div class="item-title-row">
<div class="item-title" style="width:65%;overflow:visible;white-space:normal;font-size:0.75rem;">加入"我的房产",随时掌握房产价值变化</div>
<div class="item-after"><a class="add add01 button theme open-vertical-modal" id="addHouse">立即添加</a></div>
</div>
</div>
</div>
</li>
</ul>
</div>
<a class="ad bb" href="#"><img id="img"></a>
<div class="topic">
<div class="topicTitle" style="position:relative;">均价走势
<div class="content-block">
<div class="buttons-row theme avgPriceTrend">
<a href="#tabChartAvg1" data-id="2" class="tab-link button active">半年</a>
<a href="#tabChartAvg2" data-id="3" class="tab-link button">一年</a>
<a href="#tabChartAvg3" data-id="5" class="tab-link button">三年</a>
</div>
</div>
</div>
<div class="topicContent" style="padding:0;">
<div class="chart" id="chart02"></div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="../../js/zepto.js" charset="utf-8"></script>
<script>
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
var jQuery = $
$.config = {router: false}
</script>
<script type="text/javascript" src="../../js/vue.js"></script>
<script type="text/javascript" src="../../js/beacon_release.js"></script>
<script type="text/javascript" src="../../js/light7.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/cn.js" charset="utf-8"></script>
<script type="text/javascript" src="../../js/mui.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../../config.js"></script>
<script type="text/javascript" src="../../js/common.js" ></script>
<script type="text/javascript" src="../../js/axios.min.js"></script>
<script type="text/javascript" src="../../js/axiosPlugin.js"></script>
<script type="text/javascript" src="../../js/log/log_stat.js" ></script>
<script type="text/javascript" src="../../js/shara/sharaMine.js" ></script>
<script type="text/javascript" src="../../js/ad_position_image.js"></script>
<script type="text/javascript" src="../../config.js"></script>
<!--加解密 start-->
<script type="text/javascript" src="../../js/aes.js" ></script>
<script type="text/javascript" src="../../js/crypto-js.js" ></script>
<script type="text/javascript" src="../../js/pad-zeropadding.js" ></script>
<script type="text/javascript" src="../../js/AES_UTILS.js" ></script>
<!--加解密 end-->
<script>
var shareUrl = getShareDomain(BASE_PATH)+"/fsh/evaluateReport?";
var sharehrefTitle = "小区名";
var sharehrefDes = "小区详情介绍!";
var shareId='';
var picUrl = '_www/images/default_share.png';
var hid = "";
document.addEventListener('plusready', onPlusReady, false);
function onPlusReady(){
var self = plus.webview.currentWebview();
hid = self.hid;
var houseStatus = ""
shareUrl = shareUrl+"hid="+hid;
sharehrefTitle = "小区评估报告";
var house_info = new Vue({
el:'#house_info',
data:{
name:"",
city_region:"",
house_room_num:""
}
})
var house_price = new Vue({
el:"#house_price",
data:{
total_price:"",
avg_price:"",
percentage_30:"",
arrow:"",
city:"",
compare_word:"",
compare_money:"",
words:"",
p:"",
w:""
}
})
// var evaluate_msg = new Vue({
// el:"#evaluate_msg",
// data:{
// evaluate_percent:"",
// evaluate_words:"",
// arrow:"",
// msg:""
// }
// })
var price_feedback = new Vue({
el:"#price_feedback",
data:{
isShow:"display"
},
methods:{
feedback:function(i,event){
var eventType = "priceFeedbackClick";
var dataMap = {};
dataMap["hid"]=hid
dataMap["reason"]=i
saveBehaviorLog(eventType,dataMap); //保存用户点击事件
if($(event.target).hasClass("theme")){
return;
}
axios.post("/rest/evaluate/feedBack",{
hid:hid,
reason:i
}).then(function(response){
$.toast("感谢您的反馈!")
$("#price_feedback").hide();
}).catch(function(error){console.log(error)})
},
isFeedback:function(){
axios.get("/rest/evaluate/isFeedBack",{params:{
id:hid
}}).then(function(response){
if(response.data.status){
if(1==response.data.data){
price_feedback.isShow="none"
}
}
}).catch(function(error){console.log(error)})
}
},mounted:function(){
this.isFeedback();
}
})
axios.get("/rest/evaluate/queryHouseInfo",{
params:{id : hid}
}).then(function(response){
if(response.data.status){
h = response.data.data
house_info.name = h.name
sharehrefTitle=h.name+"评估报告"
house_info.city_region = h.city+"-"+h.region
house_info.house_room_num = (h.houseRoomNum==null||h.houseRoomNum=="")?"暂无":h.houseRoomNum;
// house_info.house_type = (h.roomCount==0?"":h.roomCount+"室")+(h.hallCount==0?"":h.hallCount+"厅 ")+(h.area==0?"":h.area+"㎡ ")+((h.floor==0||h.height==0)?"":h.floor+"/"+h.height+"层")
if(h.totalPrice==0){
house_price.total_price = "暂无";
}else{
house_price.total_price = (h.totalPrice/10000).toFixed(2)
house_price.w = "万"
}
house_price.avg_price = h.avgPrice==0?"暂无":h.avgPrice+"元/㎡"
house_price.percentage_30=h.oneMonthUpDownRange==0?"暂无":h.oneMonthUpDownRange
if(h.oneMonthUpDownRange<0){
house_price.arrow="icon icon-arrow-green"
house_price.percentage_30=-h.oneMonthUpDownRange
house_price.p = "%"
}else if(h.oneMonthUpDownRange>0){
house_price.arrow="icon icon-arrow-red"
house_price.percentage_30=h.oneMonthUpDownRange
house_price.p = "%"
}else{
house_price.percentage_30="暂无"
}
house_price.city=h.city
if(h.avgPrice==0){
house_price.words="暂无"
}else{
if(h.compareMoney<0){
house_price.compare_word="低"
house_price.words="元"
house_price.compare_money=-h.compareMoney
}else if(h.compareMoney>0){
house_price.compare_word="高"
house_price.words="元"
house_price.compare_money=h.compareMoney
}else{
//house_price.compare_money="相等"
house_price.compare_word="高"
house_price.words="元"
house_price.compare_money=0
}
}
// if(h.evaluatePercent<0){
// evaluate_msg.evaluate_words="下跌概率"
// evaluate_msg.arrow="icon icon-arrow-green"
// evaluate_msg.evaluate_percent=-h.evaluatePercent
// }else if(h.evaluatePercent>0){
// evaluate_msg.evaluate_words="上涨概率"
// evaluate_msg.arrow="icon icon-arrow-red"
// evaluate_msg.evaluate_percent=h.evaluatePercent
// }else{
// evaluate_msg.evaluate_words="暂无"
// }
// evaluate_msg.msg=h.evaluateMsg
loadingChart(h.city,h.region,h.name,2)
//按照时间范围加载数据
$(".avgPriceTrend a").click(function(){
var type = $(this).attr("data-id");
$(".avgPriceTrend a").removeClass("active")
$(this).addClass('active');
loadingChart(h.city,h.region,h.name,type);
});
houseStatus = h.houseStatus;
}
}).catch(function(error){
console.log(error)
})
/* 房产用途 */
$(document).on('click','.open-vertical-modal', function () {
var houseStatus = 0;
$.modal({
title: '房产用途',
verticalButtons: true,
buttons: [
{
text: '自住',
onClick: function() {
addManagement(hid, houseStatus, "自住");
}
},
{
text: '出租',
onClick: function() {
addManagement(hid, houseStatus, "出租");
}
},
{
text: '空置',
onClick: function() {
addManagement(hid, houseStatus, "空置");
}
},
{
text: '取消'
}
]
})
});
//更新分享服务
updateSerivces();
var device = plus.device.uuid;
add_imgage("img",EVALUATE_REPORT,device);//传入广告位的imgId
}
//添加管理AJAX请求
function addManagement(id, houseStatus, liveStatus){
var eventType = "addManageClick";
var dataMap = {};
dataMap["hid"]=id;
dataMap["liveStatus"]=liveStatus;
saveBehaviorLog(eventType,dataMap); //保存用户点击事件
axios.post(BASE_PATH + "/rest/evaluate/addManagement",
{
id: id,
houseStatus: houseStatus,
liveStatus: liveStatus
}).then(function (response) {
var status = response.data.status;
if(status){
$.toast(response.data.data);
if(plus.webview.getWebviewById('views/house/houseManageList.html') != null) {
plus.webview.getWebviewById('views/house/houseManageList.html').reload();
}
if(plus.webview.getWebviewById('views/user/userInfo.html')!= null){
plus.webview.getWebviewById('views/user/userInfo.html').reload();
}
$("#addToMyHouse").hide();
}else{
$.toast(response.data.message);
}
}).catch(function (error) {
console.log(error);
});
}
</script>
<script>
/* button状态切换 */
$(".priceRecovery .col-50 .button").on("click", function () {
$(".priceRecovery .col-50 .button").removeClass("theme");
$(this).addClass("theme");
});
/* button状态切换 */
$(".content-block .button").on("click", function () {
$(this).parent().children().removeClass("active");
$(this).addClass("active");
});
</script>
<script src="../../js/highcharts-4.2.3.js"></script>
<script>
function getNowFormatDate(date) {
var seperator1 = "-";
var year = date.getFullYear();
var month = date.getMonth() + 1;
if (month >= 1 && month <= 9) {
month = "0" + month;
}
var currentdate = year + seperator1 + month ;
return currentdate;
}
function loadingChart(city, region, name,type){
axios.get("/fsh/getDistrictPriceZouShi",{
params:{city : city,region:region,name:name,type:type}
}).then(function(response){
var re = response.data;
var categories = new Array();
var series = new Array();
var cityObj = new Object();
var regionObj = new Object();
var districtObj = new Object();
districtObj.name = '小区';
regionObj.name = '区县';
cityObj.name = '城市';
series.push(districtObj);
series.push(regionObj);
series.push(cityObj);
var cityDatas = new Array();
var regionDatas = new Array();
var districtDatas = new Array();
var m = re.timeKeys;
if(m){
for(var i=0;i<m.length;i++){
var date = new Date(Number(m[i]))
//
categories.push(getNowFormatDate(date));
if(re.cityAvgZouShi[m[i]] == undefined){
cityDatas.push(null);
} else {
cityDatas.push(re.cityAvgZouShi[m[i]]);
}
if (re.regionAvgZouShi[m[i]] == undefined) {
regionDatas.push(null);
} else {
regionDatas.push(re.regionAvgZouShi[m[i]]);
}
if (re.districtAvgZouShi[m[i]] == undefined){
districtDatas.push(null);
} else {
districtDatas.push(re.districtAvgZouShi[m[i]]);
}
}
}
cityObj.data = cityDatas;
regionObj.data = regionDatas;
districtObj.data = districtDatas;
showChat(categories, series);
}).catch(function(error){
console.log(error)
})
}
/* 均价走势 */
function showChat(categories, series) {
charts =Highcharts.chart('chart02', {
title: {
text: '',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
colors: ['#50a5fc', '#666', '#ff560c'],
xAxis: {
categories: categories,
boundaryGap: false,
tickInterval: 3,
tickLength: 8,
labels: {
style: {
'font-size': '12px'
}
}
},
yAxis: {
allowDecimals: false,
title: {
text: ''
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '元/㎡'
},
plotOptions: {
line: {
connectNulls:true//该设置会连接空值点
},
series: {
events: {
legendItemClick: function(event) {
return false;
}
},
marker: {
radius: 3, //曲线点半径,默认是4
symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
}
}
},
legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom',
y: -15,
borderWidth: 0
},
series: series,
credits: {
enabled: false
}
})
}
function openaddWindow(){
clicked('/views/house/add.html',true,false,{},{type:1},function(){
})
}
function share(){
var eventType = "shareEvaluateClick";
var dataMap = {};
dataMap["hid"]=hid;
dataMap["type"]="evaluate";
saveBehaviorLog(eventType,dataMap); //保存用户点击事件
shareHref();
}
</script>
</body>
</html>