close
'; if (res.result[i].IsHot == true) { html += '
'; html += ''; html += '
'; } html += '
'; html += ''; html += ''; html += '
'; if (res.result[i].TRANSACTIONTYPE == "放租") { html += '
HK $' + toPrice(Math.round(res.result[i].RENT)) + '
'; html += '
( 租 MOP $' + toPrice(Math.round(res.result[i].MoRent)) + '元 )
'; } else if (res.result[i].TRANSACTIONTYPE == "吉售" || res.result[i].TRANSACTIONTYPE == "連約售") { if (res.result[i].PRICE >= 10000) { html += '
HK $' + priceSwitch(((res.result[i].PRICE) / 10000).toFixed(2)) + '
'; html += '
( 售 MOP $' + priceSwitch(((res.result[i].MoPrice) / 10000).toFixed(2)) + '億 )
'; } else { html += '
HK $' + toPrice(Math.round(res.result[i].PRICE)) + '
'; html += '
( 售 MOP $' + toPrice(Math.round(res.result[i].MoPrice)) + '萬 )
'; } } else if (res.result[i].TRANSACTIONTYPE == "租售") { if (res.result[i].PRICE >= 10000) { html += '
HK $' + priceSwitch(((res.result[i].PRICE) / 10000).toFixed(2)) + '
'; html += '
( 售 MOP $' + priceSwitch(((res.result[i].MoPrice) / 10000).toFixed(2)) + '億 )
'; } else { html += '
HK $' + toPrice(Math.round(res.result[i].PRICE)) + '
'; html += '
( 售 MOP $' + toPrice(Math.round(res.result[i].MoPrice)) + '萬 )
'; } html += '
HK $' + toPrice(Math.round(res.result[i].RENT)) + '
'; html += '
( 租 MOP $' + toPrice(Math.round(res.result[i].MoRent)) + '元 )
'; } html += '

分享我

'; html += '
'; html += '
'; html += '
'; } $(".c-business-list").html(html); let itemCode = $(".c-build-item"); if (itemCode != 0) { $(".build_qrcode").empty() } let urlCode = window.location.host; for (var i = 0; i < itemCode.length; i++) { let winurl = document.getElementsByClassName("c-build-item")[i].getAttribute("href"); new QRCode(document.getElementsByClassName("build_qrcode")[i], { text: "https://" + urlCode + winurl, width: 80, height: 80 }); } $(".build_qrcode").append("

分享我

