style24_link.js 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508
  1. /*
  2. * Common URL Definition
  3. */
  4. const _PAGE_LOGIN = _frontUrl + "/signin"; // GNB > 로그인
  5. const _PAGE_LOGOUT = _frontUrl + "/logout"; // GNB > 로그아웃
  6. //== 메인 ==/
  7. const _PAGE_MAIN = _frontUrl + "/display/mall/main/form"; // 몰메인
  8. const _PAGE_ALL_BRAND = _frontUrl + "/display/all/brand/form"; // 전체 브랜드
  9. const _PAGE_CATE_MAIN = _frontUrl + "/display/category/main/form"; // 카테고리메인
  10. const _PAGE_BRAND_MAIN = _frontUrl + "/display/brand/main/form"; // 브랜드메인
  11. const _PAGE_CATE_GOODS_LIST = _frontUrl + "/display/category/goods/list/form"; // 카테고리 상품목록
  12. const _PAGE_BEST_MAIN = _frontUrl + "/display/best/main/form"; // 베스트메인
  13. const _PAGE_OUTLET_MAIN = _frontUrl + "/display/outlet/main/form"; // 아울렛메인
  14. //== 고객 ==/
  15. const _PAGE_CUSTOMER_JOIN_TYPE = _frontUrl + "/customer/join/type/form"; // 고객 > 회원가입 유형
  16. const _PAGE_CUSTOMER_JOIN = _frontUrl + "/customer/join/form"; // 고객 > 회원가입
  17. const _PAGE_CUSTOMER_SNS_JOIN = _frontUrl + "/customer/sns/join/form"; // 고객 > SNS가입
  18. const _PAGE_CUSTOMER_JOIN_COMPLETE = _frontUrl + "/customer/join/complete/form"; // 고객 > 고객가입 > 완료페이지
  19. const _PAGE_CUSTOMER_ID_FIND = _frontUrl + "/customer/id/find/form"; // 고객 > 아이디 찾기
  20. const _PAGE_CUSTOMER_PWD_FIND = _frontUrl + "/customer/password/find/form"; // 고객 > 비밀번호 찾기
  21. const _PAGE_CUSTOMER_PWD_CHANGE_FIND = _frontUrl + "/customer/password/change/form?pageGb=find"; // 고객 > 비밀번호 찾기> 비밀번호 변경 화면
  22. const _PAGE_CUSTOMER_PWD_CHANGE_TEMP = _frontUrl + "/customer/password/change/form?pageGb=temp"; // 고객 > 임시비밀번호 로그인 > 비밀번호 변경 화면
  23. const _PAGE_CUSTOMER_DORMANT = _frontUrl + "/customer/dormant/certify/form"; // 고객 > 휴면회원
  24. const _PAGE_CUSTOMER_DORMANT_COMPLETE = _frontUrl + "/customer/dormant/certify/complete/form"; // 고객 > 휴면회원 > 완료페이지
  25. const _PAGE_CUSTOMER_SECEDE = _frontUrl + "/customer/secede/form"; // 고객 > 회원탈퇴
  26. const _PAGE_CUSTOMER_SECEDE_COMPLETE = _frontUrl + "/customer/secede/complete/form"; // 고객 > 회원탈퇴 > 완료페이지
  27. const _PAGE_CUSTOMER_CERTIFICATION = _frontUrl + "/customer/certification/form" // 고객 > 본인인증화면
  28. const _PAGE_USE_TERMS = _frontUrl + "/customer/use/terms/form"; // Footer > 이용약관
  29. const _PAGE_PRIVACY_POLICY = _frontUrl + "/customer/privacy/policy/form"; // Footer > 개인정보취급방침
  30. const _PAGE_CUSTOMER_CONSENT_USERINFO = _frontUrl + "/customer/consent/useinfo/form"; // 정보 이용동의 : Yes24 로그인
  31. const _PAGE_USE_TERMS_LAYER = _frontUrl + "/customer/use/terms/layer"; // 회원가입 > 이용약관
  32. const _PAGE_PRIVACY_POLICY_LAYER = _frontUrl + "/customer/privacy/policy/layer"; // 회원가입 > 개인정보취급방침
  33. const _PAGE_PRIVACY_TRUST_LAYER = _frontUrl + "/customer/privacy/trust/layer"; // 회원가입 > 개인정보취급위탁
  34. const _PAGE_NON_CUSTOMER_ORDER_CONFIRM = _frontUrl + "/customer/noncust/order/confirm/form"; // 고객 > 비회원주문확인
  35. //== 상품상세 ==/
  36. const _PAGE_GOODS_DETAIL = _frontUrl + "/goods/detail/form?goodsCd="; // 상품 상세
  37. const _PAGE_GOODS_COUPON_LAYER = _frontUrl + "/goods/coupon/layer?goodsCd="; // 쿠폰레이어
  38. const _PAGE_GOODS_SHOP_BENEFIT_LAYER = _frontUrl + "/goods/shop/benefit/layer/"; // 쇼핑혜택레이어
  39. const _PAGE_CARD_PRMT_LAYER = _frontUrl + "/goods/card/prmt/layer/"; // 카드혜택레이어
  40. const _PAGE_GOODS_SIZEINFO_LAYER = _frontUrl + "/goods/sizeInfo/layer/"; // 사이즈정보레이어
  41. const _PAGE_GOODS_INSTOCK_ALARM_LAYER = _frontUrl + "/goods/instock/alarm/layer/"; // 재입고알림레이어
  42. const _PAGE_GOODS_QNA_LAYER = _frontUrl + "/goods/qna/layer/"; // 상품문의레이어
  43. const _PAGE_GOODS_QNA_CREATE_LAYER = _frontUrl + "/goods/qna/create/layer/"; // 상품문의레이어
  44. const _PAGE_GOODS_DELIVERY_LAYER = _frontUrl + "/goods/delivery/layer/"; // 배송/교환/반품 레이어
  45. const _PAGE_GOODS_REVIEW_LAYER = _frontUrl + "/goods/review/layer/"; // 상품평 레이어
  46. const _PAGE_GOODS_REVIEW_DETAIL_LAYER = _frontUrl + "/goods/review/detail/layer"; // 상품평- 상세(베스트, 포토)
  47. const _PAGE_GOODS_REVIEW_PHTO_LIST_LAYER = _frontUrl + "/goods/review/photo/layer/"; // 상품평- 포토/영상 리뷰 (list)
  48. const _PAGE_GOODS_CPN_DOWNLOAD = "/goods/coupon/download"; // 상품쿠폰다운로드
  49. const _PAGE_GOODS_EP_CPN_DOWNLOAD = "/goods/ep/coupon/download"; // EP쿠폰다운로드
  50. const _PAGE_DEAL_GOODS_DETAIL_LAYER = _frontUrl + "/goods/deal/detail/layer/"; // 딜상품 상세레이어
  51. const _PAGE_SEARCH_LAYER = _frontUrl + "/display/search/layer/"; // 검색레이어
  52. //== 장바구니 ==/
  53. const _PAGE_CART = _frontUrl + "/cart/list/form"; // 장바구니
  54. //== 주문 ==/
  55. //== 마이페이지 ==/
  56. const _PAGE_MYPAGE = _frontUrl + "/mypage/main/form"; // 마이페이지 > 메인
  57. const _PAGE_MYPAGE_ORDER_LIST = _frontUrl + "/mypage/order/list/form"; // 마이페이지 > 주문확인/배송조회
  58. const _PAGE_MYPAGE_ORDER_DETAIL = _frontUrl + "/mypage/order/detail/form/"; // 마이페이지 > 주문/배송 상세
  59. const _PAGE_MYPAGE_CRE_LIST = _frontUrl + "/mypage/cre/list/form"; // 마이페이지 > 취소/교환/반품 목록
  60. const _PAGE_MYPAGE_RESTOCK = _frontUrl + "/mypage/restock/form"; // 마이페이지 > 재입고 알림 내역
  61. const _PAGE_MYPAGE_COUPON = _frontUrl + "/mypage/coupon/form"; // 마이페이지 > 쿠폰
  62. const _PAGE_MYPAGE_POINT = _frontUrl + "/mypage/point/form"; // 마이페이지 > 포인트
  63. const _PAGE_MYPAGE_GIFTCARD = _frontUrl + "/mypage/gift/card/form"; // 마이페이지 > 상품권
  64. const _PAGE_MYPAGE_REVIEW = _frontUrl + "/mypage/review/form"; // 마이페이지 > 리뷰
  65. const _PAGE_MYPAGE_CREATE_REVIEW = _frontUrl + "/mypage/review/create/form/"; // 마이페이지 > 리뷰 > 리뷰작성
  66. const _PAGE_MYPAGE_REVIEW_DETAIL_LAYER = _frontUrl +"/mypage/review/detail/layer/";// 마이페이지- 포토/영상 리뷰 (list)
  67. const _PAGE_MYPAGE_DELIVERY_ADDR = _frontUrl + "/mypage/delivery/addr/form"; // 마이페이지 > 배송지 관리
  68. const _PAGE_MYPAGE_WISHLIST = _frontUrl + "/mypage/wish/list/form"; // 마이페이지 > 위시리스트
  69. const _PAGE_MYPAGE_CUSTOMER = _frontUrl + "/mypage/customer/confirm/form"; // 마이페이지 > 내정보 관리 > 회원정보 확인
  70. const _PAGE_MYPAGE_CUSTOMER_MODIFY = _frontUrl + "/mypage/customer/modify/form"; // 마이페이지 > 내정보 관리 > 회원정보 수정
  71. const _PAGE_PASSWORD_MODIFY = _frontUrl + "/mypage/password/modify/form"; // 마이페이지 > 비밀번호 변경
  72. const _PAGE_MYPAGE_SECEDE = _frontUrl + "/mypage/customer/secede/form"; // 마이페이지 > 회원탈퇴
  73. const _PAGE_WISHLIST = _frontUrl + "/mypage/wish/list/form"; // 마이페이지 > 위시리스트
  74. const _PAGE_WISHLIST_PUT = _frontUrl + "/mypage/wish/list/put"; // 위시리스트 담기
  75. const _PAGE_WISHLIST_DEL = _frontUrl + "/mypage/wish/list/delete"; // 위시리스트 삭제
  76. //== 마이페이지 ==/
  77. const _PAGE_NOMEMBER_ORDER_LIST = _frontUrl + "/noMember/order/list/form"; // 비회원 > 주문확인/배송조회
  78. const _PAGE_NOMEMBER_ORDER_DETAIL = _frontUrl + "/noMember/order/detail/form/"; // 비회원 > 주문/배송 상세
  79. const _PAGE_NOMEMBER_CRE_LIST = _frontUrl + "/noMember/cre/list/form"; // 비회원 > 취소/교환/반품 목록
  80. //== 검색 ==/
  81. //== 기획전 ==/
  82. const _PAGE_PLANNING_MAIN = _frontUrl + "/planning/main/form"; // 기획전 메인
  83. const _PAGE_PLANNING_DETAIL = _frontUrl + "/planning/detail/form"; // 기획전 상세
  84. const _PAGE_PLANNING_CPN_DOWNLOAD = "/planning/coupon/download"; // 상품쿠폰다운로드
  85. //== 핫딜==/
  86. const _PAGE_SOCIAL_MAIN = _frontUrl + "/social/main/form"; // 소설(핫딜) 메인
  87. //== 이벤트 ==/
  88. const _PAGE_EVENT_MAIN = _frontUrl + "/planning/event/main/form"; // 이벤트 메인
  89. const _PAGE_EVENT_POLL = _frontUrl + "/planning/event/poll/form"; // 이벤트 > 설문조사
  90. const _PAGE_CUSTOMER_GRADE_BENEFIT = _frontUrl + "/planning/event/custgrade/benefit/form"; // 이벤트 회원등급혜택
  91. //== 고객센터 ==/
  92. const _PAGE_FAQ = _frontUrl + "/callcenter/faq/form"; // 고객센터 > FAQ
  93. const _PAGE_ONETOONE_QNA = _frontUrl + "/callcenter/onetoone/qna/form"; // 고객센터 > 1:1문의
  94. const _PAGE_ONETOONE_QNA_REG = _frontUrl + "/callcenter/onetoone/qna/register/form"; // 고객센터 > 1:1문의등록
  95. const _PAGE_GOODS_QNA = _frontUrl + "/callcenter/goods/qna/form"; // 고객센터 > 상품문의
  96. const _PAGE_NOTICE = _frontUrl + "/callcenter/notice/form"; // 고객센터 > 공지사항
  97. //== 기타 ==/
  98. const _PAGE_LOOKBOOK_MAIN = _frontUrl + "/display/lookbook/main/form"; // 룩북 메인
  99. const _PAGE_LOOKBOOK_DETAIL = _frontUrl + "/display/lookbook/detail/form"; // 룩북 상세
  100. /**********************************************************************************************/
  101. /**
  102. * @type : function
  103. * @access : public
  104. * @desc : page 이동
  105. * <pre>
  106. * cfnGoToPage(PAGE_LOGIN);
  107. * </pre>
  108. * @param : page - page
  109. * @return : None
  110. * @author : gagamel
  111. * @since : 2020/02/21
  112. */
  113. var cfnGoToPage = function(page, ithrCd) {
  114. var params = page;
  115. if (ithrCd) params += "&ithrCd=" + ithrCd;
  116. document.location.href = params;
  117. }
  118. /**
  119. * @type : function
  120. * @access : public
  121. * @desc : 나이스 휴대폰 인증
  122. * <pre>
  123. * cfnOpenCellphoneCertify();
  124. * 호출된 페이지에서
  125. * PC : fnNiceCallBack(encData) 콜백 함수 생성 후 encData 가지고 호출 처리
  126. * MO : redirectUrl 호출하는 페이지에서 넣어줘야됨
  127. * </pre>
  128. * @param redirectUrl - 모바일에서 사용 페이지이동으로 하기 때문에
  129. * @since : 2021/02/09
  130. * @author : jsshin
  131. */
  132. var cfnOpenCellphoneCertify = function (redirectUrl, custParams) {
  133. var actionUrl = _frontUrl + "/customer/nice/cellphone/form";
  134. var popupWidth = 420;
  135. var popupHeight = 720;
  136. var popupX = (window.screen.width / 2) - (popupWidth / 2);
  137. var popupY = (window.screen.height / 3) - (popupHeight / 3);
  138. if ('P' === _frontGb) {
  139. window.open(actionUrl, "popupCellphone", "top=" + popupY + ", left=" + popupX + ", width=" + popupWidth + ", height=" + popupHeight + ", fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbar=no");
  140. } else {
  141. if (!gagajf.isNull(redirectUrl)) {
  142. actionUrl = actionUrl + "?redirectUrl=" + redirectUrl;
  143. if (!gagajf.isNull(custParams)) {
  144. actionUrl = actionUrl + "&custParams=" + custParams;
  145. }
  146. document.location.href = actionUrl;
  147. }
  148. }
  149. }
  150. /**
  151. * @type : function
  152. * @access : public
  153. * @desc : 나이스 아이핀 인증
  154. * <pre>
  155. * cfnOpenIpinCertify();
  156. * 호출된 페이지에서
  157. * PC : fnNiceCallBack(encData) 콜백 함수 생성 후 encData 가지고 호출 처리
  158. * MO : redirectUrl 호출하는 페이지에서 넣어줘야됨
  159. * </pre>
  160. * @since : 2021/02/09
  161. * @author : jsshin
  162. */
  163. var cfnOpenIpinCertify = function (redirectUrl, custParams) {
  164. var actionUrl = _frontUrl + "/customer/nice/ipin/form";
  165. var popupWidth = 445;
  166. var popupHeight = 550;
  167. var popupX = (window.screen.width / 2) - (popupWidth / 2);
  168. var popupY = (window.screen.height / 3) - (popupHeight / 3);
  169. if ('P' === _frontGb) {
  170. window.open(actionUrl, "popupIpin", "top=" + popupY + ", left=" + popupX + ", width=" + popupWidth + ", height=" + popupHeight + ", fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbar=no");
  171. } else {
  172. if (!gagajf.isNull(redirectUrl)) {
  173. actionUrl = actionUrl + "?redirectUrl=" + redirectUrl;
  174. if (!gagajf.isNull(custParams)) {
  175. actionUrl = actionUrl + "&custParams=" + custParams;
  176. }
  177. document.location.href = actionUrl;
  178. }
  179. }
  180. };
  181. /**
  182. * @type : function
  183. * @access : public
  184. * @desc : 장바구니 등록 temp.cartGb :C 장바구니, O:바로구매
  185. * <pre>
  186. * cfnAddCart(cartList);
  187. * cartList는 Array로 등록해주셔야합니다.
  188. * ex) 일반 & deal 상품 장바구니 등록 (일반&딜 상품도 배열에 담아서 전송해주세요.)
  189. * let compsList = [];
  190. * let temp = new Object;
  191. * temp.goodsCd = "14373703";
  192. * temp.optCd = "블랙140";
  193. * temp.goodsQty = 1;
  194. * temp.goodsType = "G056_D";
  195. * temp.dealGoodsCd = "STY"
  196. * temp.cartGb = "C";
  197. * temp.afLinkCd = "afLinkCd";
  198. * temp.ithrCd = "G027_ZZZ";
  199. * temp.contentsLoc = "G028_YYY";
  200. * temp.planDtlSq = "123";
  201. * compsList.push(temp);
  202. * cfnAddCart(compsList);
  203. *
  204. * ex) 세트상품 장바구니 등록
  205. * let cartGoodsList = [];
  206. * for(let i = 0 ; i < 세트상품수 ; i++) {
  207. * let compsList = [];
  208. * let goodsList = {
  209. * cartCompsList : new Array()
  210. * }
  211. *
  212. * for(let j = 0 ; j < 세트구성품수 ; j++) {
  213. * let temp = new Object;
  214. * temp.goodsCd = "STYS00000005";
  215. * temp.itemCd = "A83F-DP568S";
  216. * temp.optCd = "14019445-1";
  217. * temp.goodsQty = 3;
  218. * temp.goodsType = "G056_S";
  219. * temp.cartGb = "C";
  220. * temp.afLinkCd = "aaaa";
  221. * temp.ithrCd = "12311";
  222. * temp.contentsLoc = "afasd";
  223. * temp.planDtlSq = "44";
  224. * compsList.push(temp);
  225. * }
  226. *
  227. * goodsList.cartCompsList = compsList;
  228. * cartGoodsList.push(goodsList);
  229. * }
  230. *
  231. * cfnAddCart(cartGoodsList);
  232. *
  233. * </pre>
  234. * @since : 2021/02/24
  235. * @author : xodud1202
  236. */
  237. function cfnAddCart(cartList) {
  238. gagajf.showProgressbar(true);
  239. let jsonData = JSON.stringify(cartList);
  240. $.ajax( {
  241. type: "POST",
  242. url : '/cart/save',
  243. data : jsonData,
  244. contentType: 'application/json',
  245. dataType : 'json',
  246. error : function(e) {
  247. mcxDialog.alert("장바구니 등록이 실패했습니다.");
  248. gagajf.showProgressbar(false);
  249. },
  250. success : function(result) {
  251. if(result.message == "SUCCESS") {
  252. if(result.cartGb == "C") {
  253. // 룩북 및 이벤트 페이지에서 여러 타입의 상품이 들어 올 수 있음. 반복문으로 들어오므로 cartList[0].multiGoodsGb == O면 confirm 창 안띄움.
  254. // 일반적인 장바구니 담기를 위해 공백이나 O가 아닌 값일때 confirm 처리
  255. if(!(cartList != null && cartList[0].multiGoodsGb != null && cartList[0].multiGoodsGb == "O")) {
  256. mcxDialog.confirm("<div class=" + "dialog-title" + ">" + "상품이 쇼핑백에 추가되었습니다.</div><p>쇼핑백으로 이동하시겠습니까?</p>", {
  257. cancelBtnText: "계속 쇼핑하기",
  258. sureBtnText : "쇼핑백 가기",
  259. sureBtnClick : function () {
  260. location.href = '/cart/list/form'; //내 쇼핑백 이동url
  261. }
  262. });
  263. // PC버전에서만 동작해야함(퀵메뉴)
  264. if (navigator.userAgent.indexOf('Mobile') == -1) {
  265. fnGetCartGoodsList();
  266. } else {
  267. if($("header #htopSub .button_wrap .store>span")) {
  268. // 장바구니 수량 조회
  269. $.getJSON('/cart/goods/not/soldout/cnt', function (order, status) {
  270. let cartCnt;
  271. if (order.totCartCnt > 99) {
  272. cartCnt = "99+";
  273. } else {
  274. cartCnt = order.totCartCnt;
  275. }
  276. $("header #htopSub .button_wrap .store>span").text(cartCnt);
  277. });
  278. }
  279. }
  280. // 장바구니 팝업에서
  281. if (cartList != null && cartList[0].popupYn != null && cartList[0].popupYn == "Y") {
  282. let data = {shotDelvUseYn: $("input[name=shotDelvUseYn]:checked").val()};
  283. getCartList(data);
  284. }
  285. }
  286. } else if (result.cartGb == "O"){
  287. let orderHtml = "";
  288. for(let i = 0 ; i < result.cartSqList.length ; i++) {
  289. orderHtml += '<input type="hidden" name="cartSqArr" value="' + result.cartSqList[i] + '" />';
  290. }
  291. $("#directOrderForm").html(orderHtml);
  292. if(result.custNo == 0) {
  293. var btn = ["비회원 구매", "로그인 후 구매"];
  294. mcxDialog.confirmC("로그인 후 구매 시 다양한 혜택을 받으실 수 있습니다.", { //내용
  295. btn: btn,
  296. btnClick: function(index){
  297. if (index == 1) { //button1 일때 처리문
  298. $("#directOrderForm").submit();
  299. } else {
  300. location.href="/signin";
  301. }
  302. }
  303. });
  304. } else {
  305. $("#directOrderForm").submit();
  306. }
  307. } else if (result.cartGb == "G") {
  308. if(result.custNo == 0) {
  309. location.href="/signin";
  310. }
  311. let orderHtml = "";
  312. for(let i = 0 ; i < result.cartSqList.length ; i++) {
  313. orderHtml += '<input type="hidden" name="cartSqArr" value="' + result.cartSqList[i] + '" />';
  314. }
  315. $("#directOrderForm").html(orderHtml);
  316. $("#directOrderForm").submit();
  317. } else if (result.cartGb == "N") {
  318. buy_nc_req(result.cartSqList);
  319. } else {
  320. mcxDialog.alert("해당 기능을 사용 할 수 없습니다. 새로고침 후 다시 시도해주세요.");
  321. }
  322. } else {
  323. mcxDialog.alert(result.message);
  324. }
  325. gagajf.showProgressbar(false);
  326. }
  327. });
  328. }
  329. /**
  330. * @type : function
  331. * @access : public
  332. * @desc : 네이버 로그인
  333. * <pre>
  334. * cfnLoginNaver();
  335. * 호출된 페이지에서
  336. * PC: fnSnsSigninCallback(userInfo) 콜백 함수 생성 후 가지고 호출 처리
  337. * MO : SnsCallBackFormMob.html 해당 페이지 후 처리
  338. * </pre>
  339. * @since : 2021/02/23
  340. * @author : jsshin
  341. */
  342. var cfnLoginNaver = function (requestGb, chkRememberMe) {
  343. let actionUrl = _frontUrl + '/signin/naverlogin?rememberMe=' + chkRememberMe;
  344. let popupHeight = 800;
  345. let popupWidth = 600;
  346. let popupX = (window.screen.width / 2) - (popupWidth / 2);
  347. let popupY = (window.screen.height / 3) - (popupHeight / 3);
  348. if ('P' === _frontGb) {
  349. window.open(actionUrl, 'naverLogin', 'top=' + popupY + ',left=' + popupX + ',height=' + popupHeight + ',width=' + popupWidth + ', fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbars=yes', '');
  350. } else {
  351. document.location.href = actionUrl + '&requestGb=' + requestGb;
  352. }
  353. };
  354. /**
  355. * @type : function
  356. * @access : public
  357. * @desc : 카카오 로그인
  358. * <pre>
  359. * cfnLoginKakao();
  360. * 호출된 페이지에서
  361. * PC: fnSnsSigninCallback(userInfo) 콜백 함수 생성 후 가지고 호출 처리
  362. * MO : SnsCallBackFormMob.html 해당 페이지 후 처리
  363. * </pre>
  364. * @since : 2021/02/23
  365. * @author : jsshin
  366. */
  367. var cfnLoginKakao = function (requestGb, chkRememberMe) {
  368. let actionUrl = _frontUrl + '/signin/kakologin?rememberMe=' + chkRememberMe;
  369. let popupWidth = 450;
  370. let popupHeight = 700;
  371. let popupX = (window.screen.width / 2) - (popupWidth / 2);
  372. let popupY = (window.screen.height / 3) - (popupHeight / 3);
  373. if ('P' === _frontGb) {
  374. //window.open(actionUrl, 'kakaoLogin', 'top=' + popupY + ',left=' + popupX + ',height=' + popupHeight + ',width=' + popupWidth + ', fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbars=yes', '');
  375. } else {
  376. //document.location.href = actionUrl + '&requestGb=' + requestGb;
  377. }
  378. };
  379. /**
  380. * @type : function
  381. * @access : public
  382. * @desc : Yes24 로그인
  383. * <pre>
  384. * cfnLoginYes24();
  385. * 호출된 페이지에서
  386. * PC: fnSnsSigninCallback(userInfo) 콜백 함수 생성 후 가지고 호출 처리
  387. * MO : SnsCallBackFormMob.html 해당 페이지 후 처리
  388. * </pre>
  389. * @since : 2021/02/23
  390. * @author : jsshin
  391. */
  392. var cfnLoginYes24 = function (requestGb, chkRememberMe) {
  393. let actionUrl = _frontUrl + '/signin/yes24login?rememberMe=' + chkRememberMe;
  394. let popupWidth = 987;
  395. let popupHeight = 862;
  396. let popupX = (window.screen.width / 2) - (popupWidth / 2);
  397. let popupY = (window.screen.height / 3) - (popupHeight / 3);
  398. if ('P' === _frontGb) {
  399. window.open(actionUrl, 'yes24Login', 'top=' + popupY + ',left=' + popupX + ',height=' + popupHeight + ',width=' + popupWidth + ', fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbars=yes', '');
  400. } else {
  401. document.location.href = actionUrl + '&requestGb=' + requestGb;
  402. }
  403. };
  404. /**
  405. * @type : function
  406. * @access : public
  407. * @desc : 상품상세로 이동
  408. * <pre>
  409. * cfnGoToGoodsDetail('A83U-TS058S');
  410. * </pre>
  411. * @param : goodsCd - 상품코드코드. 필수
  412. * @param : ithrCd - 유입경로. 필수
  413. * @param : contentsLoc - 컨텐츠위치.
  414. * @since : 2021/03/02
  415. * @author : eskim
  416. */
  417. var cfnGoToGoodsDetail = function (goodsCd, colorCd, ithrCd, contentsLoc, planDtlSq, rccode ) {
  418. var params = goodsCd;
  419. if (typeof (colorCd) != 'undefined') params += "&colorCd=" + colorCd;
  420. if (typeof (ithrCd) != 'undefined') params += "&ithrCd=" + ithrCd;
  421. if (typeof (contentsLoc) != 'undefined' && contentsLoc != "") params += "&contentsLoc=" + contentsLoc;
  422. if (typeof (planDtlSq) != 'undefined') params += "&planDtlSq=" + planDtlSq;
  423. if (typeof (rccode) != 'undefined') params += "&rccode=pc_detail"; // 추천솔루션 제공 상품클릭시
  424. cfnGoToPage(_PAGE_GOODS_DETAIL + params);
  425. }
  426. /**
  427. * @type : function
  428. * @access : public
  429. * @desc : 공통 레이어 띄우기
  430. * <pre>
  431. * cfOpenLayer(_PAGE_CARD_LAYER, 'layer_card_benefit');
  432. * </pre>
  433. * @param : page - page. 필수
  434. * @param : tgt - 레이어가 표시될 위치(예, div 태크의 ID). 필수
  435. * @param : oParam - Parameter Object. 옵션
  436. * @param : callbackFnc - 콜백함수. 옵션
  437. */
  438. function cfOpenLayer(page, tgt, oParam, callbackFnc) {
  439. if (!oParam) oParam = new Object();
  440. $.post(page
  441. , oParam
  442. , function (result) {
  443. $('#' + tgt).html(result);
  444. $('#' + tgt).modal("show");
  445. //$('#' + tgt).show();
  446. //layerPop_resize(tgt);
  447. if (callbackFnc && $.isFunction(callbackFnc))
  448. callbackFnc();
  449. }
  450. , "html");
  451. return false;
  452. }
  453. /**
  454. * @type : function
  455. * @access : public
  456. * @desc : 공통 레이어 위치 조정
  457. * <pre>
  458. * layerPop_resize('layer_card_benefit');
  459. * </pre>
  460. * @param : tgt - 레이어가 표시될 위치(예, div 태크의 ID). 필수
  461. */
  462. function layerPop_resize(tgt) {
  463. var thisH = $("#" + tgt).find(".modal").outerHeight();
  464. var thisT = ($(window).height() / 2) - (thisH / 2);
  465. $("#" + tgt).find(".modal").css('top', thisT + 'px');
  466. }
  467. /**
  468. * @type : function
  469. * @access : public
  470. * @desc : 공통 레이어 닫기(레이어 숨기기)
  471. * <pre>
  472. * cfCloseLayer("layer_card_benefit");
  473. * </pre>
  474. * @param : tgt - 숨길 레이어 ID(예, div 태크의 ID). 필수
  475. */
  476. function cfCloseLayer(tgt) {
  477. if (_frontGb == "M"){
  478. $('#' + tgt).hide();
  479. }else{
  480. $('#' + tgt).hide();
  481. $('#' + tgt).remove();
  482. }
  483. return false;
  484. }
  485. /**
  486. * @type : function
  487. * @access : public
  488. * @desc : 카드혜택보기
  489. * <pre>
  490. * cfCardInfo();
  491. * </pre>
  492. */
  493. function cfCardInfo() {
  494. var str = '<div class="modal fade pd_pop bnf_card_pop" id="layer_card_benefit" tabindex="-1" role="dialog" aria-labelledby="bnfCardLabel" aria-hidden="true"></div>';
  495. if ("P" != _frontGb){
  496. str = '<div class="modal pop_full fade pd_pop bnf_card_pop" id="layer_card_benefit" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true">';
  497. }
  498. if ($('#layer_card_benefit').length == 0) {
  499. $('body').append(str);
  500. }
  501. cfOpenLayer(_PAGE_CARD_PRMT_LAYER, 'layer_card_benefit');
  502. }
  503. /**
  504. * @type : function
  505. * @access : public
  506. * @desc : 상품쿠폰목록보기
  507. * <pre>
  508. * cfGoodsCouponInfo(goodsCd);
  509. * </pre>
  510. */
  511. function cfGoodsCouponInfo(goodsCd, goodsType) {
  512. if (!cfCheckLogin()) {
  513. cfnGoToPage(_PAGE_LOGIN);
  514. return false;
  515. }
  516. var aria = "saleCouponLabel";
  517. if ("P" != _frontGb){
  518. aria = "modalScrollLabel";
  519. }
  520. var str = '<div class="modal fade pd_pop salecoupon_pop" id="layer_goods_coupon" tabindex="-1" role="dialog" aria-labelledby="'+aria+'" aria-hidden="true"></div>';
  521. if ($('#layer_goods_coupon').length == 0) {
  522. $('body').append(str);
  523. }
  524. var params = goodsCd;
  525. if (typeof (goodsType) != 'undefined') params += "&goodsType=" + goodsType;
  526. cfOpenLayer(_PAGE_GOODS_COUPON_LAYER + params, 'layer_goods_coupon');
  527. }
  528. /**
  529. * @type : function
  530. * @access : public
  531. * @desc : 상품쇼핑혜택목록보기
  532. * <pre>
  533. * cfGoodsShopBenefitInfo(goodsCd);
  534. * </pre>
  535. */
  536. function cfGoodsShopBenefitInfo(goodsCd) {
  537. var str = '<div class="modal fade pd_pop bnf_shopping_pop" id="layer_shopping_benefit" tabindex="-1" role="dialog" aria-labelledby="bnfShoppingLabel" aria-hidden="true"></div>';
  538. if ("P" != _frontGb){
  539. str = '<div class="modal pop_full fade pd_pop bnf_shopping_pop" id="layer_shopping_benefit" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  540. }
  541. if ($('#layer_shopping_benefit').length == 0) {
  542. $('body').append(str);
  543. }
  544. cfOpenLayer(_PAGE_GOODS_SHOP_BENEFIT_LAYER+goodsCd, 'layer_shopping_benefit');
  545. }
  546. /**
  547. * @type : function
  548. * @access : public
  549. * @desc : 상품사이즈정보보기
  550. * <pre>
  551. * cfGoodsSizeInfo(goodsCd);
  552. * </pre>
  553. */
  554. function cfGoodsSizeInfo(goodsCd, colorCd) {
  555. var str = '<div class="modal fade pd_pop info_size_pop" id="layer_size_info" tabindex="-1" role="dialog" aria-labelledby="infoSizeLabel" aria-hidden="true"></div>';
  556. if ("P" != _frontGb){
  557. str = '<div class="modal pop_full fade pd_pop info_size_pop" id="layer_size_info" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  558. }
  559. if ($('#layer_size_info').length == 0) {
  560. $('body').append(str);
  561. }
  562. cfOpenLayer(_PAGE_GOODS_SIZEINFO_LAYER+goodsCd +'/'+colorCd, 'layer_size_info');
  563. }
  564. /**
  565. * @type : function
  566. * @access : public
  567. * @desc : 상품재입고알림보기
  568. * <pre>
  569. * cfGoodsInstockAlarmInfo(goodsCd);
  570. * </pre>
  571. */
  572. function cfGoodsInstockAlarmInfo(goodsCd, colorCd) {
  573. if (!cfCheckLogin()) {
  574. cfnGoToPage(_PAGE_LOGIN);
  575. return false;
  576. }
  577. var str = '<div class="modal fade pd_pop push_restock_pop" id="layer_instock_alarm" tabindex="-1" role="dialog" aria-labelledby="pushRestockLabel" aria-hidden="true"></div>';
  578. if ("P" != _frontGb){
  579. str = '<div class="modal pop_full fade pd_pop push_restock_pop" id="layer_instock_alarm" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  580. }
  581. if ($('#layer_instock_alarm').length == 0) {
  582. $('body').append(str);
  583. }
  584. cfOpenLayer(_PAGE_GOODS_INSTOCK_ALARM_LAYER+goodsCd+'/'+colorCd, 'layer_instock_alarm');
  585. }
  586. /**
  587. * @type : function
  588. * @access : public
  589. * @desc : 상품평- 베스트 리뷰 보기
  590. * <pre>
  591. * cfGoodsReviewDetail(goodsCd, bestYn, photoYn, reviewSq, attachSq);
  592. * </pre>
  593. */
  594. function cfGoodsReviewDetail(goodsCd, bestYn, photoYn, reviewSq, attachSq) {
  595. var str = '<div class="modal fade pd_pop pd_photoreviewdetail_pop" id="layer_review_best" tabindex="-1" role="dialog" aria-labelledby="pdBestReviewLabel" aria-hidden="true"></div>';
  596. if ("P" != _frontGb){
  597. str = '<div class="modal pop_full fade pd_pop pd_photoreviewdetail_pop" id="layer_review_best" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  598. }
  599. if ($('#layer_review_best').length == 0) {
  600. $('body').append(str);
  601. }
  602. var params = '?goodsCd=' + goodsCd;
  603. params += '&reviewSq=' + reviewSq;
  604. params += '&bestYn=' + bestYn;
  605. params += '&photoYn=' + photoYn;
  606. if (typeof (attachSq) != 'undefined') params += "&attachSq=" + attachSq;
  607. cfOpenLayer(_PAGE_GOODS_REVIEW_DETAIL_LAYER+params, 'layer_review_best');
  608. }
  609. /**
  610. * @type : function
  611. * @access : public
  612. * @desc : 상품평- 포토/영상 리뷰 리스트 보기
  613. * <pre>
  614. * cfGoodsPhotoReview(goodsCd);
  615. * </pre>
  616. */
  617. function cfGoodsReviewPhoto(goodsCd) {
  618. var str = '<div class="modal fade pd_pop pd_photoreviewlist_pop" id="layer_review_photo" tabindex="-1" role="dialog" aria-labelledby="pdPhotoReviewListLabel" aria-hidden="true"></div>';
  619. if ("P" != _frontGb){
  620. str = '<div class="modal pop_full fade pd_pop pd_photoreviewlist_pop" id="layer_review_photo" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  621. }
  622. if ($('#layer_review_photo').length == 0) {
  623. $('body').append(str);
  624. }
  625. cfOpenLayer(_PAGE_GOODS_REVIEW_PHTO_LIST_LAYER+goodsCd, 'layer_review_photo');
  626. }
  627. /**
  628. * @type : function
  629. * @access : public
  630. * @desc : 공통 full 레이어 띄우기
  631. * <pre>
  632. * cfOpenFullLayer(_PAGE_CARD_LAYER, 'layer_card_benefit');
  633. * </pre>
  634. * @param : page - page. 필수
  635. * @param : tgt - 레이어가 표시될 위치(예, div 태크의 ID). 필수
  636. * @param : oParam - Parameter Object. 옵션
  637. * @param : callbackFnc - 콜백함수. 옵션
  638. */
  639. function cfOpenFullLayer(page, tgt, oParam, callbackFnc) {
  640. if (!oParam) oParam = new Object();
  641. $.post(page
  642. , oParam
  643. , function (result) {
  644. $('body').addClass('lock');
  645. $('#' + tgt).html(result);
  646. $('#' + tgt).show();
  647. if (callbackFnc && $.isFunction(callbackFnc))
  648. callbackFnc();
  649. }
  650. , "html");
  651. return false;
  652. }
  653. /**
  654. * @type : function
  655. * @access : public
  656. * @desc : 공통 full 레이어 닫기(레이어 숨기기)
  657. * <pre>
  658. * cfCloseFullLayer("layer_card_benefit");
  659. * </pre>
  660. * @param : tgt - 숨길 레이어 ID(예, div 태크의 ID). 필수
  661. */
  662. function cfCloseFullLayer(tgt) {
  663. //if (_frontGb == "M"){
  664. // btnClose(tgt);
  665. //}else{
  666. $('#' + tgt).hide();
  667. $('#' + tgt).remove();
  668. $('body').removeClass('lock');
  669. //}
  670. return false;
  671. }
  672. /**
  673. * @type : function
  674. * @access : public
  675. * @desc : 상품문의 full 팝업
  676. * <pre>
  677. * cfGoodsQng();
  678. * </pre>
  679. */
  680. function cfGoodsQng(goodsCd) {
  681. var Param = new Object();
  682. var str = '<div class="pd_pop full_pop pd_qnalist_pop" id="layer_goods_qna"></div>';
  683. if ("P" != _frontGb){
  684. str = '<div class="modal pop_full fade pd_pop pd_qnalist_pop" id="layer_goods_qna" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  685. }
  686. if ($('#layer_goods_qna').length == 0) {
  687. $('body').append(str);
  688. }
  689. if ("P" == _frontGb){
  690. cfOpenFullLayer(_PAGE_GOODS_QNA_LAYER + goodsCd, 'layer_goods_qna');
  691. }else{
  692. cfOpenLayer(_PAGE_GOODS_QNA_LAYER + goodsCd, 'layer_goods_qna');
  693. }
  694. }
  695. /**
  696. * @type : function
  697. * @access : public
  698. * @desc : 상품문의 등록 팝업
  699. * <pre>
  700. * cfGoodsQngReg();
  701. * </pre>
  702. */
  703. function cfGoodsQngCreate(goodsCd) {
  704. if (!cfCheckLogin()) {
  705. cfnGoToPage(_PAGE_LOGIN);
  706. return false;
  707. }
  708. var Param = new Object();
  709. var str = '<div class="modal fade pd_pop pd_qnawrite_pop" id="layer_goods_qna_reg" tabindex="-1" role="dialog" aria-labelledby="pdQnaWriteLabel" aria-hidden="true"></div>';
  710. if ("P" != _frontGb){
  711. str = '<div class="modal pop_full fade pd_pop pd_qnawrite_pop" id="layer_goods_qna_reg" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  712. }
  713. if ($('#layer_goods_qna_reg').length == 0) {
  714. $('body').append(str);
  715. }
  716. cfOpenLayer(_PAGE_GOODS_QNA_CREATE_LAYER + goodsCd, 'layer_goods_qna_reg');
  717. }
  718. /**
  719. * @type : function
  720. * @access : public
  721. * @desc : 상품문의 full 팝업
  722. * <pre>
  723. * cfGoodsDelivery();
  724. * </pre>
  725. */
  726. function cfGoodsDelivery(goodsCd) {
  727. var Param = new Object();
  728. var str = '<div class="pd_pop full_pop pd_delivery_pop" id="layer_goods_delivery"></div>';
  729. if ("P" != _frontGb){
  730. str = '<div class="modal pop_full fade pd_pop pd_delivery_pop" id="layer_goods_delivery" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  731. }
  732. if ($('#layer_goods_delivery').length == 0) {
  733. $('body').append(str);
  734. }
  735. if ("P" == _frontGb){
  736. cfOpenFullLayer(_PAGE_GOODS_DELIVERY_LAYER + goodsCd, 'layer_goods_delivery');
  737. }else{
  738. cfOpenLayer(_PAGE_GOODS_DELIVERY_LAYER + goodsCd, 'layer_goods_delivery');
  739. }
  740. }
  741. /**
  742. * @type : function
  743. * @access : public
  744. * @desc : 상품 상품평 full 팝업
  745. * <pre>
  746. * cfGoodsReview();
  747. * </pre>
  748. */
  749. function cfGoodsReview(goodsCd) {
  750. var Param = new Object();
  751. var str = '<div class="pd_pop full_pop pd_review_pop" id="layer_goods_review"></div>';
  752. if ("P" != _frontGb){
  753. str = '<div class="modal pop_full fade pd_pop pd_review_pop" data-id="layer_infinite" id="layer_goods_review" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  754. }
  755. if ($('#layer_goods_review').length == 0) {
  756. $('body').append(str);
  757. }
  758. if ("P" == _frontGb){
  759. cfOpenFullLayer(_PAGE_GOODS_REVIEW_LAYER + goodsCd, 'layer_goods_review',null , fnReviewLayerCollBack);
  760. }else{
  761. cfOpenLayer(_PAGE_GOODS_REVIEW_LAYER + goodsCd, 'layer_goods_review');
  762. }
  763. }
  764. /**
  765. * @type : function
  766. * @access : public
  767. * @desc : Yes24 정보이용동의 화면
  768. * @param : custNm - 고객명
  769. * <pre>
  770. * cfnConsentUseInfo(custNm);
  771. * </pre>
  772. */
  773. function cfnConsentUseInfo(custNm) {
  774. let str = '<div class="modal fade mbAgree_pop" id="layer_consent_useinfo" tabIndex="-1" role="dialog" aria-labelledby="mbAgreeLabel" aria-hidden="true"></div>';
  775. let params = {}
  776. params.custNm = custNm;
  777. if ($('#layer_consent_useinfo').length == 0) {
  778. $('body').append(str);
  779. }
  780. cfOpenLayer(_PAGE_CUSTOMER_CONSENT_USERINFO, 'layer_consent_useinfo',params);
  781. }
  782. /**
  783. * @type : function
  784. * @access : public
  785. * @desc : 패스워드 변경 팝업
  786. * <pre>
  787. * cfnPasswordModify();
  788. * </pre>
  789. */
  790. function cfnPasswordModify() {
  791. let str;
  792. if (_frontGb === 'P') {
  793. str = '<div class="modal fade pswordModify_pop" id="pswordModifyPop" tabindex="-1" role="dialog" aria-labelledby="pswordModifyLabel" aria-hidden="true"></div>';
  794. } else {
  795. str = '<div class="modal pop_full password_change_pop" id="pswordModifyPop" tabIndex="-1" role="dialog" aria-labelledby="pswordModifyPop" aria-hidden="true"></div>';
  796. }
  797. if ($('#pswordModifyPop').length == 0) {
  798. $('body').append(str);
  799. }
  800. cfOpenLayer(_PAGE_PASSWORD_MODIFY, 'pswordModifyPop');
  801. }
  802. /**
  803. * @type : function
  804. * @access : public
  805. * @desc : 이용약관 레이어
  806. * <pre>
  807. * cfnUseTermsLayer();
  808. * </pre>
  809. */
  810. function cfnUseTermsLayer() {
  811. let str;
  812. if (_frontGb === 'P') {
  813. str = '<div class="modal fade policiesTerms_pop" id="policiesTermsPop" tabindex="-1" role="dialog" aria-labelledby="policiesTermsLabel" aria-hidden="true"></div>';
  814. } else {
  815. str = '<div class="modal pop_full fade" id="policiesTermsPop" tabindex="-1" role="dialog" aria-labelledby="policiesTermsLabel" aria-hidden="true"></div>';
  816. }
  817. if ($('#policiesTermsPop').length == 0) {
  818. $('body').append(str);
  819. }
  820. cfOpenLayer(_PAGE_USE_TERMS_LAYER, 'policiesTermsPop');
  821. }
  822. /**
  823. * @type : function
  824. * @access : public
  825. * @desc : 개인정보취급방침
  826. * <pre>
  827. * cfnPrivacyPolicyLayer();
  828. * </pre>
  829. */
  830. function cfnPrivacyPolicyLayer() {
  831. let str;
  832. if (_frontGb === 'P') {
  833. str = '<div class="modal fade policiesPrivacy_pop" id="policiesPrivacyPop" tabindex="-1" role="dialog" aria-labelledby="policiesPrivacyLabel" aria-hidden="true"></div>';
  834. } else {
  835. str = '<div class="modal pop_full fade" id="policiesPrivacyPop" tabindex="-1" role="dialog" aria-labelledby="policiesPrivacyLabel" aria-hidden="true"></div>'
  836. }
  837. if ($('#policiesPrivacyPop').length == 0) {
  838. $('body').append(str);
  839. }
  840. cfOpenLayer(_PAGE_PRIVACY_POLICY_LAYER, 'policiesPrivacyPop');
  841. }
  842. /**
  843. * @type : function
  844. * @access : public
  845. * @desc : 개인정보취급위탁 레이어
  846. * <pre>
  847. * cfnPrivacyConsignmentLayer();
  848. * </pre>
  849. */
  850. function cfnPrivacyTrustLayer() {
  851. let str;
  852. if (_frontGb === 'P') {
  853. str = '<div class="modal fade trustPrivacy_pop" id="trustPrivacyPop" tabindex="-1" role="dialog" aria-labelledby="trustPrivacyLabel" aria-hidden="true"></div>';
  854. } else {
  855. str = '<div class="modal pop_full fade" id="trustPrivacyPop" tabindex="-1" role="dialog" aria-labelledby="trustPrivacyLabel" aria-hidden="true"></div>';
  856. }
  857. if ($('#trustPrivacy_pop').length == 0) {
  858. $('body').append(str);
  859. }
  860. cfOpenLayer(_PAGE_PRIVACY_TRUST_LAYER, 'trustPrivacyPop');
  861. }
  862. /**
  863. * @type : function
  864. * @access : public
  865. * @desc : 로그인 확인
  866. * <pre>
  867. * cfCheckLogin();
  868. * </pre>
  869. */
  870. function cfCheckLogin() {
  871. var result = '';
  872. $.ajax({
  873. type: 'get'
  874. , async: false
  875. , url: '/common/login/check'
  876. , success: function (data) {
  877. result = data;
  878. }
  879. });
  880. return result;
  881. }
  882. /**
  883. * @type : function
  884. * @access : public
  885. * @desc : 위시리스트 담기/삭제
  886. * <pre>
  887. * cfnPutWishList(OBJ);
  888. * </pre>
  889. */
  890. function cfnPutWishList(a) {
  891. if (!cfCheckLogin()) {
  892. cfnGoToPage(_PAGE_LOGIN);
  893. return false;
  894. }
  895. var goodsCd = $(a).attr("goodsCd");
  896. var ithrCd = $(a).attr("ithrCd");
  897. var contentsLoc = $(a).attr("contentsLoc");
  898. var planDtlSq = $(a).attr("planDtlSq");
  899. var flag = 'REG';
  900. if ($(a).hasClass('active')) {
  901. flag = 'DEL'
  902. }
  903. if (gagajf.isNull(goodsCd)) return;
  904. var data = [];
  905. var params = new Object();
  906. params.goodsCd = goodsCd;
  907. if (!gagajf.isNull(ithrCd)) {
  908. params.ithrCd = ithrCd;
  909. }
  910. if (!gagajf.isNull(contentsLoc)) {
  911. params.contentsLoc = contentsLoc;
  912. }
  913. if (!gagajf.isNull(planDtlSq)) {
  914. params.planDtlSq = planDtlSq;
  915. }
  916. data.push(params);
  917. var jsonData = JSON.stringify(data);
  918. if (flag == 'REG') {
  919. gagajf.ajaxJsonSubmit(_PAGE_WISHLIST_PUT, jsonData, function (result) {
  920. var Msg = '';
  921. if (result.status == "200") {
  922. $(a).addClass('active');
  923. if (_frontGb == "M") {
  924. Msg = '위시리스트에 담겼습니다.';
  925. } else {
  926. // mcxDialog.confirm("위시리스트로 이동하시겠습니까?", {
  927. // cancelBtnText: "아니요", //취소 또는 닫기 버튼명
  928. // sureBtnText: "예", //처리문 버튼명
  929. // sureBtnClick: function () {
  930. // cfnGoToPage(_PAGE_WISHLIST);
  931. // }
  932. // });
  933. }
  934. if ("P" == _frontGb){
  935. fnGetWishList();
  936. }
  937. } else if (result.status == "중복") {
  938. Msg = '이미 등록 되어있습니다.';
  939. } else {
  940. //Msg = '오류로 인해 처리되지 않았습니다.';
  941. }
  942. // 메시지 처리
  943. //if (!gagajf.isNull(Msg)) {
  944. // if (_frontGb == "M") {
  945. // mcxDialog.toast(Msg);
  946. // } else {
  947. // mcxDialog.alertC(Msg);
  948. // }
  949. //}
  950. });
  951. } else {
  952. gagajf.ajaxJsonSubmit(_PAGE_WISHLIST_DEL, jsonData, function (result) {
  953. var Msg = '';
  954. if (result.status == "200") {
  955. Msg = '삭제 되었습니다.';
  956. $(a).removeClass('active');
  957. if ("P" == _frontGb){
  958. fnGetWishList();
  959. }
  960. } else {
  961. Msg = '오류로 인해 처리되지 않았습니다.';
  962. }
  963. // 메시지 처리
  964. //if (!gagajf.isNull(Msg)) {
  965. // if (_frontGb == "M") {
  966. // mcxDialog.toast(Msg);
  967. // } else {
  968. // mcxDialog.alertC(Msg);
  969. // }
  970. //}
  971. });
  972. }
  973. return false;
  974. }
  975. /**
  976. * @type : function
  977. * @access : public
  978. * @desc : 카테고리메인 페이지로 이동
  979. * <pre>
  980. * cfnGoToCategoryMain('G032_10', 1100);
  981. * </pre>
  982. * @param : cateGb - 카테고리구분. 필수
  983. * @param : cate1No - 카테고리1번호. 필수
  984. * @since : 2021/03/22
  985. * @author : gagamel
  986. */
  987. var cfnGoToCategoryMain = function(cateGb, cate1No, brandGroupNo) {
  988. var params = '?cateGb=' + cateGb + '&cate1No=' + cate1No;
  989. if (typeof (brandGroupNo) != 'undefined') params += '&brandGroupNo=' + brandGroupNo;
  990. cfnGoToPage(_PAGE_CATE_MAIN + params);
  991. }
  992. /**
  993. * @type : function
  994. * @access : public
  995. * @desc : 아울렛메인 페이지로 이동
  996. * <pre>
  997. * cfnGoToOutletMain('G032_103', 1713);
  998. * </pre>
  999. * @param : cateGb - 카테고리구분. 필수
  1000. * @param : cate1No - 카테고리1번호. 필수
  1001. * @since : 2021/04/20
  1002. * @author : bin2107
  1003. */
  1004. var cfnGoToOutletMain = function(cateGb, cate1No) {
  1005. var params = '?cateGb=' + cateGb + '&cate1No=' + cate1No;
  1006. // if (typeof (brandGroupNo) != 'undefined') params += '&brandGroupNo=' + brandGroupNo;
  1007. cfnGoToPage(_PAGE_OUTLET_MAIN + params);
  1008. }
  1009. /**
  1010. * @type : function
  1011. * @access : public
  1012. * @desc : 품목메인 페이지로 이동
  1013. * <pre>
  1014. * cfnGoToGoodsList(0, 'G032_10', 1100);
  1015. * </pre>
  1016. * @param : brandGroupNo - 브랜드그룹번호(BYITEM 기준이면 0. 이외는 브랜드그룹번호). 필수
  1017. * @param : cateGb - 카테고리구분. 필수
  1018. * @param : cate1No - 카테고리1번호. 필수
  1019. * @param : cate2No - 카테고리2번호. 옵션
  1020. * @param : cate3No - 카테고리3번호. 옵션
  1021. * @param : cate4No - 카테고리4번호. 옵션
  1022. * @param : cate5No - 카테고리5번호. 옵션
  1023. * @param : formalGb - 정상이월구분. 옵션
  1024. * @since : 2021/03/22
  1025. * @author : gagamel
  1026. */
  1027. var cfnGoToGoodsList = function(brandGroupNo, cateGb, cate1No, cate2No, cate3No, cate4No, cate5No, formalGb) {
  1028. var params = '?brandGroupNo=' + brandGroupNo + '&cateGb=' + cateGb;
  1029. if (typeof (cate1No) != 'undefined') params += '&cate1No=' + cate1No;
  1030. if (typeof (cate2No) != 'undefined') params += '&cate2No=' + cate2No;
  1031. if (typeof (cate3No) != 'undefined') params += '&cate3No=' + cate3No;
  1032. if (typeof (cate4No) != 'undefined') params += '&cate4No=' + cate4No;
  1033. if (typeof (cate5No) != 'undefined') params += '&cate5No=' + cate5No;
  1034. if (typeof (formalGb) != 'undefined') params += '&formalGb=' + formalGb;
  1035. cfnGoToPage(_PAGE_CATE_GOODS_LIST + params);
  1036. }
  1037. /**
  1038. * @type : function
  1039. * @access : public
  1040. * @desc : 브랜드메인 페이지로 이동
  1041. * <pre>
  1042. * cfnGoToBrandMain(24555);
  1043. * </pre>
  1044. * @param : brandGroupNo - 브랜드그룹번호. 필수
  1045. * @since : 2021/03/16
  1046. * @author : gagamel
  1047. */
  1048. var cfnGoToBrandMain = function(brandGroupNo) {
  1049. var params = '?brandGroupNo=' + brandGroupNo;
  1050. cfnGoToPage(_PAGE_BRAND_MAIN + params);
  1051. }
  1052. /**
  1053. * @type : function
  1054. * @access : public
  1055. * @desc : 기확전상세로 이동
  1056. * <pre>
  1057. * cfnGoToPlanDetail(251);
  1058. * </pre>
  1059. * @param : planSq - 기획전 번호. 필수
  1060. * @since : 2021/03/29
  1061. * @author : sowon
  1062. */
  1063. var cfnGoToPlanDetail = function (planSq , brandGroupNo) {
  1064. var params = '?planSq='+planSq;
  1065. if (typeof (brandGroupNo) != 'undefined') params += '&brandGroupNo=' + brandGroupNo;
  1066. cfnGoToPage(_PAGE_PLANNING_DETAIL + params);
  1067. }
  1068. /**
  1069. * @type : function
  1070. * @access : public
  1071. * @desc : 폴상세로 이동
  1072. * <pre>
  1073. * cfnGoToPollDetail(251);
  1074. * </pre>
  1075. * @param : planSq - 기획전 번호. 필수
  1076. * @since : 2021/03/29
  1077. * @author : sowon
  1078. */
  1079. var cfnGoToPollDetail = function (planSq) {
  1080. var params = '?planSq='+planSq;
  1081. cfnGoToPage(_PAGE_EVENT_POLL + params);
  1082. }
  1083. /**
  1084. * @type : function
  1085. * @access : public
  1086. * @desc : 룩북리스트로 이동
  1087. * <pre>
  1088. * cfnGoToLookbookList();
  1089. * </pre>cfnOpenGoodsPopup
  1090. * @param : brandGroupNo - 브랜드그룹번호 , lookbookGb - 룩북(L) or 브랜드룩북(BL)
  1091. * @since : 2021/04/06
  1092. * @author : bin2107
  1093. */
  1094. var cfnGoToLookbookList = function (lookbookGb, brandGroupNo) {
  1095. var params = '?lookbookGb='+lookbookGb;
  1096. if (typeof (brandGroupNo) != 'undefined') params += '&brandCd=' + brandGroupNo;
  1097. cfnGoToPage(_PAGE_LOOKBOOK_MAIN + params);
  1098. }
  1099. /**
  1100. * @type : function
  1101. * @access : public
  1102. * @desc : 룩북상세로 이동
  1103. * <pre>
  1104. * cfnGoToLookbookDetail(22);
  1105. * </pre>
  1106. * @param : lookbookSq - 룩북 번호. 필수
  1107. * @since : 2021/04/06
  1108. * @author : bin2107
  1109. */
  1110. var cfnGoToLookbookDetail = function (lookbookGb, lookbookSq, brandGroupNo) {
  1111. var params = '?lookbookGb='+lookbookGb+'&lookbookSq=' + lookbookSq;
  1112. if(lookbookGb=='BL'){
  1113. if (typeof (brandGroupNo) != 'undefined') params += '&brandCd=' + brandGroupNo + '&brandGroupNo=' + brandGroupNo;
  1114. }else {
  1115. if (typeof (brandGroupNo) != 'undefined') params += '&brandCd=' + brandGroupNo;
  1116. }
  1117. cfnGoToPage(_PAGE_LOOKBOOK_DETAIL + params);
  1118. }
  1119. /**
  1120. * @type : function
  1121. * @access : public
  1122. * @desc : 마이페이지 리뷰메인화면
  1123. * <pre>
  1124. * cfnGoToMypageReview();
  1125. * </pre>
  1126. * @param :
  1127. * @since : 2021/03/29
  1128. * @author : sowon
  1129. */
  1130. var cfnGoToMypageReview = function (ordNo,ordDtlNo,goodsCd) {
  1131. reviewStat = 'c';
  1132. if(ordNo == null || ordDtlNo == null || goodsCd == null){
  1133. cfnGoToPage(_PAGE_MYPAGE_REVIEW);
  1134. }else{
  1135. cfnGoToPage(_PAGE_MYPAGE_CREATE_REVIEW + ordNo +'/'+ordDtlNo+'/'+goodsCd+'/'+reviewStat);
  1136. }
  1137. }
  1138. /**
  1139. * @type : function
  1140. * @access : public
  1141. * @desc : 상품평- 베스트 리뷰 보기
  1142. * <pre>
  1143. * cfMypageReviewDetail(goodsCd, photoYn, reviewSq);
  1144. * </pre>
  1145. */
  1146. function cfMypageReviewDetail(goodsCd, photoYn, reviewSq) {
  1147. var str = '<div class="modal fade pd_pop pd_photoreviewdetail_pop" id="layer_review_best" tabindex="-1" role="dialog" aria-labelledby="pdBestReviewLabel" aria-hidden="true"></div>';
  1148. if ("P" != _frontGb){
  1149. str = '<div class="modal pop_full fade pd_pop pd_photoreviewdetail_pop" id="layer_review_best" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  1150. }
  1151. if ($('#layer_review_best').length == 0) {
  1152. $('body').append(str);
  1153. }
  1154. var params = '?goodsCd=' + goodsCd;
  1155. params += '&reviewSq=' + reviewSq;
  1156. params += '&photoYn=' + photoYn;
  1157. cfOpenLayer(_PAGE_MYPAGE_REVIEW_DETAIL_LAYER+params, 'layer_review_best');
  1158. }
  1159. /**
  1160. * @type : function
  1161. * @access : public
  1162. * @desc : 클립보드 복사
  1163. * <pre>
  1164. * copyToClipboard();
  1165. * </pre>
  1166. * @param :
  1167. * @since : 2021/03/29
  1168. * @author : eskim
  1169. */
  1170. function copyToClipboard() {
  1171. var t = document.createElement("textarea");
  1172. document.body.appendChild(t);
  1173. t.value = window.location.href;
  1174. t.select();
  1175. document.execCommand('copy');
  1176. document.body.removeChild(t);
  1177. mcxDialog.alert("URL이 복사 되었습니다.");
  1178. }
  1179. /**
  1180. * @type : function
  1181. * @access : public
  1182. * @desc : 검색 full 팝업
  1183. * <pre>
  1184. * cfSearchLayer();
  1185. * </pre>
  1186. */
  1187. function cfSearchLayer() {
  1188. var Param = new Object();
  1189. var str = '<div class="common_search active" id="layer_search"></div>';
  1190. if ("P" != _frontGb){
  1191. // str = '<div class="modal pop_full fade pd_pop pd_qnalist_pop" id="layer_goods_qna" tabindex="-1" role="dialog" aria-labelledby="exampleFullLabel" aria-hidden="true"></div>';
  1192. }
  1193. if ($('#layer_search').length == 0) {
  1194. $('body').append(str);
  1195. }
  1196. if ("P" == _frontGb){
  1197. cfOpenFullLayer(_PAGE_SEARCH_LAYER, 'layer_search');
  1198. }else{
  1199. cfOpenLayer(_PAGE_SEARCH_LAYER, 'layer_search');
  1200. }
  1201. }
  1202. /**
  1203. * @type : function
  1204. * @access : public
  1205. * @desc : SNS 공유 기능
  1206. * <pre>
  1207. * copyToClipboard(sns, url, txt, media, description);
  1208. * </pre>
  1209. * @param :
  1210. * @since : 2021/03/29
  1211. * @author : eskim
  1212. */
  1213. function sendSns(sns, url, txt, media, description)
  1214. {
  1215. var o;
  1216. var _txt = encodeURIComponent(txt);
  1217. var _br = encodeURIComponent('\r\n');
  1218. var _media = encodeURIComponent(media);
  1219. var _description = encodeURIComponent(description);
  1220. _url = location.protocol + encodeURIComponent(url);
  1221. switch(sns)
  1222. {
  1223. case 'facebook':
  1224. window.open('http://www.facebook.com/sharer/sharer.php?u=' + _url, "_blank", 'width=600,height=400,resizable=yes,scrollbars=yes');
  1225. break;
  1226. case 'twitter':
  1227. window.open('http://twitter.com/intent/tweet?text=' + _txt + '&url=' + _url, "_blank", 'width=600,height=400,resizable=yes,scrollbars=yes');
  1228. break;
  1229. default:
  1230. mcxDialog.alert('지원하지 않는 SNS입니다.');
  1231. return false;
  1232. }
  1233. }
  1234. var kakaoInitCnt = 0; //카카오 초기화 카운트, 재실행 방지를 위해 사용함
  1235. var kakaoDomainKey = '06cab652ad5d25be2190388d11a88fa4';
  1236. function cfnSendToKakao(linkUrl, linkNm, linkImg) {
  1237. // Kakao Key
  1238. if ( kakaoInitCnt == 0 ) {
  1239. Kakao.init(kakaoDomainKey);
  1240. kakaoInitCnt++;
  1241. }
  1242. Kakao.Link.sendDefault({
  1243. objectType: 'feed',
  1244. content: {
  1245. title: "[STYLE24]\n" + linkNm,
  1246. imageUrl: linkImg,
  1247. link: {
  1248. webUrl: linkUrl,
  1249. mobileWebUrl: linkUrl,
  1250. },
  1251. // description: page,
  1252. imageWidth: 800,
  1253. imageHeight: 800
  1254. },
  1255. buttons: [
  1256. {
  1257. title: 'style24.com',
  1258. link: {
  1259. webUrl: linkUrl,
  1260. mobileWebUrl: linkUrl,
  1261. }
  1262. }
  1263. ]
  1264. })
  1265. }
  1266. /**
  1267. * @type : function
  1268. * @access : public
  1269. * @desc : 위시리스트 담기/삭제 (모바일)
  1270. * <pre>
  1271. * cfnMoPutWishList(OBJ);
  1272. * </pre>
  1273. */
  1274. function cfnMoPutWishList(a) {
  1275. if (!cfCheckLogin()) {
  1276. cfnGoToPage(_PAGE_LOGIN);
  1277. return false;
  1278. }
  1279. var goodsCd = $(a).attr("goodsCd");
  1280. var ithrCd = $(a).attr("ithrCd");
  1281. var contentsLoc = $(a).attr("contentsLoc");
  1282. var planDtlSq = $(a).attr("planDtlSq");
  1283. var flag = 'REG';
  1284. if ($(a).hasClass('likeit')) {
  1285. flag = 'DEL'
  1286. }
  1287. if (gagajf.isNull(goodsCd)) return;
  1288. var data = [];
  1289. var params = new Object();
  1290. params.goodsCd = goodsCd;
  1291. if (!gagajf.isNull(ithrCd)) {
  1292. params.ithrCd = ithrCd;
  1293. }
  1294. if (!gagajf.isNull(contentsLoc)) {
  1295. params.contentsLoc = contentsLoc;
  1296. }
  1297. if (!gagajf.isNull(planDtlSq)) {
  1298. params.planDtlSq = planDtlSq;
  1299. }
  1300. data.push(params);
  1301. var jsonData = JSON.stringify(data);
  1302. if (flag == 'REG') {
  1303. gagajf.ajaxJsonSubmit(_PAGE_WISHLIST_PUT, jsonData, function (result) {
  1304. var Msg = '';
  1305. if (result.status == "200") {
  1306. $(a).addClass('likeit');
  1307. if (_frontGb == "M") {
  1308. Msg = '위시리스트에 담겼습니다.';
  1309. } else {
  1310. // mcxDialog.confirm("위시리스트로 이동하시겠습니까?", {
  1311. // cancelBtnText: "아니요", //취소 또는 닫기 버튼명
  1312. // sureBtnText: "예", //처리문 버튼명
  1313. // sureBtnClick: function () {
  1314. // cfnGoToPage(_PAGE_WISHLIST);
  1315. // }
  1316. // });
  1317. }
  1318. if ("P" == _frontGb){
  1319. fnGetWishList();
  1320. }
  1321. } else if (result.status == "중복") {
  1322. Msg = '이미 등록 되어있습니다.';
  1323. } else {
  1324. //Msg = '오류로 인해 처리되지 않았습니다.';
  1325. }
  1326. // 메시지 처리
  1327. //if (!gagajf.isNull(Msg)) {
  1328. // if (_frontGb == "M") {
  1329. // mcxDialog.toast(Msg);
  1330. // } else {
  1331. // mcxDialog.alertC(Msg);
  1332. // }
  1333. //}
  1334. });
  1335. } else {
  1336. gagajf.ajaxJsonSubmit(_PAGE_WISHLIST_DEL, jsonData, function (result) {
  1337. var Msg = '';
  1338. if (result.status == "200") {
  1339. Msg = '삭제 되었습니다.';
  1340. $(a).removeClass('likeit');
  1341. if ("P" == _frontGb){
  1342. fnGetWishList();
  1343. }
  1344. } else {
  1345. Msg = '오류로 인해 처리되지 않았습니다.';
  1346. }
  1347. // 메시지 처리
  1348. //if (!gagajf.isNull(Msg)) {
  1349. // if (_frontGb == "M") {
  1350. // mcxDialog.toast(Msg);
  1351. // } else {
  1352. // mcxDialog.alertC(Msg);
  1353. // }
  1354. //}
  1355. });
  1356. }
  1357. return false;
  1358. }