Sfoglia il codice sorgente

모바일 배송지 목록 추가

jsshin 5 anni fa
parent
commit
85b8df1cf8

+ 191 - 0
src/main/webapp/WEB-INF/views/mob/mypage/MypageCustDeliveryAddrFormMob.html

@@ -0,0 +1,191 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org"
+	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
+	layout:decorator="mob/common/layout/MypageLayoutMob">
+<!--
+ *******************************************************************************
+ * @source  : MypageCustDeliveryAddrFormMob.html
+ * @desc    : 마이페이지 > 배송지관리 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2021 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.05.03   jsshin      최초 작성
+ *******************************************************************************
+ -->
+<body>
+<th:block layout:fragment="content">
+<main class="container my">
+	<section class="content my_delivery">
+		<div class="inner">
+			<div class="inner wide">
+				<div id="custDeliveryList" class="delivery_list"></div>
+				<div id="nodata" class="nodata" style="display: none;">
+					<div class="txt_box">
+						<p>
+							등록된 배송지가 없습니다.<br/>
+						</p>
+					</div>
+				</div>
+				<div class="inner wide">
+					<div class="btn_group btn_group_flex">
+						<button type="button" class="btn btn_dark" id="btnAdrsaddPop">
+							<span>배송지 추가</span>
+						</button>
+					</div>
+				</div>
+			</div>
+		</div>
+	</section>
+</main>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+
+	var fnCustDeliveryAddList = function () {
+		$.get('/mypage/customer/delivery/addr/list', fnCustDeliveryAddListCallback);
+	}
+
+	var fnCustDeliveryAddListCallback = function (result) {
+		let html = '';
+		if (result.length < 1) {
+			$('#nodata').show();
+		} else {
+			$('#nodata').hide();
+			$.each(result, function (idx, custDeliveryAddr){
+				if (custDeliveryAddr.defaultYn  === 'Y') {
+					html += '<div class="ship_info active">\n';
+				} else {
+					html += '<div class="ship_info">\n';
+				}
+				html +=	'        <dl>\n';
+				html +=	'            <div class="name">\n';
+				html +=	'                <dt><span class="sr-only">배송지명</span></dt>\n';
+				html +=	'                    <dd>\n';
+				html +=	'                       '+custDeliveryAddr.recipNm +'\n';
+				html +=	'                       <div class="badge_wrap">\n';
+				if (custDeliveryAddr.defaultYn  === 'Y') {
+					html += '                       <em class="order_badge">기본배송지</em>\n';
+				}
+				if (custDeliveryAddr.shotDelvUseYn  === 'Y') {
+					html += '                       <em class="order_badge order_bullet_badge">총알배송</em>\n';
+				}
+				html +=	'                       </div>\n';
+				html +=	'                    </dd>\n';
+				html +=	'            </div>\n';
+				html +=	'            <div class="phone">\n';
+				html +=	'                <dt><span class="sr-only">휴대폰 번호</span></dt>\n';
+				html +=	'                <dd>'+custDeliveryAddr.recipPhnno+'</dd>\n';
+				html +=	'            </div>\n';
+				html +=	'            <div class="addr">\n';
+				html +=	'               <dt><span class="sr-only">배송주소</span></dt>\n';
+				html +=	'               <dd>'+custDeliveryAddr.recipBaseAddr + custDeliveryAddr.recipDtlAddr +'</dd>\n';
+				html +=	'            </div>\n';
+				html +=	'            <div class="ship_request">\n';
+				html +=	'                <dl>\n';
+				html +=	'                    <dt>배송요청 사항</dt>\n';
+				html +=	'                    <dd>'+custDeliveryAddr.delvMemo+'</dd>\n';
+				html +=	'                </dl>\n';
+				html +=	'            </div>\n';
+				html +=	'        </dl>\n';
+				html +=	'        <div class="btn_group btn_group_flex">\n';
+				html +=	'            <div>\n';
+				html +=	'                <button type="button" class="btn btn_gost" onclick="fnModiFyCustDelvAddr(\''+custDeliveryAddr.custDelvAddrSq+'\')">\n';
+				html +=	'                    <span>수정</span>\n';
+				html +=	'                </button>\n';
+				html +=	'            </div>\n';
+				html +=	'            <div>\n';
+				html +=	'                <button type="button" class="btn btn_dark" onclick="fnDeleteCustDelvAddr(\''+custDeliveryAddr.custDelvAddrSq+'\')">\n';
+				html +=	'                   <span>삭제</span>\n';
+				html +=	'                </button>\n';
+				html +=	'            </div>\n';
+				html +=	'        </div>\n';
+				html +=	'   </div>\n';
+			});
+		}
+		$('#custDeliveryList').html(html);
+	}
+
+	// 배송지 추가
+	$('#btnAdrsaddPop').on('click', function () {
+		$.ajax( {
+			type		: "POST",
+			url 		: '/common/delvAddrAddPop',
+			dataType 	: 'html',
+			beforeSend : function(xhr, settings) {
+				xhr.setRequestHeader("AJAX"			, "true");
+				xhr.setRequestHeader('Accept'		, 'application/json');
+				xhr.setRequestHeader('Content-Type'	, 'application/json');
+			},
+			success 	: function(result) {
+				$("#adrsAddPop .modal-dialog .modal-content").html(result);
+				$("#adrsAddPop").modal("show");
+			}
+		});
+	});
+
+	var delvAddrSet = function (delvObj) {
+		if(!gagajf.isNull(delvObj.custDelvAddrSq)) {
+			fnCustDeliveryAddList();
+		}
+	};
+
+	var fnModiFyCustDelvAddr = function (custDelvAddrSq) {
+		let params = {}
+		params.custDelvAddrSq = custDelvAddrSq;
+
+		$.ajax( {
+			type		: "POST",
+			url 		: '/common/delvAddrModifyPop',
+			data		: JSON.stringify(params),
+			dataType 	: 'html',
+			beforeSend : function(xhr, settings) {
+				xhr.setRequestHeader("AJAX"			, "true");
+				xhr.setRequestHeader('Accept'		, 'application/json');
+				xhr.setRequestHeader('Content-Type'	, 'application/json');
+			},
+			success 	: function(result) {
+				$("#adrsModifyPop .modal-dialog .modal-content").html(result);
+				$("#adrsModifyPop").modal("show");
+			}
+		});
+	};
+
+	var fnDeleteCustDelvAddr = function (custDelvAddrSq) {
+		let params = {}
+		params.custDelvAddrSq = custDelvAddrSq;
+		let jsonData = JSON.stringify(params);
+		gagajf.ajaxJsonSubmit("/mypage/customer/delivery/addr/delete", jsonData, function (result) {
+			if (result.isSuccess) {
+				fnCustDeliveryAddList();
+			} else {
+				mcxDialog.alert("배송지 삭제를 실패 하였습니다.");
+				return;
+			}
+		})
+	}
+
+
+	$(document).ready(function() {
+
+		$('#htopTitle').text('배송지 관리');
+
+		// 배송목록 조회
+		fnCustDeliveryAddList();
+
+		// $(document).on("scroll",function(){
+		// 	if($(".tabbar").hasClass("fixed")) {
+		// 		$(".my .my_delivery .inner > .btn_group").addClass('active');
+		// 	}else{
+		// 		$(".my .my_delivery .inner > .btn_group").removeClass('active');
+		// 	}
+		// });
+	});
+
+	/*]]>*/
+</script>
+</th:block>
+</body>
+</html>

