function listing_count(buffer, pageNo, totalPages, firstIndex, lastIndex, totalResults, totalMapSearchCount) { buffer.append('
'); if (totalMapSearchCount != null && totalMapSearchCount > 200) { buffer.append('
只显示找到的前 200 条物业信息。请放大地图或细化搜索标准。
'); } pageLinks(buffer, pageNo, totalPages); var str = '第 ${1} - ${2} 项,房源共计 ${3} 项'; str = str.replace('$\{1\}', firstIndex); str = str.replace('$\{2\}', lastIndex); str = str.replace('$\{3\}', totalResults); buffer.append('

'+str+'

'); buffer.append('
'); } function pageLinks(buffer, pageNo, totalPages) { buffer.append(''); buffer.append(''); buffer.append(''); buffer.append(''); buffer.append(''); buffer.append('
'); if (pageNo > 1) { buffer.append(''); } else { buffer.append(' '); } buffer.append(''); var minPage = pageNo - 5; if (minPage <= 0) { minPage = 1; } var maxPage = pageNo + 5; if (maxPage > totalPages) { maxPage = totalPages; } buffer.append('
'); for (var i = minPage; i <= maxPage; i++) { if (i == pageNo) { buffer.append('' + pageNo + ''); } else { buffer.append(' ' + i + ' '); } } buffer.append('
'); buffer.append('
'); if (pageNo < totalPages) { buffer.append(''); } else { buffer.append(' '); } buffer.append('
'); } function create_results_page(firstIndex, listings, pageNo, totalPages, lastIndex, totalResults) { var buffer = new StringBuffer(); if (listings != null && listings.length > 0) { buffer.append('
'); buffer.append('\n'); buffer.append('
'); if(typeof totalMapSearchCount === "undefined"){ totalMapSearchCount = totalResults; } listing_count(buffer, pageNo, totalPages, firstIndex, lastIndex, totalResults, totalMapSearchCount); buffer.append('
'); buffer.append(''); // todo: select current sort order buffer.append(''); //buffer.append('     '); buffer.append('
'); buffer.append('
'); buffer.append('
'); buffer.append('
'); buffer.append('
'); buffer.append('
'); var two_col = isWide(); if(two_col) buffer.append(''); for (var i = 0; i < listings.length; i++) { if (two_col == true){ if (i % 2 == 0) { buffer.append(''); } else { buffer.append(''); } buffer.append(''); if (i % 2 == 1 || i == listings.length - 1) { buffer.append(''); } } } if (two_col == true) buffer.append('
'); } listing_text(buffer, firstIndex + i, listings[i]); if (two_col == true){ buffer.append('
'); buffer.append('
'); buffer.append('
'); listing_count(buffer, pageNo, totalPages, firstIndex, lastIndex, totalResults); buffer.append('
'); } else { buffer.append('
'); buffer.append('\n'); buffer.append('
'); buffer.append('

'); buffer.append('没有符合您搜索条件的房源'); buffer.append('

'); } return buffer.toString(); }