diff --git a/fangija-zsyf/js/user/myFocus.js b/fangija-zsyf/js/user/myFocus.js index 00ff2a2..e031456 100644 --- a/fangija-zsyf/js/user/myFocus.js +++ b/fangija-zsyf/js/user/myFocus.js @@ -12,7 +12,7 @@ var mf_curpage = 1; var mf_totalCount = 0; function addEstate(number, lastIndex) { mf_curpage = mf_lastIndex/mf_itemsPerLoad + 1; - axios.get("/myCollection/loadCollections",{params:{pageSize:mf_itemsPerLoad,page:mf_curpage}}).then(function(response){ + axios.get("/rest/myCollection/loadCollections",{params:{pageSize:mf_itemsPerLoad,page:mf_curpage}}).then(function(response){ data = response.data; //data = eval( '(' + data + ')' ); if(data['results']==null || data['results'].length==0) { diff --git a/fangija-zsyf/views/house/houseList.html b/fangija-zsyf/views/house/houseList.html index 0049a86..86473c3 100644 --- a/fangija-zsyf/views/house/houseList.html +++ b/fangija-zsyf/views/house/houseList.html @@ -37,82 +37,39 @@

我的房产

-
-
+
@@ -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 += "
  • "; + html += "
    "; + html += "
    "+result.name+" "+tempTotalPrice+"万"+result.liveStatus+"
    "; + html += "
    "; + + //对应城市地区小区30天涨跌幅 + var xqOneMonthUpDownRangeKey = result.city+"-"+result.region +"-"+result.name; + var xqOneMonthUpDownRangeValue = xqOneMonthUpDownRangeMap[xqOneMonthUpDownRangeKey]; + if(!isNaN(xqOneMonthUpDownRangeValue)){ + //涨跌幅大于零 + if(parseFloat(xqOneMonthUpDownRangeValue)>=0){ + html += "
    近30天涨跌幅: "+xqOneMonthUpDownRangeValue+"%
    "; + }else{ + html += "
    近30天涨跌幅: "+Math.abs(xqOneMonthUpDownRangeValue)+"%
    "; + } + }else{ + html += "
    近30天涨跌幅: %
    "; + } + + //下跌概率 + var xqPotentialIndexValue = xqPotentialIndexMap[xqOneMonthUpDownRangeKey]; + if(!isNaN(xqPotentialIndexValue)){ + //涨跌幅大于零 + if(parseInt(xqPotentialIndexValue)>=50){ + html += "
    下跌概率: "+xqPotentialIndexValue+"%
    "; + }else{ + html += "
    下跌概率: "+(parseInt(100)-parseInt(xqPotentialIndexValue))+"%
    "; + } + }else{ + html += "
    下跌概率: %
    "; + } + + html += "
    抵押可贷额度: "+tempTotalPricePercent+"万
    "; + + if(result.level!=null && result.level == 1){ + html += "豪宅级"; + }else if(result.level!=null && result.level == 2){ + html += "公寓级"; + }else if(result.level!=null && result.level == 3){ + html += "平房级"; + }else if(result.level!=null && result.level == 4){ + html += "草屋级"; + }else if(result.level!=null && result.level == 5){ + html += "山洞级"; + }else{ + html += "其他"; + } + html += "立即申请
  • "; + } + $('.infinite-scroll-bottom .list-container').append(html); +} + /* 说明-房产等级 */ $(document).on('click','.alert-text-title', function () { $.alert('房产等级是房屋在城市中的综合评级,由高至低分别为 豪宅、公寓、平房、草屋、山洞共5个级别。', '房产等级'); diff --git a/fangija-zsyf/views/news/newsDetail.html b/fangija-zsyf/views/news/newsDetail.html index be88acb..9925596 100644 --- a/fangija-zsyf/views/news/newsDetail.html +++ b/fangija-zsyf/views/news/newsDetail.html @@ -262,10 +262,7 @@ function addItems(number, lastIndex) { if(!id){ return; } - curpage = lastIndex/itemsPerLoad + 1; - - axios.get("/rest/news/comment", { params: { newsId: id, diff --git a/fangija-zsyf/views/rent/rentManager.html b/fangija-zsyf/views/rent/rentManager.html new file mode 100644 index 0000000..fef22b6 --- /dev/null +++ b/fangija-zsyf/views/rent/rentManager.html @@ -0,0 +1,351 @@ + + + + + +出租管理 + + + + + + + + + + + + + + + + +
    +
    +
    + +

    出租管理

    +
    + +
    +
    + + + + + + + + + + + + + + + + \ No newline at end of file