<!DOCTYPE html>
<html lang="ko"
	xmlns:th="http://www.thymeleaf.org">
<!--
 *******************************************************************************
 * @source  : GoodsDetailReviewFormMob.html
 * @desc	: 상품평 Page
 *============================================================================
 * STYLE24
 * Copyright(C) 2020 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE		 AUTHOR		 DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2021.04.07   eskim	   최초 작성
 *******************************************************************************
 -->
<div class="pd_review" th:with="imgGoodsUrl=${@environment.getProperty('upload.goods.view')}, uxImgUrl=${@environment.getProperty('domain.uximage')}, imgUrl=${@environment.getProperty('upload.image.view')}">
	<!-- 등록리뷰 없을 시 -->
	<div class="area_rv_empty" th:if="${reviewList == null or reviewList.empty}">
		<div class="txt_box">
			<p>
				지금 첫 리뷰를 작성하고<br>
				<span class="c_primary">스타일포인트 적립</span> 받으세요!
			</p>
			<div>
				<dl>
					<dt>일반 리뷰</dt>
					<dd th:text="|${#numbers.formatInteger(reviewPoint.textReviewPoint, 0,'COMMA')}P|">150P</dd>
				</dl>
				<dl>
					<dt>포토/영상 리뷰</dt>
					<dd th:text="|${#numbers.formatInteger(reviewPoint.photoReviewPoint, 0,'COMMA')}P|">350P</dd>
				</dl>
				<dl>
					<dt>베스트 리뷰</dt>
					<dd th:text="|${#numbers.formatInteger(reviewPoint.bestReviewPoint, 0,'COMMA')}P|">10,000P</dd>
				</dl>
			</div>
		</div>
		<div class="btn_group_flex">
			<div><button type="button" class="btn btn_dark" onclick="cfnGoToMypageReview();"><span>지금 리뷰 작성하기</span></button></div>
		</div>
	</div>
	<!-- //등록리뷰 없을 시 -->
	<!-- 등록리뷰 있을 시 -->
	<div class="area_rv_average" th:if="${reviewList != null and !reviewList.empty}">
		<th:block th:if="${goodsInfo.reviewRegCnt > 0}">
		<h6 class="sr-only">구매평점</h6>
		<div class="star_score">
			<span class="tit">구매평점</span>
			<span class="score" th:text="${goodsInfo.score}">4.3</span>
			<span class="star" th:with="starScore=${#numbers.formatDecimal((goodsInfo.score*100/5), 0,0)}">
				<em class="progbar" th:style="${'width:'+starScore+'%;' }"></em> <!-- 평점 style로 표기 -->
			</span>
		</div>
		</th:block>
		<!-- 착용정보 있을 시 노출 -->
		<th:block th:if="${not #strings.isEmpty(goodsInfo.sizeGb) and goodsInfo.reviewRegCnt > 0}">
		<div class="average">
			<div class="part_average" th:with="scoreSize1=${#numbers.formatDecimal((goodsInfo.scoreSize1*100/goodsInfo.reviewRegCnt), 0,0)}
												, scoreSize2=${#numbers.formatDecimal((goodsInfo.scoreSize2*100/goodsInfo.reviewRegCnt), 0,0)}
												, scoreSize3=${#numbers.formatDecimal((goodsInfo.scoreSize3*100/goodsInfo.reviewRegCnt), 0,0)}">
				<div class="pa_head">
					<span class="tit">사이즈</span>
					<dl>
						<dt>
							<th:block th:if="${scoreSize1 >= scoreSize2 and scoreSize1 >= scoreSize3}">작음</th:block>
							<th:block th:if="${scoreSize2 > scoreSize1 and scoreSize2 >= scoreSize3}">딱맞음</th:block>
							<th:block th:if="${scoreSize3 > scoreSize1 and scoreSize3 > scoreSize2}">큼</th:block>
						</dt>
						<dd>
							<span class="line"></span>
							<span class="percent">
								<th:block th:if="${scoreSize1 >= scoreSize2 and scoreSize1 >= scoreSize3}" th:text="|${scoreSize1}%|">작음</th:block>
								<th:block th:if="${scoreSize2 > scoreSize1 and scoreSize2 >= scoreSize3}" th:text="|${scoreSize2}%|">딱맞음</th:block>
								<th:block th:if="${scoreSize3 > scoreSize1 and scoreSize3 > scoreSize2}" th:text="|${scoreSize3}%|">큼</th:block>
							</span>
						</dd>
					</dl> 
				</div>
				<div class="pa_body">
					<dl th:class="${(scoreSize1 >= scoreSize2 and scoreSize1 >= scoreSize3) ? 'on' : ''}">
						<dt>작음</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreSize1+'%'}" th:styleappend="${scoreSize1} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreSize1}"></th:block>%</span>
						</dd>
					</dl> 
					<dl th:class="${(scoreSize2 >= scoreSize1 and scoreSize2 >= scoreSize3) ? 'on' : ''}">
						<dt>딱맞음</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreSize2+'%;' }" th:styleappend="${scoreSize2} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreSize2}"></th:block>%</span>
						</dd>
					</dl>
					<dl th:class="${(scoreSize3 >= scoreSize1 and scoreSize3 >= scoreSize2) ? 'on' : ''}">
						<dt>큼</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreSize3+'%;' }" th:styleappend="${scoreSize3} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreSize3}"></th:block>%</span>
						</dd>
					</dl>
				</div>
			</div>
			<div class="part_average" th:with="scoreColor1=${#numbers.formatDecimal((goodsInfo.scoreColor1*100/goodsInfo.reviewRegCnt), 0,0)}
												, scoreColor2=${#numbers.formatDecimal((goodsInfo.scoreColor2*100/goodsInfo.reviewRegCnt), 0,0)}
												, scoreColor3=${#numbers.formatDecimal((goodsInfo.scoreColor3*100/goodsInfo.reviewRegCnt), 0,0)}">
				<div class="pa_head">
					<span class="tit">컬러</span>
					<dl>
						<dt>
							<th:block th:if="${scoreColor1 >= scoreColor2 and scoreColor1 >= scoreColor3}">밝음</th:block>
							<th:block th:if="${scoreColor2 > scoreColor1 and scoreColor2 >= scoreColor3}">똑같음</th:block>
							<th:block th:if="${scoreColor3 > scoreColor1 and scoreColor3 > scoreColor2}">어두움</th:block>
						</dt>
						<dd>
							<span class="line"></span>
							<span class="percent">
								<th:block th:if="${scoreColor1 >= scoreColor2 and scoreColor1 >= scoreColor3}" th:text="|${scoreColor1}%|">밝음</th:block>
								<th:block th:if="${scoreColor2 > scoreColor1 and scoreColor2 >= scoreColor3}" th:text="|${scoreColor2}%|">똑같음</th:block>
								<th:block th:if="${scoreColor3 > scoreColor1 and scoreColor3 > scoreColor2}" th:text="|${scoreColor3}%|">어두움</th:block>
							</span>
						</dd>
					</dl> 
				</div>
				<div class="pa_body">
					<dl th:class="${(scoreColor1 >= scoreColor2 and scoreColor1 >= scoreColor3) ? 'on' : ''}">
						<dt>밝음</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreColor1+'%;' }" th:styleappend="${scoreColor1} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreColor1}"></th:block>%</span>
						</dd>
					</dl> 
					<dl  th:class="${(scoreColor2 >= scoreColor1 and scoreColor2 >= scoreColor3) ? 'on' : ''}">
						<dt>똑같음</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreColor2+'%;' }" th:styleappend="${scoreColor2} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreColor2}"></th:block>%</span>
						</dd>
					</dl>
					<dl th:class="${(scoreColor3 >= scoreColor1 and scoreColor3 >= scoreColor2) ? 'on' : ''}">
						<dt>어두움</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreColor3+'%;' }" th:styleappend="${scoreColor3} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreColor3}"></th:block>%</span>
						</dd>
					</dl>
				</div>
			</div>
			<th:block th:if="${goodsInfo.sizeGb == 'T' or goodsInfo.sizeGb == 'B'}">
			<div class="part_average" th:with="scoreFit1=${#numbers.formatDecimal((goodsInfo.scoreFit1*100/goodsInfo.reviewRegCnt), 0,0)}
												, scoreFit2=${#numbers.formatDecimal((goodsInfo.scoreFit2*100/goodsInfo.reviewRegCnt), 0,0)}
												, scoreFit3=${#numbers.formatDecimal((goodsInfo.scoreFit3*100/goodsInfo.reviewRegCnt), 0,0)}">
				<div class="pa_head">
					<span class="tit">핏</span>
					<dl>
						<dt>
							<th:block th:if="${scoreFit1 >= scoreFit2 and scoreFit1 >= scoreFit3}">슬림</th:block>
							<th:block th:if="${scoreFit2 > scoreFit1 and scoreFit2 >= scoreFit3}">레귤러</th:block>
							<th:block th:if="${scoreFit3 > scoreFit1 and scoreFit3 > scoreFit2}">오버</th:block>
						</dt>
						<dd>
							<span class="line"></span>
							<span class="percent">
								<th:block th:if="${scoreFit1 >= scoreFit2 and scoreFit1 >= scoreFit3}" th:text="|${scoreFit1}%|">슬림</th:block>
								<th:block th:if="${scoreFit2 > scoreFit1 and scoreFit2 >= scoreFit3}" th:text="|${scoreFit2}%|">레귤러</th:block>
								<th:block th:if="${scoreFit3 > scoreFit1 and scoreFit3 > scoreFit2}" th:text="|${scoreFit3}%|">오버</th:block>
							</span>
						</dd>
					</dl> 
				</div>
				<div class="pa_body">
					<dl th:class="${(scoreFit1 >= scoreFit2 and scoreFit1 >= scoreFit3) ? 'on' : ''}">
						<dt>슬림</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreFit1+'%;' }" th:styleappend="${scoreFit1} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreFit1}"></th:block>%</span>
						</dd>
					</dl> 
					<dl th:class="${(scoreFit2 >= scoreFit1 and scoreFit2 >= scoreFit3) ? 'on' : ''}">
						<dt>레귤러</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreFit2+'%;' }" th:styleappend="${scoreFit2} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreFit2}"></th:block>%</span>
						</dd>
					</dl>
					<dl th:class="${(scoreFit3 >= scoreFit1 and scoreFit3 >= scoreFit2) ? 'on' : ''}">
						<dt>오버</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreFit3+'%;' }" th:styleappend="${scoreFit3} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreFit3}"></th:block>%</span>
						</dd>
					</dl>
				</div>	
			</div>
			<div class="part_average" th:with="scoreThick1=${#numbers.formatDecimal((goodsInfo.scoreThick1*100/goodsInfo.reviewRegCnt), 0,0)}
												, scoreThick2=${#numbers.formatDecimal((goodsInfo.scoreThick2*100/goodsInfo.reviewRegCnt), 0,0)}
												, scoreThick3=${#numbers.formatDecimal((goodsInfo.scoreThick3*100/goodsInfo.reviewRegCnt), 0,0)}">
				<div class="pa_head">
					<span class="tit">두께감</span>
					<dl>
						<dt>
							<th:block th:if="${scoreThick1 >= scoreThick2 and scoreThick1 >= scoreThick3}">얇음</th:block>
							<th:block th:if="${scoreThick2 > scoreThick1 and scoreThick2 >= scoreThick3}">적당함</th:block>
							<th:block th:if="${scoreThick3 > scoreThick1 and scoreThick3 > scoreThick2}">도톰함</th:block>
						</dt>
						<dd>
							<span class="line"></span>
							<span class="percent">
								<th:block th:if="${scoreThick1 >= scoreThick2 and scoreThick1 >= scoreThick3}" th:text="|${scoreThick1}%|">얇음</th:block>
								<th:block th:if="${scoreThick2 > scoreThick1 and scoreThick2 >= scoreThick3}" th:text="|${scoreThick2}%|">적당함</th:block>
								<th:block th:if="${scoreThick3 > scoreThick1 and scoreThick3 > scoreThick2}" th:text="|${scoreThick3}%|">도톰함</th:block>
							</span>
						</dd>
					</dl> 
				</div>
				<div class="pa_body">
					<dl th:class="${(scoreThick1 >= scoreThick2 and scoreThick1 >= scoreThick3) ? 'on' : ''}">
						<dt>얇음</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreThick1+'%;' }" th:styleappend="${scoreThick1} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreThick1}"></th:block>%</span>
						</dd>
					</dl> 
					<dl th:class="${(scoreThick2 >= scoreThick1 and scoreThick2 >= scoreThick3) ? 'on' : ''}">
						<dt>적당함</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreThick2+'%;' }" th:styleappend="${scoreThick2} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreThick2}"></th:block>%</span>
						</dd>
					</dl>
					<dl th:class="${(scoreThick3 >= scoreThick1 and scoreThick3 >= scoreThick2) ? 'on' : ''}">
						<dt>도톰함</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreThick3+'%;' }" th:styleappend="${scoreThick3} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreThick3}"></th:block>%</span>
						</dd>
					</dl>
				</div>
			</div>
			</th:block>
			<th:block  th:if="${goodsInfo.sizeGb == 'S'}">
			<div class="part_average" th:with="scoreWeight1=${#numbers.formatDecimal((goodsInfo.scoreWeight1*100/goodsInfo.reviewRegCnt), 0,0)}
											, scoreWeight2=${#numbers.formatDecimal((goodsInfo.scoreWeight2*100/goodsInfo.reviewRegCnt), 0,0)}
											, scoreWeight3=${#numbers.formatDecimal((goodsInfo.scoreWeight3*100/goodsInfo.reviewRegCnt), 0,0)}">
				<div class="pa_head">
					<span class="tit">무게감</span>
					<dl>
						<dt>
							<th:block th:if="${scoreWeight1 >= scoreWeight2 and scoreWeight1 >= scoreWeight3}">가벼움</th:block>
							<th:block th:if="${scoreWeight2 > scoreWeight1 and scoreWeight2 >= scoreWeight3}">적당함</th:block>
							<th:block th:if="${scoreWeight3 > scoreWeight1 and scoreWeight3 > scoreWeight2}">무거움</th:block>
						</dt>
						<dd>
							<span class="line"></span>
							<span class="percent">
								<th:block th:if="${scoreWeight1 >= scoreWeight2 and scoreWeight1 >= scoreWeight3}" th:text="|${scoreWeight1}%|">가벼움</th:block>
								<th:block th:if="${scoreWeight2 > scoreWeight1 and scoreWeight2 >= scoreWeight3}" th:text="|${scoreWeight2}%|">적당함</th:block>
								<th:block th:if="${scoreWeight3 > scoreWeight1 and scoreWeight3 > scoreWeight2}" th:text="|${scoreWeight3}%|">무거움</th:block>
							</span>
						</dd>
					</dl> 
				</div>
				<div class="pa_body">
					<dl th:class="${(scoreWeight1 >= scoreWeight2 and scoreWeight1 >= scoreWeight3) ? 'on' : ''}">
						<dt>가벼움</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreWeight1+'%;' }" th:styleappend="${scoreWeight1} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreWeight1}"></th:block>%</span>
						</dd>
					</dl> 
					<dl th:class="${(scoreWeight2 >= scoreWeight1 and scoreWeight2 >= scoreWeight3) ? 'on' : ''}">
						<dt>적당함</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreWeight2+'%;' }" th:styleappend="${scoreWeight2} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreWeight2}"></th:block>%</span>
						</dd>
					</dl>
					<dl th:class="${(scoreWeight3 >= scoreWeight1 and scoreWeight3 >= scoreWeight2) ? 'on' : ''}">
						<dt>무거움</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreWeight3+'%;' }" th:styleappend="${scoreWeight3} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreWeight3}"></th:block>%</span>
						</dd>
					</dl>
				</div>
			</div>
			<div class="part_average" th:with="scoreBall1=${#numbers.formatDecimal((goodsInfo.scoreBall1*100/goodsInfo.reviewRegCnt), 0,0)}
											, scoreBall2=${#numbers.formatDecimal((goodsInfo.scoreBall2*100/goodsInfo.reviewRegCnt), 0,0)}
											, scoreBall3=${#numbers.formatDecimal((goodsInfo.scoreBall3*100/goodsInfo.reviewRegCnt), 0,0)}">
				<div class="pa_head">
					<span class="tit">볼너비</span>
					<dl>
						<dt>
							<th:block th:if="${scoreBall1 >= scoreBall2 and scoreBall1 >= scoreBall3}">작음</th:block>
							<th:block th:if="${scoreBall2 > scoreBall1 and scoreBall2 >= scoreBall3}">딱맞음</th:block>
							<th:block th:if="${scoreBall3 > scoreBall1 and scoreBall3 > scoreBall2}">큼</th:block>
						</dt>
						<dd>
							<span class="line"></span>
							<span class="percent">
								<th:block th:if="${scoreBall1 >= scoreBall2 and scoreBall1 >= scoreBall3}" th:text="|${scoreBall1}%|">작음</th:block>
								<th:block th:if="${scoreBall2 > scoreBall1 and scoreBall2 >= scoreBall3}" th:text="|${scoreBall2}%|">딱맞음</th:block>
								<th:block th:if="${scoreBall3 > scoreBall1 and scoreBall3 > scoreBall2}" th:text="|${scoreBall3}%|">큼</th:block>
							</span>
						</dd>
					</dl> 
				</div>
				<div class="pa_body">
					<dl th:class="${(scoreBall1 >= scoreBall2 and scoreBall1 >= scoreBall3) ? 'on' : ''}">
						<dt>작음</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreBall1+'%;' }" th:styleappend="${scoreBall1} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreBall1}"></th:block>%</span>
						</dd>
					</dl> 
					<dl th:class="${(scoreBall2 >= scoreBall1 and scoreBall2 >= scoreBall3) ? 'on' : ''}">
						<dt>딱맞음</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreBall2+'%;' }" th:styleappend="${scoreBall2} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreBall2}"></th:block>%</span>
						</dd>
					</dl>
					<dl th:class="${(scoreBall3 >= scoreBall1 and scoreBall3 >= scoreBall2) ? 'on' : ''}">
						<dt>큼</dt>
						<dd>
							<span class="ratio">
								<em class="progbar" th:style="${'width:'+scoreBall3+'%;' }" th:styleappend="${scoreBall3} <= 0 ? '; margin-left:-8px': ''"></em>
							</span>
							<span class="percent"><th:block th:text="${scoreBall3}"></th:block>%</span>
						</dd>
					</dl>
				</div>
			</div>
			</th:block>
			<div class="btn_group_flex">
				<div>
					<button type="button" class="btn btn_default">
						<span></span>
					</button>
				</div>
			</div>
			<script>
			 function averag(){
				 var averagBtn=$(".average .btn_group_flex button");
				 var averag=$(".average .pa_body");
				 averagBtn.on('click',function(e){
					 averag.slideToggle();
					 $(this).toggleClass("active")	
				 });  
			 }
			 averag();
			</script>
		</div>
		</th:block>
		<!-- //착용정보 있을 시 노출 -->
		<div class="info_review">
			<p>
				<i class="ico_point"></i>상품 리뷰 작성 시 <span>스타일포인트 추가 적립!</span>
			</p>
			<div>
				<dl>
					<dt>일반리뷰</dt>
					<dd th:text="|${#numbers.formatInteger(reviewPoint.textReviewPoint, 0,'COMMA')}P|">150P</dd>
				</dl>
				<dl>
					<dt>포토/영상 리뷰</dt>
					<dd th:text="|${#numbers.formatInteger(reviewPoint.photoReviewPoint, 0,'COMMA')}P|">350P</dd>
				</dl>
				<dl>
					<dt>베스트 리뷰</dt>
					<dd th:text="|${#numbers.formatInteger(reviewPoint.bestReviewPoint, 0,'COMMA')}P|">10,000P</dd>
				</dl>
			</div>
		</div>
	</div>
	<div class="area_rv_best" th:if="${bestReviewList != null and !bestReviewList.empty}">
		<div class="riview_box">
			<h6>베스트 리뷰</h6>
			<div class="area_slider" id="btn_pdBestReview_pop">
				<div class="swiper-container">
					<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}]])">
									<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로 표기 -->
										</span>
										<em class="ico ico_besttag"></em>
									</div>
									<div class="lap">
										<div class="pic" th:if="${bestReview.reviewAttachList != null and !bestReview.reviewAttachList.empty}">
											<th:block th:each="reviewAttach, attachStatus : ${bestReview.reviewAttachList}" th:if="${attachStatus.first}">
												<th:block th:if="${reviewAttach.fileGb == 'M'}">
											<span class="thumb mov" th:style="${'background-image:url('+kollusMediaUrl+'/poster/'+reviewAttach.kmcKey+');'}"></span><!-- 동영상의 썸네일일 경우 mov 클래스 추가 -->
												</th:block>
												<th:block th:unless="${reviewAttach.fileGb == 'M'}">
											<span class="thumb" th:style="${'background-image:url('+imgUrl+ reviewAttach.sysFileNm+');'}"></span>
												</th:block>
											</th:block>
										</div>
										<div class="txt_best_review">
											<p th:text="${bestReview.reviewContent}">옷</p>
										</div>
									</div>
								</a>
							</div>
						</div>
					</div>
					<!-- Add Pagination -->
					<div class="swiper-pagination"></div>
				</div>
			</div>
		</div>
	</div>
	<div class="area_rv_photo" th:if="${photoReviewList != null and !photoReviewList.empty}">
		<h6>포토/영상 리뷰</h6>
		<div class="photo_list">
			<ul>
				<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}]])">
						<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 클래스 추가 -->
							</th:block>
							<th:block th:unless="${reviewAttach.fileGb == 'M'}">
							<span class="thumb" th:style="${'background-image:url('+imgUrl+ reviewAttach.sysFileNm+');'}"></span>
							</th:block>
						</div>
					</a>
					</th:block>
					</th:block>
				</li>
			</ul>
			<!-- 포토영상 게시글 최대 8개 & 버튼노출 -->
			<div th:if="${#lists.size(photoReviewList) >= 9}">
				<div>
					<button type="button" id="btn_more_photoreview" th:onclick="cfGoodsReviewPhoto([[${goodsInfo.goodsCd}]])"><span>더 보기</span></button>
				</div>	
			</div>
			<!-- //포토영상 게시글 최대 7개 & 버튼노출 -->
		</div>
	</div>
	<div class="area_rv_all" style="display:none;">
	<form id="goodsReviewForm" name="goodsReviewForm" action="#" th:action="@{'/goods/review/list'}">
	<input type="hidden" name="pageNo" value ="1"/>
	<input type="hidden" name="pageSize" value ="20"/>
	<input type="hidden" name="goodsCd" th:value ="${goodsInfo.goodsCd}"/>
	<input type="hidden" name="goodsType" th:value ="${goodsInfo.goodsType}"/>
	<input type="hidden" name="selfGoodsYn" th:value ="${goodsInfo.selfGoodsYn}"/>
	<input type="hidden" name="reviewScore" />
	<input type="hidden" name="reviewOption" />
	<input type="hidden" name="reviewHeight" />
	<input type="hidden" name="reviewWeight" />
	
		<h6>전체리뷰<span id="reviewCount" th:text="|(${(reviewCount <= 9999) ? #numbers.formatInteger(reviewCount, 0,'COMMA') : '9,999+'})|">9,999+</span></h6>
		<div class="selection">
			<ul class="category_open">
				<li data_name="grade"><span>평점 전체</span></li>
				<th:block th:if="${reviewOptionList != null and !reviewOptionList.empty}">
				<li data_name="size"><span th:text="${(goodsInfo.selfGoodsYn == 'Y')? '사이즈 전체':'옵션 전체'}">사이즈 전체</span></li>
				</th:block>
				<li data_name="height" th:if="${reviewHeightList != null and !reviewHeightList.empty}"><span>키 전체</span></li>
				<li data_name="weight"><span>몸무게 전체</span></li>
			</ul>
		</div>
		<!-- 나열조건결과 있을 때 노출 내용 -->
		<div class="review_list" id="listBoxOuter">
			<ul  id="listBox">
			</ul>
		</div>
		<div class="review_last"  style="display:none;">
			마지막 게시글입니다.
		</div>
		<!-- //나열조건결과 있을 때 노출 내용 -->
		<!-- 나열조건결과 없을 때 노출 내용 -->
		<div class="nodata"  style="display:none;">
			<div class="txt_box">
				<p>
					선택하신 조건에 맞는 리뷰가 없습니다.<br>
					조건을 변경해 보세요.
				</p>
			</div>
			<div class="btn_group_flex">
				<div><button type="button" class="btn btn_default"  onclick="fnReviewSearchInit();"><span>선택한 조건 초기화</span></button></div>
			</div>
		</div>
		<!-- //나열조건결과 없을 때 노출 내용 -->
	</form>	
	</div>
	<!-- //등록리뷰 있을 시 -->
