PlanningDetailFormWeb.html 48 KB

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