GoodsReviewDetailFormWeb.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org">
  4. <!--
  5. *******************************************************************************
  6. * * @source : GoodsReviewDetailFormWeb.html
  7. * @desc : 상품평 상세 팝업
  8. *============================================================================
  9. * STYLE24
  10. * Copyright(C) 2020 TSIT, All rights reserved.
  11. *============================================================================
  12. * VER DATE AUTHOR DESCRIPTION
  13. * === =========== ========== =============================================
  14. * 1.0 2021.03.02 eskim 최초 작성
  15. *******************************************************************************
  16. -->
  17. <div class="modal-dialog" role="document" th:with="imgGoodsUrl=${@environment.getProperty('upload.goods.view')}, uxImgUrl=${@environment.getProperty('domain.uximage')}, imgUrl=${@environment.getProperty('upload.image.view')}">
  18. <div class="modal-content">
  19. <div class="modal-header">
  20. <th:block th:if="${review.bestYn == 'Y'}">
  21. <h5 class="modal-title" id="pdBestReviewLabel">베스트 리뷰</h5>
  22. </th:block>
  23. <th:block th:unless="${review.bestYn == 'Y'}">
  24. <h5 class="modal-title" id="pdPhotoReviewDetailLabel">포토/영상 리뷰</h5>
  25. <button type="button" id="btn_pdPhotoReviewList_pop" th:onclick="cfGoodsReviewPhoto([[${params.goodsCd}]])" class="btn_more"><span>전체보기</span></button>
  26. </th:block>
  27. </div>
  28. <div class="modal-body" id="reviewBody">
  29. </div>
  30. </div>
  31. </div>
  32. <form name="reviewDetailForm" id="reviewDetailForm" method="post">
  33. <input type="hidden" name="goodsCd" th:value="${review.goodsCd}" />
  34. <input type="hidden" name="bestYn" th:value="${review.bestYn}" />
  35. <input type="hidden" name="photoYn" th:value="${review.photoYn}" />
  36. <input type="hidden" name="reviewSq" th:value="${review.reviewSq}" />
  37. </form>
  38. <a href="javascript:void(0);" rel="modal:close" onclick="cfCloseLayer('layer_review_best')" class="close-modal">Close</a>
  39. <script th:inline="javascript">
  40. /*<![CDATA[*/
  41. var fnReviewDetail = function() {
  42. var params = new Object();
  43. params.goodsCd = $('#reviewDetailForm input[name=goodsCd]').val();
  44. params.reviewSq = $('#reviewDetailForm input[name=reviewSq]').val();
  45. params.bestYn =$('#reviewDetailForm input[name=bestYn]').val();
  46. params.photoYn = $('#reviewDetailForm input[name=photoYn]').val();
  47. gagajf.ajaxSubmit("/goods/review/detail/list", "json", fnReviewDetailCallback, params);
  48. }
  49. var fnReviewDetailCallback = function(result) {
  50. $('#reviewBody').html('');
  51. // 목록
  52. if (result.reviewList != null && result.reviewList.length > 0) {
  53. let fileGbClass = '';
  54. $.each(result.reviewList, function(idx, review) {
  55. let tag = '';
  56. tag +='<div class="pop_cont">\n';
  57. tag +='<div class="swiper-container detail">\n';
  58. tag +='<div class="swiper-wrapper">\n';
  59. tag +='<div class="swiper-slide">\n';
  60. let reviewClass = 'empty_photo';
  61. if (review.reviewAttachList != null && review.reviewAttachList.length > 0){
  62. reviewClass = '';
  63. }
  64. tag +='<div class="review '+reviewClass+'" >\n'; <!-- 첨부이미지 없을 시 empty_photo 클래스 추가 -->
  65. tag +=' <div class="pic">\n';
  66. if (review.reviewAttachList != null && review.reviewAttachList.length > 0){
  67. $.each(review.reviewAttachList, function(aIdx, reviewAttach){
  68. fileGbClass = '';
  69. if (reviewAttach.fileGb == "M") fileGbClass = "mov";
  70. tag +=' <span class="thumb '+fileGbClass+'">\n';<!-- 동영상의 썸네일일 경우 mov 클래스 추가-->
  71. if (reviewAttach.fileGb == "M") {
  72. tag +=' <iframe width="100%" height="100%" src="'+_kollusMediaUrl +'/'+reviewAttach.kmcKey +'?player_version=html5" frameborder="0" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>\n';
  73. }else{
  74. tag +=' <img src="'+ _imgUrl + reviewAttach.sysFileNm +'" alt="">\n';
  75. }
  76. tag +=' </span>\n';
  77. return false;
  78. });
  79. }else{
  80. tag +=' <span class="thumb">\n';
  81. tag +=' <img src="'+_uploadGoodsUrl +'/'+review.sysImgNm+'?RS=365" alt="" onerror="' + _uximgUrl + '/images/pc/thumb/bg_item_none.png" />\n';
  82. tag +=' </span>\n';
  83. }
  84. tag +=' </div>\n';
  85. tag +=' <div class="review_cont">\n';
  86. tag +=' <div class="box_wrap">\n';
  87. tag +=' <div class="star_box">\n';
  88. tag +=' <div class="star_score">\n';
  89. tag +=' <span class="star">\n';
  90. tag +=' <em class="progbar" style="width:'+(review.iscore*20)+'%;"></em>\n'; <!-- 평점 style로 표기 -->
  91. tag +=' </span>\n';
  92. tag +=' </div>\n';
  93. tag +=' </div>\n';
  94. tag +=' <div class="response_box">\n';
  95. tag +=' <div class="full">\n';
  96. tag +=' <dl>\n';
  97. tag +=' <div>\n';
  98. tag +=' <dt>구매옵션</dt>\n';
  99. if (review.goodsOptionList != null && review.goodsOptionList.length > 0){
  100. tag +=' <dd>\n';
  101. $.each(review.goodsOptionList, function(aIdx, reviewGoods){
  102. tag +=' <p><span>'+ reviewGoods.optCd1Nm +'</span> / <span>'+ reviewGoods.optCd2+'</span></p>\n';
  103. });
  104. tag +=' <dd>\n';
  105. }
  106. tag +=' </div>\n';
  107. tag +=' </dl>\n';
  108. tag +=' </div>\n';
  109. tag +=' <div class="full">\n';
  110. tag +=' <dl>\n';
  111. tag +=' <div>\n';
  112. tag +=' <dt>키/몸무게</dt>\n';
  113. tag +=' <dd>'+review.height+'cm / '+review.weight +'kg \n';
  114. tag +=' </dd>\n';
  115. tag +=' </div>\n';
  116. tag +=' </dl>\n';
  117. tag +=' </div>\n';
  118. if (!gagajf.isNull(review.sizeGb)){ <!-- 사이즈구분(T:상의, B:하의, S:신발) -->
  119. tag +=' <div>\n';
  120. tag +=' <dl > \n';
  121. tag +=' <div>\n';
  122. tag +=' <dt>사이즈</dt>\n';
  123. tag +=' <dd>'+review.scoreSizeNm+'</dd>\n';
  124. tag +=' </div>\n';
  125. tag +=' <div>\n';
  126. tag +=' <dt>컬러</dt>\n';
  127. tag +=' <dd>'+review.scoreColorNm+'</dd>\n';
  128. tag +=' </div>\n';
  129. if (review.sizeGb == 'T' || review.sizeGb == 'B'){
  130. tag +=' <div>\n';
  131. tag +=' <dt>핏</dt>\n';
  132. tag +=' <dd>'+review.scoreFitNm+'</dd>\n';
  133. tag +=' </div>\n';
  134. tag +=' <div>\n';
  135. tag +=' <dt>두께감</dt>\n';
  136. tag +=' <dd>'+ review.scoreThickNm+'</dd>\n';
  137. tag +=' </div>\n';
  138. }
  139. if (review.sizeGb == 'S'){
  140. tag +=' <div>\n';
  141. tag +=' <dt>무게감</dt>\n';
  142. tag +=' <dd>'+review.scoreWeightNm+'</dd>\n';
  143. tag +=' </div>\n';
  144. tag +=' <div>\n';
  145. tag +=' <dt>볼너비</dt>\n';
  146. tag +=' <dd>'+review.scoreBallNm+'</dd>\n';
  147. tag +=' </div>\n';
  148. }
  149. tag +=' </dl>\n';
  150. tag +=' </div>\n';
  151. }
  152. tag +=' </div>\n';
  153. tag +=' <div class="txt_review_box">\n';
  154. tag +=' <p>' + review.reviewContent +'</p>\n';
  155. tag +=' </div>\n';
  156. tag +=' <div class="writer_box">\n';
  157. tag += ' <div class="writer">\n';
  158. tag += ' <span class="wr_id">'+ review.maskingCustId +'</span>\n';
  159. tag += ' <span class="wr_date">' + review.regDt + '</span>\n';
  160. tag += ' </div>\n'
  161. tag +=' </div>\n';
  162. if (!gagajf.isNull(review.admRpl)){
  163. tag += ' <div class="reply_box">\n';
  164. tag += ' <div class="reply">\n';
  165. tag += ' <div class="reply_writer">\n';
  166. tag += ' <span class="wr_name">관리자</span>\n';
  167. tag += ' <span class="wr_date">'+review.admRplDt+'</span>\n';
  168. tag += ' </div>\n';
  169. tag += ' <div class="reply_txt">\n';
  170. tag += ' <p>' + review.admRpl+'</p>\n';
  171. tag += ' </div>\n';
  172. tag += ' </div>\n';
  173. tag += ' </div>\n';
  174. }
  175. tag +=' </div>\n';
  176. tag +=' </div>\n';
  177. if (review.reviewAttachList != null && review.reviewAttachList.length >= 2){
  178. tag +=' <div class="thumblist">\n';
  179. tag +=' <ul>\n';
  180. let activeClass = '';
  181. $.each(review.reviewAttachList, function(aIdx, reviewAttach){
  182. activeClass = '';
  183. if (aIdx == 0){
  184. activeClass = 'active';
  185. }
  186. fileGbClass = '';
  187. if (reviewAttach.fileGb == "M") fileGbClass = "mov";
  188. tag +=' <li>\n';
  189. tag +=' <div class="pic '+activeClass+'"> \n'; <!-- 활성화시 active 클래스 추가 -->
  190. tag +=' <span class="thumb" class="'+fileGbClass+'" style="background-image:url('+ _imgUrl + reviewAttach.sysFileNm +');\" >\n';<!-- 동영상의 썸네일일 경우 mov 클래스 추가 -->
  191. if (reviewAttach.fileGb == "M") {
  192. tag +=' <iframe width="100%" height="100%" src="'+_kollusMediaUrl +'/'+reviewAttach.kmcKey +'?player_version=html5" frameborder="0" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>\n';
  193. }else{
  194. tag +=' <img src="'+ _imgUrl + reviewAttach.sysFileNm +'" alt="">\n';
  195. }
  196. tag +=' </span>\n';
  197. tag +=' </div>\n';
  198. tag +=' </li>\n';
  199. });
  200. tag +=' </ul>\n';
  201. tag +=' </div>\n';
  202. }
  203. tag +='</div>\n';
  204. tag +='</div>\n';
  205. tag +='</div>\n';
  206. tag +='</div>\n';
  207. if (gagajf.isNull(review.nextReviewSq) || review.nextReviewSq <= 0) {
  208. tag +='<div class="swiper-button-next swiper-button-disabled" id="reviewBodyNext" ></div>\n';
  209. }else{
  210. tag +='<div class="swiper-button-next" id="reviewBodyNext" onclick="fnReviewNext('+review.nextReviewSq+')"></div>\n';
  211. }
  212. if (gagajf.isNull(review.prevReviewSq) || review.prevReviewSq <= 0) {
  213. tag +='<div class="swiper-button-prev swiper-button-disabled" id="reviewBodyPrev" ></div>\n';
  214. }else{
  215. tag +='<div class="swiper-button-prev" id="reviewBodyPrev" onclick="fnReviewNext('+review.prevReviewSq+')"></div>\n';
  216. }
  217. tag +='</div>\n';
  218. $('#reviewBody').append(tag);
  219. $('.pd_photoreviewdetail_pop .swiper-slide').each(function(index, element){
  220. var $this = $(this);
  221. var thumbCount = $this.find('.thumblist ul li').length;
  222. var thumbUlWidth = $this.find('.thumblist ul li').width() * thumbCount;
  223. var thumbMargin = 8 * thumbCount;
  224. var thumbListWidth = thumbUlWidth + thumbMargin;
  225. $this.find('.thumblist ul').attr('style', 'width:' + thumbListWidth + 'px;');
  226. });
  227. });
  228. }
  229. }
  230. // 다른 상품평 보기
  231. var fnReviewNext = function(reviewSq){
  232. if (gagajf.isNull(reviewSq)) return false;
  233. $('#reviewDetailForm input[name=reviewSq]').val(reviewSq);
  234. fnReviewDetail();
  235. }
  236. $(document).ready( function() {
  237. fnReviewDetail();
  238. //슬라이드 - 상품 베스트 리뷰 자세히보기 영역
  239. var photoReviewDetailSwiper = new Swiper('.pd_photoreviewdetail_pop .swiper-container.detail', {
  240. effect :'fade',
  241. slidesPerView: 1,
  242. spaceBetween: 0,
  243. simulateTouch:false,
  244. navigation: {
  245. nextEl: '.pd_photoreviewdetail_pop .swiper-button-next',
  246. prevEl: '.pd_photoreviewdetail_pop .swiper-button-prev',
  247. },
  248. });
  249. $('.pd_photoreviewdetail_pop .swiper-slide').each(function(index, element){
  250. var $this = $(this);
  251. var thumbCount = $this.find('.thumblist ul li').length;
  252. var thumbUlWidth = $this.find('.thumblist ul li').width() * thumbCount;
  253. var thumbMargin = 8 * thumbCount;
  254. var thumbListWidth = thumbUlWidth + thumbMargin;
  255. $this.find('.thumblist ul').attr('style', 'width:' + thumbListWidth + 'px;');
  256. });
  257. $(document).on('click','.pd_photoreviewdetail_pop .thumblist ul li',function(e){
  258. $(this).parents(".swiper-slide").find(".review > .pic > .thumb").empty();
  259. $(this).parents(".swiper-slide").find(".thumblist ul li .pic").removeClass('active');
  260. $(this).find(".pic").addClass('active');
  261. var thumbIndex = $(this).index();
  262. thumbContentHtml = $(this).find('.pic .thumb').html();
  263. $(this).parents(".swiper-slide").find(".review > .pic > .thumb").append(thumbContentHtml);
  264. return false;
  265. });
  266. });
  267. /*]]>*/
  268. </script>
  269. </html>