Преглед изворни кода

[ST24PRJ-501] 반품/교환 접수 시 휴대폰번호 유효성검증 로직 추가

card007 пре 4 година
родитељ
комит
2da6775b0e

+ 20 - 1
src/main/webapp/WEB-INF/views/mob/mypage/MypageExchangeFormMob.html

@@ -277,7 +277,7 @@
 					</div>
 				</div>
 			</div>
-			<div class="inner">
+			<div class="inner" id="recipLocation">
 				<div class="tbl_wrap">
 					<div class="tbl_tit"> 
 						<h3>교환 상품 배송지</h3>
@@ -525,6 +525,25 @@ var fnExchange = function() {
 	data.cancelReqList 	= cancelReqList;
 	data.shipCompCd		= $('#exchangeForm input[name=shipCompCd]').val();
 
+	// 2021.11.09 card007 휴대폰번호 유효성검증 추가
+	if (wdGb == 'W' && !gagajf.checkPhnno(data.chgerPhnno)) {
+		mcxDialog.alert("회수지 휴대폰 번호가 유효하지 않습니다.");
+
+		let offset = $('#chgerLocation').offset();
+		$('html, body').animate({scrollTop : offset.top - 50}, 0);
+
+		return false;
+	}
+	
+	if (!gagajf.checkPhnno(data.recipPhnno)) {
+		mcxDialog.alert("교환배송지 휴대폰 번호가 유효하지 않습니다.");
+
+		let offset = $('#recipLocation').offset();
+		$('html, body').animate({scrollTop : offset.top - 50}, 0);
+
+		return false;
+	}
+
 	let jsonData = JSON.stringify(data);
 
 	// 교환 처리

+ 10 - 0
src/main/webapp/WEB-INF/views/mob/mypage/MypageReturnFormMob.html

@@ -641,6 +641,16 @@ var fnReturn = function() {
 	data.delvFeeCdGrp 		= oneData.delvFeeCdGrp;
 	data.shipCompCd			= $('#returnForm input[name=shipCompCd]').val();
 
+	// 2021.11.09 card007 휴대폰번호 유효성검증 추가
+	if (wdGb == 'W' && !gagajf.checkPhnno(data.chgerPhnno)) {
+		mcxDialog.alert("회수지 휴대폰 번호가 유효하지 않습니다.");
+
+		let offset = $('#chgerLocation').offset();
+		$('html, body').animate({scrollTop : offset.top - 50}, 0);
+
+		return false;
+	}
+
 	let jsonData = JSON.stringify(data);
 	
 	// 무통장입금 취소의 경우 계좌인증처리 후 반품 진행

+ 10 - 1
src/main/webapp/WEB-INF/views/mob/popup/DelvAddrChangePopMob.html

@@ -105,7 +105,16 @@ $(document).ready( function() {
 // 2. 버튼기능구현
 // 2.1 배송지선택버튼
 $("#delvAddrChangeForm .btn_sel_delvAddr").on("click", function(){
-	
+	// 2021.11.09 card007 휴대폰번호 유효성검증 추가
+	let recipPhnno = $(this).parent().parent().parent().find("input[name=recipPhnno]").val();
+	if (!gagajf.checkPhnno(recipPhnno)) {
+		mcxDialog.alert("휴대폰번호를 확인해주세요.");
+		
+		$(this).parent().parent().find('.btn_addrModify_pop').click();
+		
+		return false;
+	}
+
 	// custDelvAddrSq 부모창으로 전달
 	var delvObj = {
 		"custDelvAddrSq"	: $(this).attr("value")

+ 20 - 1
src/main/webapp/WEB-INF/views/web/mypage/MypageExchangeFormWeb.html

@@ -259,7 +259,7 @@
 							</div>
 						</div>
 						<h4 class="subH3">교환 상품 배송지</h4>
-						<div class="tbl type1">
+						<div class="tbl type1" id="recipLocation">
 							<input type="hidden" name="recipNm" th:value="${deliveryAddrInfo.recipNm}">
 							<input type="hidden" name="recipPhnno" th:value="${deliveryAddrInfo.recipPhnno}">
 							<input type="hidden" name="recipZipcode" th:value="${deliveryAddrInfo.recipZipcode}">
@@ -510,6 +510,25 @@
 		data.selfGoodsYn 	= oneData.selfGoodsYn;
 		data.shipCompCd 	= $('#exchangeForm input[name=shipCompCd]').val();
 
+		// 2021.11.09 card007 휴대폰번호 유효성검증 추가
+		if (wdGb == 'W' && !gagajf.checkPhnno(data.chgerPhnno)) {
+			mcxDialog.alert("회수지 휴대폰 번호가 유효하지 않습니다.");
+
+			let offset = $('#chgerLocation').offset();
+			$('html, body').animate({scrollTop : offset.top - 100}, 0);
+
+			return false;
+		}
+
+		if (!gagajf.checkPhnno(data.recipPhnno)) {
+			mcxDialog.alert("교환배송지 휴대폰 번호가 유효하지 않습니다.");
+
+			let offset = $('#recipLocation').offset();
+			$('html, body').animate({scrollTop : offset.top - 150}, 0);
+
+			return false;
+		}
+
 		let jsonData = JSON.stringify(data);
 
 		// 교환 처리

+ 10 - 0
src/main/webapp/WEB-INF/views/web/mypage/MypageReturnFormWeb.html

@@ -487,6 +487,16 @@
 		data.delvFeeCdGrp 		= oneData.delvFeeCdGrp;
 		data.shipCompCd 		= $('#returnForm input[name=shipCompCd]').val();
 
+		// 2021.11.09 card007 휴대폰번호 유효성검증 추가
+		if (wdGb == 'W' && !gagajf.checkPhnno(data.chgerPhnno)) {
+			mcxDialog.alert("회수지 휴대폰 번호가 유효하지 않습니다.");
+
+			let offset = $('#chgerLocation').offset();
+			$('html, body').animate({scrollTop : offset.top - 100}, 0);
+
+			return false;
+		}
+
 		let jsonData = JSON.stringify(data);
 		
 		// 무통장입금 취소의 경우 계좌인증처리 후 반품 진행

+ 10 - 1
src/main/webapp/WEB-INF/views/web/popup/DelvAddrChangePopWeb.html

@@ -89,13 +89,22 @@ $(document).ready( function() {
 // 2. 버튼기능구현
 // 2.1 배송지선택버튼
 $("#delvAddrChangeForm .btn_sel_delvAddr").on("click", function(){
+	// 2021.11.09 card007 휴대폰번호 유효성검증 추가
+	let recipPhnno = $(this).parent().find("input[name=recipPhnno]").val();
+	if (!gagajf.checkPhnno(recipPhnno)) {
+		mcxDialog.alert("휴대폰번호를 확인해주세요.");
+
+		$(this).parent().find('.btn_addrModify_pop').click();
+
+		return false;
+	}
 	
 	// custDelvAddrSq 부모창으로 전달
 	var delvObj = {
 		"custDelvAddrSq"	: $(this).attr("value")
 		, "dispYn"			: "Y"
 		, "recipNm"			: $(this).parent().find("input[name=recipNm]").val()
-		, "recipPhnno"		: $(this).parent().find("input[name=recipPhnno]").val()
+		, "recipPhnno"		: recipPhnno
 		, "recipZipcode"	: $(this).parent().find("input[name=recipZipcode]").val()
 		, "recipBaseAddr"	: $(this).parent().find("input[name=recipBaseAddr]").val()
 		, "recipDtlAddr"	: $(this).parent().find("input[name=recipDtlAddr]").val()

+ 4 - 0
src/main/webapp/ux/plugins/gaga/gaga.validation.js

@@ -1080,6 +1080,10 @@ var gagajf = {
 	 * @since 2021. 11. 08
 	 */
 	checkPhnno : function(param) {
+		if (this.isNull(param)) {
+			return false;
+		}
+		
 		let phnno = param.replace(/[^0-9]/g, "").replace(/(^02|^050[0-9]|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3").replace("--", "-");
 		let regExp = /^(050[0-9]|01[016789]|02|0[3-9][0-9])-?[0-9]{3,4}-?[0-9]{4}$/;