jsshin 4 лет назад
Родитель
Сommit
46eccc22a5

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

@@ -268,11 +268,7 @@ public class TsfCustomerService {
 		customer.setCustStat(TscConstants.CustStat.ACTIVE.value());
 		customer.setCustGb(TscConstants.CustGb.NORMAL.value());
 		customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
-		// 앱이면 앱푸시 기본값으로 수신동의 처리
-		String isApp = TsfSession.getAttribute("isApp");
-		if ("true".equals(isApp)) {
-			customer.setAppAgreeYn("Y");
-		}
+		
 		int custCnt = customerDao.createCustomer(customer);
 		customerDao.saveBatchBirth(customer);
 
@@ -326,11 +322,6 @@ public class TsfCustomerService {
 		customer.setCustStat(TscConstants.CustStat.ACTIVE.value());
 		customer.setCustGb(TscConstants.CustGb.NORMAL.value());
 		customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
-		// 앱이면 앱푸시 기본값으로 수신동의 처리
-		String isApp = TsfSession.getAttribute("isApp");
-		if ("true".equals(isApp)) {
-			customer.setAppAgreeYn("Y");
-		}
 
 		int custCnt = customerDao.createCustomer(customer);
 		customerDao.createCustomerSns(customer);

+ 18 - 0
src/main/java/com/style24/front/biz/web/TsfAppController.java

@@ -104,6 +104,24 @@ public class TsfAppController extends TsfBaseController {
 		return result;
 	}
 
+	/**
+	 * 앱푸시, 앱마케팅 수신동의
+	 *
+	 * @param  customer - 수신동의 여부
+	 * @author jsshin
+	 * @since 2021. 06. 22
+	 */
+	@PostMapping("/push/update")
+	@ResponseBody
+	public GagaMap updateAppPush(@RequestBody Customer customer) {
+		GagaMap result = new GagaMap();
+		int appResultCnt = customerService.updateAppAgreeYn(customer.getAppAgreeYn());
+		int mkResultCnt = customerService.updateMkAgreeYn(customer.getMkAgreeYn());
+		result.setInt("mkResultCnt", mkResultCnt);
+		result.setInt("appResultCnt", appResultCnt);
+		return result;
+	}
+
 	/**
 	 * 앱알림 화면
 	 *

+ 7 - 4
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -455,6 +455,7 @@ public class TsfCustomerController extends TsfBaseController {
 	 * @param encodeData - 휴대폰인증에서 전달받은 인증결과 암호화 데이터 취득
 	 * @param encData - 아이핀에서 전달받은 인증결과 암호화 데이터 취득
 	 * @param redirectUrl - 모바일은 호출한 URL 암호화 데이터 전달
+	 * @param custParams - 회원가입시 입력 받았던 내용 다시 받음
 	 * @return ModelAndView
 	 * @author jsshin
 	 * @since 2021. 02. 09
@@ -762,8 +763,9 @@ public class TsfCustomerController extends TsfBaseController {
 	 * @since 2021. 03. 08
 	 */
 	@RequestMapping("/dormant/certify/form")
-	public ModelAndView getDormantCeirtyForm(@RequestParam(value = "sEncData", required = false) String sEncData, @RequestParam(value = "authMethod", required = false) String authMethod, @RequestParam(value = "custParams", required = false) String custParams) {
-
+	public ModelAndView getDormantCeirtyForm(@RequestParam(value = "sEncData", required = false) String sEncData
+			, @RequestParam(value = "authMethod", required = false) String authMethod
+			, @RequestParam(value = "custParams", required = false) String custParams) {
 		ModelAndView mav = new ModelAndView();
 
 		// http 에서는 Same-Site None 설정이 안되므로 아래와 같이 처리
@@ -836,8 +838,9 @@ public class TsfCustomerController extends TsfBaseController {
 	 * @since 2021. 03. 10
 	 */
 	@RequestMapping("/certification/form")
-	public ModelAndView getCertificationForm(@RequestParam(value = "sEncData", required = false) String sEncData, @RequestParam(value = "authMethod", required = false) String authMethod, @RequestParam(value = "custParams", required = false) String custParams) {
-
+	public ModelAndView getCertificationForm(@RequestParam(value = "sEncData", required = false) String sEncData
+			, @RequestParam(value = "authMethod", required = false) String authMethod
+			, @RequestParam(value = "custParams", required = false) String custParams) {
 		ModelAndView mav = new ModelAndView();
 
 		// http 에서는 Same-Site None 설정이 안되므로 아래와 같이 처리

+ 0 - 3
src/main/webapp/WEB-INF/views/mob/SigninFormMob.html

@@ -171,9 +171,6 @@
 	var fnReloadAfterLogin = function(result) {
 		if (result.status === 'OK') {
 			if (_isApp === 'true') {
-				if (gagajf.isNull(result.appAgreeDt)) {
-					fnAppPushAgreeUpdate('Y');
-				}
 				document.location.href = "idsend://?id=" + result.custNo + "^link=" + result.returnUrl;
 			} else {
 				document.location.href = result.returnUrl;

+ 1 - 1
src/main/webapp/WEB-INF/views/mob/app/SettingFormMob.html

@@ -162,7 +162,7 @@
 			if ($(this).is(":checked")) {
 				if (_osType === 'A') {
 					window.style24.pushEnable('ON');
-				} else if (_osType == 'I') {
+				} else if (_osType === 'I') {
 					window.webkit.messageHandlers.pushEnable.postMessage({"status":"ON"});
 				}
 				appAgreeYn = 'Y';

+ 22 - 18
src/main/webapp/WEB-INF/views/mob/common/fragments/FooterMob.html

@@ -368,30 +368,34 @@
 			}
 		});
 
-		if (_isApp === 'true') {
-			//$('#alramHide').show();
-		}
-		
 	});
 
-	// 앱마케팅푸시 수신거부
-	$(document).on('click','#btnMkPushClose',function(){
-	  $('#alramHide').hide();
-	  	// 수신거부
-		if (_osType === 'A') {
-
-		} else if (_osType == 'I') {
+	// 앱 최초기동시
+	var agreeMarketingPush = function () {
+		$('#alramHide').show();
+	}
 
+	// 앱마케팅 푸시 수신동의
+	$(document).on('click','#btnMkPushAgree',function() {
+		if (_isApp === 'true') {
+			if ( _osType === 'A') {
+				window.style24.setPushSetting("ON", "ON");
+			} else if (_osType === 'I') {
+				window.webkit.messageHandlers.setPushSetting.postMessage({"pushStat":"ON", "advertisePushStat":"ON"});
+			}
+			$('#alramHide').hide();
 		}
 	});
 
-	// 앱마케팅 푸시 수신동의
-	$(document).on('click','#btnMkPushAgree',function(){
-		$('#alramHide').hide();
-		if (_osType === 'A') {
-
-		} else if (_osType == 'I') {
-
+	// 앱마케팅푸시 수신거부
+	$(document).on('click','#btnMkPushClose',function() {
+		if (_isApp === 'true') {
+			if (_osType === 'A') {
+				window.style24.setPushSetting("ON", "OFF");
+			} else if (_osType === 'I') {
+				window.webkit.messageHandlers.setPushSetting.postMessage({"pushStat":"ON", "advertisePushStat":"OFF"});
+			}
+			$('#alramHide').hide();
 		}
 	});
 

+ 38 - 2
src/main/webapp/WEB-INF/views/mob/customer/JoinCompleteFormMob.html

@@ -92,18 +92,54 @@
 	</main>
 <script th:inline="javascript">
 	const maskingCustId = [[${maskingCustId}]];
-
+	let appAgreeYn = 'Y';
 	$(document).ready(function(){
 		if (_isApp === 'true') {
 			if (gagajf.isNull(maskingCustId)) {
 				if (_osType === 'A') {
 					window.style24.setCustNo([[${custNo}]]);
+					//window.style24.isPushEnable();
 				} else if (_osType === 'I') {
-
+					//window.webkit.messageHandlers.isPushEnable.postMessage({"dummy":"dummy"});
 				}
 			}
 		}
 	});
+
+	// 앱에서 호출되는 함수(앱푸시)
+	var settingsSwtichPush = function(onOff) {
+		if (onOff === 'ON') {
+			appAgreeYn = 'Y';
+			window.style24.isAdEnable();
+			window.webkit.messageHandlers.isAdEnable.postMessage({"dummy":"dummy"});
+		} else if (onOff === 'OFF') {
+			appAgreeYn = 'N';
+			// window.style24.setCustNo([[${custNo}]],'OFF', 'OFF');
+			fnUpdatePush(appAgreeYn, 'N');
+		}
+	}
+
+	// 앱에서 호출되는 함수(마케팅동의)
+	var settingsSwtichAdvertise = function (onOff) {
+		let mkAgreeYn = 'N';
+		if (onOff === 'ON') {
+			mkAgreeYn = 'Y';
+		// window.style24.setCustNo([[${custNo}]],'ON', 'ON');
+		} else if (onOff === 'OFF'){
+			mkAgreeYn = 'N';
+		// window.style24.setCustNo([[${custNo}]],'ON', 'OFF');
+		}
+		fnUpdatePush(appAgreeYn, mkAgreeYn);
+	}
+	
+	var fnUpdatePush = function (appAgreeYn, mkAgreeYn) {
+		let params = {}
+		params.appAgreeYn = appAgreeYn;
+		params.mkAgreeYn = mkAgreeYn;
+		let jsonData = JSON.stringify(params);
+		gagajf.ajaxJsonSubmit('/app/push/update', jsonData);
+	}
+
 </script>
 </th:block>
 </body>