Browse Source

Merge remote-tracking branch 'origin/style' into jsh77b

jsh77b 4 years ago
parent
commit
3a0b3d1c81

+ 1 - 1
src/main/webapp/WEB-INF/views/mob/cart/CartListFormMob.html

@@ -33,7 +33,7 @@
 				<th:block th:with="buttonKey=${@environment.getProperty('naverPay.button.key')}">
 					<script th:inline="javascript">
 						if(!wcs_add) var wcs_add = {};
-						wcs_add["wa"] = [[${@environment.getProperty('naverPay.common.certification.key')}]];
+						wcs_add["wa"] = "[[${@environment.getProperty('naverPay.common.certification.key')}]]";
 						wcs.inflow("style24.com");
 						wcs_do();
 					</script>

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

@@ -753,9 +753,13 @@ var orderGiftInfoSet = function() {
 				} else {
 					$(this).parent().parent().find("input[name=recipNm]").attr("readOnly", true);
 					$(this).parent().parent().find("input[name=recipPhnno]").attr("readOnly", true);
-					
+
 					// 2021.06.03
-					window.style24.getContact();
+					if (_osType === 'A') {
+						window.style24.getContact();
+					} else if (_osType === 'I') {
+						window.webkit.messageHandlers.getContact.postMessage({"dummy":"dummy"});
+					}
 				}
 			});
 			
@@ -767,11 +771,18 @@ var orderGiftInfoSet = function() {
 
 // 2021.06.03 어플 callback 함수 호출
 function contactInfo(jsonString) {
-	let jsonObj = JSON.parse(jsonString);
-	var phnno = jsonObj.contact.phnno;
-	phnno = phnno.replace(/[^0-9]/g, "").replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3").replace("--", "-");
-	
-	$("#orderForm #orderGiftInfo input[name=recipNm]").val(jsonObj.contact.name);
+	let data = JSON.parse(jsonString);
+
+	// IOS는 디코딩 처리 필요
+	if (_osType === 'I') {
+		data = JSON.parse(decodeURIComponent(escape(atob(jsonString))));
+	}
+
+	// 핸드폰번호 input 넘버타입으로 대쉬 제거 처리
+	var phnno = data.contact.phnno.replaceAll('-', '');
+	//phnno = phnno.replace(/[^0-9]/g, "").replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3").replace("--", "-");
+
+	$("#orderForm #orderGiftInfo input[name=recipNm]").val(data.contact.name);
 	$("#orderForm #orderGiftInfo input[name=recipPhnno]").val(phnno);
 }
 

+ 1 - 2
src/main/webapp/WEB-INF/views/web/cart/CartListFormWeb.html

@@ -25,7 +25,6 @@
     <script type="text/javascript" th:src="${@environment.getProperty('pg.kcp.js.url')}" src=""></script>
     <script type="text/javascript" src="/biz/payment.js"></script>
 	<script type="text/javascript" src="//wcs.naver.net/wcslog.js"></script>
-	<script type="text/javascript" th:src="${@environment.getProperty('naverPay.button.mobile.js.url')}" src="" charset="UTF-8"></script>
 	<form id="nPayForm" name="nPayForm"></form>
 
 	<!--  container -->
@@ -117,7 +116,7 @@
 	
 									<script th:inline="javascript">
 										if(!wcs_add) var wcs_add = {};
-										wcs_add["wa"] = [[${@environment.getProperty('naverPay.common.certification.key')}]];
+										wcs_add["wa"] = "[[${@environment.getProperty('naverPay.common.certification.key')}]]";
 										wcs.inflow("style24.com");
 										wcs_do();
 									</script>