PlanningDetailFormWeb.html 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. <!DOCTYPE html>
  2. <html lang="ko" xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorator="web/common/layout/PlanningLayoutWeb">
  5. <!--
  6. *******************************************************************************
  7. * @source : PlanningDetailFormWeb.html
  8. * @desc : 기획전디테일 Page
  9. *============================================================================
  10. * Pastelmall
  11. * Copyright(C) 2020 TSIT, All rights reserved.
  12. *============================================================================
  13. * VER DATE AUTHOR DESCRIPTION
  14. * === =========== ========== =============================================
  15. * 1.0 2021.3.9 sowon 최초 작성
  16. *******************************************************************************
  17. -->
  18. <body>
  19. <th:block layout:fragment="content">
  20. <script src="https://developers.kakao.com/sdk/js/kakao.min.js"></script>
  21. <div id="container" class="container dp" th:with="frontUrl=${@environment.getProperty('domain.front')}, goodsView=${@environment.getProperty('upload.goods.view')}, planView=${@environment.getProperty('upload.image.view')}">
  22. <div class="breadcrumb">
  23. <ul>
  24. <li class="bread_home"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MAIN);">홈</a></li>
  25. <li class="bread_2depth" th:if="${planInfo.planGb == 'P'}" ><a href="javascript:void(0);"onclick="cfnGoToPage(_PAGE_PLANNING_MAIN);">기획전</a></li>
  26. <li class="bread_2depth" th:if="${planInfo.planGb == 'E'}" ><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_EVENT_MAIN);">이벤트/혜택</a></li>
  27. <li class="bread_2depth" th:text="${planInfo.planNm}"></li>
  28. </ul>
  29. </div>
  30. <div class="wrap">
  31. <!-- 상단 프로모션 배너 -->
  32. <div class="content wide dp_detail_visual">
  33. <div class="cont_head">
  34. <div>
  35. <h3 th:text="${planInfo.planNm}"></h3>
  36. <div class="period">
  37. <span th:text="${planInfo.dispStdt}"></span> ~ <span th:text="${planInfo.dispEddt}"></span>
  38. </div>
  39. <div class="shareSet">
  40. <button class="btn_share" data-name="openShare">공유하기</button>
  41. <div class="shareWrap">
  42. <div id="layerShare" class="setShare open">
  43. <span>
  44. <button type="button" class="kk"
  45. th:attr="onclick=|cfnSendToKakao('${stylelUrl+'/planning/detail/form?planSq='+planInfo.planSq}', '${planInfo.planNm}', '${planView+ '/'+planInfo.mainImg}');|">
  46. <span>카카오톡</span>
  47. </button>
  48. <button type="button" class="fb"
  49. th:attr="onclick=|sendSns('facebook', '${stylelUrl+'/planning/detail/form?planSq='+planInfo.planSq}', '${planInfo.planNm}', '', '');|">
  50. <span>페이스북</span>
  51. </button>
  52. <button type="button" class="tw"
  53. th:attr="onclick=|sendSns('twitter', '${stylelUrl+'/planning/detail/form?planSq='+planInfo.planSq}', '${planInfo.planNm+ '#style24몰'}', '', '');|">
  54. <span>트위터</span>
  55. </button>
  56. <button type="button" class="url btn_copy">
  57. <span>URL</span>
  58. </button>
  59. </span>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="cont_body" th:if="${fsrcInfoTop != null}" th:utext="${#strings.replace(#strings.replace(fsrcInfoTop.fsrcPc,'&amplt;','<'),'&ampgt;','>')}">
  66. <!-- 프로모션배너 type1 -->
  67. <!-- <div class="promotion_visual type1" th:if="${fsrcInfoTop != null and planInfo.planGb == 'P'}" th:utext="${#strings.replace(#strings.replace(fsrcInfoTop.fsrcPc,'&amplt;','<'),'&ampgt;','>')}"></div> -->
  68. <!-- <div class="promotion_visual type2" th:if="${fsrcInfoTop != null}" th:utext="${#strings.replace(#strings.replace(fsrcInfoTop.fsrcPc,'&amplt;','<'),'&ampgt;','>')}"></div> -->
  69. <!-- 프로모션배너 type1 -->
  70. <!-- 프로모션배너 type2 -->
  71. <!-- <div class="promotion_visual type2">
  72. <div class="swiper-container">
  73. <div class="swiper-wrapper ">
  74. <div class="swiper-slide">
  75. <img alt="" src="/images/pc/thumb/bigbanner_slide01.png">
  76. </div>
  77. <div class="swiper-slide">
  78. <img alt="" src="/images/pc/thumb/bigbanner_slide02.png">
  79. </div>
  80. </div>
  81. </div>
  82. <div class="swiper-button-prev"></div>
  83. <div class="swiper-button-next"></div>
  84. <div class="swiper-pagination"></div>
  85. </div> -->
  86. <!-- 프로모션배너 type2 -->
  87. </div>
  88. </div>
  89. <!-- //상단 프로모션 배너 -->
  90. <th:block th:each="a, template : ${templateOrd}">
  91. <th:block th:if="${a.tmplType == 'G082_10'}">
  92. <div class="content wide dp_review" th:id="${a.tmplType}"></div> <!-- //리뷰 -->
  93. </th:block>
  94. <th:block th:if="${a.tmplType == 'G082_20'}">
  95. <div class="content wide dp_coupon" th:id="${a.tmplType}"></div> <!-- //할인쿠폰 -->
  96. </th:block>
  97. <th:block th:if="${a.tmplType == 'G082_30'}">
  98. <div class="content dp_mid_banner" th:id="${a.tmplType}"></div> <!-- //이미지-->
  99. </th:block>
  100. <th:block th:if="${a.tmplType == 'G082_50'}">
  101. <div class="content dp_special" th:id="${a.tmplType + a.planContSq}"></div>
  102. </th:block>
  103. <th:block th:if="${a.tmplType == 'G082_51'}">
  104. <div class="content dp_special" th:id="${a.tmplType + a.planContSq}"></div>
  105. </th:block>
  106. <th:block th:if="${a.tmplType == 'G082_52'}">
  107. <div class="content dp_special" th:id="${a.tmplType + a.planContSq}"></div>
  108. </th:block>
  109. </th:block>
  110. <div class="coner_item01" th:if="${fsrcInfoBtm != null}" th:utext="${#strings.replace(#strings.replace(fsrcInfoBtm.fsrcPc,'&amplt;','<'),'&ampgt;','>')}"></div>
  111. <div class="coner_item01" th:if="${planInfo.pollSq != null}">
  112. <div class="content dp_btn_area">
  113. <div class="cont_head">
  114. <div>
  115. <h4>버튼영역</h4>
  116. </div>
  117. </div>
  118. <div class="cont_body">
  119. <div class="btn_wrap">
  120. <a href="javascript:void(0);" class="btn btn_primary go_next"
  121. onclick="javascript:fnJoinConfirm()"> <span>설문조사 참여하기</span></a>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <!-- 댓글리스트 -->
  127. <th:block th:if="${planInfo.replyYn == 'Y'}">
  128. <div class="content wide cmt">
  129. <div class="cont_body">
  130. <div class="cmt_wrap">
  131. <div class="cmt_write">
  132. <form class="form_wrap">
  133. <div class="cmt_tarea">
  134. <textarea class="cmt_ans" name="replyText" id="replyText" placeholder="댓글을 입력해주세요.(500자 이내)" onclick="fnTextConfirm()"></textarea>
  135. <p class="txt_cnt"><span id="cmt_cnt" class="c_primary">0</span>/500</p>
  136. </div>
  137. <div class="cmt_thumb">
  138. <div class="form_field">
  139. <div class="imgUpload">
  140. <label for="fileAdd" class="fileAdd" id="fileAdd_reply">업로드</label>
  141. <input type="file" id="fileAdd" name="files"/>
  142. </div>
  143. </div>
  144. </div>
  145. <button type="button" class="btn btn_dark" onclick="fnReplySave()"><span>등록</span></button>
  146. </form>
  147. </div>
  148. <div class="cmt_group" id="replyList">
  149. </div>
  150. <div class="paging_wrap">
  151. <ul class="pageNav" id="paging">
  152. </ul>
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </th:block>
  158. <!-- 관련상품 리스트 -->
  159. <div class="content sticky_nav_list" id="cornerList">
  160. </div>
  161. <!-- //관련상품 리스트 -->
  162. <!-- 다른 기획전,이벤트 보기 -->
  163. <div class="content other_promotion_slide">
  164. <div class="cont_head">
  165. <div>
  166. <h4 th:if="${planInfo.planGb == 'P'}">다른 기획전 보기</h4>
  167. <h4 th:if="${planInfo.planGb == 'E'}">다른 이벤트 보기</h4>
  168. <h4 th:if="${planInfo.planGb == 'C'}">다른 이벤트 보기</h4>
  169. <a href="javascript:void(0);" th:if="${planInfo.planGb == 'P'}" onclick="cfnGoToPage(_PAGE_PLANNING_MAIN);">전체보기</a>
  170. <a href="javascript:void(0);" th:if="${planInfo.planGb == 'E'}" onclick="cfnGoToPage(_PAGE_EVENT_MAIN);">전체보기</a>
  171. </div>
  172. </div>
  173. <div class="cont_body">
  174. <div class="swiper-container">
  175. <div class="swiper-wrapper">
  176. <th:block th:each="PlanData, PlanStat : ${planList}">
  177. <div class="swiper-slide">
  178. <a th:onclick="cfnGoToPlanDetail([[${PlanData.planSq}]])">
  179. <div class="thumb">
  180. <img th:src="${@environment.getProperty('upload.image.view')+PlanData.mainImg}" alt="${PlanData.planNm}">
  181. </div>
  182. <div class="txt">
  183. <p class="tit" th:text="${PlanData.planNm}"></p>
  184. </div>
  185. </a>
  186. </div>
  187. </th:block>
  188. </div>
  189. </div>
  190. <div class="swiper-button-prev"></div>
  191. <div class="swiper-button-next"></div>
  192. </div>
  193. </div>
  194. </div>
  195. </div>
  196. <div class="modal fade couponInfo_pop" id="couponInfoPop" tabindex="-1" role="dialog" aria-labelledby="couponInfoLabel" aria-hidden="true">
  197. <div class="modal-dialog" role="document">
  198. <div class="modal-content">
  199. <!-- 쿠폰사용안내 팝업 내용 -->
  200. </div>
  201. </div>
  202. </div>
  203. <!-- <form id="pollListForm" name="pollListForm" th:action="@{'/planning/event/poll/form'}" th:method="post">
  204. <input type="hidden" name="planSq" th:value="${planInfo.planSq}"/>
  205. </form> -->
  206. <form id="searchForm" name="searchForm" th:action="@{/planning/reply/list}" th:method="post">
  207. <input type="hidden" name="pageNo" value="1" />
  208. <input type="hidden" name="planSq" th:value="${planInfo.planSq}" />
  209. <input type="hidden" name="pageSize" value="10" />
  210. </form>
  211. <!-- 댓글 이미지 팝업 -->
  212. <div class="modal fade thumb_img_pop" id="thumbImgPop" tabindex="-1" role="dialog" aria-labelledby="thumbImgLabel" aria-hidden="true">
  213. <div class="modal-dialog" role="document">
  214. <div class="modal-content">
  215. <div class="modal-header sr-only">
  216. <h5 class="modal-title" id="thumbImgLabel">이미지 상세보기</h5>
  217. </div>
  218. <div class="modal-body">
  219. <div class="pop_cont">
  220. <div class="swiper-container">
  221. <div class="swiper-wrapper">
  222. <!-- 이미지 슬라이드 영역 -->
  223. </div>
  224. </div>
  225. <div class="swiper-button-next"></div>
  226. <div class="swiper-button-prev"></div>
  227. <div class="swiper-pagination"></div>
  228. </div>
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. <!-- //댓글 이미지 팝업 -->
  234. <script src="/ux/plugins/gaga/gaga.paging.js"></script>
  235. <script th:inline="javascript">
  236. let review = [[${reviewInfo}]];
  237. let coupon = [[${couponInfo}]];
  238. let plan = [[${planInfo}]];
  239. let image = [[${imageInfo}]];
  240. let goods1 = [[${goods1Info}]];
  241. let goods2 = [[${goods2Info}]];
  242. let goods4 = [[${goods4Info}]];
  243. let template =[[${templateOrd}]];
  244. let replyList = [[${replyList}]];
  245. let replyCount = [[${replyCount}]];
  246. let replyAttachList = [[${replyAttachList}]];
  247. let planCornerGoodsList = [[${planCornerGoodsList}]];
  248. let planCornerList = [[${planCornerList}]];
  249. let _mall = [[${@environment.getProperty('domain.front')}]];
  250. let goodsView =[[${@environment.getProperty('upload.goods.view')}]]
  251. let imgUrl=[[${@environment.getProperty('upload.image.view')}]];
  252. if(planCornerList.length>0){
  253. var html = '';
  254. html += '<div class="cont_head">';
  255. html += ' <div class="sticky_nav">';
  256. html += ' <ul> ';
  257. $.each(planCornerList, function(idx, item) {
  258. html += ' <li><a href="#brand'+idx+'">'+item.cornerNm+'</a></li>';
  259. })
  260. html += ' </ul>';
  261. html += ' </div>';
  262. html += '</div>';
  263. html += '<div class="cont_body">';
  264. html += ' <div class="list_content">';
  265. $.each(planCornerList, function(idx, item) {
  266. html += ' <div id="brand'+idx+'">';
  267. html += ' <div class="item_header">';
  268. html += ' <h4>'+item.cornerNm+'</h4>';
  269. html += ' </div>';
  270. html += ' <div class="itemsGrp">';
  271. $.each(planCornerGoodsList, function(idx2, item2) {
  272. if (item2.cornerNm == item.cornerNm) {
  273. html += ' <div class="item_prod">';
  274. html += ' <div class="item_state">';
  275. html += ' <button type="button" class="itemLike';
  276. if(item2.likeIt == 'likeit'){
  277. html += ' likeit';
  278. }
  279. html += ' "';
  280. html += ' onClick="cfnPutWishList(this);" goodsCd=\''+item2.goodsCd+'\', ithrCd=\'\', contentsLoc=\'\', planDtlSq=\'\'>관심상품 추가</button>';
  281. html += ' <a href="javascript:void(0);" onclick="cfnGoToGoodsDetail(\'' + item2.goodsCd + '\')" class="itemLink">';
  282. html += ' <div class="itemPic">';
  283. html += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ goodsView +'/'+item2.sysImgNm +'">';
  284. html += ' </div>';
  285. html += ' <p class="itemBrand">'+item2.brandGroupNm+'</p>';
  286. html += ' <div class="itemName">'+item2.goodsNm+'</div>';
  287. html += ' <p class="itemPrice">'+item2.currPrice.addComma();
  288. if (item2.currPrice != item2.listPrice) {
  289. html += ' <span class="itemPrice_original">'+item2.listPrice.addComma()+'</span>';
  290. }
  291. if (item2.dcRate != 0) {
  292. html += ' <span class=" itemPercent">'+item2.dcRate.addComma()+'%</span>';
  293. }
  294. html += ' </p>';
  295. html += ' <div class="itemcolorchip">';
  296. if(!gagajf.isNull(item2.colorChips)){
  297. var colorArr = item2.colorChips.split(",");
  298. var colorCd = '';
  299. var rgbColor = '';
  300. for(let i=0; i<colorArr.length; i++){
  301. var colorInfo = colorArr[i].split(":");
  302. colorCd = colorInfo[0];
  303. rgbColor = colorInfo[1];
  304. if(rgbColor=='#FFFFFF'){
  305. html += ' <span class="chip_color" style="background-color: '+rgbColor+';border:1px solid #aaa;" value="'+colorCd+'">'+colorCd+'</span>';
  306. }else{
  307. html += ' <span class="chip_color" style="background-color: '+rgbColor+'" value="'+colorCd+'">'+colorCd+'</span>';
  308. }
  309. }
  310. }
  311. html += ' </div>';
  312. if(!gagajf.isNull(item2.icon)){
  313. var iconArr = item2.icon.split(",");
  314. var iconGb = '';
  315. var iconNm = '';
  316. html += ' <p class="itemBadge">';
  317. for(let i=0; i<iconArr.length; i++){
  318. var iconInfo = iconArr[i].split(":");
  319. iconGb = iconInfo[0];
  320. iconNm = iconInfo[1];
  321. html += ' <span class="badge13" value="'+iconGb+'">'+iconNm+' </span>';
  322. }
  323. html += ' </p>';
  324. }
  325. if(item2.goodsTnm != null){
  326. html += ' <div class="itemComment">'+item2.goodsTnm+'</div>';
  327. }
  328. html += ' </a>';
  329. html += ' </div>';
  330. html += ' </div>';
  331. }
  332. })
  333. html += ' </div>';
  334. html += ' </div>';
  335. })
  336. html += ' </div>';
  337. html += ' </div>';
  338. $("#cornerList").append(html);
  339. }
  340. if(review.length>0){
  341. var html = '';
  342. html += ' <div class="cont_head">';
  343. html += ' <div>';
  344. html += ' <h4>'+review[0].title+'</h4>';
  345. html += ' </div>';
  346. html += ' <div class="cont_body">';
  347. html += ' <div class="review_list">';
  348. $.each(review, function(idx, item) {
  349. html += ' <div class="reviw_box">'
  350. html += ' <div class="best_review">';
  351. if(item.reviewSysImg!= null){
  352. html += ' <a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'\', \'Y\',\''+item.reviewSq+'\');">';
  353. }else{
  354. html += ' <a href="javascript:void();" id="btn_pdBestReview_pop">';
  355. }
  356. html += ' <div class="pic">';
  357. if(item.reviewSysImg!= null){
  358. if (item.fileGb == 'M') {
  359. html += ' <span class="thumb mov" style="background-image: url('+ imgUrl+item.reviewSysImg +');"></span>';
  360. }else{
  361. html += ' <span class="thumb" style="background-image: url('+ imgUrl +item.reviewSysImg +');"></span>';
  362. }
  363. }else{
  364. html += ' <span class="thumb" style="background-image: url('+ goodsView+'/'+item.sysImgNm +');"></span>';
  365. }
  366. html += ' </div>';
  367. html += ' <div class="star_score">';
  368. html += ' <span class="star">';
  369. html += ' <em class="progbar" style="width:'+(item.score*20)+'%;"></em> <!-- 평점 style로 표기 -->';
  370. html += ' </span>';
  371. if(item.bestYn == 'Y'){
  372. html += '<em class="ico ico_besttag"></em>';
  373. }
  374. html += ' </div>';
  375. html += ' <div class="txt_best_review">';
  376. html += ' <p>'+item.reviewContent+'</p>';
  377. html += ' </div>';
  378. html += ' <div class="info_writer">';
  379. html += ' <span class="wr_id">'+item.maskingCustId+'</span>';
  380. html += ' <span class="wr_date">'+item.regDt+'</span>';
  381. html += ' </div>';
  382. html += ' </a>';
  383. html += ' </div>';
  384. html += ' <div class="review_item">';
  385. html += ' <div class="item_prod">';
  386. html += ' <div class="item_state">';
  387. html += ' <a href="javascript:void(0)" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">';
  388. html += ' <div class="itemPic">';
  389. html += ' <img alt="" class="vLHTC pd_img" src="'+ goodsView +'/'+item.sysImgNm +'">';
  390. html += ' </div>';
  391. html += ' <div class="itemName">'+item.goodsNm+'</div>';
  392. html += ' <p class="itemPrice">'+item.currPrice.addComma()+'</p>';
  393. html += ' </a>';
  394. html += ' </div>';
  395. html += ' </div>';
  396. html += ' </div>';
  397. html += ' </div> ';
  398. });
  399. html += ' </div> ';
  400. html += ' </div>';
  401. html += '</div>';
  402. $("#G082_10").append(html);
  403. }
  404. if(image.length>0){
  405. var html = '';
  406. html += '<div class="cont_body"> ';
  407. html += ' <div class="mid_banner">';
  408. html += ' <div class="swiper-container">';
  409. html += ' <div class="swiper-wrapper">';
  410. for (var i = 0; i < image.length; i++) {
  411. html += ' <div class="swiper-slide">';
  412. if (image[i].linkOpenGb == 'M') {
  413. html += ' <a href="http://'+image[i].linkUrl+'" target="_self">><img alt="" src="'+ imgUrl + image[i].itemVal +'"></a>';
  414. }else{
  415. html += ' <a href="http://'+image[i].linkUrl+'" target="_blank">><img alt="" src="'+ imgUrl + image[i].itemVal +'"></a>';
  416. }
  417. html += ' </div>';
  418. }
  419. html += ' </div>';
  420. html += ' </div>';
  421. html += ' <div class="swiper-button-prev"></div>';
  422. html += ' <div class="swiper-button-next"></div>';
  423. html += ' <div class="swiper-pagination"></div>';
  424. html += ' </div>';
  425. html += '</div>';
  426. $("#G082_30").append(html);
  427. }
  428. if(goods1.length>0){
  429. var array = [];
  430. for (var j = 0; j < template.length; j++) {
  431. if(template[j].tmplType == 'G082_50'){
  432. array.push(template[j].planContSq);
  433. }
  434. }
  435. for (var i = 0; i < template.length; i++) {
  436. var html = '';
  437. if(template[i].tmplType == 'G082_50' && array[0] == template[i].planContSq && typeof array[0] != 'undefined') {
  438. html += '<div class="cont_head">';
  439. html += ' <div>';
  440. html += ' <h4>';
  441. if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
  442. if (template[i].linkOpenGb == 'M') { //본창
  443. html += ' <a href="http://'+template[i].linkUrl+'" target="_self">'+template[i].title+' <i class="ico_arrow"></i></a>';
  444. }else{
  445. html += ' <a href="http://'+template[i].linkUrl+'" target="_blank">'+template[i].title+' <i class="ico_arrow"></i></a>';
  446. }
  447. }else{
  448. html += ' <a href="javascript:void(0)">'+template[i].title+'</a>';
  449. }
  450. html += ' </h4>';
  451. html += ' </div>';
  452. html += '</div>';
  453. html += '<div class="cont_body">';
  454. html += ' <div class="dp_listItems_cont type1">';
  455. html += ' <ul>';
  456. $.each(goods1, function(idx, item) {
  457. if (item.planContSq == template[i].planContSq) {
  458. html += ' <li>';
  459. html += ' <div class="dp_listItems">';
  460. html += ' <div class="dp_listItems_img">';
  461. html += ' <img src="'+ goodsView +'/'+item.sysImgNm +'" alt="">';
  462. html += ' </div>';
  463. html += ' <div class="dp_listItems_info">';
  464. html += ' <div class="dp_listItems_brand">'+item.brandGroupNm+'</div>';
  465. html += ' <div class="dp_listItems_name">'+item.goodsNm+'<br></div>';
  466. html += ' <div class="dp_listItems_price">';
  467. html += ' <span class="price">'+item.currPrice.addComma()+'</span>';
  468. if (item.currPrice != item.listPrice) {
  469. html += ' <del>'+item.listPrice.addComma()+'</del>';
  470. html += ' <span class="percent">'+Math.floor(item.dcRate)+'%</span>';
  471. }
  472. html += ' </div>';
  473. if(item.goodsTnm != null){
  474. html += ' <div class="itemComment">'+item.goodsTnm+'</div>';
  475. }
  476. html += ' <div class="ui_row">';
  477. html += ' <button type="button" class="btn btn_default" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')"><span>자세히 보기</span></button>';
  478. html += ' </div>';
  479. html += ' </div>';
  480. html += ' </div>';
  481. html += ' </li>';
  482. }
  483. });
  484. html += ' </ul>';
  485. html += ' </div> ';
  486. html += '</div>';
  487. $("#G082_50" +array[0]).append(html);
  488. }
  489. if($("#G082_50" +template[i].planContSq).length){
  490. array.shift();
  491. }
  492. }
  493. }
  494. if(goods2.length>0){
  495. var array = [];
  496. for (var j = 0; j < template.length; j++) {
  497. if(template[j].tmplType == 'G082_51'){
  498. array.push(template[j].planContSq);
  499. }
  500. }
  501. for (var i = 0; i < template.length; i++) {
  502. var html = '';
  503. if(template[i].tmplType == 'G082_51' && array[0] == template[i].planContSq && typeof array[0] != 'undefined'){
  504. html += '<div class="cont_head">';
  505. html += ' <div>';
  506. html += ' <h4>';
  507. if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
  508. if (template[i].linkOpenGb == 'M') { //본창
  509. html += ' <a href="http://'+template[i].linkUrl+'" target="_self">'+template[i].title+' <i class="ico_arrow"></i></a>';
  510. }else{
  511. html += ' <a href="http://'+template[i].linkUrl+'" target="_blank">'+template[i].title+' <i class="ico_arrow"></i></a>';
  512. }
  513. }else{
  514. html+=' <a href="javascript:void(0)">'+template[i].title+'</a>';
  515. }
  516. html += ' </h4>';
  517. html += ' </div>';
  518. html += '</div>';
  519. html += '<div class="cont_body">';
  520. html += ' <div class="dp_listItems_cont type2">';
  521. html += ' <div class="swiper-container">';
  522. html += ' <div class="swiper-wrapper">';
  523. $.each(goods2, function(idx, item) {
  524. if (item.planContSq == template[i].planContSq) {
  525. html += ' <div class="swiper-slide">';
  526. html += ' <div class="item_prod">';
  527. html += ' <div class="item_state">';
  528. html += ' <a onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">';
  529. html += ' <div class="itemPic">';
  530. html += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ goodsView +'/'+item.sysImgNm +'">';
  531. html += ' </div>';
  532. html += ' <p class="itemBrand">'+item.brandGroupNm+'</p>';
  533. html += ' <div class="itemName">'+item.goodsNm+'</div>';
  534. html += ' <p class="itemPrice">'+item.currPrice.addComma();
  535. if (item.currPrice != item.listPrice) {
  536. html+=' <span class="itemPrice_original">'+item.listPrice.addComma()+'</span>';
  537. html+=' <span class=" itemPercent">'+Math.floor(item.dcRate)+'%</span>';
  538. }
  539. html += ' </p>';
  540. if(item.goodsTnm != null){
  541. html += ' <div class="itemComment">'+item.goodsTnm+'</div>';
  542. }
  543. html += ' </a>';
  544. html += ' </div>';
  545. html += ' </div>';
  546. html += ' </div> ';
  547. }
  548. });
  549. html += ' </div>';
  550. html += ' </div>';
  551. html += ' <div class="swiper-button-prev"></div>';
  552. html += ' <div class="swiper-button-next"></div>';
  553. html += ' <div class="swiper-pagination"></div>';
  554. html += ' </div> ';
  555. html += '</div>';
  556. $("#G082_51" +array[0]).append(html);
  557. }
  558. if($("#G082_51" +template[i].planContSq).length){
  559. array.shift();
  560. }
  561. }
  562. }
  563. if(goods4.length>0){
  564. var array = [];
  565. for (var j = 0; j < template.length; j++) {
  566. if(template[j].tmplType == 'G082_52'){
  567. array.push(template[j].planContSq);
  568. }
  569. }
  570. for (var i = 0; i < template.length; i++) {
  571. var html = '';
  572. if(template[i].tmplType == 'G082_52' && array[0] == template[i].planContSq && typeof array[0] != 'undefined'){
  573. html += '<div class="cont_head">';
  574. html += '<div>';
  575. html += ' <h4>';
  576. if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
  577. if (template[i].linkOpenGb == "M") { //본창
  578. html += ' <a href="http://'+template[i].linkUrl+'" target="_self">'+template[i].title+' <i class="ico_arrow"></i></a>';
  579. }else{
  580. html += ' <a href="http://'+template[i].linkUrl+'" target="_blank">'+template[i].title+' <i class="ico_arrow"></i></a>';
  581. }
  582. }else{
  583. html+=' <a href="javascript:void(0)">'+template[i].title+'</a>';
  584. }
  585. html += ' </h4>';
  586. html += ' </div>';
  587. html += '</div>';
  588. html += '<div class="cont_body">';
  589. html += ' <!-- 상품 노출 4열 type3 -->';
  590. html += ' <div class="dp_listItems_cont type3">';
  591. html += ' <div class="swiper-container">';
  592. html += ' <div class="swiper-wrapper">';
  593. $.each(goods4, function(idx, item) {
  594. if (item.planContSq == template[i].planContSq) {
  595. html += ' <div class="swiper-slide">';
  596. html += ' <div class="item_prod">';
  597. html += ' <div class="item_state">';
  598. html += ' <a onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">';
  599. html += ' <div class="itemPic">';
  600. html += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ goodsView +'/'+item.sysImgNm +'">';
  601. html += ' </div>';
  602. html += ' <p class="itemBrand">'+item.brandGroupNm+'</p>';
  603. html += ' <div class="itemName">'+item.goodsNm+'</div>';
  604. html += ' <p class="itemPrice">'+item.currPrice.addComma();
  605. if (item.currPrice != item.listPrice) {
  606. html+=' <span class="itemPrice_original">'+item.listPrice.addComma()+'</span>';
  607. html+=' <span class=" itemPercent">'+Math.floor(item.dcRate)+'%</span>';
  608. }
  609. html += ' </p>';
  610. if(item.goodsTnm != null){
  611. html += ' <div class="itemComment">'+item.goodsTnm+'</div>';
  612. }
  613. html += ' </a>';
  614. html += ' </div>';
  615. html += ' </div>';
  616. html += ' </div>';
  617. }
  618. });
  619. html += ' </div>';
  620. html += ' </div>';
  621. html += ' <div class="swiper-button-prev"></div>';
  622. html += ' <div class="swiper-button-next"></div>';
  623. html += ' <div class="swiper-pagination"></div>';
  624. html += ' </div> ';
  625. html += '</div>';
  626. $("#G082_52" +array[0]).append(html);
  627. }
  628. if($("#G082_52" +template[i].planContSq).length){
  629. array.shift();
  630. }
  631. }
  632. }
  633. if(coupon.length>0){
  634. var html = '';
  635. html += '<div class="cont_head">';
  636. html += ' <div>';
  637. html += ' <h4>'+coupon[0].title+'</h4>';
  638. html += ' </div>';
  639. html += '</div>';
  640. html += '<div class="cont_body">';
  641. html += ' <div class="coupon_list">';
  642. html += ' <ul>';
  643. $.each(coupon, function(idx, item) {
  644. html += ' <li>';
  645. html += ' <div class="coupon">';
  646. html += ' <div>';
  647. html += ' <p class="cp_name">'+item.cpnNm+'</p>';
  648. html += ' <p class="cp_cont">';
  649. html += ' <span><em>'+item.dcVal+'</em>'+item.dcWay+'</span>';
  650. html += ' </p>';
  651. html += ' <p class="cp_condition">'+item.useCondition;
  652. html += ' <span>'+item.issueCondition+'</span>';
  653. html += ' </p>';
  654. html += ' </div>';
  655. if (item.couponStat == '쿠폰받기') {
  656. html += ' <button type="button" id="coupon_'+item.cpnId+'" class="btn btn_dark btn_block btn_coupon_down" onclick="fnPlanCouponDown('+item.cpnId+')">'; /* btn_coupon_done */
  657. html += ' <span>쿠폰받기</span>'; /* 받기완료 */
  658. html += ' </button>';
  659. }else{
  660. html += ' <button type="button"';
  661. html += ' class="btn btn_dark btn_block btn_coupon_done" disabled>';
  662. html += ' <span>받기완료</span>';
  663. html += ' </button>';
  664. }
  665. html += ' </div>';
  666. html += ' <button type="button" class="btn_underline" id="btn_couponInfo_pop" onclick="useInfoCoupon('+item.cpnId+')">';
  667. html += ' <span>사용안내</span>';
  668. html += ' </button>';
  669. html += ' </li>';
  670. });
  671. html += ' </ul>';
  672. html += ' </div>';
  673. html += '</div>';
  674. html += '<div class="content dp_announce line"> ';
  675. html += ' <div class="cont_head"> ';
  676. html += ' <div> ';
  677. html += ' <h4>유의사항</h4> ';
  678. html += ' </div> ';
  679. html += ' </div> ';
  680. html += ' <div class="cont_body"> ';
  681. html += ' <div class="announce_txt"> ';
  682. html += ' <div class="note_txt"> ';
  683. html += ' <img src="/images/pc/ico_content_find.png" alt="유의사항"> ';
  684. html += ' <p>유의사항</p> ';
  685. html += ' </div> ';
  686. html += ' <div class="announce_list"> ';
  687. html += coupon[0].note;
  688. html += ' </div> ';
  689. html += ' </div> ';
  690. html += ' </div> ';
  691. html += '</div> ';
  692. $("#G082_20").append(html);
  693. }
  694. //사용안내 모달
  695. var useInfoCoupon = function (id) {
  696. var data = {cpnId : id};
  697. var jsonData = JSON.stringify(data);
  698. $.ajax( {
  699. type : "POST",
  700. url : '/planning/coupon/detailPop',
  701. data : jsonData,
  702. contentType: 'application/json',
  703. dataType : 'html',
  704. success : function(result) {
  705. if (result != null) {
  706. $("#couponInfoPop").html(result);
  707. $("#couponInfoPop").modal("show");
  708. }
  709. }
  710. });
  711. return false;
  712. }
  713. //쿠폰 다운로드
  714. var fnPlanCouponDown = function(obj){
  715. if (!cfCheckLogin()) {
  716. cfnGoToPage(_PAGE_LOGIN);
  717. return false;
  718. }
  719. let cpnId = obj;
  720. gagajf.ajaxJsonSubmit(_PAGE_PLANNING_CPN_DOWNLOAD, JSON.stringify({cpnId: cpnId}), fnPlanCouponCallBack);
  721. }
  722. // 쿠폰다운로드 콜백
  723. var fnPlanCouponCallBack = function(result){
  724. $('#coupon_'+ result.cpnId).html('<span>받기완료</span>');
  725. $('#coupon_'+ result.cpnId).attr('disabled', true);
  726. }
  727. // 설문조사 참여 버튼 클릭
  728. var fnJoinConfirm = function () {
  729. let planSq = plan.planSq;
  730. cfnGoToPollDetail(planSq);
  731. }
  732. // 댓글 입력 확인
  733. var fnTextConfirm = function() {
  734. //로그인 확인
  735. if (!cfCheckLogin()) {
  736. mcxDialog.alert("로그인 후 참여 가능합니다.");
  737. $("#replyText").val('');
  738. return false;
  739. }
  740. }
  741. var ajaxReplyList = function () {
  742. gagaPaging.init('searchForm', fnSearchCallback, 'paging', 10);
  743. gagaPaging.load(1);
  744. }
  745. var fnSearchCallback = function (result) {
  746. $("#replyList").html('');
  747. if (result!=null) {
  748. var html = '';
  749. html += '<div class="cmt_list_tit">';
  750. html += ' <strong>댓글</strong><span class="cnt">('+result.replyCount.addComma()+')</span>';
  751. html += '</div>';
  752. if (result.replyList.length>0) {
  753. html += '<ul class="cmt_list">';
  754. $.each(result.replyList, function (idx, item) {
  755. html += ' <li>';
  756. html += ' <div class="cmt_top">';
  757. html += ' <span class="writer">'+item.maskingCustId+'</span>';
  758. html += ' <span class="date">'+item.entryDt+'</span>';
  759. html += ' </div>';
  760. html += ' <div class="cmt_cont">';
  761. html += ' <div class="img_wrap clear" onclick="fnImgAttach(this)">';
  762. if (result.replyAttachList.length>0) {
  763. for (var i = 0; i < result.replyAttachList.length; i++) {
  764. if(result.replyAttachList[i].planEntrySq == item.planEntrySq){
  765. html += ' <span class="pics"><img class="picsThumbs" src="'+ imgUrl +'/'+result.replyAttachList[i].sysFileNm +'"></span>';
  766. }
  767. }
  768. }
  769. html += ' </div>';
  770. html += ' <p>'+item.entryVal1.escapeHtml()+'</p>';
  771. if (item.entryCustNo == result.custNo) {
  772. html += ' <button class="btn btn_default btn_del" value="'+item.planEntrySq+'" onclick="fnDelReply(this.value)"><span>삭제</span></button>';
  773. }
  774. html += ' </div>';
  775. html += ' </li>';
  776. });
  777. html += '</ul>';
  778. }else{
  779. html += '<div class="nodata" id="replyNoData"> ';
  780. html += ' <div class="txt_box"> ';
  781. html += ' <p> ';
  782. html += ' 등록된 댓글이 없습니다. ';
  783. html += ' </p> ';
  784. html += ' </div> ';
  785. html += '</div> ';
  786. }
  787. }
  788. $("#replyList").append(html);
  789. // Create pagination
  790. gagaPaging.createPagination(result.paging.pageable);
  791. }
  792. // 댓글 삭제
  793. var fnDelReply = function(obj) {
  794. data = {planEntrySq : obj};
  795. var jsonData = JSON.stringify(data);
  796. mcxDialog.confirm("댓글을 삭제 하시겠습니까?", {
  797. cancelBtnText : "취소",
  798. sureBtnText : "확인",
  799. sureBtnClick : function() {
  800. gagajf.ajaxJsonSubmit('/planning/reply/delete', jsonData,function() {
  801. ajaxReplyList();
  802. });
  803. }
  804. })
  805. }
  806. $('#fileAdd').on('change', function() { fnChooseFile(this); });
  807. var fnChooseFile = function(obj) {
  808. var picLength = $(".pics").length;
  809. // multiple 속성이 있으면 files에는 다수의 객체가 할당됨
  810. var file = obj.files[0];
  811. if (!gagajf.isNull(file.name)) {
  812. var extension = "\.(jpg|jpeg|png)$";
  813. if (!(new RegExp(extension, "i")).test(file.name)) {
  814. mcxDialog.alertC('이미지는 [jpg, jpeg, png] 파일만 가능합니다.', {
  815. sureBtnText: "확인",
  816. sureBtnClick: function() {
  817. //$(obj).parent('.imgUpload').find('.removes').trigger('click');
  818. $('.imgUpload').find('span').eq(0).remove();
  819. }
  820. });
  821. return false;
  822. }
  823. }
  824. // 이거 왜 안먹히지
  825. if (!gagajf.isNull(file.size) && Number(file.size) > (10 * 1000000)) {
  826. mcxDialog.alertC('이미지는 최대 10MB 이하 파일만 가능합니다.', {
  827. sureBtnText: "확인",
  828. sureBtnClick: function() {
  829. $(obj).parent('.imgUpload').find('.removes').trigger('click');
  830. }
  831. });
  832. return false;
  833. }
  834. // 파일 업로드
  835. gagajf.ajaxFileUpload('/common/file/upload?subDir=/reply'
  836. , file
  837. , function(result) {
  838. // 업로드한 파일명 설정
  839. $(".pics").children().eq(0).append("<input type='hidden' name='orgFileNm' id='orgFileNm"+(picLength+1)+"' value='"+result.oldFileName+"'>");
  840. $(".pics").children().eq(0).append("<input type='hidden' name='sysFileNm' id='sysFileNm"+(picLength+1)+"' value='"+result.newFileName+"'>");
  841. }
  842. );
  843. }
  844. // 댓글 등록 버튼 클릭 시
  845. var fnReplySave = function() {
  846. var fileLength = $("input[name='sysFileNm']").length;
  847. var content = $('#replyText').val();
  848. if (content.length < 2){
  849. mcxDialog.alert("최소 2자 이상 입력해주세요.");
  850. return;
  851. }
  852. var yokList = new Array('<script>','script','D쥐고','D지고','jonna','jot같','mi쳤','ssㅑ','tlqkf','wlfkf','같은새끼','같은새끼','개새끼','개같','개넷','개년','개념빠가','개독','개련','개련','개마이','개부랄','개삼성','개새기','개새끼','개섹','개셈','개소리','개쓰래기','개저씨','계새끼','골빈','골1빈','골빈','괘새끼','껒여','꺼지세요','꺼져요','로꺼져','로꺼져','로꺼.져','꺼.지','나빼썅','나쁜새끼','년놈','늬믜','늬미','니년','니믜','니미럴','닝기리','다꺼져','닥쳐라','닥치세','도라이','뒈져','뒤져버','디져라','디졌','디지고','디질','딴년','또라이','또라인','똘아이','ㅁㅊ','ㅁ친','맘충','보이루','망돌','머갈','먹.금','먹.끔','먹1금','먹금','먹끔','명존','믜칀','믜친','미:놈','미:놈','미1친','미놈','미시친발','미쳣네','미쳤나','미쳤니','미췬','미칀','미친새','미친~','미친개','미친새','미친색','미친ㅋ','미틴','및힌','별창','병1신','병1크','병맛','병신','병크','봊','븅신','빠큐','빡새끼','빻았','빻은','뻐규','뻐큐','뻑유','뻑큐','뻨큐','뼈큐','뽄새','뽄세','삐걱','ㅄ','ㅅ','ㅂ','ㅅ.ㅂ','ㅅ1ㅂ','ㅅ1발','ㅅㄲ네','ㅅㄲ들','ㅅ루','ㅅㅋ','ㅅㅡ루','사새끼','새.끼','새1끼','새1키','새77ㅣ','새끼라','새끼야','새퀴','새킈','새키','색희','색히','샊기','샊히','샹년','섀키','솔1친','솔친','쉬발','쉬버','쉬이바','쉬이이','쉬이이이','쉬펄','슈1발','슈레기','슈발','슈벌','슈우벌','슈ㅣ발','스.루','스벌','스죄','스타죄국','싑창','시1발','시미발친','시미친발','시바','시바류','시바시바','시바알','시바앙','시발','시방새','시벌탱','시볼탱','시부럴','시부렬','시부울','시뷰럴','시뷰렬','시빨','시새발끼','시이발','시친발미','시키가','시팔','시펄','십창','십팔','ㅆ1ㄺ','ㅆ1ㅂ','ㅆㄹㄱ','ㅆㄺ','ㅆㅂ','싸가지없','싸가지없','싸물어','쌉가','쌍년','쌍놈','쌔끼','썅','썌끼','쒸펄','쓰1레기','쓰래기같','쓰레기새','쓰레기새','쓰렉','씝창','씨1발','씨바라','씨바알','씨발','씨방새','씨버럼','씨벌','씨벌탱','씨볼탱','씨부럴','씨부렬','씨뷰럴','씨뷰렬','씨빠빠','씨빨','씨뻘','씨새발끼','씨이발','씨팔','씹귀','씹덕','씹못','씹뻐럴','씹새끼','씹쌔','씹창','씹치','씹팔','씹할','ㅇㅍㅊㅌ','아가리','아닥','아오ㅅㅂ','아오시바','아오ㅅㅂ','아오시바','애미','앰','앰창','얘쁘','얘쁜','얪','에라이퉤','에라이퉷','에라이퉤','에라이퉷','엠뷩신','엠븽신','엠빙신','엠생','엠창','엿같','엿이나','예.질','예1질','예질','옘병','외1퀴','외퀴','웅앵','웅엥','은년','은새끼','이새끼','이따위','이새끼','입털','입털','ㅈ.ㄴ','ㅈㄴ','ㅈㄹ','절라','정병','젖같','젗같','젼나','젼낰','졀라','졀리','졌같은','졏같','조낸','조온','조온나','족까','존나','존나','존','나','존.나','존1','존1나','존귀','존귘','존ㄴ나','존나','존낙','존내','졸라','좁밥','조센징','짱깨','짱개','짱꼴라','꼴라','착짱','죽짱','짱골라','좃','종나','좆','좆까','좇같','죠낸','죠온나','죤나','죤내','죵나','죶','죽어버려','죽여버리고','죽여버리고','죽여불고','죽여뿌고','중립충','줬같은','쥐랄','쥰나','쥰내','쥰니','쥰트','즤랄','지랄','지1랄','지1뢰','지껄이','지들이','지랄','지롤','지뢰','지인지조','짱깨','짱께','쪼녜','쪼다','착짱죽짱','섬숭이','쪽본','쪽1바리','쪽바리','쪽발','쫀맛','쫀1','쫀귀','쫀맛','쫂','쫓같','쬰잘','쬲','찝째끼','창년','창녀','창놈','창넘','처먹','凸','첫빠','쳐마','친년','친놈','친구년','친년','친노마','친놈','손놈','남미새','여미새','혐석','호로새끼','호로잡','화낭년','화냥년','후.려','후1려','후1빨','후려','후빨','ㅗ');
  853. if(yokList.indexOf(content)>=0){
  854. mcxDialog.alert("입력 불가한 내용을 포함하고 있습니다.");
  855. $('#replyText').val('');
  856. $('#cmt_cnt').text(0);
  857. return;
  858. }
  859. //파일관련 데이터 담기
  860. var multiReplyOrgFile = [];
  861. var multiReplySysFile = [];
  862. for (var i = 0; i < fileLength; i++) {
  863. multiReplyOrgFile.push($(".pics").eq(i).find('input[name="orgFileNm"]').val());
  864. multiReplySysFile.push($(".pics").eq(i).find('input[name="sysFileNm"]').val());
  865. }
  866. data = {entryVal1 : content,
  867. planSq : plan.planSq,
  868. multiReplyOrgFile : multiReplyOrgFile,
  869. multiReplySysFile : multiReplySysFile};
  870. var jsonData = JSON.stringify(data);
  871. mcxDialog.confirm("댓글을 등록 하시겠습니까?", {
  872. cancelBtnText : "취소",
  873. sureBtnText : "확인",
  874. sureBtnClick : function() {
  875. gagajf.ajaxJsonSubmit('/planning/reply/save', jsonData,function() {
  876. ajaxReplyList();
  877. $('#replyText').val('');
  878. $('.pics').remove();
  879. $('.fileAdd').show();
  880. //댓글 작성시 글자 카운트
  881. $('#cmt_cnt').text(0);
  882. });
  883. }
  884. })
  885. }
  886. var fnImgAttach = function (obj) {
  887. $("#thumbImgPop .swiper-wrapper").empty();
  888. //var popSlideIndex = $(obj).find('span').length -1;
  889. var popSlideIndex = 0;
  890. contactPopSwiper.slideTo(popSlideIndex);
  891. contactPopSwiper.update();
  892. var contactImglength = $(obj).find('span').length;
  893. var popImgHtml = "";
  894. for (i = 0; i < contactImglength; i++) {
  895. var contactImgSrc =$(obj).find('img').eq(i).attr('src');
  896. popImgHtml += "<div class='swiper-slide'><div class='pop_img' style='background-image:url("+ contactImgSrc +")'></div></div>";
  897. }
  898. $("#thumbImgPop .swiper-wrapper").append(popImgHtml);
  899. $('#thumbImgPop').modal("show");
  900. return false;
  901. }
  902. /* SLIDE - 댓글 이미지 팝업 */
  903. var contactPopSwiper = new Swiper('.thumb_img_pop .swiper-container', {
  904. navigation: {
  905. nextEl: '.thumb_img_pop .swiper-button-next',
  906. prevEl: '.thumb_img_pop .swiper-button-prev',
  907. },
  908. pagination: {
  909. el: '.thumb_img_pop .swiper-pagination',
  910. clickable: true,
  911. },
  912. observer:true,
  913. observeParents: true,
  914. });
  915. $(document).ready( function() {
  916. ajaxReplyList();
  917. //공유 버튼 토글
  918. $("button[data-name=openShare]").on("click", function(){
  919. $(this).toggleClass("on").next(".shareWrap").toggleClass("on");
  920. return false;
  921. });
  922. //영역밖 클릭으로 공유토글 닫기
  923. $("body").on('click', function(e) {
  924. if(!$(".shareWrap.on").parent().has(e.target).length) {
  925. $("button[data-name=openShare]").removeClass("on");
  926. $(".shareWrap").removeClass("on");
  927. };
  928. });
  929. $('.btn_copy').bind('click', function() {
  930. copyToClipboard();
  931. });
  932. //팝업 - 쿠폰사용안내
  933. $(document).on('click','#btn_couponInfo_pop',function(e){
  934. $("#couponInfoPop .modal-content").load("popup_couponInfo.html");
  935. $("#couponInfoPop").modal("show");
  936. return false;
  937. });
  938. $("#couponInfoPop_close").click(function() {
  939. $.modal.close();
  940. });
  941. //팝업 - 상품 베스트 리뷰 (detail)
  942. $(document).on('click','#btn_pdBestReview_pop, .area_rv_best .best_review a',function(e){
  943. $("#pdBestReviewPop .modal-content").load("pd_bestreviewdetail_pop.html");
  944. $("#pdBestReviewPop").modal("show");
  945. return false;
  946. });
  947. $("#pdBestReviewPop_close").click(function() {
  948. $.modal.close();
  949. });
  950. /* SLIDE - 상단 프로모션 배너 */
  951. var promotion_visual_slide = new Swiper ('.dp_detail_visual .promotion_visual.type2 .swiper-container', {
  952. loop: true,
  953. slidesPerView: 1,
  954. speed : 1500,
  955. navigation: {
  956. nextEl: '.promotion_visual.type2 .swiper-button-next',
  957. prevEl: '.promotion_visual.type2 .swiper-button-prev',
  958. },
  959. pagination: {
  960. el: '.promotion_visual.type2 .swiper-pagination',
  961. clickable: true,
  962. },
  963. });
  964. /* SLIDE - 중간 배너 */
  965. var mid_banner_slide = new Swiper ('.dp_mid_banner .mid_banner .swiper-container', {
  966. loop: true,
  967. slidesPerView: 1,
  968. speed : 1500,
  969. navigation: {
  970. nextEl: '.mid_banner .swiper-button-next',
  971. prevEl: '.mid_banner .swiper-button-prev',
  972. },
  973. pagination: {
  974. el: '.mid_banner .swiper-pagination',
  975. clickable: true,
  976. },
  977. });
  978. /* SLIDE - 대표상품 슬라이드 2열 상품 */
  979. var dp_listItems_slide1 = new Swiper ('.dp_listItems_cont.type2 .swiper-container', {
  980. loop: false,
  981. slidesPerView: 2,
  982. slidesPerGroup: 2,
  983. spaceBetween: 20,
  984. speed : 800,
  985. navigation: {
  986. nextEl: '.dp_listItems_cont.type2 .swiper-button-next',
  987. prevEl: '.dp_listItems_cont.type2 .swiper-button-prev',
  988. },
  989. pagination: {
  990. el: '.dp_listItems_cont.type2 .swiper-pagination',
  991. clickable: true,
  992. },
  993. });
  994. /* SLIDE - 대표상품 슬라이드 4열 상품 */
  995. var dp_listItems_slide2 = new Swiper ('.dp_listItems_cont.type3 .swiper-container', {
  996. loop: false,
  997. slidesPerView: 4,
  998. slidesPerGroup: 4,
  999. spaceBetween: 20,
  1000. speed : 800,
  1001. navigation: {
  1002. nextEl: '.dp_listItems_cont.type3 .swiper-button-next',
  1003. prevEl: '.dp_listItems_cont.type3 .swiper-button-prev',
  1004. },
  1005. pagination: {
  1006. el: '.dp_listItems_cont.type3 .swiper-pagination',
  1007. clickable: true,
  1008. },
  1009. });
  1010. /* SLIDE - 다른 기획전,이벤트 보기 */
  1011. var other_slide_slide = new Swiper ('.other_promotion_slide .swiper-container', {
  1012. slidesPerView: 5,
  1013. spaceBetween: 20,
  1014. navigation: {
  1015. nextEl: '.other_promotion_slide .swiper-button-next',
  1016. prevEl: '.other_promotion_slide .swiper-button-prev',
  1017. },
  1018. });
  1019. // 첨부파일 갯수제한
  1020. $('.imgUpload .fileAdd').click(function(){
  1021. if (!cfCheckLogin()) {
  1022. mcxDialog.alert("로그인 후 참여 가능합니다.");
  1023. $("#replyText").val('');
  1024. return false;
  1025. }
  1026. var imgFiles=$('.imgUpload .pics');
  1027. var maxFileLength = 10; /* 최대 파일 갯수를 입력해 주세요 */
  1028. if (imgFiles.length >= maxFileLength) {
  1029. mcxDialog.alert('이미지는 최대' + maxFileLength +'장 까지 첨부 가능합니다.');
  1030. $('#fileAdd').attr("disabled",true);
  1031. } else if(imgFiles.length < maxFileLength){
  1032. $('#fileAdd').removeAttr("disabled");
  1033. }
  1034. });
  1035. //댓글 작성시 글자 카운트
  1036. $('.cmt_ans').keyup(function (e){
  1037. var content = $(this).val();
  1038. $('#cmt_cnt').html(content.length);
  1039. if (content.length > 500){
  1040. mcxDialog.alert("최대 500자까지 입력 가능합니다.");
  1041. $(this).val(content.substring(0, 500));
  1042. $('#cmt_cnt').html("500");
  1043. }
  1044. });
  1045. });
  1046. </script>
  1047. </th:block>
  1048. </body>
  1049. </html>