|
@@ -76,7 +76,7 @@
|
|
|
<div class="popup_con">
|
|
<div class="popup_con">
|
|
|
<div class="button_list clear">
|
|
<div class="button_list clear">
|
|
|
<button type="button" onclick="fnSetSearchPeriod(1);" period="1"><span>최근 1개월</span></button>
|
|
<button type="button" onclick="fnSetSearchPeriod(1);" period="1"><span>최근 1개월</span></button>
|
|
|
- <button type="button" onclick="fnSetSearchPeriod(3);" period="3"><span>최근 3개월</span></button>
|
|
|
|
|
|
|
+ <button type="button" class="on" onclick="fnSetSearchPeriod(3);" period="3"><span>최근 3개월</span></button>
|
|
|
<button type="button" onclick="fnSetSearchPeriod(6);" period="6"><span>최근 6개월</span></button>
|
|
<button type="button" onclick="fnSetSearchPeriod(6);" period="6"><span>최근 6개월</span></button>
|
|
|
<button type="button" onclick="fnSetSearchPeriod(9);" period="9"><span>최근 9개월</span></button>
|
|
<button type="button" onclick="fnSetSearchPeriod(9);" period="9"><span>최근 9개월</span></button>
|
|
|
<button type="button" onclick="fnSetSearchPeriod(12);" period="12"><span>최근 12개월</span></button>
|
|
<button type="button" onclick="fnSetSearchPeriod(12);" period="12"><span>최근 12개월</span></button>
|
|
@@ -105,6 +105,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- //주문상태 선택 팝업 -->
|
|
<!-- //주문상태 선택 팝업 -->
|
|
|
|
|
+
|
|
|
|
|
+<script src="/ux/plugins/gaga/gaga.infinite.scrollSession.js"></script>
|
|
|
|
|
+<script src="/ux/plugins/jquery/jquery.history.min.js"></script>
|
|
|
<script th:inline="javascript">
|
|
<script th:inline="javascript">
|
|
|
// 변수설정
|
|
// 변수설정
|
|
|
let ordNo = [[${ordNo}]];
|
|
let ordNo = [[${ordNo}]];
|
|
@@ -114,14 +117,9 @@ var totalCnt = [[${totalCnt}]];
|
|
|
var totalPage = 0;
|
|
var totalPage = 0;
|
|
|
var remainList = 0;
|
|
var remainList = 0;
|
|
|
var jsonObj = {};
|
|
var jsonObj = {};
|
|
|
-var scrollTemp = true;
|
|
|
|
|
|
|
|
|
|
// 초기설정
|
|
// 초기설정
|
|
|
$(document).ready(function() {
|
|
$(document).ready(function() {
|
|
|
-
|
|
|
|
|
- // 인피니티스크롤 초기화
|
|
|
|
|
- //fnGoodsReviewInfiniteScrollInit();
|
|
|
|
|
-
|
|
|
|
|
// 타이틀명
|
|
// 타이틀명
|
|
|
$('#htopTitle').text('마이페이지');
|
|
$('#htopTitle').text('마이페이지');
|
|
|
|
|
|
|
@@ -137,76 +135,27 @@ $(document).ready(function() {
|
|
|
, "ordNm" : ordNm
|
|
, "ordNm" : ordNm
|
|
|
, "ordPhnno" : ordPhnno
|
|
, "ordPhnno" : ordPhnno
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // AJAX 변수 설정
|
|
|
|
|
- jsonData = JSON.stringify(jsonObj);
|
|
|
|
|
-
|
|
|
|
|
- // 전체페이지 구하기
|
|
|
|
|
- totalPage = parseInt(totalCnt / 10);
|
|
|
|
|
- remainList = totalCnt % 10;
|
|
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
- // 나머지가 있으면 전체 페이지 + 1
|
|
|
|
|
- if (remainList > 0) {
|
|
|
|
|
- totalPage = totalPage + 1;
|
|
|
|
|
|
|
+//사파리 - event.persisted || 크롬 - window.performance.navigation.type 이 1이면 새로고침, 2면 페이지 이동을 통한 캐쉬페이징
|
|
|
|
|
+$(window).on("pageshow", function(event) {
|
|
|
|
|
+ if ((event.originalEvent && event.originalEvent.persisted) || (window.performance && window.performance.navigation.type == 2)) {
|
|
|
|
|
+ // 캐쉬페이징
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 인피니티스크롤 초기화
|
|
|
|
|
+ fnMypageOrderListInfiniteScrollInit();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- fnSetSearchPeriod(3);
|
|
|
|
|
-
|
|
|
|
|
- var win = $(window);
|
|
|
|
|
-
|
|
|
|
|
- // Each time the user scrolls
|
|
|
|
|
- win.scroll(function() {
|
|
|
|
|
- // End of the document reached?
|
|
|
|
|
- if ($(document).height() - win.height() == win.scrollTop()) {
|
|
|
|
|
- if (scrollTemp) {
|
|
|
|
|
- var tempPage = parseInt($("#searchForm input[name=pageNo]").val());
|
|
|
|
|
- tempPage = tempPage + 1;
|
|
|
|
|
-
|
|
|
|
|
- if (totalPage > tempPage) {
|
|
|
|
|
- scrollTemp = false;
|
|
|
|
|
- fnGetInfiniteScrollDataList(tempPage);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 주문상세상태코드 셀렉트박스 변경 이벤트
|
|
|
|
|
- $('#odStatusPop .popup_con .button_list .ordDtlStat').on('click', function() {
|
|
|
|
|
- let code = $(this).attr('code');
|
|
|
|
|
- $('#searchForm input[name=ordDtlStat]').val(code);
|
|
|
|
|
- jsonObj.ordDtlStat = code;
|
|
|
|
|
-
|
|
|
|
|
- $("#odStatusPop .popup_con button").removeClass("on");
|
|
|
|
|
-
|
|
|
|
|
- // 상태값설정
|
|
|
|
|
- $("#odStatusPop .popup_con button").each(function() {
|
|
|
|
|
- var tempCode = $(this).attr("code");
|
|
|
|
|
- if (tempCode == code) {
|
|
|
|
|
- $(this).addClass("on");
|
|
|
|
|
-
|
|
|
|
|
- // 상태값 명칭
|
|
|
|
|
- var ordDtlStatNm = $(this).find("span").text();
|
|
|
|
|
- $(".container .my_order .od_status_btn").text(ordDtlStatNm);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // 리헷
|
|
|
|
|
- $("#listBox").html("");
|
|
|
|
|
-
|
|
|
|
|
- // 초기화설정
|
|
|
|
|
- fnGetInfiniteScrollDataList(1);
|
|
|
|
|
-
|
|
|
|
|
- // 팝업 닫기
|
|
|
|
|
- $(".popup_close").trigger("click");
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ gagaInfiniteScroll.getHistory();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// 주문 목록 조회
|
|
// 주문 목록 조회
|
|
|
-var fnGetInfiniteScrollDataList = function(pageNo) {
|
|
|
|
|
-
|
|
|
|
|
- // 페이지번호가 없으면 1페이지 설정
|
|
|
|
|
- if (pageNo == null || pageNo == 0) {
|
|
|
|
|
- pageNo = 1;
|
|
|
|
|
|
|
+var fnGetInfiniteScrollDataList = function() {
|
|
|
|
|
+ // 2021.05.28 페이지 기능 수정
|
|
|
|
|
+ if (pageNo <= totalPage) {
|
|
|
|
|
+ pageNo++;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 페이지설정
|
|
// 페이지설정
|
|
@@ -215,35 +164,15 @@ var fnGetInfiniteScrollDataList = function(pageNo) {
|
|
|
jsonObj.pageNo = pageNo;
|
|
jsonObj.pageNo = pageNo;
|
|
|
jsonObj.stDate = $("#searchForm input[name=stDate]").val();
|
|
jsonObj.stDate = $("#searchForm input[name=stDate]").val();
|
|
|
jsonObj.edDate = $("#searchForm input[name=edDate]").val();
|
|
jsonObj.edDate = $("#searchForm input[name=edDate]").val();
|
|
|
-
|
|
|
|
|
- //$.ajax( {
|
|
|
|
|
- // type : "POST",
|
|
|
|
|
- // url : '/noMember/order/listInfo',
|
|
|
|
|
- // data : JSON.stringify(jsonObj),
|
|
|
|
|
- // dataType : 'html',
|
|
|
|
|
- // beforeSend : function(xhr, settings) {
|
|
|
|
|
- // xhr.setRequestHeader("AJAX" , "true");
|
|
|
|
|
- // xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
|
|
- // xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
|
|
- // },
|
|
|
|
|
- // success : function(result) {
|
|
|
|
|
- // if (result != null) {
|
|
|
|
|
- // $("#listBox").css("display", "block");
|
|
|
|
|
- // $("#listBox").append(result);
|
|
|
|
|
- // scrollTemp = true;
|
|
|
|
|
- //
|
|
|
|
|
- // // 인피니티 스크롤 기억기능
|
|
|
|
|
- // //gagaInfiniteScroll.draw(result);
|
|
|
|
|
- // //gagaInfiniteScroll.draw('not');
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- //});
|
|
|
|
|
|
|
+ jsonObj.ordDtlStat = $('#searchForm input[name=ordDtlStat]').val();
|
|
|
|
|
|
|
|
gagajf.ajaxJsonSubmit('/noMember/order/list/pre/info', JSON.stringify(jsonObj), function(result) {
|
|
gagajf.ajaxJsonSubmit('/noMember/order/list/pre/info', JSON.stringify(jsonObj), function(result) {
|
|
|
let totalCount = result.paging.totalCount;
|
|
let totalCount = result.paging.totalCount;
|
|
|
totalCnt = totalCount;
|
|
totalCnt = totalCount;
|
|
|
|
|
+
|
|
|
getTotalPage(totalCount);
|
|
getTotalPage(totalCount);
|
|
|
- //gagaInfiniteScroll.pageStatus.totalCount = totalCount;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ gagaInfiniteScroll.pageStatus.totalCount = totalCount;
|
|
|
|
|
|
|
|
let ordNoList = [];
|
|
let ordNoList = [];
|
|
|
$.each(result.ordNoList, function(idx, item) {
|
|
$.each(result.ordNoList, function(idx, item) {
|
|
@@ -266,8 +195,7 @@ var fnGetInfiniteScrollDataList = function(pageNo) {
|
|
|
success: function (result) {
|
|
success: function (result) {
|
|
|
if (result != null) {
|
|
if (result != null) {
|
|
|
$("#listBox").css("display", "block");
|
|
$("#listBox").css("display", "block");
|
|
|
- $("#listBox").append(result);
|
|
|
|
|
- scrollTemp = true;
|
|
|
|
|
|
|
+ gagaInfiniteScroll.draw(result);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -293,11 +221,8 @@ var fnSetSearchPeriod = function(period) {
|
|
|
$('#searchForm input[name=edDate]').val(edDate);
|
|
$('#searchForm input[name=edDate]').val(edDate);
|
|
|
$('#searchForm input[name=stDate]').val(stDate);
|
|
$('#searchForm input[name=stDate]').val(stDate);
|
|
|
|
|
|
|
|
- // 리헷
|
|
|
|
|
- $("#listBox").html("");
|
|
|
|
|
-
|
|
|
|
|
- // 초기화설정
|
|
|
|
|
- fnGetInfiniteScrollDataList(1);
|
|
|
|
|
|
|
+ // 인피니티스크롤 초기화
|
|
|
|
|
+ fnMypageOrderListInfiniteScrollInit();
|
|
|
|
|
|
|
|
$("#odDatePop .popup_con button").removeClass("on");
|
|
$("#odDatePop .popup_con button").removeClass("on");
|
|
|
|
|
|
|
@@ -312,42 +237,53 @@ var fnSetSearchPeriod = function(period) {
|
|
|
$(".container .my_order .od_date_btn").text(periodStr);
|
|
$(".container .my_order .od_date_btn").text(periodStr);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 데이터 조회
|
|
|
|
|
+ fnGetInfiniteScrollDataList();
|
|
|
|
|
+
|
|
|
// 팝업닫기
|
|
// 팝업닫기
|
|
|
$(".popup_close").trigger("click");
|
|
$(".popup_close").trigger("click");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 2021.04.21 인피니티 스크롤 기능 구현전 추후 수정
|
|
|
|
|
-// 인피니트 스크롤 초기화
|
|
|
|
|
-/*
|
|
|
|
|
-var fnGoodsReviewInfiniteScrollInit = function(){
|
|
|
|
|
- // sessionStorage.removeItem(document.location.href);
|
|
|
|
|
- History.replaceState(null, null);
|
|
|
|
|
- gagaInfiniteScroll.pageStatus = {
|
|
|
|
|
- pageNum : [] // [0,1,2...] 로드된 페이지 (Array)
|
|
|
|
|
- , loadPage : 0 // 로드할 페이지
|
|
|
|
|
- , loadAlign : 'not' // 로드 상태(prev, next, not)
|
|
|
|
|
- , historyScroll : 0 //
|
|
|
|
|
- , nowPage : null // 현재 페이지
|
|
|
|
|
- , pageUrl : { // page url
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// 주문상세상태코드 셀렉트박스 변경 이벤트
|
|
|
|
|
+$('#odStatusPop .popup_con .button_list .ordDtlStat').on('click', function() {
|
|
|
|
|
+ let code = $(this).attr('code');
|
|
|
|
|
+ $('#searchForm input[name=ordDtlStat]').val(code);
|
|
|
|
|
+ jsonObj.ordDtlStat = code;
|
|
|
|
|
|
|
|
- //History 초기화
|
|
|
|
|
- $("#listBox").html("");
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ $("#odStatusPop .popup_con button").removeClass("on");
|
|
|
|
|
+
|
|
|
|
|
+ // 상태값설정
|
|
|
|
|
+ $("#odStatusPop .popup_con button").each(function() {
|
|
|
|
|
+ var tempCode = $(this).attr("code");
|
|
|
|
|
+ if (tempCode == code) {
|
|
|
|
|
+ $(this).addClass("on");
|
|
|
|
|
+
|
|
|
|
|
+ // 상태값 명칭
|
|
|
|
|
+ var ordDtlStatNm = $(this).find("span").text();
|
|
|
|
|
+ $(".container .my_order .od_status_btn").text(ordDtlStatNm);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 인피니티스크롤 초기화
|
|
|
|
|
+ fnMypageOrderListInfiniteScrollInit();
|
|
|
|
|
+
|
|
|
|
|
+ // 데이터 조회
|
|
|
|
|
+ fnGetInfiniteScrollDataList();
|
|
|
|
|
+
|
|
|
|
|
+ // 팝업 닫기
|
|
|
|
|
+ $(".popup_close").trigger("click");
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
-var fnDrawInfiniteScrollData = function (result){
|
|
|
|
|
- let totalCnt = result.totalCnt;
|
|
|
|
|
- gagaInfiniteScroll.pageStatus.totalCount = result.totalCnt;
|
|
|
|
|
|
|
+// 인피니티 스크롤 초기화
|
|
|
|
|
+var fnMypageOrderListInfiniteScrollInit = function(){
|
|
|
|
|
+ sessionStorage.removeItem(document.location.href);
|
|
|
|
|
|
|
|
- var htm = fnCreateGoodsList(result);
|
|
|
|
|
- gagaInfiniteScroll.draw(htm);
|
|
|
|
|
|
|
+ pageNo = 0;
|
|
|
|
|
+
|
|
|
|
|
+ // History 초기화
|
|
|
|
|
+ $("#listBox").html("");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-$(function() { gagaInfiniteScroll.getHistory(); });
|
|
|
|
|
-*/
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|