"); //这里就是分页核心了,为了更好查看效果,请在刚才id为articlelist表格后创建一个class为paginate的ul标签。 //disabled设置页码不能点击,如果当前页是第一页,«按钮不能点 var pageHtml = "
  • «
  • "; //pageTotal来设置分页显示数量,如果>=10的话,最多显示10条,否则你懂得 var pageTotal = Math.ceil(res.total / pageSize) >= 10 ? 10 : Math.ceil(res.total / pageSize); //由于是两种样式,所以根据当前页来更改 if (currentId < 10) { for (var j = 1; j <= pageTotal; j++) { pageHtml += "
  • " + j + "
  • "; } } else { //如果大于6,会加上...并且1、2页都在左侧留着 for (var j = 1; j <= pageTotal; j++) { //小于3的话 1、2页码一直存在 if (j < 3) { pageHtml += "
  • " + j + "
  • "; } //等于3,加上... if (j === 3) { pageHtml += "
  • ...
  • "; } //如果当前页大于三。页码需要根据当前页来渲染。 if (currentId > 3) { //当前页-1,如果当前页是7,左边显示7-1=6 if (j === 4) { if (currentId === res.TotalPages) { pageHtml += "
  • " + (currentId - 2) + "
  • "; } pageHtml += "
  • " + (currentId - 1) + "
  • "; } //当前页,注意disabled,不能在点击, if (j === 5) { pageHtml += "
  • " + currentId + "
  • "; } //这里当前页+1,你应该懂了。 if (j === 6 && currentId < res.TotalPages) { pageHtml += "
  • " + (Number(currentId) + 1) + "
  • "; } } } } //这里判断是不是最后一页,是就disabled pageHtml += "
  • = res.TotalCount ? "disabled" : "") + " data-pageid='" + (Number(currentId) + 1) + "'>»
  • "; //这里就是页面直接跳转了。 pageHtml += "
  • 共" + Math.ceil(res.total / pageSize) + "页, 到第
  • 确定
  • " //最后渲染 $('.paginate').html(pageHtml); $(".paginate li").each(function () { var str = $(this).attr("data-pageid"); if (str == pageIndex) { $(".paginate li").removeAttr("disabled"); $(this).attr("disabled", true); } if (pageIndex == null || pageIndex == "") { $(".paginate li:first-child").attr("disabled", true); } }); if (Math.ceil(res.total / pageSize) < 2) { $('.paginate').hide(); } else { $('.paginate').show(); } } else { html += ''; $(".c-business-list").html(html); } } //获取筍盘列表 function getTopHotBuildingList() { $.ajax({ url: hUrl + "/api/TopRoom/GetTopHotBuildingList", type: "GET", dataType: "json", success: function (res) { if (res.InnerList.length > 0) { $("#build").show(); var html = ''; jQuery.each(res.InnerList, function (i, item) { html += ''; if (item.IsHot = true) { html += '
    '; } html += '
    '; if (item.Imgs != "" && item.Imgs.length != 0) { html += '' + item.Building + ''; } else { html += ''; } html += '
    '; if (item.SellType.indexOf("售") == 1) { if (item.Price >= 10000) { html += '售HK $' + priceSwitch(((item.Price) / 10000).toFixed(2)) + ' 億'; html += '(售MOP $' + priceSwitch(((item.MoPrice) / 10000).toFixed(2)) + ' 億)'; } else { html += '售HK $' + toPrice(Math.round(item.Price)) + ' 萬'; if (item.MoPrice != "") { html += '(售MOP $' + toPrice(Math.round(item.MoPrice)) + ' 萬)'; } } } else { html += '租HK $' + toPrice(Math.round(item.Rent)) + ' 元'; html += '(租MOP $' + toPrice(Math.round(item.MoRent)) + ' 元)'; } html += '
    '; html += '
    '; html += '
    ' + item.Building + '
    '; html += '
    '; }); $("#build").append(html); } }, error: function (res) { console.log(res); } }); } //精選舖位/寫字樓/工廈 function getTopHotShopList() { console.log(NaTureList) $.ajax({ url: hUrl + "/api/TopRoom/GetTopHotShopsByPwList", type: "post", data: { "NaTureList": NaTureList }, dataType: "json", success: function (res) { if (res.length > 0) { $(".build-wrap").show(); $("#build").hide(); var pHtml = ''; var gHml = ''; var xHtml = ''; var pSize = 0; var gSize = 0; var xSize = 0; jQuery.each(res, function (i, item) { if (item.NATURE == "舖位") { pSize++; pHtml += ''; if (item.IsHot = true) { pHtml += '
    '; } pHtml += '
    '; if (item.Imgs != "" && item.Imgs.length != 0) { pHtml += '' + item.ROOMTITLE + ''; } else { pHtml += ''; } pHtml += '
    '; if (item.TRANSACTIONTYPE != '放租') { if (item.Price >= 10000) { pHtml += '售HK $' + priceSwitch(((item.PRICE) / 10000).toFixed(2)) + ' 億'; pHtml += '(售MOP $' + priceSwitch(((item.MoPrice) / 10000).toFixed(2)) + ' 億)'; } else { pHtml += '售HK $' + toPrice(Math.round(item.PRICE)) + ' 萬'; if (item.MoPrice != "") { pHtml += '(售MOP $' + toPrice(Math.round(item.MoPrice)) + ' 萬)'; } } } else { pHtml += '租HK $' + toPrice(Math.round(item.RENT)) + ' 元'; pHtml += '(租MOP $' + toPrice(Math.round(item.MoRent)) + ' 元)'; } pHtml += '
    '; pHtml += '
    '; pHtml += '
    ' + item.ROOMTITLE + '
    '; pHtml += '
    '; pHtml += '' + item.TRANSACTIONTYPE + ' | '; pHtml += '' + toPrice(item.GROSSAREA) + ' 呎'; pHtml += '
    '; pHtml += '
    '; } if (item.NATURE == "工廈") { gSize++; gHml += ''; if (item.IsHot = true) { gHml += '
    '; } gHml += '
    '; if (item.Imgs != "" && item.Imgs.length != 0) { gHml += '' + item.ROOMTITLE + ''; } else { gHml += ''; } gHml += '
    '; if (item.TRANSACTIONTYPE != '放租') { if (item.Price >= 10000) { gHml += '售HK $' + priceSwitch(((item.PRICE) / 10000).toFixed(2)) + ' 億'; gHml += '(售MOP $' + priceSwitch(((item.MoPrice) / 10000).toFixed(2)) + ' 億)'; } else { gHml += '售HK $' + toPrice(Math.round(item.PRICE)) + ' 萬'; if (item.MoPrice != "") { gHml += '(售MOP $' + toPrice(Math.round(item.MoPrice)) + ' 萬)'; } } } else { gHml += '租HK $' + toPrice(Math.round(item.RENT)) + ' 元'; gHml += '(租MOP $' + toPrice(Math.round(item.MoRent)) + ' 元)'; } gHml += '
    '; gHml += '
    '; gHml += '
    ' + item.ROOMTITLE + '
    '; gHml += '
    '; gHml += '' + item.TRANSACTIONTYPE + ' | '; gHml += '' + toPrice(item.GROSSAREA) + ' 呎'; gHml += '
    '; gHml += '
    '; } if (item.NATURE == "寫字樓") { xSize++; xHtml += ''; if (item.IsHot = true) { xHtml += '
    '; } xHtml += '
    '; if (item.Imgs != "" && item.Imgs.length != 0) { xHtml += '' + item.ROOMTITLE + ''; } else { xHtml += ''; } xHtml += '
    '; if (item.TRANSACTIONTYPE != '放租') { if (item.Price >= 10000) { xHtml += '售HK $' + priceSwitch(((item.PRICE) / 10000).toFixed(2)) + ' 億'; xHtml += '(售MOP $' + priceSwitch(((item.MoPrice) / 10000).toFixed(2)) + ' 億)'; } else { xHtml += '售HK $' + toPrice(Math.round(item.PRICE)) + ' 萬'; if (item.MoPrice != "") { xHtml += '(售MOP $' + toPrice(Math.round(item.MoPrice)) + ' 萬)'; } } } else { xHtml += '租HK $' + toPrice(Math.round(item.RENT)) + ' 元'; xHtml += '(租MOP $' + toPrice(Math.round(item.MoRent)) + ' 元)'; } xHtml += '
    '; xHtml += '
    '; xHtml += '
    ' + item.ROOMTITLE + '
    '; xHtml += '
    '; xHtml += '' + item.TRANSACTIONTYPE + ' | '; xHtml += '' + toPrice(item.GROSSAREA) + ' 呎'; xHtml += '
    '; xHtml += '
    '; } }); $("#PW").append(pHtml); $("#GX").append(gHml); $("#XZL").append(xHtml); if (xSize == 0) { $("#XZL").hide(); } if (pSize == 0) { $("#PW").hide(); } if (gSize == 0) { $("#GX").hide(); } } }, error: function (res) { console.log(res); } }); } $("#ulRegion li").each(function () { var str = $(this).find("a").html(); if (str == ZONE) { $(this).find("a").addClass("active"); } if (ZONE == null || ZONE == "") { $("#ulRegion li:first-child").find("a").addClass("active"); } }); $("#ulType li").each(function () { var str = $(this).find("a").attr("data-info"); if (str == TRANSACTIONTYPE) { $(this).find("a").addClass("active"); } if (TRANSACTIONTYPE == null || TRANSACTIONTYPE == "") { $("#ulType li:first-child").find("a").addClass("active"); } }); $("#PropertyType li").each(function () { var str = $(this).find("a").attr("data-info"); if (str == NATURE) { $(this).find("a").addClass("active"); } if (NATURE == null || NATURE == "") { $("#PropertyType li:first-child").find("a").addClass("active"); } }); $(".e-tab a").each(function () { var str = $(this).attr("data-info"); if (str == NATURE) { $(".e-tab a").removeClass("active"); $(this).addClass("active"); } if (NATURE == null || NATURE == "") { $(".e-tab a:first-child").addClass("active"); } }); $("#ulSPrice li").each(function () { var str = $(this).find("a").attr("data-info"); if (str == PRICE) { $(this).find("a").addClass("active"); } if (PRICE == null || PRICE == "") { $("#ulSPrice li:first-child").find("a").addClass("active"); } }); $("#ulArea li").each(function () { var str = $(this).find("a").attr("data-info"); if (str == GROSSAREA) { $(this).find("a").addClass("active"); } if (GROSSAREA == null || GROSSAREA == "") { $("#ulArea li:first-child").find("a").addClass("active"); } }); $("#orderBy li").each(function () { var str = $(this).find("a").attr("data-info"); if (str == orderBy) { $(this).find("a").addClass("active"); } if (orderBy == null || orderBy == "") { $("#orderBy li:first-child").find("a").addClass("active"); } });

    請加微信

    右鍵保存圖片

    close