PlanningDetailFormWeb.html 53 KB

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