Просмотр исходного кода

Merge remote-tracking branch 'TSIT/gagamel_err' into style

card007 4 лет назад
Родитель
Сommit
a754a71654

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

@@ -168,4 +168,26 @@ public class TsfAppController extends TsfBaseController {
 		return super.ok(message.getMessage("SUCC_0005"));
 	}
 
+	/**
+	 * 업데이트 정보 조회
+	 *
+	 * @author gagamel
+	 * @since 2021. 11. 18
+	 */
+	@GetMapping("/update/info")
+	@ResponseBody
+	public GagaMap getUpdateInfo() {
+		GagaMap appInfo = new GagaMap();
+
+		if ("I".equals(TsfSession.getAttribute("osType"))) {
+			appInfo.setString("regAppVersion", envsetService.getIosAppVersion(TscConstants.Site.STYLE24.value()));
+			appInfo.setString("regUpdateGb", envsetService.getIosAppUpdateGb(TscConstants.Site.STYLE24.value()));
+		} else if ("A".equals(TsfSession.getAttribute("osType"))) {
+			appInfo.setString("regAppVersion", envsetService.getAosAppVersion(TscConstants.Site.STYLE24.value()));
+			appInfo.setString("regUpdateGb", envsetService.getAosAppUpdateGb(TscConstants.Site.STYLE24.value()));
+		}
+
+		return appInfo;
+	}
+
 }

+ 95 - 40
src/main/webapp/WEB-INF/views/mob/common/fragments/FooterMob.html

@@ -556,56 +556,111 @@
 	}
 
 	$(document).ready(function() {
-		// 퀵메뉴탭 조회
-		fnCreateQuickMenuTab();
+		// 필수/선택 업데이트 안내
+		if (_isApp === 'true') {
+			$.getJSON('/app/update/info'
+					, function(result) {
+						if (_appVersion != result.regAppVersion) {
+							// 안내 alert 표기
+							if (_osType == 'I') { // IOS
+								if (result.regUpdateGb == 'Y') { // 필수업데이트
+									document.location.href = 'update://?link=https://apps.apple.com/kr/app/id627774402?mt=8';
+								} else {
+									document.location.href = 'update://?link=https://apps.apple.com/kr/app/id627774402?mt=8';
+								}
+							} else { // AOS
+								if (result.regUpdateGb == 'Y') { // 필수업데이트
+									document.location.href = 'update://?link=https://play.google.com/store/apps/details?id=com.istyle24.commerce';
+								} else {
+									document.location.href = 'update://?link=https://play.google.com/store/apps/details?id=com.istyle24.commerce';
+								}
+							}
+						} else {
+							// 퀵메뉴탭 조회
+							fnCreateQuickMenuTab();
+
+							// 최근 본 상품 조회
+							fnGetRecentlyGoods();
+							
+							// 팝업조회
+							fnGetPopup();
+							
+							$.getJSON('/cart/goods/not/soldout/cnt', function (order, status) {
+								let cartCnt;
+								if (order.cartGoodsList.length > 99) {
+									cartCnt = "99+";
+								} else {
+									cartCnt = order.cartGoodsList.length;
+								}
 
-		// 최근 본 상품 조회
-		fnGetRecentlyGoods();
+//					 			$("header #htopSub .button_wrap .store>span").text(cartCnt);
+//					 			$("#header .gnb .btn_cart").attr("href", _PAGE_CART);
+								if (cartCnt > 0) {
+									$('#spanGnbCartCnt').html(cartCnt);
+									$('#spanGnbCartCnt').show();
+								}
+							});
 
-		// 팝업조회
-		fnGetPopup();
+							// 공유하기 기능 추가
+							shareUrl = gagajf.getCookie('st24ck_share_url');
+							gagajf.setCookie('st24ck_share_url', '', 1);
+							if (!gagajf.isNull(shareUrl) && _frontGb === 'M') {
+								$("#adHide").show();
+							}
+						}
+					});
+		} else {
+			// 퀵메뉴탭 조회
+			fnCreateQuickMenuTab();
+
+			// 최근 본 상품 조회
+			fnGetRecentlyGoods();
+			
+			// 팝업조회
+			fnGetPopup();
+			
+			$.getJSON('/cart/goods/not/soldout/cnt', function (order, status) {
+				let cartCnt;
+				if (order.cartGoodsList.length > 99) {
+					cartCnt = "99+";
+				} else {
+					cartCnt = order.cartGoodsList.length;
+				}
 
-		$.getJSON('/cart/goods/not/soldout/cnt', function (order, status) {
-			let cartCnt;
-			if (order.cartGoodsList.length > 99) {
-				cartCnt = "99+";
-			} else {
-				cartCnt = order.cartGoodsList.length;
-			}
+//	 			$("header #htopSub .button_wrap .store>span").text(cartCnt);
+//	 			$("#header .gnb .btn_cart").attr("href", _PAGE_CART);
+				if (cartCnt > 0) {
+					$('#spanGnbCartCnt').html(cartCnt);
+					$('#spanGnbCartCnt').show();
+				}
+			});
 
-// 			$("header #htopSub .button_wrap .store>span").text(cartCnt);
-// 			$("#header .gnb .btn_cart").attr("href", _PAGE_CART);
-			if (cartCnt > 0) {
-				$('#spanGnbCartCnt').html(cartCnt);
-				$('#spanGnbCartCnt').show();
+			// 공유하기 기능 추가
+			shareUrl = gagajf.getCookie('st24ck_share_url');
+			gagajf.setCookie('st24ck_share_url', '', 1);
+			if (!gagajf.isNull(shareUrl) && _frontGb === 'M') {
+				$("#adHide").show();
 			}
-		});
-
-		// 공유하기 기능 추가
-		shareUrl = gagajf.getCookie('st24ck_share_url');
-		gagajf.setCookie('st24ck_share_url', '', 1);
-		if (!gagajf.isNull(shareUrl) && _frontGb === 'M') {
-			$("#adHide").show();
 		}
 	});
 
 	var shareUrl;
 	var uifn_goApp = function(){
-	 	var aosUrl = 'intent://style24://share?targetUrl=';
-	 	var iosUrl = 'style24://share?targetUrl=';
-	 	if (_osType === 'A') {
-	 		setTimeout(function () {
-	 			cfnGoToPage(_PAGE_MAIN);
-	 		}, 1500);
-	 		aosUrl += shareUrl + '#Intent;package=com.istyle24.commerce;scheme=style24;end';
-	 		location.href = aosUrl;
-	 	} else if (_osType === 'I') {
-	 		iosUrl += shareUrl;
-	 		setTimeout(function () {
-	 			window.open('https://apps.apple.com/kr/app/id627774402?mt=8');
-	 		}, 1500);
-	 		location.href = iosUrl;
-	 	}
+		var aosUrl = 'intent://style24://share?targetUrl=';
+		var iosUrl = 'style24://share?targetUrl=';
+		if (_osType === 'A') {
+			setTimeout(function () {
+				cfnGoToPage(_PAGE_MAIN);
+			}, 1500);
+			aosUrl += shareUrl + '#Intent;package=com.istyle24.commerce;scheme=style24;end';
+			location.href = aosUrl;
+		} else if (_osType === 'I') {
+			iosUrl += shareUrl;
+			setTimeout(function () {
+				window.open('https://apps.apple.com/kr/app/id627774402?mt=8');
+			}, 1500);
+			location.href = iosUrl;
+		}
 	}
 
 	// 앱 최초기동시 -> 접근권한 안내