aa
This commit is contained in:
+2
-11
@@ -24,7 +24,7 @@
|
||||
<span class="mui-tab-label">行情</span>
|
||||
</a>
|
||||
|
||||
<a class="mui-tab-item" id="evaluate">
|
||||
<a class="mui-tab-item" href="views/house/houseManageList.html">
|
||||
<span class="mui-icon iconfont icon-tab03"></span>
|
||||
<span class="mui-tab-label">评估</span>
|
||||
</a>
|
||||
@@ -48,20 +48,11 @@
|
||||
localStorage.removeItem("user_token");
|
||||
localStorage.removeItem("user_token_add_time");
|
||||
}
|
||||
var evaluateMenu=""
|
||||
if (localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == "") {
|
||||
//没有登录
|
||||
evaluateMenu = 'views/house/add_noData.html';
|
||||
}else{
|
||||
//登录成功
|
||||
evaluateMenu = 'views/evaluate/evaluateList.html';
|
||||
}
|
||||
document.getElementById("evaluate").setAttribute("href", evaluateMenu);
|
||||
document.getElementById("quotations").setAttribute("href", BASE_PATH + '/quotations/index');
|
||||
//document.getElementById("selfInfo").setAttribute("href", BASE_PATH + '/selfInfo/index');
|
||||
//mui初始化
|
||||
mui.init();
|
||||
var subpages = ['yfindex.html', BASE_PATH + '/quotations/index', evaluateMenu, 'views/user/userInfo.html'];
|
||||
var subpages = ['yfindex.html', BASE_PATH + '/quotations/index', 'views/house/houseManageList.html', 'views/user/userInfo.html'];
|
||||
var subpage_style = {
|
||||
top: '0',
|
||||
bottom: '50px',
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
<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();">
|
||||
<button class="button button-link button-nav pull-left" onclick="back(),plus.nativeUI.closeWaiting();">
|
||||
<span class="icon icon-left"></span>
|
||||
</button>-->
|
||||
</button>
|
||||
<h1 class="title">房产评估</h1>
|
||||
</header>
|
||||
<!-- 加载loading页 -->
|
||||
|
||||
@@ -1553,7 +1553,8 @@ $("#evaluation_btn").on("click", function () {
|
||||
$("input[name='name']").val(district.name)
|
||||
$("input[name='region']").val(district.region)
|
||||
$("#input_city").val(district.city)
|
||||
addEvaluation();
|
||||
|
||||
|
||||
}else{
|
||||
// $("#nextBtn").attr("disabled", false)
|
||||
console.log("error");
|
||||
@@ -1565,6 +1566,17 @@ $("#evaluation_btn").on("click", function () {
|
||||
});
|
||||
});
|
||||
|
||||
//判断是否登录
|
||||
//var loginFlag=false;
|
||||
function checkIsLogin(){
|
||||
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
|
||||
clicked('/views/user/passLogin.html',true,false,{},{},function(){
|
||||
//checkIsLogin();
|
||||
})
|
||||
}else{
|
||||
addEvaluation();
|
||||
}
|
||||
}
|
||||
|
||||
function addEvaluation(){
|
||||
axios.get("/rest/index/checkEvalPrice", {
|
||||
@@ -1582,13 +1594,7 @@ function addEvaluation(){
|
||||
.then(function (response) {
|
||||
if(response.data.data!=null && response.data.data.success){
|
||||
var id = response.data.data.id;
|
||||
mui.openWindow({
|
||||
url: 'detail.html',
|
||||
id:'detail.html',
|
||||
extras:{
|
||||
id:id
|
||||
}
|
||||
});
|
||||
clicked('detail.html',true,false,{},{id:id})
|
||||
}else{
|
||||
$.toast(response.data.message);
|
||||
}
|
||||
@@ -1596,39 +1602,6 @@ function addEvaluation(){
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
|
||||
/*$.ajax({
|
||||
url:"${basePath}/fsh/checkEvalPrice",
|
||||
dataType:'json',
|
||||
data:$("form").serialize(),
|
||||
success:function (data) {
|
||||
console.log()
|
||||
var str = "/house/add?city="+$("#input_city").val()+"®ion="+$("input[name=region]").val()+"&name="+$("#input_address").val()+"&address="+$("input[name=address]").val()+"&estateType="+$("#input_houseType").val()+"&building="+$("#input_building").val()+"&floors="+$("#input_floor").val()+"&area="+$("#input_area").val();
|
||||
if(data.success){
|
||||
$.showIndicator();
|
||||
window.location.href="${basePath}/house/doEvaluation?id="+data.id+"&backUrl=${backUrl!}";
|
||||
}else{
|
||||
if (data.data == 0){
|
||||
$.toast(data.message);
|
||||
var sstr = "${basePath}/user/smsLogin";
|
||||
console.log(sstr);
|
||||
//window.location.href = sstr;
|
||||
clicked(sstr,true);
|
||||
}
|
||||
if(data.message!=undefined && data.message!=""){
|
||||
$.hidePreloader();
|
||||
$.toast(data.message);
|
||||
}else{
|
||||
$.hidePreloader();
|
||||
$.toast("该地址不支持估价!");
|
||||
}
|
||||
}
|
||||
},
|
||||
error:function () {
|
||||
$.toast("估价失败请重试!")
|
||||
}
|
||||
})*/
|
||||
}
|
||||
|
||||
/* 信息输入弹窗 */
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
<!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" id="dataList" style="display: none;">
|
||||
<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 class="page page-current" id="noData" style="display: none;">
|
||||
<header class="bar bar-nav">
|
||||
<!--<button class="button button-link button-nav pull-left" onclick="history.go(-1)">
|
||||
<span class="icon icon-left"></span>
|
||||
</button>-->
|
||||
<h1 class="title">房产评估</h1>
|
||||
</header>
|
||||
<div class="content contentSuggest">
|
||||
<div class="noData">
|
||||
<img src="../../images/noData.png">
|
||||
<p>评估房产 发现价值</p>
|
||||
<div class="content-block">
|
||||
<p><a onclick="openaddWindow()" class="button button-big button-fill theme">立即评估</a></p>
|
||||
</div>
|
||||
</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>
|
||||
var uid = "162167854504869888";
|
||||
//判断是否登录
|
||||
function checkIsLogin(){
|
||||
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
|
||||
$('#dataList').hide();
|
||||
$('#noData').show();
|
||||
}else{
|
||||
//控制显示
|
||||
$('#noData').hide();
|
||||
$('#dataList').show();
|
||||
}
|
||||
}
|
||||
checkIsLogin();
|
||||
//调用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: {
|
||||
uid: uid
|
||||
}
|
||||
}).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+"m "+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>
|
||||
@@ -93,15 +93,15 @@
|
||||
<div class="topic" style="border-bottom:none;">
|
||||
<div class="topicContent" style="padding-left:0;padding-right:0;">
|
||||
<div class="topicContent_center home">
|
||||
<div onclick="openUrl(BASE_PATH+'/fsh/form',true)" id="addHouseDiv">
|
||||
<div onclick="openNewView('views/house/houseList.html')" id="addHouseDiv">
|
||||
<i class="icon icon-home01"></i>
|
||||
<span>房产管理</span>
|
||||
</div>
|
||||
<div onclick="openUrl(BASE_PATH+'/myHouse/detail',true)" id="detailHouseDiv">
|
||||
<div onclick="openNewView('views/house/houseList.html')" id="detailHouseDiv">
|
||||
<i class="icon icon-home01"></i>
|
||||
<span>我的房产</span>
|
||||
</div>
|
||||
<div onclick="openIntelligentHouseView()">
|
||||
<div onclick="openNewView('views/intelligentHouse/index.html')">
|
||||
<i class="icon icon-home02"></i>
|
||||
<span>智能选房</span>
|
||||
</div>
|
||||
@@ -2609,6 +2609,9 @@ function openNewsView(newId) {
|
||||
$("#visitCount_"+newId).text(count+'人');
|
||||
}
|
||||
}
|
||||
function openNewView(viewHtml) {
|
||||
clicked(viewHtml,true,false,{},{})
|
||||
}
|
||||
function openIntelligentHouseView() {
|
||||
clicked('views/intelligentHouse/index.html',true,false,{},{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user