PlanningDetailFormWeb.html 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162
  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" onclick="javascript:fnJoinConfirm()"> <span>설문조사 참여하기</span></a>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <!-- 댓글리스트 -->
  126. <th:block th:if="${planInfo.replyYn == 'Y'}">
  127. <div class="content wide cmt">
  128. <div class="cont_body">
  129. <div class="cmt_wrap">
  130. <div class="cmt_write">
  131. <form class="form_wrap">
  132. <div class="cmt_tarea">
  133. <textarea class="cmt_ans" name="replyText" id="replyText" placeholder="댓글을 입력해주세요.(500자 이내)" onclick="fnTextConfirm()"></textarea>
  134. <p class="txt_cnt"><span id="cmt_cnt" class="c_primary">0</span>/500</p>
  135. </div>
  136. <div class="cmt_thumb">
  137. <div class="form_field">
  138. <div class="imgUpload">
  139. <label for="fileAdd" class="fileAdd" id="fileAdd_reply">업로드</label>
  140. <input type="file" id="fileAdd" name="files"/>
  141. </div>
  142. </div>
  143. </div>
  144. <button type="button" class="btn btn_dark" onclick="fnReplySave()"><span>등록</span></button>
  145. </form>
  146. </div>
  147. <div class="cmt_group" id="replyList">
  148. </div>
  149. <div class="paging_wrap">
  150. <ul class="pageNav" id="paging">
  151. </ul>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. </th:block>
  157. <!-- 관련상품 리스트 -->
  158. <div class="content sticky_nav_list" id="cornerList">
  159. </div>
  160. <!-- //관련상품 리스트 -->
  161. <!-- 다른 기획전,이벤트 보기 -->
  162. <div class="content other_promotion_slide">
  163. <div class="cont_head">
  164. <div>
  165. <h4 th:if="${planInfo.planGb == 'P'}">다른 기획전 보기</h4>
  166. <h4 th:if="${planInfo.planGb == 'E'}">다른 이벤트 보기</h4>
  167. <a href="javascript:void(0);" th:if="${planInfo.planGb == 'P'}" onclick="cfnGoToPage(_PAGE_PLANNING_MAIN);">전체보기</a>
  168. <a href="javascript:void(0);" th:if="${planInfo.planGb == 'E'}" onclick="cfnGoToPage(_PAGE_EVENT_MAIN);">전체보기</a>
  169. </div>
  170. </div>
  171. <div class="cont_body">
  172. <div class="swiper-container">
  173. <div class="swiper-wrapper">
  174. <th:block th:each="PlanData, PlanStat : ${planList}">
  175. <div class="swiper-slide">
  176. <a th:onclick="cfnGoToPlanDetail([[${PlanData.planSq}]])">
  177. <div class="thumb">
  178. <img th:src="${@environment.getProperty('upload.image.view')+PlanData.mainImg}" alt="${PlanData.planNm}">
  179. </div>
  180. <div class="txt">
  181. <p class="tit" th:text="${PlanData.planNm}"></p>
  182. </div>
  183. </a>
  184. </div>
  185. </th:block>
  186. </div>
  187. </div>
  188. <div class="swiper-button-prev"></div>
  189. <div class="swiper-button-next"></div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <div class="modal fade couponInfo_pop" id="couponInfoPop" tabindex="-1" role="dialog" aria-labelledby="couponInfoLabel" aria-hidden="true">
  195. <div class="modal-dialog" role="document">
  196. <div class="modal-content">
  197. <!-- 쿠폰사용안내 팝업 내용 -->
  198. </div>
  199. </div>
  200. </div>
  201. <!-- <form id="pollListForm" name="pollListForm" th:action="@{'/planning/event/poll/form'}" th:method="post">
  202. <input type="hidden" name="planSq" th:value="${planInfo.planSq}"/>
  203. </form> -->
  204. <form id="searchForm" name="searchForm" th:action="@{/planning/reply/list}" th:method="post">
  205. <input type="hidden" name="pageNo" value="1" />
  206. <input type="hidden" name="planSq" th:value="${planInfo.planSq}" />
  207. <input type="hidden" name="pageSize" value="10" />
  208. </form>
  209. <!-- 댓글 이미지 팝업 -->
  210. <div class="modal fade thumb_img_pop" id="thumbImgPop" tabindex="-1" role="dialog" aria-labelledby="thumbImgLabel" aria-hidden="true">
  211. <div class="modal-dialog" role="document">
  212. <div class="modal-content">
  213. <div class="modal-header sr-only">
  214. <h5 class="modal-title" id="thumbImgLabel">이미지 상세보기</h5>
  215. </div>
  216. <div class="modal-body">
  217. <div class="pop_cont">
  218. <div class="swiper-container">
  219. <div class="swiper-wrapper">
  220. <!-- 이미지 슬라이드 영역 -->
  221. </div>
  222. </div>
  223. <div class="swiper-button-next"></div>
  224. <div class="swiper-button-prev"></div>
  225. <div class="swiper-pagination"></div>
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. <!-- //댓글 이미지 팝업 -->
  232. <script src="/ux/plugins/gaga/gaga.paging.js"></script>
  233. <script th:inline="javascript">
  234. let review = [[${reviewInfo}]];
  235. let coupon = [[${couponInfo}]];
  236. let plan = [[${planInfo}]];
  237. let image = [[${imageInfo}]];
  238. let goods1 = [[${goods1Info}]];
  239. let goods2 = [[${goods2Info}]];
  240. let goods4 = [[${goods4Info}]];
  241. let template =[[${templateOrd}]];
  242. let replyList = [[${replyList}]];
  243. let replyCount = [[${replyCount}]];
  244. let replyAttachList = [[${replyAttachList}]];
  245. let planCornerGoodsList = [[${planCornerGoodsList}]];
  246. let planCornerList = [[${planCornerList}]];
  247. if(planCornerList.length>0){
  248. var html = '';
  249. html += '<div class="cont_head">';
  250. html += ' <div class="sticky_nav">';
  251. html += ' <ul> ';
  252. $.each(planCornerList, function(idx, item) {
  253. html += ' <li><a href="#brand'+(idx+1)+'">'+item.cornerNm+'</a></li>';
  254. })
  255. html += ' </ul>';
  256. html += ' </div>';
  257. html += '</div>';
  258. html += '<div class="cont_body">';
  259. html += ' <div class="list_content">';
  260. $.each(planCornerList, function(idx, item) {
  261. html += ' <div id="brand'+(idx+1)+'" class="dp_item_list">';
  262. html += ' <div class="item_header">';
  263. html += ' <h4>'+item.cornerNm+'</h4>';
  264. html += ' </div>';
  265. html += ' <div class="itemsGrp';
  266. if (item.cornerDispType == 'G045_1') {
  267. html += ' cut1';
  268. }else if(item.cornerDispType == 'G045_2'){
  269. html += ' cut2';
  270. }else if(item.cornerDispType == 'G045_3'){
  271. html += ' cut3';
  272. }else if(item.cornerDispType == 'G045_4'){
  273. html += ' cut4';
  274. }else if(item.cornerDispType == 'G045_5'){
  275. html += ' cut5';
  276. }
  277. html += '">';
  278. $.each(planCornerGoodsList, function(idx2, item2) {
  279. if (item2.cornerNm == item.cornerNm) {
  280. html += ' <div class="item_prod">';
  281. html += ' <div class="item_state">';
  282. html += ' <button type="button" class="itemLike';
  283. if(item2.likeIt == 'likeit'){
  284. html += ' likeit';
  285. }
  286. html += ' "';
  287. html += ' onClick="cfnPutWishList(this);" goodsCd=\''+item2.goodsCd+'\', ithrCd=\'\', contentsLoc=\'\', planDtlSq=\'\'>관심상품 추가</button>';
  288. html += ' <a href="javascript:void(0);" onclick="cfnGoToGoodsDetail(\'' + item2.goodsCd + '\')" class="itemLink">';
  289. html += ' <div class="itemPic">';
  290. html += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item2.sysImgNm +'">';
  291. html += ' </div>';
  292. html += ' <p class="itemBrand">'+item2.brandGroupNm+'</p>';
  293. html += ' <div class="itemName">'+item2.goodsNm+'</div>';
  294. html += ' <p class="itemPrice">'+item2.currPrice.addComma();
  295. if (item2.currPrice != item2.listPrice) {
  296. html += ' <span class="itemPrice_original">'+item2.listPrice.addComma()+'</span>';
  297. }
  298. if (item2.dcRate != 0) {
  299. html += ' <span class=" itemPercent">'+item2.dcRate.addComma()+'%</span>';
  300. }
  301. html += ' </p>';
  302. html += ' <div class="itemcolorchip">';
  303. if(!gagajf.isNull(item2.colorChips)){
  304. var colorArr = item2.colorChips.split(",");
  305. var colorCd = '';
  306. var rgbColor = '';
  307. for(let i=0; i<colorArr.length; i++){
  308. var colorInfo = colorArr[i].split(":");
  309. colorCd = colorInfo[0];
  310. rgbColor = colorInfo[1];
  311. if(rgbColor=='#FFFFFF'){
  312. html += ' <span class="chip_color" style="background-color: '+rgbColor+';border:1px solid #aaa;" value="'+colorCd+'">'+colorCd+'</span>';
  313. }else{
  314. html += ' <span class="chip_color" style="background-color: '+rgbColor+'" value="'+colorCd+'">'+colorCd+'</span>';
  315. }
  316. }
  317. }
  318. html += ' </div>';
  319. if(!gagajf.isNull(item2.icon)){
  320. var iconArr = item2.icon.split(",");
  321. var iconGb = '';
  322. var iconNm = '';
  323. html += ' <p class="itemBadge">';
  324. for(let i=0; i<iconArr.length; i++){
  325. var iconInfo = iconArr[i].split(":");
  326. iconGb = iconInfo[0];
  327. iconNm = iconInfo[1];
  328. html += ' <span class="badge13" value="'+iconGb+'">'+iconNm+' </span>';
  329. }
  330. html += ' </p>';
  331. }
  332. if(item2.goodsTnm != null){
  333. html += ' <div class="itemComment">'+item2.goodsTnm+'</div>';
  334. }
  335. html += ' </a>';
  336. html += ' </div>';
  337. html += ' </div>';
  338. }
  339. })
  340. html += ' </div>';
  341. html += ' </div>';
  342. })
  343. html += ' </div>';
  344. html += ' </div>';
  345. $("#cornerList").append(html);
  346. }
  347. if(review.length>0){
  348. var html = '';
  349. html += ' <div class="cont_head">';
  350. html += ' <div>';
  351. html += ' <h4>'+review[0].title+'</h4>';
  352. html += ' </div>';
  353. html += ' <div class="cont_body">';
  354. html += ' <div class="review_list">';
  355. $.each(review, function(idx, item) {
  356. html += ' <div class="reviw_box">'
  357. html += ' <div class="best_review">';
  358. if(item.reviewSysImg!= null){
  359. html += ' <a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'\', \'Y\',\''+item.reviewSq+'\');">';
  360. }else{
  361. html += ' <a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'\', \'N\',\''+item.reviewSq+'\');">';
  362. }
  363. html += ' <div class="pic">';
  364. if(item.reviewSysImg!= null){
  365. if (item.fileGb == 'M') {
  366. html += ' <span class="thumb mov" style="background-image: url('+ _uploadImageUrl+item.reviewSysImg +');"></span>';
  367. }else{
  368. html += ' <span class="thumb" style="background-image: url('+ _uploadImageUrl +item.reviewSysImg +');"></span>';
  369. }
  370. }else{
  371. html += ' <span class="thumb" style="background-image: url('+ _uploadGoodsUrl+'/'+item.sysImgNm +');"></span>';
  372. }
  373. html += ' </div>';
  374. html += ' <div class="star_score">';
  375. html += ' <span class="star">';
  376. html += ' <em class="progbar" style="width:'+(item.score*20)+'%;"></em> <!-- 평점 style로 표기 -->';
  377. html += ' </span>';
  378. if(item.bestYn == 'Y'){
  379. html += '<em class="ico ico_besttag"></em>';
  380. }
  381. html += ' </div>';
  382. html += ' <div class="txt_best_review">';
  383. html += ' <p>'+item.reviewContent+'</p>';
  384. html += ' </div>';
  385. html += ' <div class="info_writer">';
  386. html += ' <span class="wr_id">'+item.maskingCustId+'</span>';
  387. html += ' <span class="wr_date">'+item.regDt+'</span>';
  388. html += ' </div>';
  389. html += ' </a>';
  390. html += ' </div>';
  391. html += ' <div class="review_item">';
  392. html += ' <div class="item_prod">';
  393. html += ' <div class="item_state">';
  394. html += ' <a href="javascript:void(0)" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">';
  395. html += ' <div class="itemPic">';
  396. html += ' <img alt="" class="vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">';
  397. html += ' </div>';
  398. html += ' <div class="itemName">'+item.goodsNm+'</div>';
  399. html += ' <p class="itemPrice">'+item.currPrice.addComma()+'</p>';
  400. html += ' </a>';
  401. html += ' </div>';
  402. html += ' </div>';
  403. html += ' </div>';
  404. html += ' </div> ';
  405. });
  406. html += ' </div> ';
  407. html += ' </div>';
  408. html += '</div>';
  409. $("#G082_10").append(html);
  410. }
  411. if(image.length>0){
  412. var html = '';
  413. html += '<div class="cont_body"> ';
  414. html += ' <div class="mid_banner">';
  415. html += ' <div class="swiper-container">';
  416. html += ' <div class="swiper-wrapper">';
  417. for (var i = 0; i < image.length; i++) {
  418. html += ' <div class="swiper-slide">';
  419. if (image[i].linkOpenGb == 'M') {
  420. html += ' <a href="'+image[i].linkUrl+'" target="_self">><img alt="" src="'+ _uploadImageUrl + image[i].itemVal +'"></a>';
  421. }else{
  422. html += ' <a href="'+image[i].linkUrl+'" target="_blank">><img alt="" src="'+ _uploadImageUrl + image[i].itemVal +'"></a>';
  423. }
  424. html += ' </div>';
  425. }
  426. html += ' </div>';
  427. html += ' </div>';
  428. html += ' <div class="swiper-button-prev"></div>';
  429. html += ' <div class="swiper-button-next"></div>';
  430. html += ' <div class="swiper-pagination"></div>';
  431. html += ' </div>';
  432. html += '</div>';
  433. $("#G082_30").append(html);
  434. }
  435. if(goods1.length>0){
  436. var array = [];
  437. for (var j = 0; j < template.length; j++) {
  438. if(template[j].tmplType == 'G082_50'){
  439. array.push(template[j].planContSq);
  440. }
  441. }
  442. for (var i = 0; i < template.length; i++) {
  443. var html = '';
  444. if(template[i].tmplType == 'G082_50' && array[0] == template[i].planContSq && typeof array[0] != 'undefined') {
  445. html += '<div class="cont_head">';
  446. html += ' <div>';
  447. html += ' <h4>';
  448. if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
  449. if (template[i].linkOpenGb == 'M') { //본창
  450. html += ' <a href="'+template[i].linkUrl+'" target="_self">'+template[i].title+' <i class="ico_arrow"></i></a>';
  451. }else{
  452. html += ' <a href="'+template[i].linkUrl+'" target="_blank">'+template[i].title+' <i class="ico_arrow"></i></a>';
  453. }
  454. }else{
  455. html += ' <a href="javascript:void(0)">'+template[i].title+'</a>';
  456. }
  457. html += ' </h4>';
  458. html += ' </div>';
  459. html += '</div>';
  460. html += '<div class="cont_body">';
  461. html += ' <div class="dp_listItems_cont type1">';
  462. html += ' <ul>';
  463. $.each(goods1, function(idx, item) {
  464. if (item.planContSq == template[i].planContSq) {
  465. html += ' <li>';
  466. html += ' <div class="dp_listItems">';
  467. html += ' <div class="dp_listItems_img">';
  468. html += ' <img src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'" alt="">';
  469. html += ' </div>';
  470. html += ' <div class="dp_listItems_info">';
  471. html += ' <div class="dp_listItems_brand">'+item.brandGroupNm+'</div>';
  472. html += ' <div class="dp_listItems_name">'+item.goodsNm+'<br></div>';
  473. html += ' <div class="dp_listItems_price">';
  474. html += ' <span class="price">'+item.currPrice.addComma()+'</span>';
  475. if (item.currPrice != item.listPrice) {
  476. html += ' <del>'+item.listPrice.addComma()+'</del>';
  477. html += ' <span class="percent">'+Math.floor(item.dcRate)+'%</span>';
  478. }
  479. html += ' </div>';
  480. if(item.goodsTnm != null){
  481. html += ' <div class="itemComment">'+item.goodsTnm+'</div>';
  482. }
  483. html += ' <div class="ui_row">';
  484. html += ' <button type="button" class="btn btn_default" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')"><span>자세히 보기</span></button>';
  485. html += ' </div>';
  486. html += ' </div>';
  487. html += ' </div>';
  488. html += ' </li>';
  489. }
  490. });
  491. html += ' </ul>';
  492. html += ' </div> ';
  493. html += '</div>';
  494. $("#G082_50" +array[0]).append(html);
  495. }
  496. if($("#G082_50" +template[i].planContSq).length){
  497. array.shift();
  498. }
  499. }
  500. }
  501. if(goods2.length>0){
  502. var array = [];
  503. for (var j = 0; j < template.length; j++) {
  504. if(template[j].tmplType == 'G082_51'){
  505. array.push(template[j].planContSq);
  506. }
  507. }
  508. for (var i = 0; i < template.length; i++) {
  509. var html = '';
  510. if(template[i].tmplType == 'G082_51' && array[0] == template[i].planContSq && typeof array[0] != 'undefined'){
  511. html += '<div class="cont_head">';
  512. html += ' <div>';
  513. html += ' <h4>';
  514. if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
  515. if (template[i].linkOpenGb == 'M') { //본창
  516. html += ' <a href="'+template[i].linkUrl+'" target="_self">'+template[i].title+' <i class="ico_arrow"></i></a>';
  517. }else{
  518. html += ' <a href="'+template[i].linkUrl+'" target="_blank">'+template[i].title+' <i class="ico_arrow"></i></a>';
  519. }
  520. }else{
  521. html+=' <a href="javascript:void(0)">'+template[i].title+'</a>';
  522. }
  523. html += ' </h4>';
  524. html += ' </div>';
  525. html += '</div>';
  526. html += '<div class="cont_body">';
  527. html += ' <div class="dp_listItems_cont type2">';
  528. html += ' <div class="swiper-container">';
  529. html += ' <div class="swiper-wrapper">';
  530. $.each(goods2, function(idx, item) {
  531. if (item.planContSq == template[i].planContSq) {
  532. html += ' <div class="swiper-slide">';
  533. html += ' <div class="item_prod">';
  534. html += ' <div class="item_state">';
  535. html += ' <a onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">';
  536. html += ' <div class="itemPic">';
  537. html += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">';
  538. html += ' </div>';
  539. html += ' <p class="itemBrand">'+item.brandGroupNm+'</p>';
  540. html += ' <div class="itemName">'+item.goodsNm+'</div>';
  541. html += ' <p class="itemPrice">'+item.currPrice.addComma();
  542. if (item.currPrice != item.listPrice) {
  543. html+=' <span class="itemPrice_original">'+item.listPrice.addComma()+'</span>';
  544. html+=' <span class=" itemPercent">'+Math.floor(item.dcRate)+'%</span>';
  545. }
  546. html += ' </p>';
  547. if(item.goodsTnm != null){
  548. html += ' <div class="itemComment">'+item.goodsTnm+'</div>';
  549. }
  550. html += ' </a>';
  551. html += ' </div>';
  552. html += ' </div>';
  553. html += ' </div> ';
  554. }
  555. });
  556. html += ' </div>';
  557. html += ' </div>';
  558. html += ' <div class="swiper-button-prev"></div>';
  559. html += ' <div class="swiper-button-next"></div>';
  560. html += ' <div class="swiper-pagination"></div>';
  561. html += ' </div> ';
  562. html += '</div>';
  563. $("#G082_51" +array[0]).append(html);
  564. }
  565. if($("#G082_51" +template[i].planContSq).length){
  566. array.shift();
  567. }
  568. }
  569. }
  570. if(goods4.length>0){
  571. var array = [];
  572. for (var j = 0; j < template.length; j++) {
  573. if(template[j].tmplType == 'G082_52'){
  574. array.push(template[j].planContSq);
  575. }
  576. }
  577. for (var i = 0; i < template.length; i++) {
  578. var html = '';
  579. if(template[i].tmplType == 'G082_52' && array[0] == template[i].planContSq && typeof array[0] != 'undefined'){
  580. html += '<div class="cont_head">';
  581. html += '<div>';
  582. html += ' <h4>';
  583. if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
  584. if (template[i].linkOpenGb == "M") { //본창
  585. html += ' <a href="'+template[i].linkUrl+'" target="_self">'+template[i].title+' <i class="ico_arrow"></i></a>';
  586. }else{
  587. html += ' <a href="'+template[i].linkUrl+'" target="_blank">'+template[i].title+' <i class="ico_arrow"></i></a>';
  588. }
  589. }else{
  590. html+=' <a href="javascript:void(0)">'+template[i].title+'</a>';
  591. }
  592. html += ' </h4>';
  593. html += ' </div>';
  594. html += '</div>';
  595. html += '<div class="cont_body">';
  596. html += ' <!-- 상품 노출 4열 type3 -->';
  597. html += ' <div class="dp_listItems_cont type3">';
  598. html += ' <div class="swiper-container">';
  599. html += ' <div class="swiper-wrapper">';
  600. $.each(goods4, function(idx, item) {
  601. if (item.planContSq == template[i].planContSq) {
  602. html += ' <div class="swiper-slide">';
  603. html += ' <div class="item_prod">';
  604. html += ' <div class="item_state">';
  605. html += ' <a onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">';
  606. html += ' <div class="itemPic">';
  607. html += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">';
  608. html += ' </div>';
  609. html += ' <p class="itemBrand">'+item.brandGroupNm+'</p>';
  610. html += ' <div class="itemName">'+item.goodsNm+'</div>';
  611. html += ' <p class="itemPrice">'+item.currPrice.addComma();
  612. if (item.currPrice != item.listPrice) {
  613. html+=' <span class="itemPrice_original">'+item.listPrice.addComma()+'</span>';
  614. html+=' <span class=" itemPercent">'+Math.floor(item.dcRate)+'%</span>';
  615. }
  616. html += ' </p>';
  617. if(item.goodsTnm != null){
  618. html += ' <div class="itemComment">'+item.goodsTnm+'</div>';
  619. }
  620. html += ' </a>';
  621. html += ' </div>';
  622. html += ' </div>';
  623. html += ' </div>';
  624. }
  625. });
  626. html += ' </div>';
  627. html += ' </div>';
  628. html += ' <div class="swiper-button-prev"></div>';
  629. html += ' <div class="swiper-button-next"></div>';
  630. html += ' <div class="swiper-pagination"></div>';
  631. html += ' </div> ';
  632. html += '</div>';
  633. $("#G082_52" +array[0]).append(html);
  634. }
  635. if($("#G082_52" +template[i].planContSq).length){
  636. array.shift();
  637. }
  638. }
  639. }
  640. if(coupon.length>0){
  641. var html = '';
  642. html += '<div class="cont_head">';
  643. html += ' <div>';
  644. html += ' <h4>'+coupon[0].title+'</h4>';
  645. html += ' </div>';
  646. html += '</div>';
  647. html += '<div class="cont_body">';
  648. html += ' <div class="coupon_list">';
  649. html += ' <ul>';
  650. $.each(coupon, function(idx, item) {
  651. html += ' <li>';
  652. html += ' <div class="coupon">';
  653. html += ' <div>';
  654. html += ' <p class="cp_name">'+item.cpnNm+'</p>';
  655. html += ' <p class="cp_cont">';
  656. html += ' <span><em>'+item.dcVal.addComma()+'</em>'+item.dcWay+'</span>';
  657. html += ' </p>';
  658. html += ' <p class="cp_condition">'+item.useCondition;
  659. html += ' <span>'+item.issueCondition+'</span>';
  660. html += ' </p>';
  661. html += ' </div>';
  662. if (item.couponStat == '쿠폰받기') {
  663. html += ' <button type="button" id="coupon_'+item.cpnId+'" class="btn btn_dark btn_block btn_coupon_down" onclick="fnPlanCouponDown('+item.cpnId+')">';
  664. html += ' <span>쿠폰받기</span>';
  665. html += ' </button>';
  666. }else{
  667. html += ' <button type="button"';
  668. html += ' class="btn btn_dark btn_block btn_coupon_done" disabled>';
  669. html += ' <span>받기완료</span>';
  670. html += ' </button>';
  671. }
  672. html += ' </div>';
  673. html += ' <button type="button" class="btn_underline" id="btn_couponInfo_pop" onclick="usePlanInfoCoupon('+item.cpnId+')">';
  674. html += ' <span>사용안내</span>';
  675. html += ' </button>';
  676. html += ' </li>';
  677. });
  678. html += ' </ul>';
  679. html += ' </div>';
  680. html += '</div>';
  681. html += '<div class="content dp_announce line"> ';
  682. html += ' <div class="cont_head"> ';
  683. html += ' <div> ';
  684. html += ' <h4>유의사항</h4> ';
  685. html += ' </div> ';
  686. html += ' </div> ';
  687. html += ' <div class="cont_body"> ';
  688. html += ' <div class="announce_txt"> ';
  689. html += ' <div class="note_txt"> ';
  690. html += ' <img src="/images/pc/ico_content_find.png" alt="유의사항"> ';
  691. html += ' <p>유의사항</p> ';
  692. html += ' </div> ';
  693. html += ' <div class="announce_list"> ';
  694. html += coupon[0].note;
  695. html += ' </div> ';
  696. html += ' </div> ';
  697. html += ' </div> ';
  698. html += '</div> ';
  699. $("#G082_20").append(html);
  700. }
  701. //사용안내 모달
  702. var usePlanInfoCoupon = function (id) {
  703. var data = {cpnId : id
  704. ,planSq : plan.planSq};
  705. var jsonData = JSON.stringify(data);
  706. $.ajax( {
  707. type : "POST",
  708. url : '/planning/coupon/detailpop',
  709. data : jsonData,
  710. contentType: 'application/json',
  711. dataType : 'html',
  712. success : function(result) {
  713. if (result != null) {
  714. $("#couponInfoPop").html(result);
  715. $("#couponInfoPop").modal("show");
  716. }
  717. }
  718. });
  719. return false;
  720. }
  721. //쿠폰 다운로드
  722. var fnPlanCouponDown = function(obj){
  723. if (!cfCheckLogin()) {
  724. cfnGoToPage(_PAGE_LOGIN);
  725. return false;
  726. }
  727. let cpnId = obj;
  728. gagajf.ajaxJsonSubmit(_PAGE_PLANNING_CPN_DOWNLOAD, JSON.stringify({cpnId: cpnId}), fnPlanCouponCallBack);
  729. }
  730. // 쿠폰다운로드 콜백
  731. var fnPlanCouponCallBack = function(result){
  732. console.log(result);
  733. $.each(result.couponList, function (idx, item) {
  734. if (Number(item.custPubLimitQty) > 0){
  735. if (Number(item.custPubLimitQty) <= Number(item.custCouponCnt)){
  736. $('#coupon_'+ item.cpnId).html('<span>받기완료</span>');
  737. $('#coupon_'+ item.cpnId).attr('disabled', true);
  738. }
  739. }
  740. });
  741. }
  742. // 설문조사 참여 버튼 클릭
  743. var fnJoinConfirm = function () {
  744. let planSq = plan.planSq;
  745. cfnGoToPollDetail(planSq);
  746. }
  747. // 댓글 입력 확인
  748. var fnTextConfirm = function() {
  749. //로그인 확인
  750. if (!cfCheckLogin()) {
  751. mcxDialog.alert("로그인 후 참여 가능합니다.");
  752. $("#replyText").val('');
  753. return false;
  754. }
  755. }
  756. var ajaxReplyList = function () {
  757. gagaPaging.init('searchForm', fnSearchCallback, 'paging', 10);
  758. gagaPaging.load(1);
  759. }
  760. var fnSearchCallback = function (result) {
  761. $("#replyList").html('');
  762. if (result!=null) {
  763. var html = '';
  764. html += '<div class="cmt_list_tit">';
  765. html += ' <strong>댓글</strong><span class="cnt">('+result.replyCount.addComma()+')</span>';
  766. html += '</div>';
  767. if (result.replyList.length>0) {
  768. html += '<ul class="cmt_list">';
  769. $.each(result.replyList, function (idx, item) {
  770. html += ' <li>';
  771. html += ' <div class="cmt_top">';
  772. html += ' <span class="writer">'+item.maskingCustId+'</span>';
  773. html += ' <span class="date">'+item.entryDt+'</span>';
  774. html += ' </div>';
  775. html += ' <div class="cmt_cont">';
  776. html += ' <div class="img_wrap clear" onclick="fnImgAttach(this)">';
  777. if (result.replyAttachList.length>0) {
  778. for (var i = 0; i < result.replyAttachList.length; i++) {
  779. if(result.replyAttachList[i].planEntrySq == item.planEntrySq){
  780. html += ' <span class="pics"><img class="picsThumbs" src="'+ _uploadImageUrl +'/'+result.replyAttachList[i].sysFileNm +'"></span>';
  781. }
  782. }
  783. }
  784. html += ' </div>';
  785. html += ' <p>'+item.entryVal1.escapeHtml()+'</p>';
  786. if (item.entryCustNo == result.custNo) {
  787. html += ' <button class="btn btn_default btn_del" value="'+item.planEntrySq+'" onclick="fnDelReply(this.value)"><span>삭제</span></button>';
  788. }
  789. html += ' </div>';
  790. html += ' </li>';
  791. });
  792. html += '</ul>';
  793. }else{
  794. html += '<div class="nodata" id="replyNoData"> ';
  795. html += ' <div class="txt_box"> ';
  796. html += ' <p> ';
  797. html += ' 등록된 댓글이 없습니다. ';
  798. html += ' </p> ';
  799. html += ' </div> ';
  800. html += '</div> ';
  801. }
  802. }
  803. $("#replyList").append(html);
  804. // Create pagination
  805. gagaPaging.createPagination(result.paging.pageable);
  806. }
  807. // 댓글 삭제
  808. var fnDelReply = function(obj) {
  809. data = {planEntrySq : obj};
  810. var jsonData = JSON.stringify(data);
  811. mcxDialog.confirm("댓글을 삭제 하시겠습니까?", {
  812. cancelBtnText : "취소",
  813. sureBtnText : "확인",
  814. sureBtnClick : function() {
  815. gagajf.ajaxJsonSubmit('/planning/reply/delete', jsonData,function() {
  816. ajaxReplyList();
  817. });
  818. }
  819. })
  820. }
  821. $('#fileAdd').on('change', function() { fnChooseFile(this); });
  822. var fnChooseFile = function(obj) {
  823. var picLength = $(".pics").length;
  824. // multiple 속성이 있으면 files에는 다수의 객체가 할당됨
  825. var file = obj.files[0];
  826. if (!gagajf.isNull(file.name)) {
  827. var extension = "\.(jpg|jpeg|png)$";
  828. if (!(new RegExp(extension, "i")).test(file.name)) {
  829. mcxDialog.alertC('이미지는 [jpg, jpeg, png] 파일만 가능합니다.', {
  830. sureBtnText: "확인",
  831. sureBtnClick: function() {
  832. //$(obj).parent('.imgUpload').find('.removes').trigger('click');
  833. $('.imgUpload').find('span').eq(0).remove();
  834. }
  835. });
  836. return false;
  837. }
  838. }
  839. // 이거 왜 안먹히지
  840. if (!gagajf.isNull(file.size) && Number(file.size) > (10 * 1000000)) {
  841. mcxDialog.alertC('이미지는 최대 10MB 이하 파일만 가능합니다.', {
  842. sureBtnText: "확인",
  843. sureBtnClick: function() {
  844. $(obj).parent('.imgUpload').find('.removes').trigger('click');
  845. }
  846. });
  847. return false;
  848. }
  849. // 파일 업로드
  850. gagajf.ajaxFileUpload('/common/file/upload?subDir=/reply'
  851. , file
  852. , function(result) {
  853. // 업로드한 파일명 설정
  854. $(".pics").children().eq(0).append("<input type='hidden' name='orgFileNm' id='orgFileNm"+(picLength+1)+"' value='"+result.oldFileName+"'>");
  855. $(".pics").children().eq(0).append("<input type='hidden' name='sysFileNm' id='sysFileNm"+(picLength+1)+"' value='"+result.newFileName+"'>");
  856. }
  857. );
  858. }
  859. // 댓글 등록 버튼 클릭 시
  860. var fnReplySave = function() {
  861. var fileLength = $("input[name='sysFileNm']").length;
  862. var content = $('#replyText').val();
  863. if (content.length < 2){
  864. mcxDialog.alert("최소 2자 이상 입력해주세요.");
  865. return;
  866. }
  867. 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빨','후려','후빨','ㅗ');
  868. if(yokList.indexOf(content)>=0){
  869. mcxDialog.alert("입력 불가한 내용을 포함하고 있습니다.");
  870. $('#replyText').val('');
  871. $('#cmt_cnt').text(0);
  872. return;
  873. }
  874. //파일관련 데이터 담기
  875. var multiReplyOrgFile = [];
  876. var multiReplySysFile = [];
  877. for (var i = 0; i < fileLength; i++) {
  878. multiReplyOrgFile.push($(".pics").eq(i).find('input[name="orgFileNm"]').val());
  879. multiReplySysFile.push($(".pics").eq(i).find('input[name="sysFileNm"]').val());
  880. }
  881. data = {entryVal1 : content,
  882. planSq : plan.planSq,
  883. multiReplyOrgFile : multiReplyOrgFile,
  884. multiReplySysFile : multiReplySysFile};
  885. var jsonData = JSON.stringify(data);
  886. mcxDialog.confirm("댓글을 등록 하시겠습니까?", {
  887. cancelBtnText : "취소",
  888. sureBtnText : "확인",
  889. sureBtnClick : function() {
  890. gagajf.ajaxJsonSubmit('/planning/reply/save', jsonData,function() {
  891. ajaxReplyList();
  892. $('#replyText').val('');
  893. $('.pics').remove();
  894. $('.fileAdd').show();
  895. //댓글 작성시 글자 카운트
  896. $('#cmt_cnt').text(0);
  897. });
  898. }
  899. })
  900. }
  901. var fnImgAttach = function (obj) {
  902. $("#thumbImgPop .swiper-wrapper").empty();
  903. //var popSlideIndex = $(obj).find('span').length -1;
  904. var popSlideIndex = 0;
  905. contactPopSwiper.slideTo(popSlideIndex);
  906. contactPopSwiper.update();
  907. var contactImglength = $(obj).find('span').length;
  908. var popImgHtml = "";
  909. for (i = 0; i < contactImglength; i++) {
  910. var contactImgSrc =$(obj).find('img').eq(i).attr('src');
  911. popImgHtml += "<div class='swiper-slide'><div class='pop_img' style='background-image:url("+ contactImgSrc +")'></div></div>";
  912. }
  913. $("#thumbImgPop .swiper-wrapper").append(popImgHtml);
  914. $('#thumbImgPop').modal("show");
  915. return false;
  916. }
  917. /* SLIDE - 댓글 이미지 팝업 */
  918. var contactPopSwiper = new Swiper('.thumb_img_pop .swiper-container', {
  919. navigation: {
  920. nextEl: '.thumb_img_pop .swiper-button-next',
  921. prevEl: '.thumb_img_pop .swiper-button-prev',
  922. },
  923. pagination: {
  924. el: '.thumb_img_pop .swiper-pagination',
  925. clickable: true,
  926. },
  927. observer:true,
  928. observeParents: true,
  929. });
  930. $(document).ready( function() {
  931. ajaxReplyList();
  932. //공유 버튼 토글
  933. $("button[data-name=openShare]").on("click", function(){
  934. $(this).toggleClass("on").next(".shareWrap").toggleClass("on");
  935. return false;
  936. });
  937. //영역밖 클릭으로 공유토글 닫기
  938. $("body").on('click', function(e) {
  939. if(!$(".shareWrap.on").parent().has(e.target).length) {
  940. $("button[data-name=openShare]").removeClass("on");
  941. $(".shareWrap").removeClass("on");
  942. };
  943. });
  944. $('.btn_copy').bind('click', function() {
  945. copyToClipboard();
  946. });
  947. //팝업 - 쿠폰사용안내
  948. $(document).on('click','#btn_couponInfo_pop',function(e){
  949. $("#couponInfoPop .modal-content").load("popup_couponInfo.html");
  950. $("#couponInfoPop").modal("show");
  951. return false;
  952. });
  953. $("#couponInfoPop_close").click(function() {
  954. $.modal.close();
  955. });
  956. //팝업 - 상품 베스트 리뷰 (detail)
  957. $(document).on('click','#btn_pdBestReview_pop, .area_rv_best .best_review a',function(e){
  958. $("#pdBestReviewPop .modal-content").load("pd_bestreviewdetail_pop.html");
  959. $("#pdBestReviewPop").modal("show");
  960. return false;
  961. });
  962. $("#pdBestReviewPop_close").click(function() {
  963. $.modal.close();
  964. });
  965. /* SLIDE - 상단 프로모션 배너 */
  966. var promotion_visual_slide = new Swiper ('.dp_detail_visual .promotion_visual.type2 .swiper-container', {
  967. loop: true,
  968. slidesPerView: 1,
  969. speed : 1500,
  970. navigation: {
  971. nextEl: '.promotion_visual.type2 .swiper-button-next',
  972. prevEl: '.promotion_visual.type2 .swiper-button-prev',
  973. },
  974. pagination: {
  975. el: '.promotion_visual.type2 .swiper-pagination',
  976. clickable: true,
  977. },
  978. });
  979. /* SLIDE - 중간 배너 */
  980. var mid_banner_slide = new Swiper ('.dp_mid_banner .mid_banner .swiper-container', {
  981. loop: true,
  982. slidesPerView: 1,
  983. speed : 1500,
  984. navigation: {
  985. nextEl: '.mid_banner .swiper-button-next',
  986. prevEl: '.mid_banner .swiper-button-prev',
  987. },
  988. pagination: {
  989. el: '.mid_banner .swiper-pagination',
  990. clickable: true,
  991. },
  992. });
  993. /* SLIDE - 대표상품 슬라이드 2열 상품 */
  994. var dp_listItems_slide1 = new Swiper ('.dp_listItems_cont.type2 .swiper-container', {
  995. loop: false,
  996. slidesPerView: 2,
  997. slidesPerGroup: 2,
  998. spaceBetween: 20,
  999. speed : 800,
  1000. navigation: {
  1001. nextEl: '.dp_listItems_cont.type2 .swiper-button-next',
  1002. prevEl: '.dp_listItems_cont.type2 .swiper-button-prev',
  1003. },
  1004. pagination: {
  1005. el: '.dp_listItems_cont.type2 .swiper-pagination',
  1006. clickable: true,
  1007. },
  1008. });
  1009. /* SLIDE - 대표상품 슬라이드 4열 상품 */
  1010. var dp_listItems_slide2 = new Swiper ('.dp_listItems_cont.type3 .swiper-container', {
  1011. loop: false,
  1012. slidesPerView: 4,
  1013. slidesPerGroup: 4,
  1014. spaceBetween: 20,
  1015. speed : 800,
  1016. navigation: {
  1017. nextEl: '.dp_listItems_cont.type3 .swiper-button-next',
  1018. prevEl: '.dp_listItems_cont.type3 .swiper-button-prev',
  1019. },
  1020. pagination: {
  1021. el: '.dp_listItems_cont.type3 .swiper-pagination',
  1022. clickable: true,
  1023. },
  1024. });
  1025. /* SLIDE - 다른 기획전,이벤트 보기 */
  1026. var other_slide_slide = new Swiper ('.other_promotion_slide .swiper-container', {
  1027. slidesPerView: 5,
  1028. spaceBetween: 20,
  1029. navigation: {
  1030. nextEl: '.other_promotion_slide .swiper-button-next',
  1031. prevEl: '.other_promotion_slide .swiper-button-prev',
  1032. },
  1033. });
  1034. // 첨부파일 갯수제한
  1035. $('.imgUpload .fileAdd').click(function(){
  1036. if (!cfCheckLogin()) {
  1037. mcxDialog.alert("로그인 후 참여 가능합니다.");
  1038. $("#replyText").val('');
  1039. return false;
  1040. }
  1041. var imgFiles=$('.imgUpload .pics');
  1042. var maxFileLength = 10; /* 최대 파일 갯수를 입력해 주세요 */
  1043. if (imgFiles.length >= maxFileLength) {
  1044. mcxDialog.alert('이미지는 최대' + maxFileLength +'장 까지 첨부 가능합니다.');
  1045. $('#fileAdd').attr("disabled",true);
  1046. } else if(imgFiles.length < maxFileLength){
  1047. $('#fileAdd').removeAttr("disabled");
  1048. }
  1049. });
  1050. //댓글 작성시 글자 카운트
  1051. $('.cmt_ans').keyup(function (e){
  1052. var content = $(this).val();
  1053. $('#cmt_cnt').html(content.length);
  1054. if (content.length > 500){
  1055. $(this).val(content.substring(0, 500));
  1056. $('#cmt_cnt').html("500");
  1057. }
  1058. });
  1059. });
  1060. </script>
  1061. </th:block>
  1062. </body>
  1063. </html>