Browse Source

Merge branch 'card007' into style

card007 4 năm trước cách đây
mục cha
commit
3377025624

+ 1 - 0
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -315,6 +315,7 @@ public class TsfCustomerService {
 		customer.initBirthMm();
 		customer.setEncodedPasswd(" ");
 		customer.setCustId(customer.getSnsType() + "_" + snsId);
+		customer.setHypenCellPhone();
 		customer.encryptData();
 
 		customer.setSiteCd(TscConstants.Site.STYLE24.value());

+ 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);
 	
 	// 무통장입금 취소의 경우 계좌인증처리 후 반품 진행

+ 18 - 0
src/main/webapp/WEB-INF/views/mob/order/OrderFormMob.html

@@ -1380,6 +1380,24 @@ var paymentInfoSet = function() {
 								custPayMeans = "Y";
 							}
 							
+							// 2021.11.08 card007 배송지 휴대폰번호 유효성 체크 추가
+							let phnno = $("#orderAmtForm .recipPhnno").text();
+							
+							if (!gagajf.checkPhnno(phnno)) {
+								mcxDialog.alert("배송지 휴대폰 번호가 유효하지 않습니다.");
+								
+								$('.fold_head').removeClass('on');
+								$('.fold_cont').css('display', 'none');
+								
+								$("#deliveryAddrInfo .fold_head").addClass("on");
+								$("#deliveryAddrInfo .fold_cont").css("display", "block");
+								
+								let offset = $('#deliveryAddrInfo').offset();
+								$('html, body').animate({scrollTop : offset.top - 50}, 0);
+								
+								return false;
+							}
+							
 							// 주문상세데이타 생성
 							$("#orderDetailInfo .cartSq").each(function () {
 								// 주문상세단위 총알배송여부 변경

+ 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);
 		
 		// 무통장입금 취소의 경우 계좌인증처리 후 반품 진행

+ 18 - 0
src/main/webapp/WEB-INF/views/web/order/OrderFormWeb.html

@@ -1251,6 +1251,24 @@ var paymentInfoSet = function() {
 								custPayMeans		= "Y";
 							}
 							
+							// 2021.11.08 card007 배송지 휴대폰번호 유효성 체크 추가
+							let phnno = $("#orderAmtForm .recipPhnno").text();
+							
+							if (!gagajf.checkPhnno(phnno)) {
+								mcxDialog.alert("배송지 휴대폰 번호가 유효하지 않습니다.");
+								
+								$('.fold_head').removeClass('on');
+								$('.fold_cont').css('display', 'none');
+								
+								$("#deliveryAddrInfo .fold_head").addClass("on");
+								$("#deliveryAddrInfo .fold_cont").css("display", "block");
+								
+								let offset = $('#deliveryAddrInfo').offset();
+								$('html, body').animate({scrollTop : offset.top - 200}, 0);
+								
+								return false;
+							}
+							
 							// 주문상세데이타 생성
 							$("#orderDetailInfo .cartSq").each(function(){
 								

+ 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()

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

@@ -1068,6 +1068,30 @@ var gagajf = {
 		}
 
 		return true;
+	},
+	
+	/**
+	 * 전화번호 유효성 체크한다.
+	 * 예)
+	 * 		gagajf.checkPhnno(phnno);
+	 * @param param - 휴대폰번호
+	 * @returns {boolean}
+	 * @author card007
+	 * @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}$/;
+		
+		if (regExp.test(phnno)) {
+			return true;
+		} else {
+			return false;
+		}
 	}
 };