+ 2 - 2
src/main/webapp/WEB-INF/views/web/mypage/MypageCustDeliveryAddrFormWeb.html

@@ -52,7 +52,7 @@
 				<div id="nodata" class="nodata">
 					<div class="txt_box">
 						<p>
-							현재 노출 할 수 있는 데이터가 없습니다.<br>
+							등록된 배송지가 없습니다.<br/>
 						</p>
 					</div>
 				</div>
@@ -65,7 +65,7 @@
 		<!-- // CONT-BODY -->
 	</div>
 </div>
-	<script th:inline="javascript">
+<script th:inline="javascript">
 	/*<![CDATA[*/
 
 	var fnCustDeliveryAddList = function () {

+ 13 - 0
src/main/webapp/ux/mo/css/common_m.css

@@ -1765,6 +1765,19 @@ button.alertCls {-webkit-appearance: none;padding: 0;cursor: pointer;background:
 .modal.pop_fullCol .modal-body .pop_cont{max-height: 100%;}
 .modal.pop_fullCol .modal-body [class^="ui_col_"]{margin: 0;}
 
+
+
+.pop_cont .nodata {padding:8.0rem 0 10.0rem;  text-align:center;}
+.pop_cont .nodata .txt_box {color:#666; font-size:1.6rem; font-weight:300; line-height:2.6rem;}
+.pop_cont .nodata .txt_box::before {content:''; display:block; width:3.6rem; height:4.6rem; margin:0 auto 2.4rem; background:url('/images/mo/ico_content_none.png') no-repeat;}
+.pop_cont .nodata .txt_box span {color:#fd4802; font-weight:500;}
+.pop_cont .nodata .btn_box {margin-top:4.0rem;}
+.pop_cont .nodata .btn_box .btn span {color:#222; font-size:1.4rem; font-weight:300;}
+
+
+
+
+
 .modal::-webkit-scrollbar,.pop_cont::-webkit-scrollbar {width: 2px;}
 .modal::-webkit-scrollbar-thumb,.pop_cont::-webkit-scrollbar-thumb {background-color: #888888;border-radius: 0px;background-clip: padding-box;border: 0px solid transparent;}
 .modal::-webkit-scrollbar-track, .pop_cont::-webkit-scrollbar-track{background-color: #dddddd;border-radius: 0px;}

+ 0 - 6
src/main/webapp/ux/pc/js/common-ui.js

@@ -404,12 +404,6 @@ $(document).ready( function() {
 		return false;
 	});
 
-	// $(".jquery-modal").modal({
-	// 	escapeClose: false,
-	// 	clickClose: false
-	// });
-
-
 	/* 같은 데이터 노출시 동일 영역끼리 병합 */
 	$(".merge_row").each(function() {
 		var txtcont = $(this).text();