383 lines
14 KiB
HTML
383 lines
14 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>
|
|
.cardPrice01 .card-footer span:nth-child(2){text-align:center;}
|
|
.list-block ul:before{height:0;}
|
|
.icon-houseLevel{width:0.8rem;height:0.75rem;background:url(../../images/icon-houseLevel.png) no-repeat center center;background-size:100%;margin-right:0.3rem;vertical-align:-0.1rem;}
|
|
.cardPrice01 .card-content{background:url(../../images/cardBg01.png) no-repeat center bottom;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 .add01a{top:inherit;bottom:0.75rem;right:0.75rem;}
|
|
.list-block .item-title em{font-size:0.8rem;color:#EB5F34;}
|
|
.list-block .item-title .tag small{font-size:80%;color:#F5A100;}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="page-group" style="display: none;" id="page-group-nologin">
|
|
<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>
|
|
<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 href="#" class="button button-big button-fill theme" onclick="gotoAddHouse()">添加房产</a></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="page-group" style="display: none;" id="page-group-login">
|
|
<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>
|
|
<h1 class="title">我的房产</h1>
|
|
</header>
|
|
<div class="content infinite-scroll infinite-scroll-bottom">
|
|
<div class="card cardPrice cardPrice01" id="houseInfo">
|
|
<div class="card-header">
|
|
<span>房产总值</span>
|
|
<a class="button theme" href="#" onclick="gotoAddHouse()">添加房产</a>
|
|
</div>
|
|
<div class="card-content">
|
|
<div class="card-content-inner">{{totalPrice}}<span>万</span></div>
|
|
</div>
|
|
<div class="card-footer">
|
|
<span>
|
|
<em><strong>{{oneYearUpDownRange}}</strong>%<i id ="oneYearUpDownRange" class="icon icon-arrow-red"></i></em>
|
|
<label>近1年涨跌幅</label>
|
|
</span>
|
|
<span>
|
|
<em><strong>{{oneYearUpDownPrice}}</strong>万<i id="oneYearUpDownPrice" class="icon icon-arrow-red"></i></em>
|
|
<label>近1年升值额</label>
|
|
</span>
|
|
<!--<span>
|
|
<em><strong>待定</strong><i class="icon icon-arrow-red"></i></em>
|
|
<label>资产排名</label>
|
|
</span>-->
|
|
</div>
|
|
</div>
|
|
<div class="list-block media-list">
|
|
<ul class="list-container">
|
|
<!-- 动态拼接内容 -->
|
|
</ul>
|
|
</div>
|
|
<!-- 分页加载效果, 默认不显示, 和 加载loading页区分开-->
|
|
<div class="infinite-scroll-preloader">
|
|
<div class="preloader"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="page-group" style="display: none;" id="page-group-login-temp">
|
|
<div class="page page-current">
|
|
<!-- 加载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="http://g.alicdn.com/sj/lib/zepto/zepto.js" charset="utf-8"></script>
|
|
<script>
|
|
|
|
/* 关闭路由,以实现不同页面之间的相互跳转(仅开发环境需要) */
|
|
Zepto = $
|
|
$.config = {router: false}
|
|
|
|
</script>
|
|
<script type="text/javascript" src="../../js/beacon_release.js" charset="utf-8"></script>
|
|
<script type="text/javascript" src="../../js/vue.js"></script>
|
|
<script type="text/javascript" src="../../js/light7-2.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' charset='utf-8'></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>
|
|
<script>
|
|
//初始化init
|
|
$.init();
|
|
|
|
//定义对象
|
|
var baseInfo = new Vue({
|
|
el: '#houseInfo',
|
|
data: {
|
|
totalPrice : "",
|
|
oneYearUpDownRange:"",
|
|
oneYearUpDownPrice: ""
|
|
}
|
|
})
|
|
|
|
// 加载flag
|
|
var loading = false;
|
|
|
|
//分页部分参数定义
|
|
var page;
|
|
var pageSize;
|
|
var totalPages;
|
|
var totalRecords;
|
|
|
|
// 上次加载的序号
|
|
var lastIndex;
|
|
// 每次加载添加多少条目
|
|
var itemsPerLoad;
|
|
// 最多可加载的条目
|
|
var maxItems = 100;
|
|
|
|
// 注册'infinite'事件处理函数
|
|
$(document).on('infinite', '.infinite-scroll-bottom', function() {
|
|
// 如果正在加载,则退出
|
|
if(loading) return;
|
|
// 设置flag
|
|
loading = true;
|
|
// 模拟1s的加载过程
|
|
setTimeout(function() {
|
|
// 重置加载flag
|
|
loading = false;
|
|
//如果当前页大于等于总页数
|
|
if(page >= totalPages) {
|
|
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
|
$.detachInfiniteScroll($('.infinite-scroll'));
|
|
// 删除加载提示符
|
|
$('.infinite-scroll-preloader').remove();
|
|
return;
|
|
}
|
|
//控制查询下一页的数据
|
|
page = page + 1;
|
|
selectHouseInfoList();
|
|
//容器发生改变,如果是js滚动,需要刷新滚动
|
|
//$.refreshScroller();
|
|
}, 1000);
|
|
});
|
|
|
|
//我的收藏查询请求
|
|
function selectHouseInfoList(){
|
|
axios.get(BASE_PATH + "/rest/index/ourHouseInfoList",
|
|
{
|
|
params: {
|
|
page: page,
|
|
pageSize: pageSize
|
|
}
|
|
}).then(function (response) {
|
|
var resultsMap = response.data.data;
|
|
var resultList = resultsMap.houseInfoPageList.list;
|
|
var xqOneMonthUpDownRangeMap = resultsMap.xqOneMonthUpDownRangeMap;
|
|
var xqPotentialIndexMap = resultsMap.xqPotentialIndexMap;
|
|
var houseInfoTotalMap = resultsMap.houseInfoTotalMap;
|
|
// 上次加载的序号
|
|
lastIndex = $('.list-container li').length;
|
|
//登录状态,但没有数据
|
|
if(lastIndex == 0 && (resultList != null && resultList.length == 0)){
|
|
//控制显示
|
|
$('#page-group-nologin').show();
|
|
$('#page-group-login').hide();
|
|
}else{
|
|
//控制显示
|
|
$('#page-group-nologin').hide();
|
|
$('#page-group-login').show();
|
|
}
|
|
if(resultList != null && resultList.length == 0){
|
|
// 删除加载提示符
|
|
$('.infinite-scroll-preloader').remove();
|
|
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
|
$.detachInfiniteScroll($('.infinite-scroll'));
|
|
return;
|
|
}
|
|
if(resultsMap.houseInfoPageList.currentPage == resultsMap.houseInfoPageList.totalPages){
|
|
//如果此次查询刚好是page = totalPages
|
|
// 删除加载提示符
|
|
$('.infinite-scroll-preloader').remove();
|
|
// 加载完毕,则注销无限加载事件,以防不必要的加载
|
|
$.detachInfiniteScroll($('.infinite-scroll'));
|
|
}
|
|
//封装list数据
|
|
var dataObj = [];
|
|
for(var i in resultList){
|
|
dataObj.push(resultList[i])
|
|
}
|
|
//每次加载添加多少条目
|
|
itemsPerLoad = resultList.length;
|
|
//请求后对page进行赋值
|
|
page = resultsMap.houseInfoPageList.currentPage;
|
|
pageSize = resultsMap.houseInfoPageList.limit;
|
|
totalPages = resultsMap.houseInfoPageList.totalPages;
|
|
totalRecords = resultsMap.houseInfoPageList.totalRecords;
|
|
addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xqPotentialIndexMap, houseInfoTotalMap);
|
|
}).catch(function (error) {
|
|
console.log(error);
|
|
});
|
|
}
|
|
|
|
//判断是否登录
|
|
function checkIsLogin(){
|
|
if(localStorage.getItem("user_token") == null || localStorage.getItem("user_token") == ""){
|
|
$('#page-group-login').hide();
|
|
$('#page-group-nologin').show();
|
|
}else{
|
|
//控制显示
|
|
selectHouseInfoList();
|
|
}
|
|
}
|
|
|
|
//跳转添加房产
|
|
function gotoAddHouse(){
|
|
clicked('/views/house/add.html',true,false,{},{type:0},function(){
|
|
checkIsLogin();
|
|
})
|
|
}
|
|
|
|
//跳转房产详情
|
|
function gotoHouseDetail(id){
|
|
clicked('/views/house/detail.html',true,false,{},{houseId:id},function(){
|
|
})
|
|
}
|
|
|
|
//跳转房产申请贷款
|
|
function gotoLoanApply(houseId, city){
|
|
clicked('/views/loan/loanInfo.html',true,false,{},{houseId: houseId, city: city, mobile: ""},function(){})
|
|
}
|
|
|
|
//界面加载
|
|
$(document).ready(function () {
|
|
checkIsLogin();
|
|
});
|
|
|
|
/* 分页构造数据 */
|
|
function addItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xqPotentialIndexMap, houseInfoTotalMap) {
|
|
var html = '';
|
|
//控制总产值部分显示
|
|
baseInfo.totalPrice = houseInfoTotalMap["totalPrice"];
|
|
baseInfo.oneYearUpDownRange = Math.abs(houseInfoTotalMap["oneYearUpDownRange"]);
|
|
baseInfo.oneYearUpDownPrice = Math.abs(houseInfoTotalMap["oneYearUpDownPrice"]);
|
|
if(!isNaN(houseInfoTotalMap["oneYearUpDownRange"])){
|
|
//涨跌幅大于零
|
|
if(parseFloat(houseInfoTotalMap["oneYearUpDownRange"])>=0){
|
|
$('#oneYearUpDownRange').attr("class", "icon icon-arrow-red");
|
|
}else{
|
|
//涨跌幅小于零
|
|
$('#oneYearUpDownRange').attr("class", "icon icon-arrow-green");
|
|
}
|
|
}
|
|
if(!isNaN(houseInfoTotalMap["oneYearUpDownPrice"])){
|
|
//涨跌幅大于零
|
|
if(parseFloat(houseInfoTotalMap["oneYearUpDownPrice"])>=0){
|
|
$('#oneYearUpDownPrice').attr("class", "icon icon-arrow-red");
|
|
}else{
|
|
//涨跌幅小于零
|
|
$('#oneYearUpDownPrice').attr("class", "icon icon-arrow-green");
|
|
}
|
|
}
|
|
for(var i in dataObj) {
|
|
var result = dataObj[i];
|
|
var tempTotalPrice = result.totalPrice;
|
|
//可抵押贷额度
|
|
var tempTotalPricePercent;
|
|
//考虑是否为数字,加强逻辑判断
|
|
if(!isNaN(tempTotalPrice)){
|
|
//转换成元,四舍五入
|
|
tempTotalPricePercent = (parseFloat(tempTotalPrice)*0.7/10000).toFixed(2);
|
|
tempTotalPrice = (parseFloat(tempTotalPrice)/10000).toFixed(2);
|
|
}
|
|
html += '<li onclick="gotoHouseDetail(\''+result.id+'\')"><a href="#" class="item-content">';
|
|
html += "<div class='item-inner'><div class='item-title-row'>";
|
|
html += "<div class='item-title'>"+result.name+" <em>"+tempTotalPrice+"万</em><span class='tag'><small>"+result.liveStatus+"</small></span></div>";
|
|
html += "</div><div class='item-subtitle'>";
|
|
|
|
//对应城市地区小区30天涨跌幅
|
|
var xqOneMonthUpDownRangeKey = result.city+"-"+result.region +"-"+result.name;
|
|
var xqOneMonthUpDownRangeValue = xqOneMonthUpDownRangeMap[xqOneMonthUpDownRangeKey];
|
|
if(!isNaN(xqOneMonthUpDownRangeValue)){
|
|
//涨跌幅大于零
|
|
if(parseFloat(xqOneMonthUpDownRangeValue)>=0){
|
|
html += "<div>近30天涨跌幅: <em class='up'>"+xqOneMonthUpDownRangeValue+"%<i class='icon icon-arrow-red'></i></em></div>";
|
|
}else{
|
|
html += "<div>近30天涨跌幅: <em class='down'>"+Math.abs(xqOneMonthUpDownRangeValue)+"%<i class='icon icon-arrow-green'></i></em></div>";
|
|
}
|
|
}else{
|
|
html += "<div>近30天涨跌幅: <em class='down'> %<i class='icon icon-arrow-green'></i></em></div>";
|
|
}
|
|
|
|
//下跌概率
|
|
var xqPotentialIndexValue = xqPotentialIndexMap[xqOneMonthUpDownRangeKey];
|
|
if(!isNaN(xqPotentialIndexValue)){
|
|
//涨跌幅大于零
|
|
if(parseInt(xqPotentialIndexValue)>=50){
|
|
html += "<div>下跌概率: <em class='up'>"+xqPotentialIndexValue+"%<i class='icon icon-arrow-red'></i></em></div>";
|
|
}else{
|
|
html += "<div>下跌概率: <em class='down'>"+(parseInt(100)-parseInt(xqPotentialIndexValue))+"%<i class='icon icon-arrow-green'></i></em></div>";
|
|
}
|
|
}else{
|
|
html += "<div>下跌概率: <em class='down'> %<i class='icon icon-arrow-green'></i></em></div>";
|
|
}
|
|
|
|
html += "<div>抵押可贷额度: <em style='color:#EB5F34;'>"+tempTotalPricePercent+"万</em></div></div></div></a>";
|
|
|
|
if(result.level!=null && result.level == 1){
|
|
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>豪宅级</a>";
|
|
}else if(result.level!=null && result.level == 2){
|
|
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>公寓级</a>";
|
|
}else if(result.level!=null && result.level == 3){
|
|
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>平房级</a>";
|
|
}else if(result.level!=null && result.level == 4){
|
|
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>草屋级</a>";
|
|
}else if(result.level!=null && result.level == 5){
|
|
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>山洞级</a>";
|
|
}else{
|
|
html += "<a class='add alert-text-title'><i class='icon icon-houseLevel'></i>其他</a>";
|
|
}
|
|
html += '<a class="button theme add add01 add01a" href="#" onclick="gotoLoanApply(\''+result.id+'\', \''+result.city+'\')">立即申请</a></li>';
|
|
}
|
|
$('.infinite-scroll-bottom .list-container').append(html);
|
|
}
|
|
|
|
/* 说明-房产等级 */
|
|
$(document).on('click','.alert-text-title', function () {
|
|
$.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级');
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html> |