BestMainFormMob.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <!DOCTYPE html>
  2. <html lang="ko"
  3. xmlns:th="http://www.thymeleaf.org"
  4. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  5. layout:decorator="mob/common/layout/DefaultLayoutMob">
  6. <!--
  7. *******************************************************************************
  8. * @source : BestMainFormMob.html
  9. * @desc : 베스트메인 Page
  10. *============================================================================
  11. * STYLE24
  12. * Copyright(C) 2020 TSIT, All rights reserved.
  13. *============================================================================
  14. * VER DATE AUTHOR DESCRIPTION
  15. * === =========== ========== =============================================
  16. * 1.0 2021.05.10 bin2107 최초 작성
  17. *******************************************************************************
  18. -->
  19. <body>
  20. <th:block layout:fragment="content">
  21. <main role="" id="" class="container dp">
  22. <section class="content dp_best">
  23. <div class="inner wide">
  24. <div class="category_nav">
  25. <ul id="cateListArea">
  26. <li class="" id="li0"><button type="button" onclick="fnBestListSearch(this,'');">전체</button></li>
  27. <th:block th:each="item, stat : ${bestCateList}">
  28. <li class="" th:id="${'li'+item.cateNo}"><button type="button" th:onclick="fnBestListSearch(this,[[${item.cateNo}]]);" th:text="${item.cateNm}">여성</button></li>
  29. </th:block>
  30. </ul>
  31. </div>
  32. </div>
  33. <div class="inner bg_gray">
  34. <div class="view_item">
  35. <div class="count_wrap">
  36. <div>
  37. <p>지금 많이 <span>보고 있어요</span></p>
  38. </div>
  39. <div>
  40. <ul class="dp_util">
  41. <li><a href="javascript:void(0);" id="researchBtn" class="refresh" th:text="${#calendars.format(#calendars.createNow(), 'HH:mm')+' 기준'}">17:30 기준</a></li>
  42. </ul>
  43. </div>
  44. </div>
  45. <div class="swiper-container item_list">
  46. <div class="swiper-wrapper" id="itemViewArea">
  47. <!-- <div class="swiper-slide">-->
  48. <!-- <div class="item_prod">-->
  49. <!-- <div class="item_state">-->
  50. <!-- <a href="#none" class="itemLink">-->
  51. <!-- <div class="itemPic">-->
  52. <!-- <img alt="BLACK-a" class=" vLHTC pd_img" src="/images/mo/thumb/prod3.jpg">-->
  53. <!-- </div>-->
  54. <!-- <div class="itemName">남성 로고 자카드 방풍 패딩 스웨터 가디건 자카드 방풍 패딩 스웨터 가디건 자카드 방풍 패딩 스웨터 가디건</div>-->
  55. <!-- <div class="viewComment">508명 보는중</div>-->
  56. <!-- </a>-->
  57. <!-- </div>-->
  58. <!-- </div>-->
  59. <!-- </div>-->
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="inner">
  65. <div class="best_item">
  66. <h2 class="dp_subtitle">베스트 TOP 100</h2>
  67. <div class="item_list">
  68. <div class="count_wrap">
  69. <ul class="dp_util">
  70. <li>
  71. <div class="open_categori sex">
  72. <a id="filter">구매 성별 전체
  73. <!--<option value="hide">구매 성별 전체</option>
  74. <option value="Test_SELECT_OPTION_1" rel="icon-temperature">구매 성별 전체1</option>
  75. <option value="Test_SELECT_OPTION_2">구매 성별 전체2</option>
  76. <option value="Test_SELECT_OPTION_3">구매 성별 전체3</option>-->
  77. </a>
  78. </div>
  79. </li>
  80. <li>
  81. <div class="open_categori age">
  82. <a id="filter">구매 연령 전체
  83. <!--<option value="hide">구매 연령전체</option>
  84. <option value="Test_SELECT_OPTION_1" rel="icon-temperature">구매 연령전체1</option>
  85. <option value="Test_SELECT_OPTION_2">구매 연령전체2</option>
  86. <option value="Test_SELECT_OPTION_3">구매 연령전체3</option>-->
  87. </a>
  88. </div>
  89. </li>
  90. </ul>
  91. </div>
  92. <div class="list_content">
  93. <div class="itemsGrp" id="prodArea">
  94. </div>
  95. </div>
  96. <div class="list_last" id="divLastPage" style="display: none;">마지막페이지 입니다.</div>
  97. </div>
  98. </div>
  99. </div>
  100. </section>
  101. <!-- 카테고리 -->
  102. <div class="category_box">
  103. <div class="lap">
  104. <div class="category_close">카테고리닫기</div>
  105. <div class="category_list">
  106. <!-- 카테고리 선택 -->
  107. <div class="selcet_list">
  108. <ul>
  109. <li class="active"><a href="javascript:void(0)">구매성별 전체</a></li>
  110. <li><a href="javascript:void(0)">구매성별1</a></li>
  111. <li><a href="javascript:void(0)">구매성별2</a></li>
  112. <li><a href="javascript:void(0)">구매성별3</a></li>
  113. <li><a href="javascript:void(0)">구매성별4</a></li>
  114. </ul>
  115. </div>
  116. <!-- //카테고리 선택 -->
  117. </div>
  118. </div>
  119. </div>
  120. <!-- //카테고리 -->
  121. <!-- 210415_최신상품순 리스트 팝업 추가 -->
  122. <div id="odDatePop1" class="popup_box odDatePop">
  123. <div class="lap">
  124. <div class="popup_close">카테고리닫기</div>
  125. <div class="popup_head sr-only">
  126. <h2 class="">기간 선택 팝업</h2>
  127. </div>
  128. <div class="popup_con">
  129. <div class="button_list clear">
  130. <button type="button" class="on"><span>구매성별 전체</span></button>
  131. <button type="button"><span>구매성별1</span></button>
  132. <button type="button"><span>구매성별2</span></button>
  133. <button type="button"><span>구매성별3</span></button>
  134. <button type="button"><span>구매성별4</span></button>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <div id="odDatePop2" class="popup_box odDatePop">
  140. <div class="lap">
  141. <div class="popup_close">카테고리닫기</div>
  142. <div class="popup_head sr-only">
  143. <h2 class="">기간 선택 팝업</h2>
  144. </div>
  145. <div class="popup_con">
  146. <div class="button_list clear">
  147. <button type="button" class="on"><span>구매연령 전체</span></button>
  148. <button type="button"><span>구매연령1</span></button>
  149. <button type="button"><span>구매연령2</span></button>
  150. <button type="button"><span>구매연령3</span></button>
  151. <button type="button"><span>구매연령4</span></button>
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. </main>
  157. <form id="bestGoodsForm" name="bestGoodsForm">
  158. <input type="hidden" name="pageNo" id="pageNo" value ="1"/>
  159. <input type="hidden" name="pageSize" value ="50"/>
  160. <input type="hidden" name="cateNo" value=""/>
  161. <input type="hidden" name="sortGb"/>
  162. </form>
  163. <!-- 수동설정 + 추천솔루션 카운트 문제로 인해 인피티니스크롤 제거 협의 21-07-21 -->
  164. <!-- <script src="/ux/plugins/gaga/gaga.infinite.scrollSession.js"></script>-->
  165. <!-- <script src="/ux/plugins/jquery/jquery.history.min.js"></script>-->
  166. <!-- <script th:src="@{'/biz/goods.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/goods.js"></script>-->
  167. <script th:inline="javascript">
  168. /*<![CDATA[*/
  169. var bestCateList = [[${bestCateList}]];
  170. $(document).ready(function(){
  171. $(document).on('click','.sub_category .more_btn',function(){
  172. $(this).toggleClass('on');
  173. $('.sub_category .cate_wrap').toggleClass('on');
  174. if($(this).hasClass('on')){
  175. $(this).find('span').text('접기');
  176. }else{
  177. $(this).find('span').text('더보기');
  178. }
  179. });
  180. //카테고리
  181. function category(){
  182. var categoryOpen=$(".open_categori .select_dress");
  183. var categoryClose=$(".category_box .category_close");
  184. var categoryPop=$(".category_box");
  185. categoryOpen.on("click",function(){
  186. categoryPop.show();
  187. categoryPop.addClass("active");
  188. $("body").css({"overflow":"hidden"});
  189. });
  190. categoryClose.on("click",function(){
  191. categoryPop.hide();
  192. $("body").css({"overflow":"visible"});
  193. });
  194. }
  195. category();
  196. // 210415_팝업관련 추가
  197. //기간 선택 팝업
  198. $(document).on("click", ".open_categori.sex", function(){
  199. $('#odDatePop1').show().addClass("active");
  200. $("body").css({"overflow":"hidden"});
  201. });
  202. $(document).on("click", ".open_categori.age", function(){
  203. $('#odDatePop2').show().addClass("active");
  204. $("body").css({"overflow":"hidden"});
  205. });
  206. //팝업_닫기
  207. $('.popup_close').on("click",function(){
  208. $('.popup_box').hide().removeClass('active');
  209. $("body").css({"overflow":"visible"});
  210. });
  211. //210510_수정 : 토스트 팝업 버튼 on 클래스 제어.
  212. $(document).on('click','.popup_box .button_list button',function(){
  213. $(this).siblings('.button_list button').removeClass('on');
  214. $(this).addClass('on');
  215. })
  216. //210510_추가 : 토스트 팝업 button 클릭 시 팝업 닫기.
  217. $(document).on('click','.popup_box.odDatePop .button_list button',function(){
  218. $(this).parents('.popup_box.odDatePop').hide().removeClass('active');
  219. $("body").css({"overflow":"visible"});
  220. })
  221. $(document).on('click','.popup_box.odDatePop .button_list button',function(){
  222. $(this).parents('.popup_box.odDatePop').hide().removeClass('active');
  223. $("body").css({"overflow":"visible"});
  224. })
  225. });
  226. var fnBestListSearch = function (obj, cateNo){
  227. $.each($("#cateListArea").find('li').find('button'), function() {
  228. $(this).removeClass();
  229. });
  230. if(gagajf.isNull(cateNo)){
  231. $("#li0").find("button").addClass('active');
  232. }else{
  233. $("#li"+cateNo).find("button").addClass('active');
  234. }
  235. $("#bestGoodsForm input[name=cateNo]").val(cateNo);
  236. // 카테고리별 실시간 베스트 상품 조회 getRealtimeViewBestGoodsList
  237. fnRealtimeViewBestList(cateNo);
  238. // TOP100 조회
  239. fnBestTop100List();
  240. }
  241. var fnRealtimeViewBestList = function (cateNo){
  242. if(gagajf.isNull(cateNo)){
  243. cateNo = "";
  244. }
  245. var data = {cateNo : cateNo};
  246. var html = '';
  247. $.getJSON('/display/realtime/best/list' , data, function (result, status){
  248. $("#itemViewArea").html('');
  249. console.log(result);
  250. if(result.length > 0){
  251. $.each(result, function (idx, item){
  252. var imgUrl = '';
  253. html += '<div class="swiper-slide">\n';
  254. html += ' <div class="item_prod">\n';
  255. html += ' <div class="item_state">\n';
  256. html += ' <a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.itemId+'\')">\n';
  257. html += ' <div class="itemPic">\n';
  258. html += ' <img alt="BLACK-a" class=" vLHTC pd_img" src="' + item.imageUrl + '">\n';
  259. html += ' </div>\n';
  260. html += ' <div class="itemName">'+item.itemName+'</div>\n';
  261. if(item.count < 10){
  262. html += ' <div class="viewCount">10명 미만</div>\n';
  263. }else{
  264. html += ' <div class="viewCount">'+item.count.addComma()+'명 보는중</div>\n';
  265. }
  266. html += ' </a>\n';
  267. html += ' </div>\n';
  268. html += ' </div>\n';
  269. html += '</div>\n';
  270. });
  271. }
  272. $("#itemViewArea").append(html);
  273. $("#researchBtn").attr("onclick","fnRealtimeViewBestList("+cateNo+");");
  274. /* SLIDE - 지금많이 보고있어요 */
  275. //210624_ 추가 : 슬라이드 속성 추가.
  276. var dp_viewitem_slide = new Swiper('.view_item .swiper-container', {
  277. slidesPerView: 'auto',
  278. slidesPerView: 3,
  279. spaceBetween: 8,
  280. speed: 1000,
  281. centerMode: true,
  282. a11y: {
  283. enabled: true,
  284. notificationClass: 'swiper-notification',
  285. prevSlideMessage: '이전 슬라이드',
  286. nextSlideMessage: '다음 슬라이드',
  287. firstSlideMessage: '첫번째 슬라이드 입니다',
  288. lastSlideMessage: '마지막 슬라이드 입니다',
  289. paginationBulletMessage: '슬라이드 {{index}}로 이동',
  290. },
  291. autoplay : {
  292. delay : 3000, // 시간 설정
  293. disableOnInteraction: true,
  294. },
  295. });
  296. });
  297. }
  298. var fnBestTop100List = function (){
  299. gagajf.ajaxFormSubmit("/display/best/main/goods/list", document.bestGoodsForm, fnCallbackBestTop100);
  300. }
  301. var fnCallbackBestTop100 = function (result){
  302. $("#prodArea").html('');
  303. var tag = '';
  304. if(result.dataList.length > 0){
  305. $.each(result.dataList, function (idx, item){
  306. tag += '<div class="item_prod">\n';
  307. tag += ' <div class="item_state">\n';
  308. tag += ' <button type="button" class="itemLike" goodsCd=\''+item.goodsCd+'\' onclick="wishlistDelete(this)">관심상품 추가</button>\n';
  309. tag += ' <a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.goodsCd+'\', \''+item.colorCd+'\')">\n';
  310. tag += '<div class="shape ';
  311. if(idx==0){
  312. tag += ' ranker';
  313. }
  314. tag += '"><span>'+(idx+1)+'</span></div>\n';
  315. tag += ' <div class="itemPic">\n';
  316. tag += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="' + _uploadGoodsUrl + '/' + item.sysImgNm + '">\n';
  317. tag += ' </div>\n';
  318. tag += ' <p class="itemBrand">'+item.brandGroupNm+'</p>\n';
  319. tag += ' <div class="itemName">'+item.goodsFullNm+'</div>\n';
  320. tag += ' <p class="itemPrice">';
  321. if (item.currPrice != item.listPrice) {
  322. tag += ' <span class="itemPrice_original">' + item.listPrice.addComma() + '</span>\n';
  323. }
  324. tag += item.currPrice.addComma();
  325. if (item.currPrice != item.listPrice) {
  326. tag+=' <span class=" itemPercent">'+ Math.round((item.listPrice - item.currPrice) / (item.listPrice * 1.0) * 100) +'%</span>\n';
  327. }
  328. tag += ' </p>\n';
  329. tag += ' <div class="itemcolorchip">\n';
  330. if(!gagajf.isNull(item.colorChips)){
  331. var colorArr = item.colorChips.split(",");
  332. var colorCd = '';
  333. var rgbColor = '';
  334. for(let i=0; i<colorArr.length; i++){
  335. var colorInfo = colorArr[i].split(":");
  336. colorCd = colorInfo[0];
  337. rgbColor = colorInfo[1];
  338. if(rgbColor=='#FFFFFF'){
  339. tag += ' <span class="chip_color" style="background-color: '+rgbColor+';border:1px solid #aaa;" value="'+colorCd+'">'+colorCd+'</span>\n';
  340. }else{
  341. tag += ' <span class="chip_color" style="background-color: '+rgbColor+'" value="'+colorCd+'">'+colorCd+'</span>\n';
  342. }
  343. }
  344. }
  345. tag += ' </div>\n';
  346. if(!gagajf.isNull(item.icon)){
  347. var iconArr = item.icon.split(",");
  348. var iconGb = '';
  349. var iconNm = '';
  350. tag += ' <p class="itemBadge">\n';
  351. let arrCnt;
  352. if(iconArr.length > 2){
  353. arrCnt = 3;
  354. }else{
  355. arrCnt = iconArr.length;
  356. }
  357. for(let i=0; i<arrCnt; i++){
  358. var iconInfo = iconArr[i].split(":");
  359. iconGb = iconInfo[0];
  360. iconNm = iconInfo[1];
  361. tag += ' <span class="badge13" value="'+iconGb+'">'+iconNm+' </span>\n';
  362. }
  363. tag += ' </p>';
  364. }
  365. if (item.goodsTnm != null && item.goodsTnm != '') {
  366. tag+=' <div class="itemComment">'+item.goodsTnm+'</div>\n';
  367. }
  368. tag += ' </a>\n';
  369. tag += ' </div>\n';
  370. tag += '</div>\n';
  371. });
  372. $("#prodArea").append(tag);
  373. }
  374. }
  375. $(document).ready(function() {
  376. fnBestListSearch();
  377. });
  378. /*]]>*/
  379. </script>
  380. </th:block>
  381. </body>
  382. </html>