// 加载flag var mh_loading = false; //分页部分参数定义 var mh_page; var mh_pageSize; var mh_totalPages; var mh_totalRecords; // 上次加载的序号 var mh_lastIndex; // 每次加载添加多少条目 var mh_itemsPerLoad; // 最多可加载的条目 var mh_maxItems = 100; //我的收藏查询请求 function selectHouseInfoList(){ axios.get(BASE_PATH + "/rest/index/ourHouseInfoList", { params: { page: mh_page, pageSize: mh_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){ // 删除加载提示符 $('#loadTip1').remove(); //$('.infinite-scroll-preloader').remove(); // 加载完毕,则注销无限加载事件,以防不必要的加载 //$.detachInfiniteScroll($('.infinite-scroll')); return; } if(resultsMap.houseInfoPageList.currentPage == resultsMap.houseInfoPageList.totalPages){ //如果此次查询刚好是page = totalPages // 删除加载提示符 $('#loadTip1').remove(); //$('.infinite-scroll-preloader').remove(); // 加载完毕,则注销无限加载事件,以防不必要的加载 //$.detachInfiniteScroll($('.infinite-scroll')); } //封装list数据 var dataObj = []; for(var i in resultList){ dataObj.push(resultList[i]) } // 上次加载的序号 mh_lastIndex = $('.cardInfo').length; //每次加载添加多少条目 mh_itemsPerLoad = resultList.length; //请求后对page进行赋值 mh_page = resultsMap.houseInfoPageList.currentPage; mh_pageSize = resultsMap.houseInfoPageList.limit; mh_totalPages = resultsMap.houseInfoPageList.totalPages; mh_totalRecords = resultsMap.houseInfoPageList.totalRecords; tab.mh_num = mh_totalRecords; mhAddItems(mh_itemsPerLoad, mh_lastIndex, dataObj, xqOneMonthUpDownRangeMap, xqPotentialIndexMap, houseInfoTotalMap); }).catch(function (error) { console.log(error); }); } /* 分页构造数据 */ function mhAddItems(itemsPerLoad, lastIndex, dataObj, xqOneMonthUpDownRangeMap, xqPotentialIndexMap, houseInfoTotalMap) { var html = ''; 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 += '