PlanningShotGuideFormWeb.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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="web/common/layout/DefaultLayoutWeb">
  6. <!--
  7. *******************************************************************************
  8. * @source : PlanningShotGuideFormWeb.html
  9. * @desc : 총알배송 Page
  10. *============================================================================
  11. * Pastelmall
  12. * Copyright(C) 2020 TSIT, All rights reserved.
  13. *============================================================================
  14. * VER DATE AUTHOR DESCRIPTION
  15. * === =========== ========== =============================================
  16. * 1.0 2021.3.30 sowon 최초 작성
  17. *******************************************************************************
  18. -->
  19. <body>
  20. <th:block layout:fragment="content">
  21. <!-- // container -->
  22. <div id="container" class="container dp">
  23. <div class="breadcrumb">
  24. <ul>
  25. <li class="bread_home"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_MAIN);">홈</a></li>
  26. <li class="bread_2depth">총알배송</li>
  27. </ul>
  28. </div>
  29. <div class="wrap">
  30. <div class="content wide dp_Bulletship"> <!-- 페이지특정 클래스 = dp_Bulletship -->
  31. <div class="cont_body">
  32. <div class="bulletship">
  33. <!-- <div class="bulletship_head" th:utext="${#strings.replace(#strings.replace(shotHtmlTop.fsrcPc,'&amplt;','<'),'&ampgt;','>')}"> -->
  34. <div class="bulletship_head">
  35. <img th:src="${@environment.getProperty('domain.uximage')} + '/images/pc/thumb/bullet_bg1.png'" alt="10시까지 주문하면 당일도착">
  36. </div>
  37. <div class="bulletship_body" id="shotHtml">
  38. </div>
  39. <div class="bulletship_foot">
  40. <div class="bulletship_foot"><br></div>
  41. </div>
  42. <div class="bulletship_foot"><br>
  43. </div>
  44. <!-- <div class="bulletship_foot" th:utext="${#strings.replace(#strings.replace(shotHtmlBtm.fsrcPc,'&amplt;','<'),'&ampgt;','>')}"> -->
  45. <div class="bulletship_foot">
  46. <img th:src="${@environment.getProperty('domain.uximage')} + '/images/pc/thumb/bullet_bg2.png'" alt="주문/도착, 배송일, 대상상품">
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <!-- 총알배송 가능 상품 리스트 -->
  52. <div class="content sticky_nav_list" id="cornerList">
  53. </div>
  54. <!-- //총알배송 가능 상품 리스트 -->
  55. </div>
  56. </div>
  57. <!-- 총알배송 가능여부 결과 팝업 -->
  58. <div class="modal fade bulletShip_pop" id="bulletShipPop" tabindex="-1" role="dialog" aria-labelledby="bulletShipPopLabel" aria-hidden="true">
  59. <div class="modal-dialog" role="document">
  60. <div class="modal-content">
  61. <div class="modal-header">
  62. <h5 class="modal-title" id="bulletShipLabel"><span class="sr-only">총알배송 가능여부 결과</span></h5>
  63. </div>
  64. <div class="modal-body">
  65. <div class="pop_cont">
  66. <div class="txt_result">
  67. <p>고객님이 찾으시는 지역은</p>
  68. <p><span id="shotAdr"></span>&nbsp;가능 지역</p>
  69. <div class="address">
  70. <p id="addr"></p>
  71. </div>
  72. <div class="info">
  73. <p id="infoTxt"></p>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="modal-footer">
  79. <button type="button" id="" class="btn btn_dark" onclick="$.modal.close();"><span>계속 쇼핑하기</span></button>
  80. </div>
  81. </div>
  82. </div>
  83. <a href="#close-modal" rel="modal:close" id="bulletShipPop_close" class="close-modal">Close</a>
  84. </div>
  85. <!-- //총알배송 가능여부 결과 팝업 -->
  86. <script th:inline="javascript">
  87. /*<![CDATA[*/
  88. let custAddr = [[${custAddr}]];
  89. let customerInfo = [[${customerInfo}]];
  90. let shotBrandList = [[${shotBrandList}]];
  91. let shotBrandGoodsList = [[${shotBrandGoodsList}]];
  92. // 로그인 확인
  93. if(shotBrandList.length>0){
  94. var html = '';
  95. html += '<div class="cont_head">';
  96. html += ' <div class="sticky_nav">';
  97. html += ' <ul> ';
  98. $.each(shotBrandList, function(idx, item) {
  99. html += ' <li><a href="#brand'+idx+'">'+item.brandNm+'</a></li>';
  100. })
  101. html += ' </ul>';
  102. html += ' </div>';
  103. html += '</div>';
  104. html += '<div class="cont_body">';
  105. html += ' <div class="list_content">';
  106. $.each(shotBrandList, function(idx, item) {
  107. html += ' <div id="brand'+idx+'" class="dp_item_list">';
  108. html += ' <div class="item_header">';
  109. html += ' <h4>'+item.brandNm+'</h4>';
  110. html += ' </div>';
  111. html += ' <div class="itemsGrp';
  112. if(item.cornerDispType == 'G045_2'){
  113. html += ' cut2';
  114. }else if(item.cornerDispType == 'G045_4'){
  115. html += ' cut4';
  116. }else if(item.cornerDispType == 'G045_5'){
  117. html += ' cut5';
  118. }
  119. html += '">';
  120. $.each(shotBrandGoodsList, function(idx2, item2) {
  121. if (item2.brandGroupNo == item.brandGroupNo) {
  122. html += ' <div class="item_prod">';
  123. html += ' <div class="item_state">';
  124. if(item2.likeIt === 'likeit'){
  125. html += ' <button type="button" class="itemLike likeit active"';
  126. }else{
  127. html += ' <button type="button" class="itemLike"';
  128. }
  129. html += ' onClick="cfnPutWishList(this);" goodsCd=\''+item2.goodsCd+'\', ithrCd=\'\', contentsLoc=\'\', planDtlSq=\'\'>관심상품 추가</button>';
  130. html += ' <a href="javascript:void(0);" onclick="cfnGoToGoodsDetail(\''+item2.goodsCd+'\',\'\',\'IN13_01\')" class="itemLink">';
  131. html += ' <div class="itemPic">';
  132. html += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item2.sysImgNm +'">';
  133. html += ' </div>';
  134. html += ' <p class="itemBrand">'+item2.brandNm+'</p>';
  135. html += ' <div class="itemName">'+item2.goodsNm+'</div>';
  136. html += ' <p class="itemPrice">'+item2.currPrice.addComma();
  137. if (item2.currPrice != item2.listPrice) {
  138. html += ' <span class="itemPrice_original">'+item2.listPrice.addComma()+'</span>';
  139. }
  140. if (item2.dcRate != 0) {
  141. html += ' <span class=" itemPercent">'+item2.dcRate.addComma()+'%</span>';
  142. }
  143. html += ' </p>';
  144. html += ' <div class="itemcolorchip">';
  145. if(!gagajf.isNull(item2.colorChips)){
  146. var colorArr = item2.colorChips.split(",");
  147. var colorCd = '';
  148. var rgbColor = '';
  149. for(let i=0; i<colorArr.length; i++){
  150. var colorInfo = colorArr[i].split(":");
  151. colorCd = colorInfo[0];
  152. rgbColor = colorInfo[1];
  153. if(rgbColor=='#FFFFFF'){
  154. html += ' <span class="chip_color" style="background-color: '+rgbColor+';border:1px solid #aaa;" value="'+colorCd+'">'+colorCd+'</span>';
  155. }else{
  156. html += ' <span class="chip_color" style="background-color: '+rgbColor+'" value="'+colorCd+'">'+colorCd+'</span>';
  157. }
  158. }
  159. }
  160. html += ' </div>';
  161. if(!gagajf.isNull(item2.icon)){
  162. var iconArr = item2.icon.split(",");
  163. var iconGb = '';
  164. var iconNm = '';
  165. html += ' <p class="itemBadge">';
  166. let arrCnt;
  167. if (iconArr.length > 2) {
  168. arrCnt = 3;
  169. } else {
  170. arrCnt = iconArr.length;
  171. }
  172. for(let i=0; i<arrCnt; i++){
  173. var iconInfo = iconArr[i].split(":");
  174. iconGb = iconInfo[0];
  175. iconNm = iconInfo[1];
  176. html += ' <span class="badge13" value="'+iconGb+'">'+iconNm+' </span>';
  177. }
  178. html += ' </p>';
  179. }
  180. if(item2.goodsTnm != null){
  181. html += ' <div class="itemComment">'+item2.goodsTnm+'</div>';
  182. }
  183. html += ' </a>';
  184. html += ' </div>';
  185. html += ' </div>';
  186. }
  187. })
  188. html += ' </div>';
  189. html += ' </div>';
  190. })
  191. html += ' </div>';
  192. html += ' </div>';
  193. $("#cornerList").append(html);
  194. }
  195. var shotBody = function () {
  196. if (!cfCheckLogin() || (custAddr == null || custAddr == '')) {
  197. html = '';
  198. html += '<div class="txt_result"> ';
  199. html += ' <p>오전10시 이전 주문 당일도착</p> ';
  200. html += ' <p><span>총알배송이 가능한 지역</span>인지<br>확인해보세요!</p> ';
  201. html += ' <div class="bulletshop_btn"> ';
  202. html += ' <button type="button" class="btn btn_default btn_block" onclick="fnOpenDaumAddr();"><span>내 배송지 확인하기</span></button> ';
  203. html += ' </div> ';
  204. html += ' <p>서울&middot;경기&middot;인천 중 일부지역은 총알배송이 불가합니다.</p> ';
  205. html += ' </div> ';
  206. $("#shotHtml").append(html);
  207. }else{
  208. html = '';
  209. html += ' <div class="txt_result">';
  210. html += ' <p><span>'+customerInfo.custNm+'</span>님의 배송지는</p>';
  211. if (custAddr.shotDelvUseYn === 'Y') {
  212. html += ' <p><span>총알배송</span> 가능 지역</p>';
  213. }else{
  214. html += ' <p><span>일반배송</span> 지역</p>';
  215. }
  216. html += ' <div class="bullet_able">';
  217. html += ' <p>'+custAddr.recipBaseAddr+' '+custAddr.recipDtlAddr+'</p>';
  218. html += ' </div>';
  219. html += ' <div class="bulletshop_btn">';
  220. html += ' <button class="btn btn_default btn_block" onclick="fnOpenDaumAddr();"><span>다른 배송지 확인하기</span></button>';
  221. html += ' </div>';
  222. html += ' </div> ';
  223. $("#shotHtml").append(html);
  224. }
  225. }
  226. //우편번호 DAUM을 이용한 우편번호 팝업 레이어
  227. var fnOpenDaumAddr = function() {
  228. let daumZip = new daum.Postcode({
  229. oncomplete: function(data) {
  230. // data.zonecode
  231. $.ajax( {
  232. type : "GET",
  233. url : '/planning/shot/delivery/confirm?recipZipcode='+data.zonecode,
  234. dataType : 'json',
  235. success : function(result) {
  236. if (result != null) {
  237. $('#addr').text(cfnGetDaumRoadAddr(data));
  238. if (result.shotYn != null && result.shortYn != '') {
  239. if(result.shotYn.shotDelvUseYn == "Y"){
  240. $('#shotAdr').text("총알배송");
  241. $("#infoTxt").text("오늘 오전 10시까지 주문하시면 오늘 도착합니다. (토, 일, 공휴일 휴무)");
  242. }
  243. }
  244. else{
  245. $('#shotAdr').text("일반배송");
  246. $("#infoTxt").text("주문시간/배송지에 따라 2~3일 이내 도착합니다. (일, 공휴일 휴무)");
  247. }
  248. $("#bulletShipPop").modal("show");
  249. }
  250. }
  251. });
  252. cfnCloseDaumAddr();
  253. },
  254. width: '100%'
  255. });
  256. cfnOpenDaumAddr(daumZip);
  257. }
  258. $(document).ready(function() {
  259. shotBody();
  260. $("#bulletShipPop_close").click(function() {
  261. $.modal.close();
  262. });
  263. });
  264. /*]]>*/
  265. </script>
  266. </th:block>
  267. </body>
  268. </html>