|
|
@@ -27,7 +27,7 @@
|
|
|
<div class="list_content"> <!-- 데이터 없을시 클래스 nodata 추가 -->
|
|
|
<div class="count_wrap">
|
|
|
<div>
|
|
|
- <p><span id="totCnt"></span>개의 상품</p>
|
|
|
+ <p><span id="lookbookTotCnt"></span>개의 상품</p>
|
|
|
</div>
|
|
|
<div>
|
|
|
<ul class="dp_util">
|
|
|
@@ -54,13 +54,15 @@
|
|
|
<div class="lookbookGrp">
|
|
|
<div class="swiper_filter brand" id="filterChkArea">
|
|
|
<div class="cate_wrap" id="chkBrand">
|
|
|
- <a href="javascript:void(0);" onclick="fnReset();">전체</a>
|
|
|
+ <a href="javascript:void(0);" onclick="fnLookbookReset();">전체</a>
|
|
|
</div>
|
|
|
- <div class="btnbox"><a href="javascript:void(0);" class="reset" onclick="fnReset();">새로고침</a></div>
|
|
|
+ <div class="btnbox"><a href="javascript:void(0);" class="reset" onclick="fnLookbookReset();">새로고침</a></div>
|
|
|
+ </div>
|
|
|
+ <div class="list_content">
|
|
|
+ <ul class="event_con itemsGrp" id="listBox">
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
- <ul class="event_con" id="lookbookArea">
|
|
|
|
|
|
- </ul>
|
|
|
</div>
|
|
|
<div class="list_last">마지막페이지 입니다.</div>
|
|
|
</div>
|
|
|
@@ -82,7 +84,7 @@
|
|
|
</div>
|
|
|
<div class="brand_floormenu"><!-- ☞☞ 제품이 품절되면 soldout클래스 추가 -->
|
|
|
<div class="share_like">
|
|
|
- <button class="refresh" onclick="fnReset();">초기화</button>
|
|
|
+ <button class="refresh" onclick="fnReset1();">초기화</button>
|
|
|
<!--<button class="like">위시리스트</button>-->
|
|
|
</div>
|
|
|
<div class="prd_buy">
|
|
|
@@ -93,6 +95,18 @@
|
|
|
</div>
|
|
|
</main>
|
|
|
|
|
|
+ <form id="lbMainForm" name="lbMainForm">
|
|
|
+ <input type="hidden" name="pageNo" id="pageNo" value ="1"/>
|
|
|
+ <input type="hidden" name="pageSize" value ="30"/>
|
|
|
+ <input type="hidden" name="lookbookGb" th:value="${lbInfo.lookbookGb}"/>
|
|
|
+ <input type="hidden" name="brandCd" th:value="${lbInfo.brandCd}">
|
|
|
+ <input type="hidden" name="frontYn" value="Y"/>
|
|
|
+ <input type="hidden" name="totalCnt" />
|
|
|
+ </form>
|
|
|
+
|
|
|
+<script src="/ux/plugins/gaga/gaga.infinite.scrollSession.js"></script>
|
|
|
+<script src="/ux/plugins/jquery/jquery.history.min.js"></script>
|
|
|
+
|
|
|
<script th:inline="javascript">
|
|
|
/*<![CDATA[*/
|
|
|
var currUrl = document.location.href;
|
|
|
@@ -106,7 +120,139 @@
|
|
|
}
|
|
|
var brandCd = [[${lbInfo.brandCd}]];
|
|
|
|
|
|
- let fnGetLookbookList = function (lookbookGb, brandGroupNo){
|
|
|
+ var fnLookbookListSearch = function (){
|
|
|
+ gagaInfiniteScroll.getHistory();
|
|
|
+ }
|
|
|
+
|
|
|
+ var fnGetInfiniteScrollDataList = function (pageNum){
|
|
|
+ $("#lbMainForm input[name=pageNo]").val(pageNum+1);
|
|
|
+ gagajf.ajaxFormSubmit("/display/lookbook/main/list", document.lbMainForm, gagaInfiniteScroll.jsonToHtml);
|
|
|
+ }
|
|
|
+
|
|
|
+ var fnDrawInfiniteScrollData = function (result){
|
|
|
+ let totalCnt = result.paging.totalCount;
|
|
|
+ $("#lookbookTotCnt").text(totalCnt);
|
|
|
+ $("#lbMainForm").find("input[name=totalCnt]").val(totalCnt);
|
|
|
+ gagaInfiniteScroll.pageStatus.totalCount = totalCnt;
|
|
|
+
|
|
|
+ if (result.dataList != null && result.dataList.length > 0) {
|
|
|
+ $(".nodata").hide();
|
|
|
+ let lastPage = result.paging.pageNo;
|
|
|
+ let endRow = result.paging.endRow - result.paging.pageSize;
|
|
|
+
|
|
|
+ var htm = fnGetLookbookList(result);
|
|
|
+ gagaInfiniteScroll.draw(htm);
|
|
|
+ }else{
|
|
|
+ if($("#lbMainForm input[name=pageNo]").val()==1){
|
|
|
+ $("#divLookbookNoData").show();
|
|
|
+ }else{
|
|
|
+ $("#divLastPage").show();
|
|
|
+ }
|
|
|
+ gagaInfiniteScroll.draw('not');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let fnGetLookbookList = function (result){
|
|
|
+ var html = '';
|
|
|
+
|
|
|
+ $.each(result.dataList, function (idx, item){
|
|
|
+ html += '<li>\n';
|
|
|
+ html += ' <a href="javascript:void(0);" onclick="cfnGoToLookbookDetail(\''+lookbookGb+'\','+item.lookbookSq+','+item.brandCd+')">\n';
|
|
|
+ html += ' <div class="ev_img">\n';
|
|
|
+ html += ' <img src="' + _imgUrl + item.orgTnfileNm + '" alt="ATTENTION! 20FW HOLIDAY TBJ 주목할 홀리데이 TBJ 컬렉션">\n';
|
|
|
+ html += ' </div>\n';
|
|
|
+ html += ' <div class="ev_txt">\n';
|
|
|
+ if(lookbookGb != 'BL') {
|
|
|
+ html += ' <p class="brand">' + item.brandNm + '</p>\n';
|
|
|
+ }
|
|
|
+ html += ' <p class="tit">'+item.title+'</p>\n';
|
|
|
+ html += ' </div>\n';
|
|
|
+ html += ' </a>\n';
|
|
|
+ html += '</li>\n';
|
|
|
+ });
|
|
|
+ return html;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 브랜드 리스트 가져오기
|
|
|
+ let fnGetBrandList = function (){
|
|
|
+ let actionUrl = '/display/lookbook/main/brand/list?frontYn=Y';
|
|
|
+ $.getJSON(actionUrl, function(result, status){
|
|
|
+ if(result.length > 0){
|
|
|
+ $('#brandArea').html('');
|
|
|
+ let tag = '';
|
|
|
+ tag += '<button type="button" data-name="" id="chkFilterBrand" class="on" onclick="fnAddBrand(\'\');"><span>전체</span></button>\n';
|
|
|
+ $.each(result, function(idx, item) {
|
|
|
+ tag += '<button type="button" id="chkFilterBrand'+idx+'" data-name="'+item.brandCd+'" onclick="fnAddBrand(\''+item.brandCd+'\');"><span>'+item.brandNm+'</span></button>\n';
|
|
|
+ });
|
|
|
+ $('#brandArea').html(tag);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 브랜드 선택 적용
|
|
|
+ var fnGetBrandLookbookList = function (){
|
|
|
+ $("#lbMainForm input:hidden[name=multiBrandCd]").remove();
|
|
|
+ var tag = '';
|
|
|
+ var tag2 = '';
|
|
|
+ $('#chkBrand').html('');
|
|
|
+ $(".button_list button").each(function (index) {
|
|
|
+ if($(this).hasClass("on")){
|
|
|
+ if(!gagajf.isNull($(this).attr('data-name'))){
|
|
|
+ tag += '<input type="hidden" name="multiBrandCd" value="'+$(this).attr('data-name')+'" />';
|
|
|
+ $("#lbMainForm").append(tag);
|
|
|
+
|
|
|
+ var brandCd = $(this).attr("data-name");
|
|
|
+ var brandNm = $(this).find('span').text();
|
|
|
+ tag2 += '<a href="javascript:void(0);" onclick="fnDeleteBrandFilter(\''+brandCd+'\');">'+brandNm+'</a>';
|
|
|
+ $('#chkBrand').html(tag2);
|
|
|
+ }else{
|
|
|
+ $(this).addClass("on");
|
|
|
+ tag2 += '<a href="javascript:void(0);" onclick="fnDeleteBrandFilter("");">전체</a>';
|
|
|
+ $('#chkBrand').html(tag2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var chkLen = $("#chkBrand").find('a').length;
|
|
|
+ if(chkLen < 1){
|
|
|
+ $('#chkBrand').html('<a href="javascript:void(0);" onclick="fnDeleteBrandFilter("");">전체</a>');
|
|
|
+ $(".button_list button").each(function (index) {
|
|
|
+ if(gagajf.isNull($(this).attr('data-name'))){
|
|
|
+ $(this).addClass("on");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ fnLookbookInfiniteScrollInit();
|
|
|
+ fnLookbookListSearch();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 브랜드 선택 초기화
|
|
|
+ var fnLookbookReset = function (){
|
|
|
+ $("#lbMainForm input:hidden[name=multiBrandCd]").remove();
|
|
|
+
|
|
|
+ var tag2 = '';
|
|
|
+ tag2 += '<a href="javascript:void(0);" onclick="fnDeleteBrandFilter(\'\');">전체</a>';
|
|
|
+ $('#chkBrand').html(tag2);
|
|
|
+
|
|
|
+ $(".button_list button").each(function (index) {
|
|
|
+ $(this).removeClass("on");
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#chkFilterBrand").addClass('on');
|
|
|
+
|
|
|
+ fnLookbookInfiniteScrollInit();
|
|
|
+ fnLookbookListSearch();
|
|
|
+ //fnGetBrandLookbookList();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 인피니티 스크롤 초기화
|
|
|
+ var fnLookbookInfiniteScrollInit = function (){
|
|
|
+ sessionStorage.removeItem(document.location.href);
|
|
|
+ $("#listBox").html("");
|
|
|
+ }
|
|
|
+
|
|
|
+ let fnGetLookbookList2 = function (lookbookGb, brandGroupNo){
|
|
|
let actionUrl = '/display/lookbook/main/list?lookbookGb='+lookbookGb;
|
|
|
if (!gagajf.isNull(brandGroupNo)) actionUrl += '&multiBrandCd=' + brandGroupNo;
|
|
|
|
|
|
@@ -120,7 +266,7 @@
|
|
|
let tag = '';
|
|
|
let tag3 = '';
|
|
|
let brandArr = [];
|
|
|
- tag += '<button type="button" data-name="" class="on" onclick="fnAddBrand(\'\');"><span>전체</span></button>\n';
|
|
|
+ tag += '<button type="button" data-name="" id="chkFilterBrand" class="on" onclick="fnAddBrand(\'\');"><span>전체</span></button>\n';
|
|
|
$.each(result, function(idx, item) {
|
|
|
if(!brandArr.includes(item.brandCd)){
|
|
|
brandArr.push(item.brandCd);
|
|
|
@@ -197,25 +343,9 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- // 선택된 브랜드 조회
|
|
|
- var fnGetBrandLookbookList = function (){
|
|
|
- var multiBrandCd = [];
|
|
|
- $(".button_list button").each(function (index) {
|
|
|
- if($(this).hasClass("on")){
|
|
|
- multiBrandCd.push($(this).attr('data-name'));
|
|
|
- }
|
|
|
- });
|
|
|
- $('#chkBrand').html('');
|
|
|
- fnGetLookbookList(lookbookGb,multiBrandCd);
|
|
|
- }
|
|
|
-
|
|
|
// 초기화버튼
|
|
|
var fnReset = function (){
|
|
|
- // var multiBrandCd = [];
|
|
|
- // $('#chkBrand').html('');
|
|
|
- // fnGetLookbookList(lookbookGb,multiBrandCd);
|
|
|
- // $(".popup_close").click();
|
|
|
- document.location.href = currUrl;
|
|
|
+ $('.reset').click();
|
|
|
}
|
|
|
|
|
|
// 리스트상단 필터 리스트에서 삭제 시
|
|
|
@@ -232,12 +362,19 @@
|
|
|
}
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
- fnGetLookbookList(lookbookGb,brandCd);
|
|
|
+ // fnGetLookbookList(lookbookGb,brandCd);
|
|
|
+ //fnLookbookListSearch();
|
|
|
+ fnLookbookReset();
|
|
|
|
|
|
if(lookbookGb=='BL'){
|
|
|
$("#btnHome").attr('onclick', 'cfnGoToBrandMain('+brandCd+');');
|
|
|
}else{
|
|
|
$("#btnHome").attr('href', '/');
|
|
|
+ fnGetBrandList();
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!gagajf.isNull($("#lbMainForm").find("input[name=totalCnt]").val())){
|
|
|
+ $("#lookbookTotCnt").text($("#lbMainForm").find("input[name=totalCnt]").val());
|
|
|
}
|
|
|
|
|
|
$(document).on('click','.sub_category .more_btn',function(){
|
|
|
@@ -274,6 +411,7 @@
|
|
|
});
|
|
|
$(document).on('click','.brand_floormenu .refresh',function(){
|
|
|
$('.popup_box .button_list button').removeClass('on');
|
|
|
+ $('#chkFilterBrand').addClass('on');
|
|
|
});
|
|
|
$(document).on('click','.popup_box .buying',function(){
|
|
|
$(this).parents('.popup_box').hide().removeClass('active');
|