</div>
<div class="category_box review_cate_box">
	<div class="lap">
		<div class="category_close" onclick="fnReviewCateClose();">카테고리닫기</div>
		<div class="category_list">
			<!-- 평점,사이즈,키,몸무게 카테고리 -->
			<div class="category" id="grade">
				<ul class="n1">
					<li class="active"><a href="javascript:void(0)" data="평점 전체" onclick="fnReviewSearch('A','');">전체</a></li>
					<li><a href="javascript:void(0)" data="5점" onclick="fnReviewSearch('A','5');">5점&nbsp;★★★★★</a></li>
					<li><a href="javascript:void(0)" data="4점" onclick="fnReviewSearch('A','4');">4점&nbsp;★★★★</a></li>
					<li><a href="javascript:void(0)" data="3점" onclick="fnReviewSearch('A','3');">3점&nbsp;★★★</a></li>
					<li><a href="javascript:void(0)" data="2점" onclick="fnReviewSearch('A','2');">2점&nbsp;★★</a></li>
					<li><a href="javascript:void(0)" data="1점" onclick="fnReviewSearch('A','1');">1점&nbsp;★</a></li>
				</ul>
			</div>
			<div class="category" id="size" th:if="${reviewOptionList != null and !reviewOptionList.empty}">
				<ul class="n2"> 
					<li class="active"><a href="javascript:void(0)"  th:attr="data=${(goodsInfo.selfGoodsYn == 'Y')? '사이즈 전체' :'옵션 전체'}" onclick="fnReviewSearch('O','');">전체</a></li>
					<li th:each="reviewOption, status : ${reviewOptionList}">
						<a href="javascript:void(0)" th:attr="data=${reviewOption.optCd}" th:onclick="fnReviewSearch('O',[[${reviewOption.optCd}]]);"><th:block th:text="${reviewOption.optCd}"></th:block></a>
						<input type="hidden" name="selOption" th:value="${reviewOption.optCd}"/>
					</li>
				</ul>
			</div>
			<div class="category" id="height" th:if="${reviewHeightList != null and !reviewHeightList.empty}">
				<ul class="n2">
					<li class="active"><a href="javascript:void(0)" data="키 전체" onclick="fnReviewSearch('H','');">전체</a></li>
					<li th:each="reviewHeight, status : ${reviewHeightList}">
						<a href="javascript:void(0)" th:attr="data=${reviewHeight.cdNm}" th:onclick="fnReviewSearch('H',[[${reviewHeight.cd}]]);"><th:block th:text="${reviewHeight.cdNm}"></th:block></a>
						<input type="hidden" name="selHeight" th:value="${reviewHeight.cd}"/>
					</li>
				</ul>
			</div>
			<div class="category" id="weight" th:if="${reviewWeightList != null and !reviewWeightList.empty}">
				<ul class="n2">
					<li class="active"><a href="javascript:void(0)" data="몸무게 전체" onclick="fnReviewSearch('W','');">전체</a></li>
					<li th:each="reviewWeight, status : ${reviewWeightList}">
						<a href="javascript:void(0)" th:attr="data=${reviewWeight.cdNm}" th:onclick="fnReviewSearch('W',[[${reviewWeight.cd}]]);"><th:block th:text="${reviewWeight.cdNm}"></th:block></a>
						<input type="hidden" name="selWeight" th:value="${reviewWeight.cd}"/>
					</li>
				</ul>
			</div>
			<!-- //평점,사이즈,키,몸무게 카테고리 -->
		</div>
	</div>
