PlanningReviewDetailFormWeb.html 11 KB

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