99999){
$("."+sets.picBox).owlCarousel({
loop : false,
items : _this.item_num,
nav : true,
});
}
};
//設定內容
this.setFile= function(_item,$this,d){
_item.find("."+sets.loveBox).removeClass("click");
if(d.ID){
_item.find("."+sets.ordButton).attr("sid",d.ID);
_item.find("."+sets.addReserveBtn).attr("sid",d.ID);
$(".rack_detail").attr('sid', d.ID);
}
if(d.Name)_item.find("."+sets.nameBox).html(d.Name);
if(d.Prod_No)_item.find("."+sets.prodnoBox).html(d.Prod_No);
if(d.Love)_item.find("."+sets.loveBox).addClass(d.Love);
_item.find("."+sets.price1Box).html(d.Price1);
_item.find("."+sets.price2Box).html(d.Price2);
if(d.RBonus)_item.find("."+sets.rbonusBox).html(d.RBonus);
if(d.Get_Bonus)_item.find("."+sets.bonusBox).html(d.Get_Bonus);
if(d.Color)_item.find("."+sets.colorBox).html(d.Color);
if(d.Color_Name){
_item.find("."+sets.colorName).html(d.Color_Name);
_item.find("."+sets.R_Color).html(d.Color_Name);
}
_item.find("."+sets.sale_msg).html(d.sale_msg);
_item.find("."+sets.Wear_Report).html(d.Wear_Report);
if(d.sale_tag){
_item.find("."+sets.sale_tag).removeClass("hide").html(d.sale_tag);
}else{
_item.find("."+sets.sale_tag).addClass("hide").empty()
}
if(d.Stock > 0){
_item.find("."+sets.stockBox).html(_jsLang.庫存+' : '+d.Stock);
}else{
_item.find("."+sets.stockBox).html('');
}
if(sets.type == 3){
if(d.Size_Sel)$this.next("."+sets.sizeSelect).html(d.Size_Sel);
if(d.SP3_Sel)$this.nextAll("."+sets.sp3Select).eq(0).html(d.SP3_Sel);
if(d.Amount)$this.nextAll("."+sets.amountBox).eq(0).html(d.Amount);
$this.nextAll("."+sets.amountBox).eq(0).trigger('change');
}else{
if(d.Size_Button)_item.find("."+sets.sizeBox).html(d.Size_Button);
if(d.Size_Sel)_item.find("."+sets.sizeSelect).html(d.Size_Sel);
if(d.Size_Name){
_item.find("."+sets.sizeName).html(d.Size_Name);
_item.find("."+sets.R_Size).html(d.Size_Name);
}
if(d.SP3_Button)_item.find("."+sets.sp3Box).html(d.SP3_Button);
if(d.SP3_Sel)_item.find("."+sets.sp3Select).html(d.SP3_Sel);
if(d.SP3_Name)_item.find("."+sets.sp3Name).html(d.SP3_Name);
if(d.Amount){_item.find("."+sets.amountBox).replaceWith(d.Amount);}
if(d.Max_Stock){
//if(d.Max_Stock > d.purchase_limit){d.Max_Stock= purchase_limit}
_item.find("."+sets.amountBox).attr('max',d.Max_Stock);
}
}
for($i=1;$i<=3;$i++){
if(d.Button[$i])_item.find("."+sets.addBox+$i).html(d.Button[$i]);
}
if(d.Pre_Flag=='1' || d.Expect_Date){
_item.find("."+sets.expect_date).show();
_item.find("."+sets.stockBox).html(_jsLang.預購品+" | "+_jsLang.預計出貨時間+d.Expect_Date);
_item.find("."+sets.expect_date).html(_jsLang.預購品+" | "+_jsLang.預計出貨時間+d.Expect_Date);
}else{
_item.find("."+sets.expect_date).hide();
}
if(d.Act_Str){
_item.find("."+sets.ActStrBox).html(d.Act_Str);
}else{
_item.find("."+sets.ActStrBox).hide();
}
if(d.B_St_Date && d.B_End_Date ){
_item.find("."+sets.StDate).html(d.B_St_Date + '-' + d.B_End_Date);
}else{
_item.find("."+sets.StDate).hide();
}
if(d.B_Add_St && d.B_Add_End ){
_item.find("."+sets.AddDate).html(d.B_Add_St + '-' + d.B_Add_End);
}else{
_item.find("."+sets.AddDate).hide();
}
if(d.coming){
_item.find("."+sets.addBox).html("尚未開賣");
}
if(d.Color_Name && sets.box_color){
_item.find("."+sets.box_color).html("顏色 / " + d.Color_Name);
}
if(d.Size_Name && sets.box_size){
_item.find("."+sets.box_size).html("尺寸 / " + d.Size_Name);
}
_item.find("."+sets.R_Btn).html(d.R_Btn);
if(d.R_Pic)_item.find("."+sets.R_Pic).html(d.R_Pic);
if(d.R_Name)_item.find("."+sets.R_Name).html(d.R_Name);
if(d.R_Price)_item.find("."+sets.R_Price).html(d.R_Price);
if(d.Buy_St){
_item.find("#Buy_Time_Box").show();
_item.find("#Buy_St").html(d.Buy_St);
}else{
_item.find("#Buy_Time_Box").hide();
}
if(d.Serial_No){
$("#Serial_No").val(d.Serial_No);
$("#stock_serial").val(d.Serial_No);
$(".rack_detail").attr('serial', d.Serial_No);
}
//切換規格事件
_item.find("."+sets.contBox).trigger("changeSpec")
_this.setImg(_item,d.Pic_Path,d.Pic,d.Video,d.Outfit_Pic,d.Name);
_this.setFileOther(_item,d);
}
//變更內容自訂Function
this.setFileOther = function(){
}
//加入購物車後自訂Function
this.setCartOther = function(){
}
//設定圖片、影片
this.setImg = function(_item,Pic_Path,Pic,Video,Outfit_Pic,Name){
//手機
if($(window).width() <=768){
//列表
if(sets.type == 1){
_item.find("."+sets.picpathBox).css("background-image","url('https://cdn-iroo.fonlego.com//upload_files/fonlego-rwd/prodpic/"+Pic_Path+"')");
_item.find("."+sets.picpathBox).html('');
}
//一頁式購物
else if((sets.type == 5) && !sets.fullset_flag)
{
_item.find("."+sets.picpathBox).html(Pic_Path);
_item.find("."+sets.picBox).html(Pic).trigger('destroy.owl.carousel');
//一頁式購物彈窗
if(_item.find("."+sets.picBox).parents(".kol-popupbox").length > 0){
_item.find("."+sets.picBox).owlCarousel({
items: 1,
nav: false,
dots: true
});
}else{
_item.find("."+sets.picBox).owlCarousel({
loop:false,
responsive:{
0:{
items : 3,
},
572:{
items : 5,
}
},
nav : true,
navText : ['','']
});
}
}
//詳細頁
else
{
_this.item_num = 1;
var _Pic = (Pic_Path+','+Pic).split(',');
$_Pic1 = '',
$_Pic2 = '';
for($i=0;$i<_Pic.length;$i++){
if((sets.type == 4 || sets.fullset_flag) && $i >0 )
{
break;
}
if(_Pic[$i]){
$_Pic1 += '';
$_Pic1 += '
';
$_Pic1 += '
';
$_Pic2 += '';
}
}
if(Video && sets.type != 4 && !sets.fullset_flag){
$_Pic1 += '';
$_Pic1 += '';
$_Pic1 += '
';
}
_item.find("."+sets.picpathBox).html($_Pic1).trigger('destroy.owl.carousel')
.owlCarousel({
loop : false,
items : _this.item_num,
nav : true,
});
_item.find("."+sets.picpathBox).on('changed.owl.carousel',function(e){
var num = e.item.index;
$('.productImg').on('changed.owl.carousel',function(e){
var num = e.item.index;
if(document.getElementById("Video")){
if($(".productView").find(".owl-item").eq(num).find("#Video").attr("style")){
$("#big_picture").hide();
document.getElementById("Video").play();
}else{
$("#big_picture").show();
document.getElementById("Video").pause();
}
}
});
});
$(".previewbox").html($_Pic2+'');
}
}
//PC、平板
else{
//列表
if(sets.type == 1){
var _Pic = (Pic_Path+','+Pic).split(','),
$Pic = '',
now_class= '',
Pic_Size = 'L',
$loop = true;
_item.find("."+sets.picpathBox).css("background-image","url('https://cdn-iroo.fonlego.com//upload_files/fonlego-rwd/prodpic/"+_Pic[0]+"')");
_item.find("."+sets.picpathBox).html('');
}
else if((sets.type == 5) && !sets.fullset_flag)
{
_item.find("."+sets.picpathBox).html(Pic_Path);
_item.find("."+sets.picBox).html(Pic).trigger('destroy.owl.carousel');
//一頁式購物彈窗
if(_item.find("."+sets.picBox).parents(".kol-popupbox").length > 0){
_item.find("."+sets.picBox).owlCarousel({
items: 1,
nav: false,
dots: true
});
}else{
_item.find("."+sets.picBox).owlCarousel({
loop:false,
responsive:{
0:{
items : 3,
},
572:{
items : 5,
}
},
nav : true,
navText : ['','']
});
}
}
//詳細頁
else{
_this.item_num = 5;
var _Pic = (Pic_Path+','+Pic).split(',');
$Pic = '',
$Pic_Path = '',
now_class= 'now',
Pic_Size = 'S',
$loop = false;
if(Video && (sets.type == 2 || sets.type == 3) ){
$Pic_Path += '';
$Pic_Path += '';
$Pic_Path += '
';
}
for($i=0;$i<_Pic.length;$i++){
if((sets.type == 4 || sets.fullset_flag) && $i >0 )
{
break;
}
now_class =($i==0 && (sets.type == 2 || sets.type == 3) && !Video)?'now':'';
if(_Pic[$i]){
$Pic_Path += '';
$Pic_Path += '
';
$Pic_Path += '
';
$Pic_Path += '
';
$Pic_Path += '
';
$Pic_Path += '
';
$Pic_Path += '
';
}
}
_item.find("."+sets.picpathBox).html($Pic_Path);
$('.zoonbox').zoom({magnify:1,duration:450});//放大套件
}
if(Video && (sets.type == 2 || sets.type == 3)){
$Pic += '';
}
//設定輪播圖
if(_Pic)
{
for($i=0;$i<_Pic.length;$i++)
{
if((sets.type == 4 || sets.fullset_flag) && $i >0 )
{
break;
}
now_class =($i==0 && (sets.type == 2 || sets.type == 3))?'now':'';
if(_Pic[$i]){
if(sets.type == 1) {
let strStart = Name.indexOf('href') + 6;
let strEnd = Name.indexOf('"', strStart);
let $hrefUrl = Name.slice(strStart, strEnd);
$Pic += `
`;
} else {
$Pic += '';
}
}
}
}
_item.find("."+sets.picBox).html($Pic);
if(sets.type == 2 || sets.type == 3)
{
sets.slider.reloadSlider();
} else if (sets.type == 1) {
$(".product-img-carousel").each(function(){
let _this = $(this)
_this.trigger("destroy.owl.carousel")
_this.owlCarousel({
items: 1,
nav: false,
dots: true
})
})
}
if(document.getElementById("Video")){
//影片預覽圖
document.getElementById("Video").oncanplay=function(){
var video = $("#Video").get(0);
var canvas = document.getElementById("video_review");
canvas.getContext('2d').drawImage(video, 0, 0, 66, 92);
};
$("#video_control").addClass('fa-pause').removeClass('fa-play');
document.getElementById("Video").play();
}
}
//穿搭卡片購物彈窗
if((sets.type == 5) && ($(".outfit-popup").length > 0) && Outfit_Pic){
let container = $(".outfit-popup").find(".bounce-product-left")
container.empty();
container.html(''+Outfit_Pic+'
');
container.find('.picbox').owlCarousel({
items: 1,
nav: false,
dots: true
})
window.dispatchEvent(new Event('resize'))
}
}
};
var prod_list = function(option){
var sets = {
//商品內容
contBox : 'Main_Content', //總容器的ID
styleBox : 'stylebox', //樣式下拉選單的ID
sizeBox : 'sizebox', //尺寸下拉選單的ID
orderBox : 'orderbox', //排序下拉選單的ID
morderBox : 'mobile_sort>div',
pageBox : 'pagebox', //分頁容器的class
pageShow : 'page_show', //顯示分頁資訊的ID
pageSelect : 'page-select', //分頁下拉選單的class
prevPage : 'prev_page', //手機版上一頁的ID
nextPage : 'next_page', //手機版下一頁的ID
picBox : 'productSlidebox', //圖片容器的class
mainPicBox : 'productImg', //主圖片容器的class
searchBox : 'slideBox', //搜尋按鈕容器的class
searchBtn : 'search_item', //搜尋按鈕的class
searchFocus : 'search_focus', //搜尋按鈕focus的class
searchType : 'type', //搜尋按鈕type標籤
searchID : 'search_id', //搜尋按鈕search_id標籤
moneyRange : 'money_range', //篩選價格的class
mobileFilter: 'mobile-filter', //手機版行銷篩選器的class
urlGetID : 'Url_Get', //塞入get資料的表單ID
searchUrl : '/products/ajax/list/ajax_get_prod_list.php',//搜尋ajax網址
searchSend : 'search_btn_X',//搜尋ajax按鈕
cleanSearch : 'cleanButton', //清除篩選Button之ID
sharetype : '' //是否被分享
};
$.extend(sets, option);
var _this = this;
let Params = new URLSearchParams(location.search),
searchParam = (Params.get("keywords") !== null) ? '&keywords=' + Params.get("keywords") : '';
//初始
this.init = function(){
if(!history.hasOwnProperty('state'))
{
window.history.replaceState({page:''},'','');
}
var str = location.hash;
str1 = str.substring(1,str.length);
if(str1 == 'share'){
sets.sharetype = 'share';
$("#minRange").text();
$("#maxRange").text();
$("."+sets.searchFocus).each(function(){
$(this).addClass("search_focus2");
});
var Str = _this.SearchStr();
$("#filter_val").val(Str);
_this.Search();
}
//篩選按鈕
$("."+sets.searchBtn).on('click',function(){
var $class= "";
$class = ($(this).hasClass(sets.searchFocus))?"":sets.searchFocus;
//$(this).parents("."+sets.searchBox).children("."+sets.searchBtn).removeClass(sets.searchFocus);
$(this).removeClass(sets.searchFocus);
$(this).addClass($class);
// _this.Search();
});
//每頁幾筆
$('input[name="viewNumder"]').on('click',function(){
_this.Search();
});
//排序
$("#"+sets.orderBox).on('change',function(){
_this.Search();
});
$('.show_listpage').on('click',function(){
$('.show_listpage').removeClass('now');
$(this).addClass('now');
_this.Search();
});
//手機版排序
$('#'+sets.morderBox).on('click',function(){
var $class= "";
$('#'+sets.morderBox).removeAttr('click');
$(this).attr('click','true');
$class = ($(this).hasClass(sets.searchFocus))?"":sets.searchFocus;
$('#'+sets.morderBox).removeClass(sets.searchFocus);
$(this).addClass($class);
// _this.Search();
})
//下拉篩選樣式
$("#"+sets.styleBox).on('change',function(){
_this.Search();
});
//下拉篩選尺寸
$("#"+sets.sizeBox).on('change',function(){
_this.Search();
});
//紅綠標
$("input[name='pair_flag']").click(function(){
_this.Search();
});
//手機版行銷篩選
$("."+sets.mobileFilter).on('click',function(){
$("."+sets.mobileFilter+"[type="+$(this).attr("type")+"]").removeClass("now");
$(this).addClass("now");
_this.Search();
});
//分頁
$("."+sets.pageBox).on('click','.page,.page-next',function(){
window.location.hash = $(this).attr("send");
});
//手機版上下頁
$("#"+sets.prevPage+",#"+sets.nextPage).on('click',function(){
if($(this).attr("send")>0){
window.location.hash = $(this).attr("send");
$("#prev_page").show();
}else{
$("#prev_page").hide();
}
});
//分頁下拉選單
$("."+sets.pageSelect).change(function(){
window.location.hash = $(this).val();
});
//篩選價格
if((typeof $.fn.nstSlider) == 'function'){
$('.nstSlider').nstSlider({
"rounding":{
"50":"1000"
},
"crossable_handles":false,
"left_grip_selector": ".leftGrip",
"right_grip_selector": ".rightGrip",
"value_bar_selector": ".bar",
"highlight": {
"grip_class": "gripHighlighted",
"panel_selector": ".highlightPanel"
},
"user_mouseup_callback": function(leftValue, rightValue) {
$('.leftLabel').text(leftValue);
$('.rightLabel').text(rightValue);
// _this.Search(hash,'no');
},
"value_changed_callback": function(cause, leftValue, rightValue) {
$('.leftLabel').text(leftValue);
$('.rightLabel').text(rightValue);
},
});
}
//分頁錨點
var hash = parseInt(window.location.hash.replace('#',''));
if(hash > 0){
var Str = _this.SearchStr(),Str_Old = $("#filter_val").val();
if(Str != Str_Old){
_this.SearchClean();
}
_this.Search(hash);
}else{
if($(window).width()<=1024){
_this.Search();
}
}
window.onhashchange=function(){
var hash = parseInt(window.location.hash.replace('#','')) || '1';
if(hash > 0){
var Str = _this.SearchStr(),
Str_Old = $("#filter_val").val();
if(Str != Str_Old){
_this.SearchClean();
}
_this.Search(hash);
}else{
_this.Search(1);
}
}
//我有興趣按鈕
$("#"+sets.contBox).on("click","."+sets.interestBtn,function(){
$("#"+sets.interestID).val($(this).attr('SID'));
//打開視窗
$('.modal-layer').removeClass('in-active');
$('#sendCellphone').addClass('in-active');
});
//清除篩選
$("#"+sets.cleanSearch).on('click',function(){
sets.sharetype = '';
_this.SearchClean();
_this.Search();
});
//篩選送出
$("#"+sets.searchSend).on('click',function(){
sets.sharetype = 'share';
$("."+sets.searchFocus).each(function(){
$(this).addClass("search_focus2");
});
var Str = _this.SearchStr();
$("#filter_val").val(Str);
_this.Search();
$(".filter-button").click()
});
};
//搜尋callback
this.searchCallback = function(){
}
//記錄篩選資訊
this.SearchStr = function(){
var _str = "",
_style = "&style=",
_spec1 = "&spec1=",
_spec2 = "&spec2=",
_series = "&series=";
$("."+sets.searchFocus).each(function(){
switch($(this).attr(sets.searchType)){
case "series":
_series += $(this).attr(sets.searchID) +',';
break;
case "style":
_style += $(this).attr(sets.searchID) +',';
break;
case "spec1":
_spec1 += $(this).attr(sets.searchID) +',';
break;
case "spec2":
_spec2 += $(this).attr(sets.searchID) +',';
break;
}
});
_str += _style+_spec1+_spec2+_series;
return _str;
};
//清除篩選資訊
this.SearchClean = function(){
if(document.getElementById('filter_val'))
{
var max_price = $(".nstSlider").attr("data-range_max");
$("."+sets.searchBtn).removeClass(sets.searchFocus); //篩選按鈕歸零
$(".sort-item").removeClass(sets.searchFocus); //篩選按鈕歸零
if((typeof $.fn.nstSlider) == "function"){
$('.nstSlider').nstSlider('set_position',0,max_price);
}
$('#'+sets.morderBox).removeAttr('click');
}
};
//篩選功能
this.Search = function(pageCode,other){
//置頂
if(other != "no"){
$(window).scrollTop(0);
}
var _str = "",
_style = "&style=",
_spec1 = "&spec1=",
_spec2 = "&spec2=",
_series = "&series=",
pageCode = parseInt(pageCode) || 1,
_limit = $(".show_listpage.now").text() || ($('input[name="viewNumder"]:checked').val() || 24),
$page = "";
//搜尋結果頁無限制筆數功能 所以預設值24
if(_limit == undefined){
_limit = 24;
}
$(".loading").show();
$("."+sets.searchFocus).each(function(){
switch($(this).attr(sets.searchType)){
case "series":
_series += $(this).attr(sets.searchID) +',';
break;
case "style":
_style += $(this).attr(sets.searchID) +',';
break;
case "spec1":
_spec1 += $(this).attr(sets.searchID) +',';
break;
case "spec2":
_spec2 += $(this).attr(sets.searchID) +',';
break;
}
});
_str += _style+_spec1+_spec2+_series;
$("."+sets.moneyRange).each(function(){
_str += "&"+$(this).attr("id")+"="+$(this).text();
});
if($("#"+sets.orderBox).val() && $("#"+sets.orderBox).val() != "undefined"){
_str += "&order="+$("#"+sets.orderBox).val();
}else if($('#mobile_sort>div.search_focus').attr("search_id")){
_str += "&order="+$('#mobile_sort>div.search_focus').attr("search_id");
}
if($(window).width()<=1024){
//手機版排序
if($('#'+sets.morderBox+'[click="true"]').data('val')){
_str += "&order="+$('#'+sets.morderBox+'[click="true"]').data('val');
}
//手機版下拉
_limit = 99;
}
if($("#"+sets.styleBox).val()){
_str += "&style="+$("#"+sets.styleBox).val();
}
if($("#"+sets.sizeBox).val()){
_str += "&spec2="+$("#"+sets.sizeBox).val();
}
if($("input[name='pair_flag']:checked").val()){
_str += "&pair="+$("input[name='pair_flag']:checked").val();
}
$("."+sets.mobileFilter+".now").each(function(){
_str += "&"+$(this).attr("type")+"="+$(this).attr("val");
})
//檢查state記錄
if(!pageCode)
{
pageCode = window.history.state.page || '1';
}
_str += "&limit="+_limit;
_str += "&page="+pageCode;
$.ajax({
url:sets.searchUrl,
type:"POST",
async:false,
data:$("#"+sets.urlGetID).val()+_str,
error:function(d){
alert(d.responseText);
},
success:function(d){
//插入資料
$("#"+sets.contBox).html(d)
.find("."+sets.picBox)
.owlCarousel({
loop : true,
items : 1,
nav : true
});
//處理分頁
var Total = $("#Ajax_Total").val(),
$start= 0,
$end = 0,
$Total= Math.ceil(Total/_limit);
if($("#topTitle .red").eq(1).length > 0){
$("#topTitle .red").eq(1).text(Total)
}
if(_limit != 99){
//一般分頁
$("."+sets.pageBox).children().css({visibility:''});
$("#"+sets.pageShow).css({visibility:''});
//手機版上一頁
if($Total >1){
$("#"+sets.prevPage).show();
$("#"+sets.prevPage).attr("send",(pageCode-1));
if(pageCode>1){
$("#"+sets.prevPage).show();
}else{
$("#"+sets.prevPage).hide();
}
}else{
$("#"+sets.prevPage).hide();
}
//手機版下一頁
if(pageCode < $Total){
$("#"+sets.nextPage).show();
$("#"+sets.nextPage).attr("send",(pageCode+1));
}else{
$("#"+sets.nextPage).hide();
}
//第一頁
if(pageCode >=4){
$page += '1';
}
//上一頁
if(pageCode > 1){
$page += ''+_jsLang.上一頁+'...';
}
if(pageCode <3){
var $max = ($Total-1>=4)?4:$Total-1;
$start = 1;
$end = 1+$max;
}else if(pageCode >=($Total-1)){
$min = ($Total-4>0)?4:$Total-1;
$start = $Total-$min;
$end = $Total;
}else{
$start = pageCode-2;
$end = pageCode+2;
}
for($i=$start;$i<=$end;$i++){
var $class = (pageCode == $i)?'now':'';
$page += ''+$i+'';
}
//下一頁
if(pageCode <$Total){
$page += '...'+_jsLang.下一頁+'';
}
//最後一頁
if(pageCode <=$Total-3){
$page += ''+$Total+'';
}
if(pageCode != '1')
{
window.location.hash = pageCode;
}
$shareurl = '';
if(sets.sharetype == 'share'){
$shareurl = "?type=share"+_str;
}else{
$shareurl = '';
sets.sharetype = pageCode;
}
window.history.replaceState({pageCode:pageCode},"test",$shareurl+searchParam+"#"+sets.sharetype);
$("."+sets.pageBox).html($page);
$("#"+sets.pageShow).html('Showing '+((pageCode-1)*_limit+1)+'-'+((Total'+_jsLang.第X頁.replace("%u",$i)+'';
}
$("."+sets.pageSelect).html($option);
//$(window).Scroll_Data.destroy();
}else{
$("."+sets.pageBox).children().css({visibility:'hidden'});
$("#"+sets.pageShow).css({visibility:'hidden'});
$(window).Scroll_Data({
loading_box : "#"+sets.contBox,
loading_distance : 1000,
url : sets.searchUrl,
data : $("#"+sets.urlGetID).val()+_str,
callback : function(){
if($(window).width() <= 1024){
$(".product-img-carousel").each(function(){
let _this = $(this)
_this.owlCarousel({
items: 1,
nav: false,
dots: true
})
})
}else{
$(".product-img-carousel").each(function(){
$(this).trigger("destroy.owl.carousel")
})
}
}
});
}
var url = $("#Page_Url").val();
if(url)
{
url += '?mode=search'+_str;
window.history.replaceState({page:pageCode},'',url);
}
//console.log(pageCode);
_this.searchCallback(d);
}
});
$(".loading").hide();
}
}