|
|
@@ -43,7 +43,7 @@ var fnCreateGoodsList = function(result, ithrCd, contentLoc, goodsUrl, lastPage,
|
|
|
}else{
|
|
|
tag += ' onClick="cfnPutWishList(this);" goodsCd=\''+item.goodsCd+'\', ithrCd=\'\', contentsLoc=\'\', planDtlSq=\'\'>관심상품 추가</button>';
|
|
|
}
|
|
|
- tag += '<a href="javascript:void(0);" class="itemLink" onclick="fnClickGoodsCd(\''+item.goodsCd+'\',\''+item.mainColorCd+'\');">';
|
|
|
+ tag += '<a href="javascript:void(0);" class="itemLink" onclick="fnClickGoodsCd(\''+item.goodsCd+'\',\'\');">';
|
|
|
tag += ' <div class="itemPic">';
|
|
|
if(!gagajf.isNull(item.videos)){
|
|
|
var videoArr = item.videos.split(",");
|
|
|
@@ -182,4 +182,390 @@ var fnCategoryGoodsInfiniteScrollInit = function(){
|
|
|
$("#listBox").html("");
|
|
|
}
|
|
|
|
|
|
+var filterHtml = '';
|
|
|
+var filterStatHtml = '';
|
|
|
+
|
|
|
+// 공용,신상 조건
|
|
|
+var fnFilterOption = function (obj, stat){
|
|
|
+ var thisId = $(obj).attr('id');
|
|
|
+ var tag = '';
|
|
|
+
|
|
|
+ if(thisId == 'unisex'){
|
|
|
+ if(stat=='on'){
|
|
|
+ $(obj).attr('onclick','fnFilterOption(this,\'off\');');
|
|
|
+ tag += '<input type="hidden" name="unisex" value="G007_Z"/>\n';
|
|
|
+ $("#searchGoodsForm").append(tag);
|
|
|
+ }else{
|
|
|
+ $(obj).attr('onclick','fnFilterOption(this,\'on\');');
|
|
|
+ $("#searchGoodsForm input:hidden[name=unisex]").remove();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(stat=='on'){
|
|
|
+ $(obj).attr('onclick','fnFilterOption(this,\'off\');');
|
|
|
+ tag += '<input type="hidden" name="newGoods" value="40"/>\n';
|
|
|
+ $("#searchGoodsForm").append(tag);
|
|
|
+ }else{
|
|
|
+ $(obj).attr('onclick','fnFilterOption(this,\'on\');');
|
|
|
+ $("#searchGoodsForm input:hidden[name=newGoods]").remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fnCategoryGoodsInfiniteScrollInit();
|
|
|
+ fnSearchGoodsListSearch();
|
|
|
+}
|
|
|
+
|
|
|
+// 상품상세 필터 조회
|
|
|
+var filterSel = function (obj, gubun, staus, sizeGb){
|
|
|
+ gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
|
|
|
+ gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
|
|
|
+ let $obj = $(obj);
|
|
|
+ if(staus=='on'){
|
|
|
+ filterStatHtml = '';
|
|
|
+ if(gubun=='size'){
|
|
|
+ $(obj).attr('onclick','filterSel(this,\''+gubun+'\',\'off\',\''+sizeGb+'\');');
|
|
|
+ }else{
|
|
|
+ $(obj).attr('onclick','filterSel(this,\''+gubun+'\',\'off\',\'\');');
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#filterData").find('span').each(function(idx,item) {
|
|
|
+ if(gubun=='color'){
|
|
|
+ if($obj.attr('data-id').replace('#','').trim() == $(this).closest("span").attr('id')) {
|
|
|
+ $(this).closest("span").remove();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if($obj.attr('data-id') == $(this).closest("span").text()) {
|
|
|
+ $(this).closest("span").remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ filterStatHtml = $("#filterData").html();
|
|
|
+ }else{
|
|
|
+ if(gubun=='size'){
|
|
|
+ $(obj).attr('onclick','filterSel(this,\''+gubun+'\',\'on\',\''+sizeGb+'\');');
|
|
|
+ }else{
|
|
|
+ $(obj).attr('onclick','filterSel(this,\''+gubun+'\',\'on\',\'\');');
|
|
|
+ }
|
|
|
+
|
|
|
+ let tag = '';
|
|
|
+ if(gubun=='color'){
|
|
|
+ tag += '<span id="'+$obj.attr('data-id').replace('#','')+'">';
|
|
|
+ if($obj.attr('data-id')=='#FFFFFF'){
|
|
|
+ tag += ' <span class="pdColor-color" style="background-color: #'+$obj.attr('data-id')+';border:1px solid #aaa;" value="'+$obj.attr('data-id')+'"></span>';
|
|
|
+ }else{
|
|
|
+ tag += ' <span class="pdColor-color" style="background-color: #'+$obj.attr('data-id')+'" value="'+$obj.attr('data-id')+'"></span>';
|
|
|
+ }
|
|
|
+ tag += ' <a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilter(this,\''+gubun+'\',\'on\');"></a >';
|
|
|
+ tag += '</span>';
|
|
|
+ }else{
|
|
|
+ tag += '<span>'+$obj.attr('data-id');
|
|
|
+ if(!gagajf.isNull(sizeGb)){
|
|
|
+ tag += '<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilter(this,\''+gubun+'\',\'on\',\''+sizeGb+'\');"></a >';
|
|
|
+ }else{
|
|
|
+ tag += '<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilter(this,\''+gubun+'\',\'on\',\'\');"></a >';
|
|
|
+ }
|
|
|
+ tag += '</span>';
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#filterData").append(tag);
|
|
|
+
|
|
|
+ filterStatHtml += tag;
|
|
|
+ }
|
|
|
+
|
|
|
+ gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
|
|
|
+ fnFilterSet(gubun, sizeGb);
|
|
|
+}
|
|
|
+
|
|
|
+var fnFilterSet = function (searchId, sizeGb, appGb){
|
|
|
+ fnCategoryGoodsInfiniteScrollInit();
|
|
|
+ $("#searchGoodsForm input:hidden[name="+searchId+"Arr]").remove();
|
|
|
+ var tag = '';
|
|
|
+ var mobTag = '';
|
|
|
+ if(searchId=='size'){
|
|
|
+ $('#filterForm input[name='+searchId+']:checked').each(function(){
|
|
|
+ tag = '<input type="hidden" name="'+searchId+'Arr" value="'+$(this).attr('data-id')+'"/>\n';
|
|
|
+ $("#searchGoodsForm").append(tag);
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ $('#filterForm input[name='+searchId+']:checked').each(function(){
|
|
|
+ tag = '<input type="hidden" name="'+searchId+'Arr" value="'+$(this).val()+'"/>\n';
|
|
|
+ $("#searchGoodsForm").append(tag);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if(appGb == 'Mob'){
|
|
|
+ var data = '';
|
|
|
+ var tag = '';
|
|
|
+ var filterSet = '';
|
|
|
+ $('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
|
|
|
+ $('#filterForm input[name='+searchId+']:checked').each(function(idx){
|
|
|
+ if(searchId=='color'){
|
|
|
+ $('#'+searchId+'FilterDiv').find('.daps1').find('.pic').find('span').html('');
|
|
|
+ var mobTag = '';
|
|
|
+ var color = $(this).attr('data-id');
|
|
|
+ console.log('color::'+$(this).attr('data-id'));
|
|
|
+ if(color=='FFFFFF'){
|
|
|
+ mobTag += '<span class="pdColor-color" style="background-color:#'+color+';border:1px solid #aaa;"></span>';
|
|
|
+ }else{
|
|
|
+ mobTag += '<span class="pdColor-color" style="background-color:#'+color+'"></span>';
|
|
|
+ }
|
|
|
+ $("#"+searchId+"FilterDiv").find('.daps1').find('.pic').append(mobTag);
|
|
|
+ }else{
|
|
|
+ $('#'+searchId+'FilterDiv').find('.daps1').find('span').html('');
|
|
|
+ if(idx>0){
|
|
|
+ data += ',';
|
|
|
+ }
|
|
|
+ data += $(this).attr('data-id');
|
|
|
+ $("#"+searchId+"FilterDiv").find('.daps1').append('<span class="pic">'+data+'</span>');
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ fnSetFilterHtml();
|
|
|
+ fnSearchGoodsListSearch();
|
|
|
+}
|
|
|
+
|
|
|
+var fnSetFilterHtml = function (gubun, staus, mobGb){
|
|
|
+ filterHtml = '';
|
|
|
+
|
|
|
+ $('#filterForm input[name=size]:checked').each(function(){
|
|
|
+ filterHtml += '<input type="hidden" name="sizeArr" value="'+$(this).attr('data-id')+'"/>\n';
|
|
|
+ });
|
|
|
+ $('#filterForm input[name=brandGroup]:checked').each(function(){
|
|
|
+ filterHtml += '<input type="hidden" name="brandGroupArr" value="'+$(this).val()+'"/>\n';
|
|
|
+ });
|
|
|
+ $('#filterForm input[name=age]:checked').each(function(){
|
|
|
+ filterHtml += '<input type="hidden" name="ageArr" value="'+$(this).val()+'"/>\n';
|
|
|
+ });
|
|
|
+ $('#filterForm input[name=season]:checked').each(function(){
|
|
|
+ filterHtml += '<input type="hidden" name="seasonArr" value="'+$(this).val()+'"/>\n';
|
|
|
+ });
|
|
|
+ $('#filterForm input[name=color]:checked').each(function(){
|
|
|
+ filterHtml += '<input type="hidden" name="colorArr" value="'+$(this).val()+'"/>\n';
|
|
|
+ });
|
|
|
+ $('#filterForm input[name=benefit]:checked').each(function(){
|
|
|
+ filterHtml += '<input type="hidden" name="benefitArr" value="'+$(this).val()+'"/>\n';
|
|
|
+ });
|
|
|
+ $('#filterForm input[name=price]:checked').each(function(){
|
|
|
+ filterHtml += '<input type="hidden" name="priceArr" value="'+$(this).val()+'"/>\n';
|
|
|
+ });
|
|
|
+ $('#filterForm input[name=dcRate]:checked').each(function(){
|
|
|
+ filterHtml += '<input type="hidden" name="dcRateArr" value="'+$(this).val()+'"/>\n';
|
|
|
+ });
|
|
|
+ if(!gagajf.isNull($("#filterForm input[name=hPriceFrom]").val())){
|
|
|
+ filterHtml += '<input type="hidden" name="priceFrom" value="'+$("#filterForm input[name=hPriceFrom]").val()+'"/>\n';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull($("#filterForm input[name=hPriceTo]").val())){
|
|
|
+ filterHtml += '<input type="hidden" name="priceTo" value="'+$("#filterForm input[name=hPriceTo]").val()+'"/>\n';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull($("#filterForm input[name=hDcRateFrom]").val())){
|
|
|
+ filterHtml += '<input type="hidden" name="dcRateFrom" value="'+$("#filterForm input[name=hDcRateFrom]").val()+'"/>\n';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull($("#filterForm input[name=hDcRateTo]").val())){
|
|
|
+ filterHtml += '<input type="hidden" name="dcRateTo" value="'+$("#filterForm input[name=hDcRateTo]").val()+'"/>\n';
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate1No]').val())){
|
|
|
+ filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate1No]').val()+'"/>\n';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate2No]').val())){
|
|
|
+ filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate2No]').val()+'"/>\n';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate3No]').val())){
|
|
|
+ filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate3No]').val()+'"/>\n';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate4No]').val())){
|
|
|
+ filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate4No]').val()+'"/>\n';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull($("#searchGoodsForm").find('input[name=cate5No]').val())){
|
|
|
+ filterHtml += '<input type="hidden" name="cate1No" value="'+$("#searchGoodsForm").find('input[name=cate5No]').val()+'"/>\n';
|
|
|
+ }
|
|
|
+
|
|
|
+ gagaInfiniteScroll.pageStatus.filterHtml = filterHtml;
|
|
|
+}
|
|
|
+
|
|
|
+// 상품상세 필터 삭제
|
|
|
+var fnDeleteFilter = function (obj, gubun, staus, sizeGb){
|
|
|
+ if(gubun=='size'){
|
|
|
+ $("#"+gubun+"FilterDiv #sizeLi"+sizeGb).each(function(idx,item) {
|
|
|
+ $('#sizeLi'+sizeGb+' .size_btn').each(function (){
|
|
|
+ if($(obj).closest("span").text() == $(this).find('input').attr('data-id')){
|
|
|
+ $(this).find('input').click();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ $("#"+gubun+"FilterDiv > ul > li").each(function(idx,item) {
|
|
|
+ if(gubun == 'color'){
|
|
|
+ if($(obj).closest("span").attr('id') == $(this).find('input').attr('data-id').trim()){
|
|
|
+ $(this).find('input').click();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if($(obj).closest("span").text() == $(this).find('input').attr('data-id')){
|
|
|
+ $(this).find('input').click();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ $(obj).closest("span").remove();
|
|
|
+}
|
|
|
+
|
|
|
+// 정렬 순서
|
|
|
+var fnSortingChange = function (obj, sortingType, stat, appGb){
|
|
|
+ fnCategoryGoodsInfiniteScrollInit();
|
|
|
+ if(stat != 'back'){
|
|
|
+ if($("#searchGoodsForm input[name=sortingType]").val()==sortingType){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(appGb != 'Mob'){
|
|
|
+ $("#sortArea").find('li').each(function (){
|
|
|
+ $(this).find('a').attr('class','off');
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ $("#sortArea").find('button').each(function (){
|
|
|
+ $(this).removeClass("on");
|
|
|
+ });
|
|
|
+ $("#sorting"+sortingType).addClass("on");
|
|
|
+ $("#filter").text($("#sorting"+sortingType).find('span').text());
|
|
|
+ }
|
|
|
+
|
|
|
+ $(obj).addClass("on");
|
|
|
+ if(stat=='back'){
|
|
|
+ $("#sorting"+sortingType).addClass("on");
|
|
|
+ }
|
|
|
+ $("#searchGoodsForm").find("[name=sortingType]").val(sortingType);
|
|
|
+ $("#searchGoodsForm").find("[name=pageNo]").val(1);
|
|
|
+ gagaInfiniteScroll.pageStatus.loadPage = 1;
|
|
|
+ gagaInfiniteScroll.pageStatus.pageNum = [];
|
|
|
+ gagaInfiniteScroll.pageStatus.sortingType = sortingType;
|
|
|
+
|
|
|
+ $('#endPage').hide();
|
|
|
+ $('#noFilterData').hide();
|
|
|
+ fnSearchGoodsListSearch();
|
|
|
+}
|
|
|
+
|
|
|
+// 상품상세
|
|
|
+var fnClickGoodsCd = function (goodsCd, mainColorCd){
|
|
|
+ let scrollpos = $(window).scrollTop();
|
|
|
+ localStorage.setItem('scrollpos', scrollpos);
|
|
|
+ cfnGoToGoodsDetail(goodsCd, mainColorCd);
|
|
|
+}
|
|
|
+
|
|
|
+var fnSetCateFilter = function (cate1No, cate2No, cate3No, cate4No, cate5No){
|
|
|
+ fnCategoryGoodsInfiniteScrollInit();
|
|
|
+ $("#searchGoodsForm input:hidden[name=cate1No]").remove();
|
|
|
+ $("#searchGoodsForm input:hidden[name=cate2No]").remove();
|
|
|
+ $("#searchGoodsForm input:hidden[name=cate3No]").remove();
|
|
|
+ $("#searchGoodsForm input:hidden[name=cate4No]").remove();
|
|
|
+ $("#searchGoodsForm input:hidden[name=cate5No]").remove();
|
|
|
+ let tag = '';
|
|
|
+
|
|
|
+ if(!gagajf.isNull(cate1No)){
|
|
|
+ tag += '<input type="hidden" name="cate1No" value="'+cate1No+'"/>';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull(cate2No)){
|
|
|
+ tag += '<input type="hidden" name="cate2No" value="'+cate2No+'"/>';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull(cate3No)){
|
|
|
+ tag += '<input type="hidden" name="cate3No" value="'+cate3No+'"/>';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull(cate4No)){
|
|
|
+ tag += '<input type="hidden" name="cate4No" value="'+cate4No+'"/>';
|
|
|
+ }
|
|
|
+ if(!gagajf.isNull(cate5No)){
|
|
|
+ tag += '<input type="hidden" name="cate5No" value="'+cate5No+'"/>';
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#searchGoodsForm").append(tag);
|
|
|
+ fnSetFilterHtml();
|
|
|
+
|
|
|
+ fnSearchGoodsListSearch();
|
|
|
+}
|
|
|
+
|
|
|
+// 필터 가격 확인
|
|
|
+var fnCheckPrice = function (data,priceLen){
|
|
|
+ $("#priceSpan").remove();
|
|
|
+ $("#searchGoodsForm input:hidden[name=priceFrom]").remove();
|
|
|
+ $("#searchGoodsForm input:hidden[name=priceTo]").remove();
|
|
|
+ let min = data.from;
|
|
|
+ let max = data.to;
|
|
|
+ $("#price_input_from").val(custom_values[0]);
|
|
|
+ $("#price_input_to").val(custom_values[priceLen]);
|
|
|
+
|
|
|
+ fnFilterSlider('price' , custom_values[min].addComma(), custom_values[max].addComma());
|
|
|
+}
|
|
|
+
|
|
|
+// 필터 할인율 확인
|
|
|
+var fnCheckDcRate = function (data){
|
|
|
+ $("#dcrateSpan").remove();
|
|
|
+ $("#searchGoodsForm input:hidden[name=dcRateFrom]").remove();
|
|
|
+ $("#searchGoodsForm input:hidden[name=dcRateTo]").remove();
|
|
|
+ let min = data.from;
|
|
|
+ let max = data.to;
|
|
|
+ $("#price_input_from").val(0);
|
|
|
+ $("#price_input_to").val(100);
|
|
|
+
|
|
|
+ fnFilterSlider('dcrate' , custom_values02[min].replace('%',''), custom_values02[max].replace('%',''));
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+var fnFilterSlider = function (gubun, min, max){
|
|
|
+ fnCategoryGoodsInfiniteScrollInit();
|
|
|
+ let tag = '';
|
|
|
+ let oriMin = '';
|
|
|
+ let oriMax = '';
|
|
|
+ filterHtml = '';
|
|
|
+ filterStatHtml = '';
|
|
|
+ filterStatHtml = $("#filterData").html();
|
|
|
+ $("#searchGoodsForm").find('input[name=priceFrom]').remove();
|
|
|
+ $("#searchGoodsForm").find('input[name=priceTo]').remove();
|
|
|
+ $("#searchGoodsForm").find('input[name=dcRateFrom]').remove();
|
|
|
+ $("#searchGoodsForm").find('input[name=dcRateTo]').remove();
|
|
|
+ if(gubun=='price'){
|
|
|
+ oriMin = $("#price_input_from").val();
|
|
|
+ oriMax = $("#price_input_to").val();
|
|
|
+ }else{
|
|
|
+ oriMin = $("#dcrate_input_from").val();
|
|
|
+ oriMax = $("#dcrate_input_to").val();
|
|
|
+ }
|
|
|
+
|
|
|
+ if(gubun=='price'){
|
|
|
+ if(min!=max){
|
|
|
+ tag += '<span id="priceSpan">'+ min +'원~'+max+'원';
|
|
|
+ }else{
|
|
|
+ tag += '<span id="priceSpan">'+max+'원';
|
|
|
+ }
|
|
|
+ $("#filterForm").find('input[name=hPriceFrom]').val(min);
|
|
|
+ $("#filterForm").find('input[name=hPriceTo]').val(max);
|
|
|
+ }else{
|
|
|
+ if(min!=max){
|
|
|
+ tag += '<span id="dcrateSpan">'+ min +'~'+max+'%';
|
|
|
+ }else{
|
|
|
+ tag += '<span id="dcrateSpan">'+max+'%';
|
|
|
+ }
|
|
|
+ $("#filterForm").find('input[name=hDcRateFrom]').val(min);
|
|
|
+ $("#filterForm").find('input[name=hDcRateTo]').val(max);
|
|
|
+ }
|
|
|
+ tag += '<a href="javascript:void(0);" class="filter_delete" onclick="fnDeleteFilterSlider(this,\''+gubun+'\', \''+oriMin+'\', \''+oriMax+'\');"></a >';
|
|
|
+ tag += '</span>';
|
|
|
+
|
|
|
+ $("#filterData").append(tag);
|
|
|
+ filterStatHtml += tag;
|
|
|
+
|
|
|
+ var tag2 = '';
|
|
|
+ if(gubun=='price'){
|
|
|
+ tag2 += '<input type="hidden" name="priceFrom" value="'+min.replace(",", "")+'"/>\n';
|
|
|
+ tag2 += '<input type="hidden" name="priceTo" value="'+max.replace(",", "")+'"/>\n';
|
|
|
+ $("#searchGoodsForm").append(tag2);
|
|
|
+ }else{
|
|
|
+ tag2 += '<input type="hidden" name="dcRateFrom" value="'+min+'"/>\n';
|
|
|
+ tag2 += '<input type="hidden" name="dcRateTo" value="'+max+'"/>\n';
|
|
|
+ $("#searchGoodsForm").append(tag2);
|
|
|
+ }
|
|
|
+ gagaInfiniteScroll.pageStatus.filterStatHtml = filterStatHtml;
|
|
|
+ fnSetFilterHtml();
|
|
|
+ fnSearchGoodsListSearch();
|
|
|
+}
|
|
|
+
|
|
|
//****************상품리스트 end **********************************
|