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

[ST24PRJ-577] [결함][FRONT] 상품상세 > 상품평 > History back 오류

jmh 4 лет назад
Родитель
Сommit
9ca32b54f8

+ 45 - 9
src/main/webapp/WEB-INF/views/mob/goods/GoodsDetailFormMob.html

@@ -875,7 +875,7 @@
 			<!-- 리뷰영역 -->
 			<div class="riview_box" th:if="${reviewDisplayYn == 'Y'}">
 				<div class="ex_review">
-					<a href="javascript:void(0);" id="btn_pdReview_pop" th:onclick="cfGoodsReview([[${goodsInfo.goodsCd}]])">
+					<a href="#hspop_rv" id="btn_pdReview_pop" th:onclick="cfGoodsReview([[${goodsInfo.goodsCd}]])">
 						<span class="tit">리뷰<em class="number">(<th:block  th:text="${(goodsInfo.reviewRegCnt <= 9999) ? #numbers.formatInteger(goodsInfo.reviewRegCnt, 0,'COMMA')  : '9,999+'}"></th:block>)</em></span>
 						<div class="star_score" th:if="${goodsInfo.reviewRegCnt  > 0 }">
 							<span class="star" th:with="starScore=${#numbers.formatDecimal((goodsInfo.score*100/5), 0,0)}">
@@ -2584,7 +2584,14 @@
 
 	// 상품평 상세 레이어 호출후 콜백에서 호출하므로 여기에 있어야함
 	var fnReviewDetailLayerCollBack = function(){
-
+		// 활성화 안되는 경우가 종종발생하여 추가.
+		setTimeout(function() {
+			if( "#hsSpop_rv" == location.hash ){
+				if("none" == $("#layer_review_best").css("display")){
+					$("#layer_review_best").css("display", "inline-block")
+				}
+			}
+		}, 500);
 	}
 
 
@@ -2867,37 +2874,43 @@
 		//팝업 - 상품상세 베스트리뷰
 		$(document).on('click','.pd_detail #btn_pdBestReview_pop a',function(e){
                reviewCount = 1;
-               return false;
+               //return false;
            })
         //팝업 - 상품상세>리뷰팝업>포토상세(포토영상상세)
 		$(document).on('click','.pd_review_pop .area_rv_photo a',function(e){
                $("#layer_review_best").modal("show");
                reviewCount = 2;
-               return false;
+               //return false;
            })
         //팝업 - 상품상세>리뷰팝업>포토상세(베스트상세)
 		$(document).on('click','.pd_review_pop .area_rv_best a',function(e){
                $("#layer_review_best").modal("show");
                reviewCount = 2;
-               return false;
+               //return false;
            })
         //팝업 - 상품상세>리뷰팝업>포토상세 닫기
 		$(document).on('click','#layer_review_best .close-modal',function(e){
 			if(reviewCount === 2){
 				$('.pd_review_pop').modal('show');
+				if( -1 < location.hash.indexOf("#hsSpop")){
+					history.back();
+				}
 			}
-               return false;
+               //return false;
            });
 		//팝업 - 포토/영상 (list)
 		$(document).on('click','.pd_review_pop #btn_more_photoreview',function(e){
                reviewCount = 2;
-               return false;
+               //return false;
            })
 		$(document).on('click','#layer_review_photo .close-modal',function(e){
 			if(reviewCount === 2){
 				$('.pd_review_pop').modal('show');
+				if( -1 < location.hash.indexOf("#hsSpop")){
+					history.back();
+				}
 			}
-               return false;
+               //return false;
            });
 
 		//--상품리뷰 창 순서 -
@@ -3091,7 +3104,30 @@
 		    });
 		}
 
-
+		// 22.01.11 레이어팝업내에서 뒤로가기시 레이어팝업이 닫히도록 작업 관련건
+		window.addEventListener("hashchange", function(e) {
+			if(1 < e.oldURL.indexOf("hspop")){
+				if (location.hash == '' || location.hash == '#enp_mbris') {
+					$('#layer_goods_review').hide();
+					$(".jquery-modal.blocker.current").hide();
+					$("body").css("overflow", "");
+				}
+			}
+			
+			if(1 < e.oldURL.indexOf("hsSpop_rv")){
+				if (location.hash == '#hspop_rv') {
+					$('#layer_review_best').hide();
+					$('.pd_review_pop').modal('show');
+				}
+			}
+		});
+		
+		$(document).on("click",".pd_review_pop .close-modal", function () {
+			if( -1 < location.hash.indexOf("#hspop")){
+				history.back();
+			}
+		});
+		
 	});
 
 

+ 3 - 3
src/main/webapp/WEB-INF/views/mob/goods/GoodsDetailReviewFormMob.html

@@ -416,7 +416,7 @@
 					<div class="swiper-wrapper">
 						<div class="swiper-slide" th:each="bestReview, status : ${bestReviewList}">
 							<div class="best_review">
-								<a href="javascript:void(0);" id="btn_pdBestReview_pop" th:onclick="cfGoodsReviewDetail([[${goodsInfo.goodsCd}]],'Y', '',[[${bestReview.reviewSq}]])">
+								<a href="#hsSpop_rv" id="btn_pdBestReview_pop" th:onclick="cfGoodsReviewDetail([[${goodsInfo.goodsCd}]],'Y', '',[[${bestReview.reviewSq}]])">
 									<div class="star_score" th:with="starScore=${#numbers.formatDecimal((bestReview.iscore*100/5), 0,0)}">
 										<span class="star">
 											<em class="progbar" th:style="${'width:'+starScore+'%;' }"></em> <!-- 평점 style로 표기 -->
@@ -455,7 +455,7 @@
 				<li  th:each="photoReview, status : ${photoReviewList}" th:if="${status.count<=8}">
 					<th:block th:if="${photoReview.reviewAttachList != null and !photoReview.reviewAttachList.empty}">
 					<th:block th:each="reviewAttach, attachStatus : ${photoReview.reviewAttachList}" th:if="${attachStatus.first}">
-					<a href="javascript:void(0);" th:onclick="cfGoodsReviewDetail([[${goodsInfo.goodsCd}]], '', 'Y', [[${photoReview.reviewSq}]])">
+					<a href="#hsSpop_rv" th:onclick="cfGoodsReviewDetail([[${goodsInfo.goodsCd}]], '', 'Y', [[${photoReview.reviewSq}]])">
 						<div class="pic">
 							<th:block th:if="${reviewAttach.fileGb == 'M'}">
 							<span class="thumb mov" th:style="${'background-image:url('+kollusMediaUrl+'/poster/'+reviewAttach.kmcKey+');'}"></span><!-- 동영상의 썸네일일 경우 mov 클래스 추가 -->
@@ -707,7 +707,7 @@
 //					fileGbClass = '';
 //					if (reviewAttach == "M") fileGbClass = "mov";
 			tag += '				<li>\n';
-			tag += '					<a href="javascript:void();" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'\', \'Y\',\''+item.reviewSq+'\','+aIdx+');">\n';
+			tag += '					<a href="#hsSpop_rv" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'\', \'Y\',\''+item.reviewSq+'\','+aIdx+');">\n';
 			tag += '						<div class="pic">\n';
 			if (reviewAttach.fileGb == "M") {
 			tag +='								<span class="thumb mov" style="background-image:url('+_kollusMediaUrl +'/poster/'+reviewAttach.kmcKey +');\" ></span>\n';