248 lines
9.5 KiB
HTML
248 lines
9.5 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">
|
|
|
|
<style>
|
|
.list-block .item-title{font-size:0.85rem;}
|
|
.list-block .item-title span.span01{font-size:0.7rem;color:#666;margin-left:0.3rem;}
|
|
.icon-add{width:0.6rem;height:0.6rem;background:url(../../images/icon-add.png) no-repeat center center;background-size:100%;margin-right:0.3rem;}
|
|
.star .icon{width:0.7rem;height:0.7rem;background:url(../../images/icon-star.png) no-repeat center center;background-size:100%;margin-right:0.1rem;vertical-align:sub;}
|
|
.star .icon-star01{background:url(../../images/icon-star01.png) no-repeat center center;background-size:100%;}
|
|
.star .icon-star02{background:url(../../images/icon-star02.png) no-repeat center center;background-size:100%;}
|
|
.list-block .add{background:none;font-size:0.75rem;color:#F18D00;position:absolute;top:0;right:0;padding:0.5rem 0.75rem;}
|
|
.list-block .add01{padding:0 0.5rem;top:1.1rem;right:0.75rem;}
|
|
.list-block .item-subtitle em.em02{font-size:0.75rem;color:#EB5F34;}
|
|
.list-block .item-subtitle div.price{position:absolute;bottom:-0.3rem;right:0;}
|
|
.list-block .item-subtitle div.price em strong{font-size:1.4rem;color:#EB5F34;font-weight:bold;margin-right:0.1rem;}
|
|
/**添加loading加载效果**/
|
|
.loadingBg{width:100%;height:100%;background:#fff;overflow:hidden;position:absolute;top:71px;left:0;z-index:100;}
|
|
.loadingBg .infinite-scroll-preloader{margin-top:60%;}
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="page-group">
|
|
<div class="page page-current">
|
|
<header class="bar bar-nav">
|
|
<button class="button button-link button-nav pull-left" onclick="back(),plus.nativeUI.closeWaiting();">
|
|
<span class="icon icon-left"></span>
|
|
</button>
|
|
<h1 class="title">房产评估</h1>
|
|
</header>
|
|
<!-- 加载loading页 -->
|
|
<div class="loadingBg">
|
|
<div class="infinite-scroll-preloader">
|
|
<div class="preloader"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<div class="list-block media-list">
|
|
<!-- 动态封装部分 begin -->
|
|
<ul>
|
|
|
|
</ul>
|
|
<!-- 动态封装部分 end -->
|
|
</div>
|
|
<div class="content-block" style="display: none;">
|
|
<p><a onclick="openaddWindow()" class="button button-big button-fill theme">立即评估</a></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript" src="../../js/zepto.js" charset="utf-8"></script>
|
|
|
|
<script>
|
|
|
|
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
|
|
Zepto = $
|
|
$.config = {router: false}
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript" src="../../js/beacon_release.js"></script>
|
|
<script type="text/javascript" src="../../js/vue.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/shara/sharaMine.js" ></script>
|
|
<script type="text/javascript" src="../../js/log/log_stat.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 uid = "162167854504869888";
|
|
//调用mui.init方法
|
|
$.init();
|
|
|
|
/* 房产用途 */
|
|
$(document).on('click','.open-vertical-modal', function () {
|
|
//获取对应<li>栏目存储的houseinfo id
|
|
var id = $(this).attr("id");
|
|
var houseStatus = 0;
|
|
$.modal({
|
|
title: '房产用途',
|
|
verticalButtons: true,
|
|
buttons: [
|
|
{
|
|
text: '自住',
|
|
onClick: function() {
|
|
addManagement(id, houseStatus, "自住");
|
|
}
|
|
},
|
|
{
|
|
text: '出租',
|
|
onClick: function() {
|
|
addManagement(id, houseStatus, "出租");
|
|
}
|
|
},
|
|
{
|
|
text: '空置',
|
|
onClick: function() {
|
|
addManagement(id, houseStatus, "空置");
|
|
}
|
|
},
|
|
{
|
|
text: '取消'
|
|
}
|
|
]
|
|
})
|
|
});
|
|
|
|
//添加管理AJAX请求
|
|
function addManagement(id, houseStatus, liveStatus){
|
|
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);
|
|
window.location.reload();
|
|
}else{
|
|
$.toast(response.data.message);
|
|
}
|
|
}).catch(function (error) {
|
|
console.log(error);
|
|
});
|
|
}
|
|
|
|
//查询房产评估列表AJAX请求
|
|
function selectEvaluateList(){
|
|
//先清空列表
|
|
$('.list-block ul').html("");
|
|
var htmlContent = '';
|
|
axios.get(BASE_PATH + "/rest/evaluate/houseinfolist",
|
|
{
|
|
params: {}
|
|
}).then(function (response) {
|
|
var resultsMap = response.data.data;
|
|
var results = resultsMap.houseInfoList;
|
|
var xqOneMonthUpDownRangeMap = resultsMap.xqOneMonthUpDownRangeMap;
|
|
var cityAvgPriceMap = resultsMap.cityAvgPriceMap;
|
|
//构造数据列表
|
|
htmlContent = constructHtmlContent(results, xqOneMonthUpDownRangeMap, cityAvgPriceMap, htmlContent);
|
|
|
|
//动态追加内容
|
|
$('.list-block ul').html(htmlContent);
|
|
//添加loading等待效果
|
|
$(".loadingBg").hide();
|
|
$(".content-block").show();
|
|
}).catch(function (error) {
|
|
console.log(error);
|
|
});
|
|
}
|
|
|
|
//动态构造房产评估列表
|
|
function constructHtmlContent(results, xqOneMonthUpDownRangeMap, cityAvgPriceMap, htmlContent){
|
|
if(results!=null && results.length>0){
|
|
for(var i in results){
|
|
var result = results[i];
|
|
var tempTotalPrice = result.totalPrice;
|
|
//考虑是否为数字,加强逻辑判断
|
|
if(!isNaN(tempTotalPrice)){
|
|
//转换成元,四舍五入
|
|
tempTotalPrice = (parseFloat(tempTotalPrice)/10000).toFixed(2);
|
|
}
|
|
htmlContent = htmlContent +"<li><a href='#' class='item-content'>";
|
|
htmlContent = htmlContent +"<div class='item-inner'><div class='item-title-row'>";
|
|
htmlContent = htmlContent +"<div class='item-title'>"+result.name+"<span class='span01'>"+result.city+"-"+result.region+"</span></div>";
|
|
htmlContent = htmlContent +"</div><div class='item-title-row'>";
|
|
htmlContent = htmlContent +"<div class='item-title'><small>"+result.roomCount+"室"+result.hallCount+"厅 "+result.area+"㎡ "+result.floor+"/"+result.height+"层</small></div>";
|
|
htmlContent = htmlContent +"</div><div class='item-subtitle'>";
|
|
//对应城市地区小区30天涨跌幅
|
|
//动态构建key
|
|
var xqOneMonthUpDownRangeKey = result.city+"-"+result.region +"-"+result.name;
|
|
//取得key对于的value
|
|
var xqOneMonthUpDownRangeValue = xqOneMonthUpDownRangeMap[xqOneMonthUpDownRangeKey];
|
|
if(!isNaN(xqOneMonthUpDownRangeValue)){
|
|
//涨跌幅大于零
|
|
if(parseFloat(xqOneMonthUpDownRangeValue)>=0){
|
|
htmlContent = htmlContent + "<div>近30天涨跌幅: <em class='up'>"+xqOneMonthUpDownRangeValue+"%<i class='icon icon-arrow-red'></i></em></div>";
|
|
}else{
|
|
//涨跌幅小于零
|
|
htmlContent = htmlContent + "<div>近30天涨跌幅: <em class='down'>"+Math.abs(xqOneMonthUpDownRangeValue)+"%<i class='icon icon-arrow-green'></i></em></div>";
|
|
}
|
|
}else{
|
|
//为非数字清空放空格
|
|
htmlContent = htmlContent + "<div>近30天涨跌幅: <em class='down'>"+ +"%<i class='icon icon-arrow-green'></i></em></div>";
|
|
}
|
|
|
|
//相比对于城市均价
|
|
var cityAvgPriceKey = result.city;
|
|
//取得对应城市的value
|
|
var cityAvgPriceValue = cityAvgPriceMap[cityAvgPriceKey];
|
|
if(!isNaN(cityAvgPriceValue)){
|
|
if(parseInt(cityAvgPriceValue)>=parseInt(result.price)){
|
|
htmlContent = htmlContent + "<div>相比"+result.city+"均价: <em class='up'>高"+(parseInt(cityAvgPriceValue)-parseInt(result.price))+"元</em></div>";
|
|
}else{
|
|
htmlContent = htmlContent + "<div>相比"+result.city+"均价: <em class='down'>低"+(parseInt(result.price)-parseInt(cityAvgPriceValue))+"元</em></div>";
|
|
}
|
|
}else{
|
|
//为非数字清空放空格
|
|
htmlContent = htmlContent + "<div>相比"+result.city+"均价: <em class='down'>"+' '+"</em></div>";
|
|
}
|
|
htmlContent = htmlContent + "<div>均价: <em class='em02'>"+result.price+"元/㎡</em></div>";
|
|
htmlContent = htmlContent + "<div class='price'><em><strong>"+tempTotalPrice+"</strong>万</em></div>";
|
|
htmlContent = htmlContent + "</div></div></a><a class='add open-vertical-modal' id="+result.id+" uid="+result.uid+" houseStatus="+result.houseStatus+"><i class='icon icon-add'></i>添加管理</a>"
|
|
htmlContent = htmlContent +"</li>";
|
|
}
|
|
}
|
|
return htmlContent;
|
|
}
|
|
|
|
//界面加载
|
|
$(document).ready(function () {
|
|
selectEvaluateList();
|
|
});
|
|
|
|
function openaddWindow(){
|
|
clicked('/views/house/add.html',true,false,{},{})
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html> |