|
@@ -1,6 +1,5 @@
|
|
|
<!DOCTYPE html>
|
|
<!DOCTYPE html>
|
|
|
-<html lang="ko"
|
|
|
|
|
- xmlns:th="http://www.thymeleaf.org"
|
|
|
|
|
|
|
+<html lang="ko" xmlns:th="http://www.thymeleaf.org"
|
|
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
|
|
layout:decorator="web/common/layout/MypageLayoutWeb">
|
|
layout:decorator="web/common/layout/MypageLayoutWeb">
|
|
|
<!--
|
|
<!--
|
|
@@ -18,283 +17,359 @@
|
|
|
-->
|
|
-->
|
|
|
<body>
|
|
<body>
|
|
|
|
|
|
|
|
-<th:block layout:fragment="content">
|
|
|
|
|
-<!-- container -->
|
|
|
|
|
- <div class="my_cont">
|
|
|
|
|
- <div class="sec_head">
|
|
|
|
|
- <h3>STYLE24 상품권</h3>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="sec_body">
|
|
|
|
|
- <div class="save_area mypage_coupon">
|
|
|
|
|
- <p>사용 가능한 보유 금액<strong th:text="${#numbers.formatInteger(giftcardInfo.useGift,0,'COMMA')}"></strong>원</p>
|
|
|
|
|
- <ul>
|
|
|
|
|
- <li>보유 상품권 <span th:text="${#numbers.formatInteger(giftcardInfo.totalCount,0,'COMMA')} + '장'"></span></li>
|
|
|
|
|
- <li>한달 이내 소멸 예정 <span th:text="${#numbers.formatInteger(giftcardInfo.expireCount,0,'COMMA')} + '장'"></span></li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="gift_search">
|
|
|
|
|
- <div class="gift_sea_wrap clear">
|
|
|
|
|
- <label for="gift_input">상품권 등록</label>
|
|
|
|
|
- <input type="text" id="gift_input" placeholder="상품권 번호를 입력해주세요.">
|
|
|
|
|
- <button type="button" class="btn btn_dark" onclick="giftcardSave()">등록</button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="com_info_txt">
|
|
|
|
|
- <p class="tit">상품권 등록 안내</p>
|
|
|
|
|
- <ul>
|
|
|
|
|
- <li>상품권은 상품 구매시 현금과 동일하게 사용됩니다.</li>
|
|
|
|
|
- <li>상품권은 등록한 해당 몰에서만 사용이 가능합니다.</li>
|
|
|
|
|
- <li>사용 후 남은 잔액은 상품권 잔액으로 환불되며,유효기간 내에 사용 가능합니다.</li>
|
|
|
|
|
- <li>유효기간이 지난 상품권의 잔액은 자동 소멸됩니다.</li>
|
|
|
|
|
- <li>상품권은 현금성 결제 수단에 포함되어 주문시 포인트 적립이 가능합니다.</li>
|
|
|
|
|
- <li>상품권으로 결제한 금액은 마이페이지>주문상세페이지에서 현금영수증을 발급 받으실 수 있습니다.</li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="my_tab coupon_tab">
|
|
|
|
|
- <ul>
|
|
|
|
|
- <li><a href="javascript:void(0);" id="SearchUseGiftcard">사용내역</a></li>
|
|
|
|
|
- <li><a href="javascript:void(0);" id="SearchOwnGiftcard">보유 상품권</a></li>
|
|
|
|
|
- </ul>
|
|
|
|
|
- <!-- <div class="form_field" id="dateField">
|
|
|
|
|
- <select id="searchDt" onchange="fnChangeDate(this)">
|
|
|
|
|
-
|
|
|
|
|
- </select>
|
|
|
|
|
- </div> -->
|
|
|
|
|
- <div class="form_field" id="dateField">
|
|
|
|
|
- <div class="select_custom type1">
|
|
|
|
|
- <div class="combo">
|
|
|
|
|
- <div class="select"></div> <!-- 셀렉박스 -->
|
|
|
|
|
- <ul id="searchDt" class="list" style="width:200px; margin:0 auto">
|
|
|
|
|
|
|
+ <th:block layout:fragment="content">
|
|
|
|
|
+ <!-- container -->
|
|
|
|
|
+ <div class="content myVoucher">
|
|
|
|
|
+ <!-- 페이지특정 클래스 = myVoucher -->
|
|
|
|
|
+ <div class="cont_body">
|
|
|
|
|
+ <div class="lnb">
|
|
|
|
|
+ <!-- 마이페이지 lnb 영역 -->
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="cont">
|
|
|
|
|
+ <div class="sec_head">
|
|
|
|
|
+ <h3 class="subH1">상품권</h3>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="sec_body">
|
|
|
|
|
+ <div class="highlight_area">
|
|
|
|
|
+ <div class="have_amount">
|
|
|
|
|
+ <div class="total_amount">
|
|
|
|
|
+ 나의 보유 금액 <span><em
|
|
|
|
|
+ th:text="${#numbers.formatInteger(giftcardInfo.useGift,0,'COMMA')}"></em>원</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <dl>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>보유 상품권</dt>
|
|
|
|
|
+ <dd>
|
|
|
|
|
+ <em
|
|
|
|
|
+ th:text="${#numbers.formatInteger(giftcardInfo.totalCount,0,'COMMA')}"></em>장
|
|
|
|
|
+ </dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <dt>
|
|
|
|
|
+ <span class="tag primary_line">D-<em>30</em></span>한 달 이내 소멸
|
|
|
|
|
+ 예정
|
|
|
|
|
+ </dt>
|
|
|
|
|
+ <dd>
|
|
|
|
|
+ <em
|
|
|
|
|
+ th:text="${#numbers.formatInteger(giftcardInfo.expireCount,0,'COMMA')}"></em>원
|
|
|
|
|
+ </dd>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </dl>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="input_area">
|
|
|
|
|
+ <form class="form_wrap">
|
|
|
|
|
+ <div class="form_field">
|
|
|
|
|
+ <label class="input_label"><span>상품권 등록</span></label>
|
|
|
|
|
+ <div class="input_wrap">
|
|
|
|
|
+ <input type="text" class="form_control" id="gift_input"
|
|
|
|
|
+ placeholder="상품권 번호를 입력해주세요">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <button type="button" class="btn btn_dark"
|
|
|
|
|
+ onclick="giftcardSave()">
|
|
|
|
|
+ <span>등록</span>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="com_info_txt">
|
|
|
|
|
+ <p class="tit">상품권 등록 안내</p>
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li>상품권은 상품 구매시 현금과 동일하게 사용됩니다.</li>
|
|
|
|
|
+ <li>상품권은 등록한 해당 몰에서만 사용이 가능합니다.(YES24와 중복 사용불가)</li>
|
|
|
|
|
+ <li>사용 후 남은 잔액은 상품권 잔액으로 환불되며, 유효기간 내에 사용 가능합니다.</li>
|
|
|
|
|
+ <li>유효기간이 지난 상품권의 잔액은 자동 소멸됩니다.</li>
|
|
|
|
|
+ <li>상품권은 현금성 결제 수단에 포함되어 주문시 포인트 적립이 가능합니다.</li>
|
|
|
|
|
+ <li>상품권으로 결제한 금액은 마이페이지 > 주문상세페이지에서 현금영수증을 발급 받으실 수 있습니다.</li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="content_area">
|
|
|
|
|
+ <div class="taps">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li id="SearchUseGiftcard"><a href="javascript:void(0);" >사용내역</a></li>
|
|
|
|
|
+ <li id="SearchOwnGiftcard"><a href="javascript:void(0);" >보유
|
|
|
|
|
+ 상품권</a></li>
|
|
|
</ul>
|
|
</ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="select_box" id="dateField">
|
|
|
|
|
+ <div class="form_field">
|
|
|
|
|
+ <div class="select_custom month">
|
|
|
|
|
+ <div class="combo">
|
|
|
|
|
+ <div class="select"></div>
|
|
|
|
|
+ <ul class="list" id="searchDt">
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 데이터 있을 시 -->
|
|
|
|
|
+ <div class="list_box" id="giftcardList"></div>
|
|
|
|
|
+ <!-- //데이터 있을 시 -->
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div id="giftcardList">
|
|
|
|
|
- </div>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
-<!-- // CONT-BODY -->
|
|
|
|
|
|
|
+ <!-- // CONT-BODY -->
|
|
|
<script th:inline="javascript">
|
|
<script th:inline="javascript">
|
|
|
-var date = new Date();
|
|
|
|
|
-var year = date.getFullYear();
|
|
|
|
|
-var month = date.getMonth()+1;
|
|
|
|
|
-
|
|
|
|
|
-//동적으로 날짜 년도 append
|
|
|
|
|
-function appendYear(){
|
|
|
|
|
-
|
|
|
|
|
- for(var i=year; i<=year; i++){
|
|
|
|
|
- for (var j= 1; j <=month; j++) {
|
|
|
|
|
- $("#searchDt").prepend("<li onclick='fnChangeDate(this.value)' value='"+year+""+j+"'>"+i+"년"+j +"월 </li>");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- $(".select").append("<li class='selected' value='"+year+""+month+"'>"+year+"년"+ month +"월 </li>"); // 현재년도 선택 */
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-appendYear($("#searchDt"));
|
|
|
|
|
-
|
|
|
|
|
-// 사용내역 조회
|
|
|
|
|
-$("#SearchUseGiftcard").click(function(){
|
|
|
|
|
- // class제거 추가
|
|
|
|
|
- $("#SearchOwnGiftcard").removeClass("on");
|
|
|
|
|
- $("#SearchUseGiftcard").addClass("on");
|
|
|
|
|
- $("#giftcardList").attr("class","order_list");
|
|
|
|
|
-
|
|
|
|
|
- // 날짜 필드
|
|
|
|
|
- $("#dateField").css("display","block");
|
|
|
|
|
-
|
|
|
|
|
- let data = {searchDt : year+""+month,
|
|
|
|
|
- month : month};
|
|
|
|
|
-
|
|
|
|
|
- var jsonData = JSON.stringify(data);
|
|
|
|
|
-
|
|
|
|
|
- $.ajax(
|
|
|
|
|
- {
|
|
|
|
|
- type : "POST",
|
|
|
|
|
- data : jsonData,
|
|
|
|
|
- url : '/mypage/gift/use/list',
|
|
|
|
|
- contentType: 'application/json',
|
|
|
|
|
- dataType : 'json',
|
|
|
|
|
- success : function(result){
|
|
|
|
|
- useGiftcard(result);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ var date = new Date();
|
|
|
|
|
+ var year = date.getFullYear();
|
|
|
|
|
+ var month = date.getMonth() + 1;
|
|
|
|
|
+
|
|
|
|
|
+ //동적으로 날짜 년도 append
|
|
|
|
|
+ function appendYear() {
|
|
|
|
|
+
|
|
|
|
|
+ for (var i = year; i <= year; i++) {
|
|
|
|
|
+ for (var j = 1; j <= month; j++) {
|
|
|
|
|
+ $("#searchDt").prepend(
|
|
|
|
|
+ "<li onclick='fnChangeDate(this.value)' value='"
|
|
|
|
|
+ + year + "" + j + "'>" + i
|
|
|
|
|
+ + "년" + j + "월 </li>");
|
|
|
}
|
|
}
|
|
|
- )
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
-function useGiftcard(result) {
|
|
|
|
|
-
|
|
|
|
|
- let giftcardUseList = result.giftcardUseList;
|
|
|
|
|
-
|
|
|
|
|
- let tmtbHtml = "";
|
|
|
|
|
-
|
|
|
|
|
- tmtbHtml += '<section class="order_row mt30">';
|
|
|
|
|
- tmtbHtml += '<div class="tbl track_tbl type2">';
|
|
|
|
|
- tmtbHtml += '<table>';
|
|
|
|
|
- tmtbHtml += '<colgroup>';
|
|
|
|
|
- tmtbHtml += '<col width="750px">';
|
|
|
|
|
- tmtbHtml += '<col width="150px">';
|
|
|
|
|
- tmtbHtml += '<col width="*">';
|
|
|
|
|
- tmtbHtml += '</colgroup>';
|
|
|
|
|
- tmtbHtml += '<thead>';
|
|
|
|
|
- tmtbHtml += '<tr>';
|
|
|
|
|
- tmtbHtml += '<th>내용</th>';
|
|
|
|
|
- tmtbHtml += '<th>증감/차감</th>';
|
|
|
|
|
- tmtbHtml += '<th>일자</th>';
|
|
|
|
|
- tmtbHtml += '</tr>';
|
|
|
|
|
- tmtbHtml += '</thead>';
|
|
|
|
|
- tmtbHtml += '<tbody>';
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- for(let i=0; i<giftcardUseList.length; i++){
|
|
|
|
|
- let useGiftcard = giftcardUseList[i];
|
|
|
|
|
- tmtbHtml +='<tr>';
|
|
|
|
|
- if(useGiftcard.goodsNm != null){
|
|
|
|
|
- tmtbHtml +='<td class="t_l pl40">'+ useGiftcard.goodsNm + '</td>';
|
|
|
|
|
- }else{
|
|
|
|
|
- tmtbHtml +='<td class="t_l pl40">'+ useGiftcard.balanceName + '</td>';
|
|
|
|
|
}
|
|
}
|
|
|
- tmtbHtml += '<td class="c_primary">'+ useGiftcard.balance + ' ' + useGiftcard.gfcdAmt.addComma() + '</td>';
|
|
|
|
|
- tmtbHtml += '<td>'+ useGiftcard.regDt + '</td>';
|
|
|
|
|
|
|
+ $(".select").append(
|
|
|
|
|
+ "<li class='selected' value='"+year+""+month+"'>"
|
|
|
|
|
+ + year + "년" + month + "월 </li>"); // 현재년도 선택 */
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ appendYear($("#searchDt"));
|
|
|
|
|
+
|
|
|
|
|
+ // 사용내역 조회
|
|
|
|
|
+ $("#SearchUseGiftcard").click(function() {
|
|
|
|
|
+ // class제거 추가
|
|
|
|
|
+ $("#SearchOwnGiftcard").removeClass("active");
|
|
|
|
|
+ $("#SearchUseGiftcard").addClass("active");
|
|
|
|
|
+ $("#giftcardList").attr("class", "order_list");
|
|
|
|
|
+
|
|
|
|
|
+ // 날짜 필드
|
|
|
|
|
+ $("#dateField").css("display", "block");
|
|
|
|
|
+
|
|
|
|
|
+ let data = {
|
|
|
|
|
+ searchDt : year + "" + month,
|
|
|
|
|
+ month : month
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ data : jsonData,
|
|
|
|
|
+ url : '/mypage/gift/use/list',
|
|
|
|
|
+ contentType : 'application/json',
|
|
|
|
|
+ dataType : 'json',
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ useGiftcard(result);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ function useGiftcard(result) {
|
|
|
|
|
+
|
|
|
|
|
+ let giftcardUseList = result.giftcardUseList;
|
|
|
|
|
+
|
|
|
|
|
+ let tmtbHtml = "";
|
|
|
|
|
+ tmtbHtml += '<div class="tbl type5">';
|
|
|
|
|
+ tmtbHtml += '<table>';
|
|
|
|
|
+ tmtbHtml += '<colgroup>';
|
|
|
|
|
+ tmtbHtml += '<col width="10%">';
|
|
|
|
|
+ tmtbHtml += '<col width="*">';
|
|
|
|
|
+ tmtbHtml += '<col width="18%">';
|
|
|
|
|
+ tmtbHtml += '<col width="18%">';
|
|
|
|
|
+ tmtbHtml += '</colgroup>';
|
|
|
|
|
+ tmtbHtml += '<thead>';
|
|
|
|
|
+ tmtbHtml += '<tr>';
|
|
|
|
|
+ tmtbHtml += '<th scope="col"><span class="sr-only">차감</span></th>';
|
|
|
|
|
+ tmtbHtml += '<th scope="col">내용</th>';
|
|
|
|
|
+ tmtbHtml += '<th scope="col">사용금액</th>';
|
|
|
|
|
+ tmtbHtml += '<th scope="col">일자</th>';
|
|
|
tmtbHtml += '</tr>';
|
|
tmtbHtml += '</tr>';
|
|
|
|
|
+ tmtbHtml += '</thead>';
|
|
|
|
|
+
|
|
|
|
|
+ if (giftcardUseList.length <= 0) {
|
|
|
|
|
+ tmtbHtml += '<tbody>';
|
|
|
|
|
+ tmtbHtml += '</tbody>';
|
|
|
|
|
+ tmtbHtml += '</table>';
|
|
|
|
|
+ tmtbHtml += '</div>';
|
|
|
|
|
+ tmtbHtml += '<div class="nodata">';
|
|
|
|
|
+ tmtbHtml += '<div class="txt_box">';
|
|
|
|
|
+ tmtbHtml += '<p>현재 노출 할 수 있는 이용내역이 없습니다.<br></p>';
|
|
|
|
|
+ tmtbHtml += '</div>';
|
|
|
|
|
+ tmtbHtml += '</div>';
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tmtbHtml += '<tbody>';
|
|
|
|
|
+
|
|
|
|
|
+ for (let i = 0; i < giftcardUseList.length; i++) {
|
|
|
|
|
+ let useGiftcard = giftcardUseList[i];
|
|
|
|
|
+ tmtbHtml += '<tr>';
|
|
|
|
|
+ tmtbHtml += '<td><span class="tag deepgray">차감</span></td>';
|
|
|
|
|
+ tmtbHtml += '<td>';
|
|
|
|
|
+ tmtbHtml += '<div class="txt_content">' + useGiftcard.goodsNm + '</div>';
|
|
|
|
|
+ tmtbHtml += '</td>';
|
|
|
|
|
+ tmtbHtml += '<td><span class="amount_minus"> <em>'
|
|
|
|
|
+ + '-'
|
|
|
|
|
+ + ' '
|
|
|
|
|
+ + useGiftcard.gfcdAmt.addComma()
|
|
|
|
|
+ + '</em>원';
|
|
|
|
|
+ tmtbHtml += '</span></td>';
|
|
|
|
|
+ tmtbHtml += '<td>' + useGiftcard.regDt
|
|
|
|
|
+ + '</td>';
|
|
|
|
|
+ tmtbHtml += '</tr>';
|
|
|
|
|
+ }
|
|
|
|
|
+ tmtbHtml += '</tbody>';
|
|
|
|
|
+ tmtbHtml += '</table>';
|
|
|
|
|
+ tmtbHtml += '</div>';
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $("#giftcardList").html(tmtbHtml);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- tmtbHtml += '</tbody>';
|
|
|
|
|
- tmtbHtml += '</table>';
|
|
|
|
|
- tmtbHtml += '</div>';
|
|
|
|
|
- tmtbHtml += '</section>';
|
|
|
|
|
-
|
|
|
|
|
- $("#giftcardList").html(tmtbHtml);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 보유상품권 조회
|
|
|
|
|
-$("#SearchOwnGiftcard").click(function(){
|
|
|
|
|
- $("#SearchUseGiftcard").removeClass("on");
|
|
|
|
|
- $("#SearchOwnGiftcard").addClass("on");
|
|
|
|
|
- $("#giftcardList").attr("class","gift_list");
|
|
|
|
|
-
|
|
|
|
|
- // 날짜 필드
|
|
|
|
|
- $("#dateField").css("display","none");
|
|
|
|
|
- let data = {};
|
|
|
|
|
-
|
|
|
|
|
- var jsonData = JSON.stringify(data);
|
|
|
|
|
-
|
|
|
|
|
- $.ajax(
|
|
|
|
|
- {
|
|
|
|
|
- type : "POST",
|
|
|
|
|
- data : jsonData,
|
|
|
|
|
- url : '/mypage/gift/own/list',
|
|
|
|
|
- contentType: 'application/json',
|
|
|
|
|
- dataType : 'json',
|
|
|
|
|
- success : function(result){
|
|
|
|
|
- ownGiftcard(result);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 보유상품권 조회
|
|
|
|
|
+ $("#SearchOwnGiftcard").click(function() {
|
|
|
|
|
+ $("#SearchUseGiftcard").removeClass("active");
|
|
|
|
|
+ $("#SearchOwnGiftcard").addClass("active");
|
|
|
|
|
+ $("#giftcardList").attr("class", "gift_list");
|
|
|
|
|
+
|
|
|
|
|
+ // 날짜 필드
|
|
|
|
|
+ $("#dateField").css("display", "none");
|
|
|
|
|
+ let data = {};
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ data : jsonData,
|
|
|
|
|
+ url : '/mypage/gift/own/list',
|
|
|
|
|
+ contentType : 'application/json',
|
|
|
|
|
+ dataType : 'json',
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ ownGiftcard(result);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ function ownGiftcard(result) {
|
|
|
|
|
+
|
|
|
|
|
+ let giftcardOwnList = result.giftcardOwnList;
|
|
|
|
|
+
|
|
|
|
|
+ let tmtbHtml2 = "";
|
|
|
|
|
+
|
|
|
|
|
+ if (giftcardOwnList == null) {
|
|
|
|
|
+ tmtbHtml2 += '<div class="nodata">';
|
|
|
|
|
+ tmtbHtml2 += '<div class="txt_box">';
|
|
|
|
|
+ tmtbHtml2 += '<p>현재 노출 할 수 있는 상품권이 없습니다.<br></p>';
|
|
|
|
|
+ tmtbHtml2 += '</div>';
|
|
|
|
|
+ tmtbHtml2 += '</div>';
|
|
|
|
|
+ } else {
|
|
|
|
|
+
|
|
|
|
|
+ tmtbHtml2 += '<div class="voucher_list">';
|
|
|
|
|
+ tmtbHtml2 += '<ul>';
|
|
|
|
|
+ for (let i = 0; i < giftcardOwnList.length; i++) {
|
|
|
|
|
+ let ownGiftcard = giftcardOwnList[i];
|
|
|
|
|
+
|
|
|
|
|
+ tmtbHtml2 += '<li>';
|
|
|
|
|
+ if (ownGiftcard.rmGfcdAmt == 0) {
|
|
|
|
|
+ tmtbHtml2 += '<div class="voucher disable">';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tmtbHtml2 += '<div class="voucher">';
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ tmtbHtml2 += '<div>';
|
|
|
|
|
+ tmtbHtml2 += '<p class="vch_name">' + ownGiftcard.gfcdNm + '</p>';
|
|
|
|
|
+ tmtbHtml2 += '<p class="vch_price"><span class="tag primary_line"><em>' + ownGiftcard.chgGfcdAmt.addComma() + '</em>원권</span></p>';
|
|
|
|
|
+ if (ownGiftcard.rmGfcdAmt > 0) {
|
|
|
|
|
+ tmtbHtml2 += '<p class="vch_remain">'+ ownGiftcard.rmGfcdAmt.addComma()+ '원</p>';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tmtbHtml2 += '<p class="vch_remain">전액소진</p>';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ tmtbHtml2 += '<p class="vch_code">' + ownGiftcard.gfcdNo + '</p>';
|
|
|
|
|
+ tmtbHtml2 += '</div>';
|
|
|
|
|
+ tmtbHtml2 += '<div class="vch_date">~ <span>' + ownGiftcard.useExpDate + '</span></div>';
|
|
|
|
|
+ tmtbHtml2 += '</div>';
|
|
|
|
|
+ tmtbHtml2 += '</li>';
|
|
|
}
|
|
}
|
|
|
- )
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
-function ownGiftcard(result) {
|
|
|
|
|
-
|
|
|
|
|
- let giftcardOwnList = result.giftcardOwnList;
|
|
|
|
|
-
|
|
|
|
|
- let tmtbHtml2 = "";
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- tmtbHtml2 += '<ul class="clear">';
|
|
|
|
|
-
|
|
|
|
|
- for(let i=0; i<giftcardOwnList.length; i++){
|
|
|
|
|
- let ownGiftcard = giftcardOwnList[i];
|
|
|
|
|
-
|
|
|
|
|
- if(ownGiftcard.rmGfcdAmt > 0){
|
|
|
|
|
- tmtbHtml2 += '<li>';
|
|
|
|
|
- }else{
|
|
|
|
|
- tmtbHtml2 += '<li class="off">';
|
|
|
|
|
- }
|
|
|
|
|
- tmtbHtml2 += '<div class="gift_shape">';
|
|
|
|
|
- tmtbHtml2 += '<strong>' + ownGiftcard.gfcdNm + '</strong>';
|
|
|
|
|
- tmtbHtml2 += '<div class="gift_price01">' +ownGiftcard.chgGfcdAmt.addComma() + ' 원권' +'</div>';
|
|
|
|
|
- tmtbHtml2 += '<div class="gift_price02">';
|
|
|
|
|
- tmtbHtml2 += '<span class="pr_t">잔액</span><span class="pr_num">'+ownGiftcard.rmGfcdAmt.addComma()+'</span>원'
|
|
|
|
|
- tmtbHtml2 += '<div>';
|
|
|
|
|
- tmtbHtml2 += '<div class="gift_price03">' +ownGiftcard.gfcdNo + '</div>';
|
|
|
|
|
- tmtbHtml2 += '</div>';
|
|
|
|
|
- tmtbHtml2 += '<div class="gift_date">';
|
|
|
|
|
- tmtbHtml2 += '~ <span>' +ownGiftcard.useExpDate + '</span>';
|
|
|
|
|
- tmtbHtml2 += '</div>';
|
|
|
|
|
- tmtbHtml2 += '</li>';
|
|
|
|
|
|
|
+ tmtbHtml2 += '</ul>';
|
|
|
|
|
+ tmtbHtml2 += '</div>';
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $("#giftcardList").html(tmtbHtml2);
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- tmtbHtml2 += '</ul>';
|
|
|
|
|
-
|
|
|
|
|
- $("#giftcardList").html(tmtbHtml2);
|
|
|
|
|
-
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-function fnChangeDate(obj) {
|
|
|
|
|
-
|
|
|
|
|
- var seletedDate = obj.toString();
|
|
|
|
|
- var splitMonth = seletedDate.substr(4);
|
|
|
|
|
-
|
|
|
|
|
- data = {month : splitMonth,
|
|
|
|
|
- searchDt : seletedDate};
|
|
|
|
|
-
|
|
|
|
|
- var jsonData = JSON.stringify(data);
|
|
|
|
|
-
|
|
|
|
|
- $.ajax(
|
|
|
|
|
- {
|
|
|
|
|
- type : "POST",
|
|
|
|
|
- data : jsonData,
|
|
|
|
|
- url : '/mypage/gift/use/list',
|
|
|
|
|
- contentType: 'application/json',
|
|
|
|
|
- dataType : 'json',
|
|
|
|
|
- success : function(result){
|
|
|
|
|
- useGiftcard(result);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ function fnChangeDate(obj) {
|
|
|
|
|
+
|
|
|
|
|
+ var seletedDate = obj.toString();
|
|
|
|
|
+ var splitMonth = seletedDate.substr(4);
|
|
|
|
|
+
|
|
|
|
|
+ data = {
|
|
|
|
|
+ month : splitMonth,
|
|
|
|
|
+ searchDt : seletedDate
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ type : "POST",
|
|
|
|
|
+ data : jsonData,
|
|
|
|
|
+ url : '/mypage/gift/use/list',
|
|
|
|
|
+ contentType : 'application/json',
|
|
|
|
|
+ dataType : 'json',
|
|
|
|
|
+ success : function(result) {
|
|
|
|
|
+ useGiftcard(result);
|
|
|
}
|
|
}
|
|
|
- )
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 상품권 등록 버튼 누를 시
|
|
|
|
|
-function giftcardSave() {
|
|
|
|
|
- if($("#gift_input").val() == "" || $("#gift_input").val() == null){
|
|
|
|
|
- mcxDialog.alert("상품권 번호를 입력해주세요.");
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- data = {gfcdNo : $("#gift_input").val()};
|
|
|
|
|
-
|
|
|
|
|
- var jsonData = JSON.stringify(data);
|
|
|
|
|
-
|
|
|
|
|
- mcxDialog.confirm("상품권을 등록 하시겠습니까?", {
|
|
|
|
|
- cancelBtnText: "취소",
|
|
|
|
|
- sureBtnText: "확인",
|
|
|
|
|
- sureBtnClick: function() {
|
|
|
|
|
-
|
|
|
|
|
- gagajf.ajaxJsonSubmit('/mypage/gift/use/confirm', jsonData, function() {
|
|
|
|
|
- cfnGoToPage(_PAGE_MYPAGE_GIFTCARD);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 상품권 등록 버튼 누를 시
|
|
|
|
|
+ function giftcardSave() {
|
|
|
|
|
+ if ($("#gift_input").val() == ""
|
|
|
|
|
+ || $("#gift_input").val() == null) {
|
|
|
|
|
+ mcxDialog.alert("상품권 번호를 입력해주세요.");
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ data = {
|
|
|
|
|
+ gfcdNo : $("#gift_input").val()
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
|
|
+
|
|
|
|
|
+ mcxDialog.confirm("상품권을 등록 하시겠습니까?", {
|
|
|
|
|
+ cancelBtnText : "취소",
|
|
|
|
|
+ sureBtnText : "확인",
|
|
|
|
|
+ sureBtnClick : function() {
|
|
|
|
|
+
|
|
|
|
|
+ gagajf.ajaxJsonSubmit(
|
|
|
|
|
+ '/mypage/gift/use/confirm', jsonData,
|
|
|
|
|
+ function() {
|
|
|
|
|
+ cfnGoToPage(_PAGE_MYPAGE_GIFTCARD);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $(document).ready(function() {
|
|
|
|
|
+
|
|
|
|
|
+ // 마이페이지 LNB 설정
|
|
|
|
|
+ fnSetMypageLnbList(6);
|
|
|
|
|
+
|
|
|
|
|
+ // 마이페이지 location 설정
|
|
|
|
|
+ fnSetMypageLocation('상품권', '_PAGE_MYPAGE_GIFTCARD');
|
|
|
|
|
+
|
|
|
|
|
+ // 전체내역 표시
|
|
|
|
|
+ $("#SearchUseGiftcard").trigger('click');
|
|
|
|
|
+
|
|
|
|
|
+ // 셀렉트박스 활성화
|
|
|
|
|
+ $('.select_custom.month').each(function(index) {
|
|
|
|
|
+ var selecter01 = new sCombo($(this));
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-$(document).ready(function() {
|
|
|
|
|
-
|
|
|
|
|
- // 마이페이지 LNB 설정
|
|
|
|
|
- fnSetMypageLnbList(6);
|
|
|
|
|
-
|
|
|
|
|
- // 마이페이지 location 설정
|
|
|
|
|
- fnSetMypageLocation('상품권', '_PAGE_MYPAGE_GIFTCARD');
|
|
|
|
|
-
|
|
|
|
|
- // 전체내역 표시
|
|
|
|
|
- $("#SearchUseGiftcard").trigger('click');
|
|
|
|
|
-
|
|
|
|
|
- // 셀렉트박스 활성화
|
|
|
|
|
- $('.select_custom.type1').each(function(index) {
|
|
|
|
|
- var selecter01 = new sCombo($(this));
|
|
|
|
|
- });
|
|
|
|
|
-});
|
|
|
|
|
</script>
|
|
</script>
|
|
|
</th:block>
|
|
</th:block>
|
|
|
|
|
|