انتخاب استان و شهر
استان و شهر کنونی:
"; if (HasPackage) { fragment += "
";
fragment += ""; } fragment += "
"; fragment += "
"; if (HasPrice) { fragment += "
";
fragment += "- ";
fragment += IsPriceRange
? ""
: "";
fragment += "";
fragment += Price;
fragment += "
"; } fragment += "
"; fragment += ""; fragment += ""; fragment += "
" + LocationArea + "";
if (taged === false && isAdminUser === "True") {
fragment += "- ویرایش "; } fragment += "
"; fragment += "
"; if (!IsMobile) { fragment += ""; var showbuttom = " "; if (HasCatalog || HasWebsite) { } else { showbuttom = "style="display:none;""; } fragment += ""; } else { fragment += "
"; if (Col2Mobile) { fragment += ""; } else { fragment += ""; } fragment += "
"; } fragment += "
";
var gaLoadmore = 'C' + CompanyID + "-" + CompanyName + '-P' + ID + '-' + ProductName;
ga("send", "event", "UI", "VIEW", gaLoadmore);
});
$("#ulproducts").append(fragment);
var newskipcount = parseInt(SkipCount) + parseInt(listCount);
$('#ctl00_content_MainList_hdnSkipCountProduct').val(newskipcount);
if (newskipcount >= allcount) $('#ctl00_content_MainList_btnLoadMoreProduct').hide();
setTimeout(function () {
$('#ctl00_content_MainList_btnLoadMoreProduct').removeClass('active');
}, 1000);
loadlazy();
loadStatActives($);
b($);
}
function OnErrorCall(response) { console.log(error); }
setTimeout(function () {
$('#ctl00_content_MainList_btnLoadMoreProduct').removeClass('active');
}, 1000);
return false;
}
$("#ctl00_content_MainList_btnLoadMoreProduct").on("click", function () {
GetProductListCount();
loadMoreProduct(ProductListCount);
});
$("#ctl00_content_MainList_btnLoadMoreCompanies").on("click", function () {
$("#ctl00_content_MainList_btnLoadMoreCompanies").addClass("active");
var newskipcount = 0;
var allcount = parseInt($('#ctl00_content_MainList_hdnAllCountCompany').val());
var keywords = $('#ctl00_content_MainList_hdnKeyword').val();
var ListCount = $('#ctl00_content_MainList_hdnListCount').val();
var SkipCount = $('#ctl00_content_MainList_hdnSkipCountCompany').val();
var tagRouteId = $('#ctl00_content_MainList_hdnTagRouteId').val();
if (!IsMobile) {
ListCount = 8;
}
var jsonData;
var jsonUrl;
if (ProvinceID !== '0' && CityID === '0') {
//jsonData = JSON.stringify({ Keyword: keywords, ProvinceID: ProvinceID, Count: ListCount, Skip: SkipCount, tagRouteId: tagRouteId });
//jsonUrl = "/Code/JsonService.asmx/LoadMoreCompanyProvince";
jsonUrl = "/api/LoadMoreCompanyProvince";
jsonData = JSON.stringify({
Keyword: keywords,
ProvinceID: ProvinceID,
Count: ListCount,
Skip: SkipCount,
tagRouteId: tagRouteId
});
}
else if (CityID !== '0') {
//jsonData = JSON.stringify({ Keyword: keywords, CityID: CityID, Count: ListCount, Skip: SkipCount, tagRouteId: tagRouteId });
//jsonUrl = "/Code/JsonService.asmx/LoadMoreCompanyCity";
jsonUrl = "/api/LoadMoreCompanyCity";
jsonData = JSON.stringify({
Keyword: keywords,
CityID: CityID,
Count: ListCount,
Skip: SkipCount,
tagRouteId: tagRouteId
});
}
else {
//jsonData = JSON.stringify({ Keyword: keywords, Count: ListCount, Skip: SkipCount, tagRouteId: tagRouteId });
//jsonURL = "/Code/JsonService.asmx/LoadMoreCompany";
jsonUrl = "/api/LoadMoreCompany";
jsonData = JSON.stringify({
Keyword: keywords,
Count: ListCount,
Skip: SkipCount,
tagRouteId: tagRouteId
});
}
$.ajax({
type: "POST",
url: jsonUrl,
data: jsonData,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
error: OnErrorCall
});
function OnSuccess(response) {
if (response === '[]') {
$('#ctl00_content_MainList_btnLoadMoreCompanies').hide();
return;
}
var mainkeyword = $('#ctl00_content_MainList_hdnKeyword').val();
var GAlisttype = 'List-';
if (HasRouter == '0') GAlisttype = 'Search-';
var gacurrentlocation = GAlisttype + '(' + mainkeyword + ')';
//var items = JSON.parse(response.d); //Change After Web Api
var items = JSON.parse(response);
var isAdminList = ('False');
var fragment = "";
$.each(items, function (index, val) {
var HasWebsite = val.HasWebSite;
var HasCatalog = val.HasCatalog;
var EncodeWebsite;
var LocationArea = val.Location;
var ID = val.ID;
var CompanyID = val.CompanyID;
var AboutText = val.AboutWithLinks;
var CompanyName = "";
if (isAdminList === 'True')
CompanyName = val.EditOnDate + " - " + val.CompanyName;
else
CompanyName = val.CompanyName;
var Logo = val.Logo;
var Website = val.Website;
var Tel = val.Tel;
var CurrentPackageID = val.CurrentPackageID;
var HasPackage = false;
var Col2Mobile = false;
var CallActionTel = val.CallActionTel;
var DetailText = "جزئیات بیشتر و تماس";
EncodeWebsite = encodeURIComponent(Website);
if (Logo == null || Logo === "") {
Logo = "/images/image-not-available.gif";
}
if (CurrentPackageID > 1) {
HasPackage = true;
DetailText = "جزئیات بیشتر";
if (CallActionTel != '') Col2Mobile = true;
}
if (location.length > 39) {
location = location.Substring(0, 36) + '...';
}
fragment += "
"; if (HasPackage) { fragment += "
";
fragment += ""; } fragment += "
"; if (HasPackage) { fragment += "
"; } else { fragment += "
" + AboutText + "
"; if (HasPackage) { fragment += "
"; } if (!IsMobile) { fragment += ""; } else { fragment += "
"; if (Col2Mobile) { fragment += ""; } else { fragment += ""; } fragment += "
"; } fragment += "
آدرس: " + LocationArea + "
"; fragment += "
"; }); $("#ulcompanies").append(fragment); var newskipcount = parseInt(SkipCount) + parseInt(ListCount); $('#ctl00_content_MainList_hdnSkipCountCompany').val(newskipcount); if (newskipcount >= allcount) { $('#ctl00_content_MainList_btnLoadMoreCompanies').hide(); } setTimeout(function () { $('#ctl00_content_MainList_btnLoadMoreCompanies').removeClass('active'); }, 1000); loadlazy(); loadStatActives($); } function OnErrorCall(response) { console.log(error); } setTimeout(function () { $('#ctl00_content_MainList_btnLoadMoreCompanies').removeClass('active'); }, 1000); return false; }); $("#ctl00_content_MainList_btnLoadMoreArticle").on("click", function () { $("#ctl00_content_MainList_btnLoadMoreArticle").addClass("active"); var newskipcount = 0; var allcount = parseInt($('#ctl00_content_MainList_hdnAllCountArticle').val()); var keywords = $('#ctl00_content_MainList_hdnKeyword').val(); var ListCount = $('#ctl00_content_MainList_hdnListCount').val(); var SkipCount = $('#ctl00_content_MainList_hdnSkipCountArticle').val(); var tagRouteId = $('#ctl00_content_MainList_hdnTagRouteId').val(); if (newskipcount >= allcount) { $('#ctl00_content_MainList_btnLoadMoreArticle').hide(); return; } var jsonData = JSON.stringify({ Keyword: keywords, Count: ListCount, Skip: SkipCount }); $.ajax({ type: "POST", //url: "/Code/JsonService.asmx/LoadMoreArticle", url: "/api/LoadMoreArticle", data: jsonData, contentType: "application/json; charset=utf-8", dataType: "json", success: onSuccess, error: onErrorCall }); function onSuccess(response) { var mainkeyword = $('#ctl00_content_MainList_hdnKeyword').val(); var gAlisttype = 'List'; if (HasRouter === '0') gAlisttype = 'Search'; var items = JSON.parse(response); var fragment = ""; $.each(items, function (index, val) { var HowToID = val.HowToID; var ThumbURL = val.ThumbURL; var HowToTitle = val.HowToTitle; var HowToDesc = val.HowToDesc; var HowToDate = val.HowToDate; var ModifiedDate = val.ModifiedDate; var howToMainImageUrl = "http://" + window.location.hostname + "/image/articleimage/" + HowToID + "/"; HowToDesc = HowToDesc.length > 110 ? HowToDesc.substring(0, 107) + '...' : val.HowToDescWithLinks; fragment += "
";
fragment += " ";
fragment += ""; fragment += "
" + HowToTitle + "
"; fragment += "
" + HowToDesc + "
"; //fragment += ""; fragment += "
";
fragment += "";
fragment += "
"; fragment += "
"; var gaLoadmore = 'A' + HowToID + "-" + HowToTitle; ga("send", "event", "UI", "VIEW", gaLoadmore); }); $("#ularticle").append(fragment); var newskipcount = parseInt(SkipCount) + parseInt(ListCount); $('#ctl00_content_MainList_hdnSkipCountArticle').val(newskipcount); if (newskipcount >= allcount) { $('#ctl00_content_MainList_btnLoadMoreArticle').hide(); } setTimeout(function () { $('#ctl00_content_MainList_btnLoadMoreArticle').removeClass('active'); }, 1000); loadlazy(); loadStatActives($); b($); } function onErrorCall(response) { console.log(error); } setTimeout(function () { $('#ctl00_content_MainList_btnLoadMoreArticle').removeClass('active'); }, 1000); return false; }); }); })(jQuery);
مطالب برگزیده...
ما را در سایت مطالب برگزیده دنبال می کنید
برچسب : نویسنده : جواد رمضانی بازدید : 390 تاريخ : پنجشنبه 18 بهمن 1397 ساعت: 14:16