|
|
|
@@ -37,82 +37,39 @@
|
|
|
|
|
</button>
|
|
|
|
|
<h1 class="title">我的房产</h1>
|
|
|
|
|
</header>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div class="card cardPrice cardPrice01">
|
|
|
|
|
<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="#">添加房产</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-content">
|
|
|
|
|
<div class="card-content-inner">5000<span>万</span></div>
|
|
|
|
|
<div class="card-content-inner">{{totalPrice}}<span>万</span></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-footer">
|
|
|
|
|
<span>
|
|
|
|
|
<em><strong>11.84</strong>%<i class="icon icon-arrow-red"></i></em>
|
|
|
|
|
<em><strong>{{oneYearUpDownRange}}</strong>%<i id ="oneYearUpDownRange" class="icon icon-arrow-red"></i></em>
|
|
|
|
|
<label>近1年涨跌幅</label>
|
|
|
|
|
</span>
|
|
|
|
|
<span>
|
|
|
|
|
<em><strong>41.45</strong>万<i class="icon icon-arrow-red"></i></em>
|
|
|
|
|
<em><strong>{{oneYearUpDownPrice}}</strong>万<i id="oneYearUpDownPrice" class="icon icon-arrow-red"></i></em>
|
|
|
|
|
<label>近1年升值额</label>
|
|
|
|
|
</span>
|
|
|
|
|
<span>
|
|
|
|
|
<em><strong>12</strong><i class="icon icon-arrow-red"></i></em>
|
|
|
|
|
<em><strong>待定</strong><i class="icon icon-arrow-red"></i></em>
|
|
|
|
|
<label>资产排名</label>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="list-block media-list">
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="#" class="item-content">
|
|
|
|
|
<div class="item-inner">
|
|
|
|
|
<div class="item-title-row">
|
|
|
|
|
<div class="item-title">龙盛佳苑 <em>391万</em><span class="tag"><small>空置</small></span></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item-subtitle">
|
|
|
|
|
<div>近30天涨跌幅: <em class="down">3.37%<i class="icon icon-arrow-green"></i></em></div>
|
|
|
|
|
<div>下跌概率: <em class="down">12%<i class="icon icon-arrow-green"></i></em></div>
|
|
|
|
|
<div>抵押可贷额度: <em style="color:#EB5F34;">391万</em></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="add alert-text-title"><i class="icon icon-houseLevel"></i>公寓</a>
|
|
|
|
|
<a class="button theme add add01 add01a" href="#">立即申请</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="#" class="item-content">
|
|
|
|
|
<div class="item-inner">
|
|
|
|
|
<div class="item-title-row">
|
|
|
|
|
<div class="item-title">龙盛佳苑 <em>391万</em><span class="tag"><small>空置</small></span></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item-subtitle">
|
|
|
|
|
<div>近30天涨跌幅: <em class="down">3.37%<i class="icon icon-arrow-green"></i></em></div>
|
|
|
|
|
<div>下跌概率: <em class="down">12%<i class="icon icon-arrow-green"></i></em></div>
|
|
|
|
|
<div>抵押可贷额度: <em style="color:#EB5F34;">391万</em></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="add alert-text-title"><i class="icon icon-houseLevel"></i>公寓</a>
|
|
|
|
|
<a class="button theme add add01 add01a" href="#">立即申请</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="#" class="item-content">
|
|
|
|
|
<div class="item-inner">
|
|
|
|
|
<div class="item-title-row">
|
|
|
|
|
<div class="item-title">龙盛佳苑 <em>391万</em><span class="tag"><small>空置</small></span></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item-subtitle">
|
|
|
|
|
<div>近30天涨跌幅: <em class="down">3.37%<i class="icon icon-arrow-green"></i></em></div>
|
|
|
|
|
<div>下跌概率: <em class="down">12%<i class="icon icon-arrow-green"></i></em></div>
|
|
|
|
|
<div>抵押可贷额度: <em style="color:#EB5F34;">391万</em></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="add alert-text-title"><i class="icon icon-houseLevel"></i>公寓</a>
|
|
|
|
|
<a class="button theme add add01 add01a" href="#">立即申请</a>
|
|
|
|
|
</li>
|
|
|
|
|
<ul class="list-container">
|
|
|
|
|
<!-- 动态拼接内容 -->
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 分页加载效果, 默认不显示, 和 加载loading页区分开-->
|
|
|
|
|
<div class="infinite-scroll-preloader">
|
|
|
|
|
<div class="preloader"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@@ -140,6 +97,201 @@ $.config = {router: false}
|
|
|
|
|
//初始化init
|
|
|
|
|
$.init();
|
|
|
|
|
|
|
|
|
|
//定义对象
|
|
|
|
|
var baseInfo = new Vue({
|
|
|
|
|
el: '#houseInfo',
|
|
|
|
|
data: {
|
|
|
|
|
totalPrice : "",
|
|
|
|
|
oneYearUpDownRange:"",
|
|
|
|
|
oneYearUpDownPrice: ""
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var uid = "162167854504869888";
|
|
|
|
|
// 加载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: {
|
|
|
|
|
uid: uid,
|
|
|
|
|
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;
|
|
|
|
|
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])
|
|
|
|
|
}
|
|
|
|
|
// 上次加载的序号
|
|
|
|
|
lastIndex = $('.cardInfo').length;
|
|
|
|
|
//每次加载添加多少条目
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//界面加载
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
selectHouseInfoList();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/* 分页构造数据 */
|
|
|
|
|
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><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='#'>立即申请</a></li>";
|
|
|
|
|
}
|
|
|
|
|
$('.infinite-scroll-bottom .list-container').append(html);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 说明-房产等级 */
|
|
|
|
|
$(document).on('click','.alert-text-title', function () {
|
|
|
|
|
$.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级');
|
|
|
|
|