</div>

<script src="/ux/plugins/jquery/jquery.history.min.js"></script>
<script src="/ux/plugins/gaga/gaga.infinite.scrollLayer.js"></script>
<script th:inline="javascript">
/*<![CDATA[*/
	
	$(function() { gagaInfiniteScroll.getHistory(); });
	
	// 상품펴 검색
	var fnGetInfiniteScrollDataList = function(pageNum) {
	
		$("#goodsReviewForm input[name=pageNo]").val(pageNum+1);
		// 콜백함수인 gagaInfiniteScroll.jsonToHtml 에서는 fnDrawInfiniteScrollData 함수를 호출한다.
		gagajf.ajaxFormSubmit("/goods/review/list", document.goodsReviewForm,  gagaInfiniteScroll.jsonToHtml);
	}
	
	var fnDrawInfiniteScrollData = function(result, pageNum){
		if (result.dataList != null && result.dataList.length > 0) {
			$('.area_rv_all').show();
			var htm = fnCreateGoodsReviewList(result);
			gagaInfiniteScroll.draw(htm);
		}else {
			if($("#goodsReviewForm input[name=pageNo]").val()==1){
				$('#goodsReviewForm').find('.nodata').show();
				$('#goodsReviewForm').find('.review_list').hide();
			}
			gagaInfiniteScroll.draw('not');
		}
	}

	var fnGoodsReviewListSearch = function() {
		fnGoodsReviewInfiniteScrollInit();
		gagaInfiniteScroll.getHistory();
	}
	
	// 상품평 검색조건 클릭시
	var fnReviewSearch = function(flag, val){
		
		let reviewScore = $('#goodsReviewForm input[name=reviewScore]').val();
		let reviewOption = $('#goodsReviewForm input[name=reviewOption]').val();
		let reviewHeight = $('#goodsReviewForm input[name=reviewHeight]').val();
		let reviewWeight = $('#goodsReviewForm input[name=reviewWeight]').val();
		
		if (flag == 'A'){ //평점
			reviewScore = val;
		}else if (flag == 'O'){ //옵션
			reviewOption = val;
		}else if (flag == 'H'){ //키
			reviewHeight = val;
		}else{ //무게
			reviewWeight = val;
		}
		
		let changFlag = false;
		if ($('#goodsReviewForm input[name=reviewScore]').val() != reviewScore){
			changFlag = true;
		}else if ($('#goodsReviewForm input[name=reviewOption]').val() != reviewOption){
			changFlag = true;
		}else if ($('#goodsReviewForm input[name=reviewHeight]').val() != reviewHeight){
			changFlag = true;
		}else if ($('#goodsReviewForm input[name=reviewWeight]').val() != reviewWeight){
			changFlag = true;
		}
		
		$('#goodsReviewForm input[name=reviewScore]').val(reviewScore);
		$('#goodsReviewForm input[name=reviewOption]').val(reviewOption);
		$('#goodsReviewForm input[name=reviewHeight]').val(reviewHeight);
		$('#goodsReviewForm input[name=reviewWeight]').val(reviewWeight);
		
		if (changFlag) {
			fnReviewCateClose();
			fnGoodsReviewInfiniteScrollInit();
			fnGoodsReviewListSearch();
		}
		
	}
	
	var fnCreateGoodsReviewList = function(result) {

		let tag = '';
		
		$.each(result.dataList, function(idx, item) {
			$('#goodsReviewForm').find('.nodata').hide();
			$('#goodsReviewForm').find('.review_list').show();
			
			tag += '<li>\n';
			tag += '<div class="review">\n';
			tag += '	<div class="info_box">\n';
			tag += '		<div class="star_score">\n';
			tag += '			<span class="star">\n';
			tag += '				<em class="progbar" style="width:'+(item.score*20)+'%;"></em>\n'; //<!-- 평점 style로 표기 -->
			tag += '			</span>\n';
			tag += '		</div>\n';
			tag += '		<div class="writer">\n';
			tag += '			<span class="wr_id">'+ item.maskingCustId +'</span>\n';
			tag += '			<span class="wr_date">' + item.regDt + '</span>\n';
			tag += '		</div>\n';
			tag += '	</div>\n';
			tag += '	<div class="response_box">\n';
			tag += '		<div>\n';
			tag += '			<dl>\n';
			tag += '				<div>\n';
			tag += '					<dt>구매옵션</dt>\n';
			tag += '					<dd>\n';
			if (item.goodsOptionList != null && item.goodsOptionList.length > 0){
				$.each(item.goodsOptionList, function(gIdx, goodsOption){
			tag += '					'+ gagajf.convNull(goodsOption.optCd1Nm,'') +' / '+ gagajf.convNull(goodsOption.optCd2,'');
				if (item.goodsOptionList.length != (gIdx+1)){
			tag += '					,';
				}
				});
			}
			tag += '					</dd>\n';
			tag += '				</div>\n';
			
			// 2021.08.11
			if (item.height > 0 || item.weight > 0) {
				tag += '				<div>\n';
				tag += '					<dt>키/몸무게</dt>\n';
				tag += '					<dd>'+ item.height +'cm/'+ item.weight +'kg</dd>\n';
				tag += '				</div>\n';
			}
			tag += '			</dl>\n';
			tag += '		</div>\n';
			tag += '	</div>\n';
			tag += '	<div class="photo_box">\n';
			tag += '		<div class="photo_list">\n';
			tag += '			<ul>\n';
			if (item.reviewAttachList != null && item.reviewAttachList.length > 0){
				var fileGbClass = '';
				$.each(item.reviewAttachList, function(aIdx, reviewAttach){
//					fileGbClass = '';
//					if (reviewAttach == "M") fileGbClass = "mov";
			tag += '				<li>\n';
			tag += '					<a href="javascript:void();" 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';
				}else{
			tag +='								<span class="thumb" style="background-image:url('+ _imgUrl + reviewAttach.sysFileNm +');\" ></span>\n';
				}
			tag += '						</div>\n';
			tag += '					</a>\n';
			tag += '				</li>\n';		
				});	
			}
			tag += '			</ul>\n';
			tag += '		</div>\n';
			tag += '	</div>\n';
			tag += '	<div class="txt_review_box">\n';
			tag += '		<p>' + item.reviewContent.replaceAll("\n", "</br>") +'</p>\n';
			tag += '	</div>\n';
			
			tag += '	<div class="response_box2">\n';
			tag += '		<div>\n';
			tag += '			<dl>\n';
			if (!gagajf.isNull(item.sizeGb) ){	// 사이즈구분값이 있을경우 노출
				tag += '				<div>\n';
				tag += '					<dt>사이즈</dt>\n';
				tag += '					<dd>'+ gagajf.convNull(item.scoreSizeNm,'') +'</dd>\n';
				tag += '				</div>\n';
				tag += '				<div>\n';
				tag += '					<dt>컬러</dt>\n';
				tag += '					<dd>'+ gagajf.convNull(item.scoreColorNm,'') +'</dd>\n';
				tag += '				</div>\n';
			if (item.sizeGb == 'T' || item.sizeGb == 'B'){
				tag += '				<div>\n';
				tag += '					<dt>핏</dt>\n';
				tag += '					<dd>'+ gagajf.convNull(item.scoreFitNm,'') +'</dd>\n';
				tag += '				</div>\n';
				tag += '				<div>\n';
				tag += '					<dt>두께감</dt>\n';
				tag += '					<dd>'+ gagajf.convNull(item.scoreThickNm,'') +'</dd>\n';
				tag += '				</div>\n';	
			}
			if (item.sizeGb == 'S' ){
				tag += '				<div>\n';
				tag += '					<dt>무게감</dt>\n';
				tag += '					<dd>'+ gagajf.convNull(item.scoreWeightNm,'') +'</dd>\n';
				tag += '				</div>\n';
				tag += '				<div>\n';
				tag += '					<dt>볼너비</dt>\n';
				tag += '					<dd>'+ gagajf.convNull(item.scoreBallNm,'') +'</dd>\n';
				tag += '				</div>\n';	
			}
			}
			tag += '			</dl>\n';
			tag += '		</div>\n';
			tag += '	</div>\n';
			if (!gagajf.isNull(item.admRpl)){
				tag += '	<div class="reply_box">\n';
				tag += '		<div class="reply">\n';
				tag += '			<div class="reply_writer">\n';
				tag += '				<span class="wr_name">관리자</span>\n';
				tag += '				<span class="wr_date">'+item.admRplDt+'</span>\n';
				tag += '			</div>\n';
				tag += '			<div class="reply_txt">\n';
				tag += '				<p>' + item.admRpl.replaceAll("\n", "</br>")+'</p>\n';
				tag += '			</div>\n';
				tag += '		</div>\n';
				tag += '	</div>\n';	
			}
			tag += '</div>\n';
			tag += '</li>\n';
			
		});
		return tag;
	}
	
	// 인피니트 스크롤 초기화
	var fnGoodsReviewInfiniteScrollInit = function(){
		// sessionStorage.removeItem(document.location.href);
		History.replaceState(null, null);
		gagaInfiniteScroll.pageStatus = {
				  pageNum : []      // [0,1,2...] 로드된 페이지 (Array)
				, loadPage : 0      // 로드할 페이지
				, loadAlign : 'not' // 로드 상태(prev, next, not)
				, historyScroll : 0 //
				, nowPage : null    // 현재 페이지
				, pageUrl : {       // page url
				}
		}
		//History 초기화
		$("#listBox").html("");;
	}
	
	// 상품평 초기화
	var fnReviewSearchInit = function(){

		$(".pd_review .category_box.review_cate_box").find('#grade').find('ul li').eq(0).trigger('click');
		$(".pd_review .category_box.review_cate_box").find('#size').find('ul li').eq(0).trigger('click');
		$(".pd_review .category_box.review_cate_box").find('#height').find('ul li').eq(0).trigger('click');
		$(".pd_review .category_box.review_cate_box").find('#weight').find('ul li').eq(0).trigger('click');
		
		//$('#goodsReviewForm').find('#grade').find('ul li').eq(0).trigger('click');
		//$('#goodsReviewForm').find('#size').find('ul li').eq(0).trigger('click');
		//$('#goodsReviewForm').find('#height').find('ul li').eq(0).trigger('click');
		//$('#goodsReviewForm').find('#weight').find('ul li').eq(0).trigger('click');
		
		
		$('#goodsReviewForm input[name=reviewScore]').val('');
		$('#goodsReviewForm input[name=reviewOption]').val('');
		$('#goodsReviewForm input[name=reviewHeight]').val('');
		$('#goodsReviewForm input[name=reviewWeight]').val('');
		
		//fnGetList();
		
		fnReviewCateClose();
		fnGoodsReviewInfiniteScrollInit();
		fnGoodsReviewListSearch();
	}
	
	var fnReviewCateClose = function(){
		$(".pd_review .category_box").hide();
	}
	
	//210615_ 수정 : 제품리뷰 > 카테고리 팝업 선택자 [.review_cate_box] 변경.
	//팝업 - 제품리뷰 > 카테고리팝오픈
	// 오픈
    $(document).on('click','.pd_review .category_open > li',function(e){
		var dataName=$(this).attr("data_name");
        $(".review_cate_box").show();
		$(".review_cate_box").find(".category").hide();
		$(".review_cate_box").find("#"+dataName).show();
		return false;
    });
	// 닫기
	$(document).on('click','.review_cate_box .category_close',function(e){
		$(".review_cate_box").hide();
        return false;
    });
	// 변경
    $(document).on('click','.review_cate_box ul > li',function(e){
		var num=$(".pd_review .category_open > li").length;
		var value=$(this).find("a").attr("data");
		var name=$(this).parent().parent().attr("id");
		$(this).parent().find("li").removeClass("active");
		$(this).addClass("active");
		for(var i=0; i < num; i++){
			var dataname=$(".pd_review .category_open > li").eq(i).attr("data_name");
			if(name==dataname){
				$(".pd_review .category_open > li").eq(i).find("span").text(value);
			}
		}
        return false;
    });

	
	$(document).ready( function() {

		//슬라이드 - 베스트리뷰
		var riviewSwiper = new Swiper('.riview_box .area_slider .swiper-container', {
			observer: true,
			observeParents: true,
			slidesPerView: 1,
			spaceBetween: 8,
			//loop: true,
			pagination: {
				el: '.swiper-pagination',
				type: 'fraction',
			},
		});	
		
	});
	
/*]]>*/
</script>
 </html>