PlanningDetailFormWeb.html 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256
  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(template.length>0){
  378. if(review.length>0 || reviewContent[0].title != ''){
  379. $("#G082_10").show();
  380. var html = '';
  381. html += ' <div class="cont_head">\n';
  382. html += ' <div>\n';
  383. html += ' <h4>'+reviewContent[0].title+'</h4>\n';
  384. html += ' </div>\n';
  385. html += ' <div class="cont_body">\n';
  386. html += ' <div class="review_list">\n';
  387. $.each(review, function(idx, item) {
  388. html += ' <div class="reviw_box">\n'
  389. html += ' <div class="best_review">\n';
  390. if(item.reviewSysImg!= null){
  391. if (item.bestYn == 'Y') {
  392. html += ' <a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'Y\',\''+item.reviewSq+'\');">\n';
  393. }else{
  394. html += ' <a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'N\', \'Y\',\''+item.reviewSq+'\');">\n';
  395. }
  396. }else{
  397. if (item.bestYn == 'Y') {
  398. html += ' <a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'N\',\''+item.reviewSq+'\');">\n';
  399. }else{
  400. html += ' <a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'N\', \'N\',\''+item.reviewSq+'\');">\n';
  401. }
  402. }
  403. html += ' <div class="pic">\n';
  404. if(item.reviewSysImg!= null){
  405. if (item.fileGb == 'M') {
  406. html += ' <span class="thumb mov" style="background-image: url('+ _uploadImageUrl+item.reviewSysImg +');"></span>\n';
  407. }else{
  408. html += ' <span class="thumb" style="background-image: url('+ _uploadImageUrl +item.reviewSysImg +');"></span>\n';
  409. }
  410. }else{
  411. html += ' <span class="thumb" style="background-image: url('+ _uploadGoodsUrl+'/'+item.sysImgNm +');"></span>\n';
  412. }
  413. html += ' </div>\n';
  414. html += ' <div class="star_score">\n';
  415. html += ' <span class="star">\n';
  416. html += ' <em class="progbar" style="width:'+(item.score*20)+'%;"></em>\n';
  417. html += ' </span>\n';
  418. if(item.bestYn == 'Y'){
  419. html += '<em class="ico ico_besttag"></em>\n';
  420. }
  421. html += ' </div>\n';
  422. html += ' <div class="txt_best_review">\n';
  423. html += ' <p>'+item.reviewContent+'</p>\n';
  424. html += ' </div>\n';
  425. html += ' <div class="info_writer">\n';
  426. html += ' <span class="wr_id">'+item.maskingCustId+'</span>\n';
  427. html += ' <span class="wr_date">'+item.regDt+'</span>\n';
  428. html += ' </div>\n';
  429. html += ' </a>\n';
  430. html += ' </div>\n';
  431. html += ' <div class="review_item">\n';
  432. html += ' <div class="item_prod">\n';
  433. html += ' <div class="item_state">\n';
  434. html += ' <a href="javascript:void(0)" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">\n';
  435. html += ' <div class="itemPic">\n';
  436. html += ' <img alt="" class="vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">\n';
  437. html += ' </div>\n';
  438. html += ' <div class="itemName">'+item.goodsNm+'</div>\n';
  439. html += ' <p class="itemPrice">'+item.currPrice.addComma()+'</p>\n';
  440. html += ' </a>\n';
  441. html += ' </div>\n';
  442. html += ' </div>\n';
  443. html += ' </div>\n';
  444. html += ' </div>\n';
  445. });
  446. html += ' </div>\n ';
  447. html += ' </div>\n';
  448. html += '</div>\n';
  449. $("#G082_10").append(html);
  450. }
  451. }
  452. if(image.length>0){
  453. if (image[0].itemVal != null && image[0].itemVal != '') {
  454. $("#G082_30").show();
  455. var html = '';
  456. html += '<div class="cont_body">\n ';
  457. html += ' <div class="mid_banner">\n';
  458. html += ' <div class="swiper-container">\n';
  459. html += ' <div class="swiper-wrapper">\n';
  460. for (var i = 0; i < image.length; i++) {
  461. html += ' <div class="swiper-slide">\n';
  462. if (image[i].linkOpenGb == 'M') {
  463. html += ' <a href="'+image[i].linkUrl+'" target="_self"><img alt="" src="'+ _uploadImageUrl + image[i].itemVal +'"></a>\n';
  464. }else{
  465. html += ' <a href="'+image[i].linkUrl+'" target="_blank"><img alt="" src="'+ _uploadImageUrl + image[i].itemVal +'"></a>\n';
  466. }
  467. html += ' </div>\n';
  468. }
  469. html += ' </div>\n';
  470. html += ' </div>\n';
  471. html += ' <div class="swiper-button-prev"></div>\n';
  472. html += ' <div class="swiper-button-next"></div>\n';
  473. html += ' <div class="swiper-pagination"></div>\n';
  474. html += ' </div>\n';
  475. html += '</div>\n';
  476. $("#G082_30").append(html);
  477. }
  478. }
  479. if(template.length>0){
  480. var array = [];
  481. for (var j = 0; j < template.length; j++) {
  482. if(template[j].tmplType == 'G082_50'){
  483. array.push(template[j].planContSq);
  484. }
  485. }
  486. for (var i = 0; i < template.length; i++) {
  487. var html = '';
  488. if(template[i].tmplType == 'G082_50' && array[0] == template[i].planContSq && typeof array[0] != 'undefined') {
  489. if(template[i].title != null && template[i].title != ''){
  490. $("#G082_50" +template[i].planContSq).show();
  491. }
  492. html += '<div class="cont_head">\n';
  493. html += ' <div>\n';
  494. html += ' <h4>\n';
  495. if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
  496. if (template[i].linkOpenGb == 'M') { //본창
  497. html += ' <a href="'+template[i].linkUrl+'" target="_self">'+template[i].title+' <i class="ico_arrow"></i></a>\n';
  498. }else{
  499. html += ' <a href="'+template[i].linkUrl+'" target="_blank">'+template[i].title+' <i class="ico_arrow"></i></a>\n';
  500. }
  501. }else{
  502. html += ' <a href="javascript:void(0)">'+template[i].title+'</a>\n';
  503. }
  504. html += ' </h4>\n';
  505. html += ' </div>\n';
  506. html += '</div>\n';
  507. html += '<div class="cont_body">\n';
  508. html += ' <div class="dp_listItems_cont type1">\n';
  509. html += ' <ul>\n';
  510. $.each(goods1, function(idx, item) {
  511. if (item.planContSq == template[i].planContSq) {
  512. $("#G082_50" + item.planContSq).show();
  513. html += ' <li>\n';
  514. html += ' <div class="dp_listItems">\n';
  515. html += ' <div class="dp_listItems_img">\n';
  516. html += ' <img src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'" alt="">\n';
  517. html += ' </div>\n';
  518. html += ' <div class="dp_listItems_info">\n';
  519. html += ' <div class="dp_listItems_brand">'+item.brandGroupNm+'</div>\n';
  520. html += ' <div class="dp_listItems_name">'+item.goodsNm+'<br></div>\n';
  521. html += ' <div class="dp_listItems_price">\n';
  522. html += ' <span class="price">'+item.currPrice.addComma()+'</span>\n';
  523. if (item.currPrice != item.listPrice) {
  524. html += ' <del>'+item.listPrice.addComma()+'</del>\n';
  525. html += ' <span class="percent">'+Math.floor(item.dcRate)+'%</span>\n';
  526. }
  527. html += ' </div>\n';
  528. if(item.goodsTnm != null){
  529. html += ' <div class="itemComment">'+item.goodsTnm+'</div>\n';
  530. }
  531. html += ' <div class="ui_row">\n';
  532. html += ' <button type="button" class="btn btn_default" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')"><span>자세히 보기</span></button>\n';
  533. html += ' </div>\n';
  534. html += ' </div>\n';
  535. html += ' </div>\n';
  536. html += ' </li>\n';
  537. }
  538. });
  539. html += ' </ul>\n';
  540. html += ' </div>\n ';
  541. html += '</div>';
  542. $("#G082_50" +array[0]).append(html);
  543. }
  544. if($("#G082_50" +template[i].planContSq).length){
  545. array.shift();
  546. }
  547. }
  548. }
  549. if(template.length>0){
  550. var array = [];
  551. for (var j = 0; j < template.length; j++) {
  552. if(template[j].tmplType == 'G082_51'){
  553. array.push(template[j].planContSq);
  554. }
  555. }
  556. for (var i = 0; i < template.length; i++) {
  557. var html = '';
  558. if(template[i].tmplType == 'G082_51' && array[0] == template[i].planContSq && typeof array[0] != 'undefined'){
  559. if(template[i].title != null && template[i].title != ''){
  560. $("#G082_51" +template[i].planContSq).show();
  561. }
  562. html += '<div class="cont_head">\n';
  563. html += ' <div>\n';
  564. html += ' <h4>\n';
  565. if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
  566. if (template[i].linkOpenGb == 'M') { //본창
  567. html += ' <a href="'+template[i].linkUrl+'" target="_self">'+template[i].title+' <i class="ico_arrow"></i></a>\n';
  568. }else{
  569. html += ' <a href="'+template[i].linkUrl+'" target="_blank">'+template[i].title+' <i class="ico_arrow"></i></a>\n';
  570. }
  571. }else{
  572. html+=' <a href="javascript:void(0)">'+template[i].title+'</a>\n';
  573. }
  574. html += ' </h4>\n';
  575. html += ' </div>\n';
  576. html += '</div>\n';
  577. html += '<div class="cont_body">\n';
  578. html += ' <div class="dp_listItems_cont type2">\n';
  579. html += ' <div class="swiper-container">\n';
  580. html += ' <div class="swiper-wrapper">\n';
  581. $.each(goods2, function(idx, item) {
  582. if (item.planContSq == template[i].planContSq) {
  583. $("#G082_51" + item.planContSq).show();
  584. html += ' <div class="swiper-slide">\n';
  585. html += ' <div class="item_prod">\n';
  586. html += ' <div class="item_state">\n';
  587. html += ' <a onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">\n';
  588. html += ' <div class="itemPic">\n';
  589. html += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">\n';
  590. html += ' </div>\n';
  591. html += ' <p class="itemBrand">'+item.brandGroupNm+'</p>\n';
  592. html += ' <div class="itemName">'+item.goodsNm+'</div>\n';
  593. html += ' <p class="itemPrice">'+item.currPrice.addComma();
  594. if (item.currPrice != item.listPrice) {
  595. html+=' <span class="itemPrice_original">'+item.listPrice.addComma()+'</span>\n';
  596. html+=' <span class=" itemPercent">'+Math.floor(item.dcRate)+'%</span>\n';
  597. }
  598. html += ' </p>\n';
  599. if(item.goodsTnm != null){
  600. html += ' <div class="itemComment">'+item.goodsTnm+'</div>\n';
  601. }
  602. html += ' </a>\n';
  603. html += ' </div>\n';
  604. html += ' </div>\n';
  605. html += ' </div>\n ';
  606. }
  607. });
  608. html += ' </div>\n';
  609. html += ' </div>\n';
  610. html += ' <div class="swiper-button-prev"></div>\n';
  611. html += ' <div class="swiper-button-next"></div>\n';
  612. html += ' <div class="swiper-pagination"></div>\n';
  613. html += ' </div>\n ';
  614. html += '</div>\n';
  615. $("#G082_51" +array[0]).append(html);
  616. }
  617. if($("#G082_51" +template[i].planContSq).length){
  618. array.shift();
  619. }
  620. }
  621. }
  622. if(template.length>0){
  623. var array = [];
  624. for (var j = 0; j < template.length; j++) {
  625. if(template[j].tmplType == 'G082_52'){
  626. array.push(template[j].planContSq);
  627. }
  628. }
  629. for (var i = 0; i < template.length; i++) {
  630. var html = '';
  631. if(template[i].tmplType == 'G082_52' && array[0] == template[i].planContSq && typeof array[0] != 'undefined'){
  632. if(template[i].title != null && template[i].title != ''){
  633. $("#G082_52" +template[i].planContSq).show();
  634. }
  635. html += '<div class="cont_head">\n';
  636. html += '<div>\n';
  637. html += ' <h4>\n';
  638. if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
  639. if (template[i].linkOpenGb == "M") { //본창
  640. html += ' <a href="'+template[i].linkUrl+'" target="_self">'+template[i].title+' <i class="ico_arrow"></i></a>\n';
  641. }else{
  642. html += ' <a href="'+template[i].linkUrl+'" target="_blank">'+template[i].title+' <i class="ico_arrow"></i></a>\n';
  643. }
  644. }else{
  645. html+=' <a href="javascript:void(0)">'+template[i].title+'</a>\n';
  646. }
  647. html += ' </h4>\n';
  648. html += ' </div>\n';
  649. html += '</div>\n';
  650. html += '<div class="cont_body">\n';
  651. html += ' <div class="dp_listItems_cont type3">\n';
  652. html += ' <div class="swiper-container">\n';
  653. html += ' <div class="swiper-wrapper">\n';
  654. $.each(goods4, function(idx, item) {
  655. if (item.planContSq == template[i].planContSq) {
  656. $("#G082_52" + item.planContSq).show();
  657. html += ' <div class="swiper-slide">\n';
  658. html += ' <div class="item_prod">\n';
  659. html += ' <div class="item_state">\n';
  660. html += ' <a onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">\n';
  661. html += ' <div class="itemPic">\n';
  662. html += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">\n';
  663. html += ' </div>\n';
  664. html += ' <p class="itemBrand">'+item.brandGroupNm+'</p>\n';
  665. html += ' <div class="itemName">'+item.goodsNm+'</div>\n';
  666. html += ' <p class="itemPrice">'+item.currPrice.addComma();
  667. if (item.currPrice != item.listPrice) {
  668. html+=' <span class="itemPrice_original">'+item.listPrice.addComma()+'</span>\n';
  669. html+=' <span class=" itemPercent">'+Math.floor(item.dcRate)+'%</span>\n';
  670. }
  671. html += ' </p>\n';
  672. if(item.goodsTnm != null){
  673. html += ' <div class="itemComment">'+item.goodsTnm+'</div>\n';
  674. }
  675. html += ' </a>\n';
  676. html += ' </div>\n';
  677. html += ' </div>\n';
  678. html += ' </div>\n';
  679. }
  680. });
  681. html += ' </div>\n';
  682. html += ' </div>\n';
  683. html += ' <div class="swiper-button-prev"></div>\n';
  684. html += ' <div class="swiper-button-next"></div>\n';
  685. html += ' <div class="swiper-pagination"></div>\n';
  686. html += ' </div>\n ';
  687. html += '</div>\n';
  688. $("#G082_52" +array[0]).append(html);
  689. }
  690. if($("#G082_52" +template[i].planContSq).length){
  691. array.shift();
  692. }
  693. }
  694. }
  695. if(template.length>0){
  696. if(coupon.length>0 || (couponContent[0].title != '' && couponContent[0].title != null) || (couponContent[0].cpnNote0 != '' && couponContent[0].cpnNote0 != null)){
  697. $("#G082_20").show();
  698. var html = '';
  699. html += '<div class="cont_head">\n';
  700. html += ' <div>\n';
  701. html += ' <h4>'+couponContent[0].title+'</h4>\n';
  702. html += ' </div>\n';
  703. html += '</div>\n';
  704. html += '<div class="cont_body">\n';
  705. html += ' <div class="coupon_list">\n';
  706. html += ' <ul>\n';
  707. $.each(coupon, function(idx, item) {
  708. html += ' <li>\n';
  709. html += ' <div class="coupon">\n';
  710. html += ' <div>\n';
  711. html += ' <p class="cp_name">'+item.cpnNm+'</p>\n';
  712. html += ' <p class="cp_cont">\n';
  713. html += ' <span><em>'+item.dcVal.addComma()+'</em>'+item.dcWay+'</span>\n';
  714. html += ' </p>\n';
  715. html += ' <p class="cp_condition">'+item.useCondition;
  716. html += ' <span>'+item.issueCondition+'</span>\n';
  717. html += ' </p>\n';
  718. html += ' </div>\n';
  719. if (item.couponStat == '쿠폰받기') {
  720. html += ' <button type="button" id="coupon_'+item.cpnId+'" class="btn btn_dark btn_block btn_coupon_down" onclick="fnPlanCouponDown('+item.cpnId+')">\n';
  721. html += ' <span>쿠폰받기</span>\n';
  722. html += ' </button>\n';
  723. }else{
  724. html += ' <button type="button"';
  725. html += ' class="btn btn_dark btn_block btn_coupon_done" disabled>\n';
  726. html += ' <span>받기완료</span>\n';
  727. html += ' </button>\n';
  728. }
  729. html += ' </div>\n';
  730. html += ' <button type="button" class="btn_underline" id="btn_couponInfo_pop" onclick="usePlanInfoCoupon('+item.cpnId+')">\n';
  731. html += ' <span>사용안내</span>\n';
  732. html += ' </button>\n';
  733. html += ' </li>\n';
  734. });
  735. html += ' </ul>\n';
  736. html += ' </div>\n';
  737. html += '</div>\n';
  738. if(couponContent[0].cpnNote0 != null && couponContent[0].cpnNote0 != ''){
  739. html += '<div class="content dp_announce line">\n ';
  740. html += ' <div class="cont_head">\n ';
  741. html += ' <div>\n ';
  742. html += ' <h4>유의사항</h4>\n ';
  743. html += ' </div>\n ';
  744. html += ' </div>\n ';
  745. html += ' <div class="cont_body">\n ';
  746. html += ' <div class="announce_txt">\n ';
  747. html += ' <div class="note_txt">\n ';
  748. html += ' <img src="/images/pc/ico_content_find.png" alt="유의사항">\n ';
  749. html += ' <p>유의사항</p>\n ';
  750. html += ' </div>\n ';
  751. html += ' <div class="announce_list">\n ';
  752. html += ' <ul>\n';
  753. html += ' <li>' + couponContent[0].cpnNote0 +'</li>\n';
  754. if(couponContent[0].cpnNote1 != null && couponContent[0].cpnNote1 != '')
  755. html += ' <li>' + couponContent[0].cpnNote1 +'</li>\n';
  756. if(couponContent[0].cpnNote2 != null && couponContent[0].cpnNote2 != '')
  757. html += ' <li>' + couponContent[0].cpnNote2 +'</li>\n';
  758. if(couponContent[0].cpnNote3 != null && couponContent[0].cpnNote3 != '')
  759. html += ' <li>' + couponContent[0].cpnNote3 +'</li>\n';
  760. if(couponContent[0].cpnNote4 != null && couponContent[0].cpnNote4 != '')
  761. html += ' <li>' + couponContent[0].cpnNote4 +'</li>\n';
  762. if(couponContent[0].cpnNote5 != null && couponContent[0].cpnNote5 != '')
  763. html += ' <li>' + couponContent[0].cpnNote5 +'</li>\n';
  764. if(couponContent[0].cpnNote6 != null && couponContent[0].cpnNote6 != '')
  765. html += ' <li>' + couponContent[0].cpnNote6 +'</li>\n';
  766. if(couponContent[0].cpnNote7 != null && couponContent[0].cpnNote7 != '')
  767. html += ' <li>' + couponContent[0].cpnNote7 +'</li>\n';
  768. if(couponContent[0].cpnNote8 != null && couponContent[0].cpnNote8 != '')
  769. html += ' <li>' + couponContent[0].cpnNote8 +'</li>\n';
  770. if(couponContent[0].cpnNote9 != null && couponContent[0].cpnNote9 != '')
  771. html += ' <li>' + couponContent[0].cpnNote9 +'</li>\n';
  772. html += ' </ul>\n';
  773. html += ' </div> ';
  774. html += ' </div> ';
  775. html += ' </div> ';
  776. html += '</div> ';
  777. }
  778. $("#G082_20").append(html);
  779. }
  780. }
  781. //사용안내 모달
  782. var usePlanInfoCoupon = function (id) {
  783. var data = {cpnId : id
  784. ,planSq : plan.planSq};
  785. var jsonData = JSON.stringify(data);
  786. $.ajax( {
  787. type : "POST",
  788. url : '/planning/coupon/detailpop',
  789. data : jsonData,
  790. contentType: 'application/json',
  791. dataType : 'html',
  792. success : function(result) {
  793. if (result != null) {
  794. $("#couponInfoPop").html(result);
  795. $("#couponInfoPop").modal("show");
  796. }
  797. }
  798. });
  799. return false;
  800. }
  801. //쿠폰 다운로드
  802. var fnPlanCouponDown = function(obj){
  803. if (!cfCheckLogin()) {
  804. cfnGoToPage(_PAGE_LOGIN);
  805. return false;
  806. }
  807. let cpnId = obj;
  808. gagajf.ajaxJsonSubmit(_PAGE_PLANNING_CPN_DOWNLOAD, JSON.stringify({cpnId: cpnId}), fnPlanCouponCallBack);
  809. }
  810. // 쿠폰다운로드 콜백
  811. var fnPlanCouponCallBack = function(result){
  812. console.log(result);
  813. $.each(result.couponList, function (idx, item) {
  814. if (Number(item.custPubLimitQty) > 0){
  815. if (Number(item.custPubLimitQty) <= Number(item.custCouponCnt)){
  816. $('#coupon_'+ item.cpnId).html('<span>받기완료</span>');
  817. $('#coupon_'+ item.cpnId).attr('disabled', true);
  818. }
  819. }
  820. });
  821. }
  822. // 설문조사 참여 버튼 클릭
  823. var fnJoinConfirm = function () {
  824. let planSq = plan.planSq;
  825. cfnGoToPollDetail(planSq);
  826. }
  827. // 댓글 입력 확인
  828. var fnTextConfirm = function() {
  829. //로그인 확인
  830. if (!cfCheckLogin()) {
  831. mcxDialog.alert("로그인 후 참여 가능합니다.");
  832. $("#replyText").val('');
  833. return false;
  834. }
  835. }
  836. var ajaxReplyList = function () {
  837. gagaPaging.init('searchForm', fnSearchCallback, 'paging', 10);
  838. gagaPaging.load(1);
  839. }
  840. var fnSearchCallback = function (result) {
  841. $("#replyList").html('');
  842. if (result!=null) {
  843. var html = '';
  844. html += '<div class="cmt_list_tit">\n';
  845. html += ' <strong>댓글</strong><span class="cnt">('+result.replyCount.addComma()+')</span>\n';
  846. html += '</div>\n';
  847. if (result.replyList.length>0) {
  848. html += '<ul class="cmt_list">\n';
  849. $.each(result.replyList, function (idx, item) {
  850. html += ' <li>\n';
  851. html += ' <div class="cmt_top">\n';
  852. html += ' <span class="writer">'+item.maskingCustId+'</span>\n';
  853. html += ' <span class="date">'+item.entryDt+'</span>\n';
  854. html += ' </div>\n';
  855. html += ' <div class="cmt_cont">\n';
  856. html += ' <div class="img_wrap clear">\n';
  857. if (result.replyAttachList.length>0) {
  858. var j = 0;
  859. for (var i = 0; i < result.replyAttachList.length; i++) {
  860. if(result.replyAttachList[i].planEntrySq == item.planEntrySq){
  861. //html += ' <span class="pics"><img class="picsThumbs" src="'+ _uploadImageUrl +'/'+result.replyAttachList[i].sysFileNm +'"></span>\n';
  862. 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';
  863. j++;
  864. }
  865. }
  866. }
  867. html += ' </div>\n';
  868. html += ' <p>'+item.entryVal1.escapeHtml()+'</p>\n';
  869. if (item.entryCustNo == result.custNo) {
  870. html += ' <button class="btn btn_default btn_del" value="'+item.planEntrySq+'" onclick="fnDelReply(this.value)"><span>삭제</span></button>\n';
  871. }
  872. html += ' </div>\n';
  873. html += ' </li>\n';
  874. });
  875. html += '</ul>\n';
  876. }else{
  877. html += '<div class="nodata" id="replyNoData">\n';
  878. html += ' <div class="txt_box">\n ';
  879. html += ' <p>\n ';
  880. html += ' 등록된 댓글이 없습니다. ';
  881. html += ' </p>\n ';
  882. html += ' </div>\n ';
  883. html += '</div>\n ';
  884. }
  885. }
  886. $("#replyList").append(html);
  887. // Create pagination
  888. gagaPaging.createPagination(result.paging.pageable);
  889. }
  890. // 댓글 삭제
  891. var fnDelReply = function(obj) {
  892. data = {planEntrySq : obj};
  893. var jsonData = JSON.stringify(data);
  894. mcxDialog.confirm("댓글을 삭제 하시겠습니까?", {
  895. cancelBtnText : "취소",
  896. sureBtnText : "확인",
  897. sureBtnClick : function() {
  898. gagajf.ajaxJsonSubmit('/planning/reply/delete', jsonData,function() {
  899. ajaxReplyList();
  900. });
  901. }
  902. })
  903. }
  904. $('#fileAdd').on('change', function() { fnChooseFile(this); });
  905. var fnChooseFile = function(obj) {
  906. var picLength = $(".pics").length;
  907. // multiple 속성이 있으면 files에는 다수의 객체가 할당됨
  908. var file = obj.files[0];
  909. if (!gagajf.isNull(file.name)) {
  910. var extension = "\.(jpg|jpeg|png)$";
  911. if (!(new RegExp(extension, "i")).test(file.name)) {
  912. mcxDialog.alertC('이미지는 [jpg, jpeg, png] 파일만 가능합니다.', {
  913. sureBtnText: "확인",
  914. sureBtnClick: function() {
  915. //$(obj).parent('.imgUpload').find('.removes').trigger('click');
  916. $('.imgUpload').find('span').eq(0).remove();
  917. }
  918. });
  919. return false;
  920. }
  921. }
  922. // 이거 왜 안먹히지
  923. if (!gagajf.isNull(file.size) && Number(file.size) > (10 * 1000000)) {
  924. mcxDialog.alertC('이미지는 최대 10MB 이하 파일만 가능합니다.', {
  925. sureBtnText: "확인",
  926. sureBtnClick: function() {
  927. $(obj).parent('.imgUpload').find('.removes').trigger('click');
  928. }
  929. });
  930. return false;
  931. }
  932. // 파일 업로드
  933. gagajf.ajaxFileUpload('/common/file/upload?subDir=/reply'
  934. , file
  935. , function(result) {
  936. // 업로드한 파일명 설정
  937. $(".pics").children().eq(0).append("<input type='hidden' name='orgFileNm' id='orgFileNm"+(picLength+1)+"' value='"+result.oldFileName+"'>");
  938. $(".pics").children().eq(0).append("<input type='hidden' name='sysFileNm' id='sysFileNm"+(picLength+1)+"' value='"+result.newFileName+"'>");
  939. }
  940. );
  941. }
  942. // 댓글 등록 버튼 클릭 시
  943. var fnReplySave = function() {
  944. var fileLength = $("input[name='sysFileNm']").length;
  945. var content = $('#replyText').val();
  946. if (content.length < 2){
  947. mcxDialog.alert("최소 2자 이상 입력해주세요.");
  948. return;
  949. }
  950. 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빨','후려','후빨','ㅗ');
  951. if(yokList.indexOf(content)>=0){
  952. mcxDialog.alert("입력 불가한 내용을 포함하고 있습니다.");
  953. $('#replyText').val('');
  954. $('#cmt_cnt').text(0);
  955. return;
  956. }
  957. //파일관련 데이터 담기
  958. var multiReplyOrgFile = [];
  959. var multiReplySysFile = [];
  960. for (var i = 0; i < fileLength; i++) {
  961. multiReplyOrgFile.push($(".pics").eq(i).find('input[name="orgFileNm"]').val());
  962. multiReplySysFile.push($(".pics").eq(i).find('input[name="sysFileNm"]').val());
  963. }
  964. data = {entryVal1 : content,
  965. planSq : plan.planSq,
  966. multiReplyOrgFile : multiReplyOrgFile,
  967. multiReplySysFile : multiReplySysFile};
  968. var jsonData = JSON.stringify(data);
  969. mcxDialog.confirm("댓글을 등록 하시겠습니까?", {
  970. cancelBtnText : "취소",
  971. sureBtnText : "확인",
  972. sureBtnClick : function() {
  973. gagajf.ajaxJsonSubmit('/planning/reply/save', jsonData,function() {
  974. ajaxReplyList();
  975. $('#replyText').val('');
  976. $('.pics').remove();
  977. $('.fileAdd').show();
  978. //댓글 작성시 글자 카운트
  979. $('#cmt_cnt').text(0);
  980. });
  981. }
  982. })
  983. }
  984. var fnImgAttach = function (obj) {
  985. $("#thumbImgPop .swiper-wrapper").empty();
  986. //var popSlideIndex = $(obj).find('span').length -1;
  987. var popSlideIndex = 0;
  988. contactPopSwiper.slideTo(popSlideIndex);
  989. contactPopSwiper.update();
  990. var contactImglength = $(obj).find('span').length;
  991. var popImgHtml = "";
  992. for (i = 0; i < contactImglength; i++) {
  993. var contactImgSrc =$(obj).find('img').eq(i).attr('src');
  994. popImgHtml += "<div class='swiper-slide'><div class='pop_img' style='background-image:url("+ contactImgSrc +")'></div></div>";
  995. }
  996. $("#thumbImgPop .swiper-wrapper").append(popImgHtml);
  997. $('#thumbImgPop').modal("show");
  998. return false;
  999. }
  1000. /* SLIDE - 댓글 이미지 팝업 */
  1001. var contactPopSwiper = new Swiper('.thumb_img_pop .swiper-container', {
  1002. navigation: {
  1003. nextEl: '.thumb_img_pop .swiper-button-next',
  1004. prevEl: '.thumb_img_pop .swiper-button-prev',
  1005. },
  1006. pagination: {
  1007. el: '.thumb_img_pop .swiper-pagination',
  1008. clickable: true,
  1009. },
  1010. observer:true,
  1011. observeParents: true,
  1012. });
  1013. $(document).ready( function() {
  1014. ajaxReplyList();
  1015. //공유 버튼 토글
  1016. $("button[data-name=openShare]").on("click", function(){
  1017. $(this).toggleClass("on").next(".shareWrap").toggleClass("on");
  1018. return false;
  1019. });
  1020. //영역밖 클릭으로 공유토글 닫기
  1021. $("body").on('click', function(e) {
  1022. if(!$(".shareWrap.on").parent().has(e.target).length) {
  1023. $("button[data-name=openShare]").removeClass("on");
  1024. $(".shareWrap").removeClass("on");
  1025. };
  1026. });
  1027. $('.btn_copy').bind('click', function() {
  1028. copyToClipboard();
  1029. });
  1030. $('#replyText').bind('input paste', function() {
  1031. $(this).trigger('keyup');
  1032. });
  1033. //팝업 - 쿠폰사용안내
  1034. $(document).on('click','#btn_couponInfo_pop',function(e){
  1035. $("#couponInfoPop .modal-content").load("popup_couponInfo.html");
  1036. $("#couponInfoPop").modal("show");
  1037. return false;
  1038. });
  1039. $("#couponInfoPop_close").click(function() {
  1040. $.modal.close();
  1041. });
  1042. //팝업 - 상품 베스트 리뷰 (detail)
  1043. $(document).on('click','#btn_pdBestReview_pop, .area_rv_best .best_review a',function(e){
  1044. $("#pdBestReviewPop .modal-content").load("pd_bestreviewdetail_pop.html");
  1045. $("#pdBestReviewPop").modal("show");
  1046. return false;
  1047. });
  1048. $("#pdBestReviewPop_close").click(function() {
  1049. $.modal.close();
  1050. });
  1051. /* SLIDE - 상단 프로모션 배너 */
  1052. var promotion_visual_slide = new Swiper ('.dp_detail_visual .promotion_visual.type2 .swiper-container', {
  1053. loop: true,
  1054. slidesPerView: 1,
  1055. speed : 1500,
  1056. navigation: {
  1057. nextEl: '.promotion_visual.type2 .swiper-button-next',
  1058. prevEl: '.promotion_visual.type2 .swiper-button-prev',
  1059. },
  1060. pagination: {
  1061. el: '.promotion_visual.type2 .swiper-pagination',
  1062. clickable: true,
  1063. },
  1064. });
  1065. /* SLIDE - 중간 배너 */
  1066. var mid_banner_slide = new Swiper ('.dp_mid_banner .mid_banner .swiper-container', {
  1067. loop: true,
  1068. slidesPerView: 1,
  1069. speed : 1500,
  1070. navigation: {
  1071. nextEl: '.mid_banner .swiper-button-next',
  1072. prevEl: '.mid_banner .swiper-button-prev',
  1073. },
  1074. pagination: {
  1075. el: '.mid_banner .swiper-pagination',
  1076. clickable: true,
  1077. },
  1078. });
  1079. /* SLIDE - 대표상품 슬라이드 2열 상품 */
  1080. var dp_listItems_slide1 = new Swiper ('.dp_listItems_cont.type2 .swiper-container', {
  1081. loop: false,
  1082. slidesPerView: 2,
  1083. slidesPerGroup: 2,
  1084. spaceBetween: 20,
  1085. speed : 800,
  1086. navigation: {
  1087. nextEl: '.dp_listItems_cont.type2 .swiper-button-next',
  1088. prevEl: '.dp_listItems_cont.type2 .swiper-button-prev',
  1089. },
  1090. pagination: {
  1091. el: '.dp_listItems_cont.type2 .swiper-pagination',
  1092. clickable: true,
  1093. },
  1094. });
  1095. /* SLIDE - 대표상품 슬라이드 4열 상품 */
  1096. var dp_listItems_slide2 = new Swiper ('.dp_listItems_cont.type3 .swiper-container', {
  1097. loop: false,
  1098. slidesPerView: 4,
  1099. slidesPerGroup: 4,
  1100. spaceBetween: 20,
  1101. speed : 800,
  1102. navigation: {
  1103. nextEl: '.dp_listItems_cont.type3 .swiper-button-next',
  1104. prevEl: '.dp_listItems_cont.type3 .swiper-button-prev',
  1105. },
  1106. pagination: {
  1107. el: '.dp_listItems_cont.type3 .swiper-pagination',
  1108. clickable: true,
  1109. },
  1110. });
  1111. /* SLIDE - 다른 기획전,이벤트 보기 */
  1112. var other_slide_slide = new Swiper ('.other_promotion_slide .swiper-container', {
  1113. slidesPerView: 5,
  1114. spaceBetween: 20,
  1115. navigation: {
  1116. nextEl: '.other_promotion_slide .swiper-button-next',
  1117. prevEl: '.other_promotion_slide .swiper-button-prev',
  1118. },
  1119. });
  1120. // 첨부파일 갯수제한
  1121. $('.imgUpload .fileAdd').click(function(){
  1122. if (!cfCheckLogin()) {
  1123. mcxDialog.alert("로그인 후 참여 가능합니다.");
  1124. $("#replyText").val('');
  1125. return false;
  1126. }
  1127. var imgFiles=$('.imgUpload .pics');
  1128. var maxFileLength = 10; /* 최대 파일 갯수를 입력해 주세요 */
  1129. if (imgFiles.length >= maxFileLength) {
  1130. mcxDialog.alert('이미지는 최대' + maxFileLength +'장 까지 첨부 가능합니다.');
  1131. $('#fileAdd').attr("disabled",true);
  1132. } else if(imgFiles.length < maxFileLength){
  1133. $('#fileAdd').removeAttr("disabled");
  1134. }
  1135. });
  1136. //댓글 작성시 글자 카운트
  1137. $('.cmt_ans').keyup(function (e){
  1138. var content = $(this).val();
  1139. $('#cmt_cnt').html(content.length);
  1140. if (content.length > 500){
  1141. $(this).val(content.substring(0, 500));
  1142. $('#cmt_cnt').html("500");
  1143. }
  1144. });
  1145. $('.cmt_ans').bind('input paste', function() {
  1146. $(this).trigger('keyup');
  1147. });
  1148. });
  1149. </script>
  1150. </th:block>
  1151. </body>
  1152. </html>