style24_link.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  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. //== 고객 ==/
  9. const _PAGE_CUSTOMER_JOIN_TYPE = _frontUrl + "/customer/join/type/form"; // 고객 > 회원가입 유형
  10. const _PAGE_CUSTOMER_JOIN = _frontUrl + "/customer/join/form"; // 고객 > 회원가입
  11. const _PAGE_CUSTOMER_SNS_JOIN = _frontUrl + "/customer/sns/join/form"; // 고객 > SNS가입
  12. const _PAGE_CUSTOMER_JOIN_COMPLETE = _frontUrl + "/customer/join/complete/form"; // 고객 > 고객가입 > 완료페이지
  13. const _PAGE_CUSTOMER_ID_FIND = _frontUrl + "/customer/id/find/form"; // 고객 > 아이디 찾기
  14. const _PAGE_CUSTOMER_PWD_FIND = _frontUrl + "/customer/password/find/form"; // 고객 > 비밀번호 찾기
  15. const _PAGE_CUSTOMER_PWD_CHANGE_FIND = _frontUrl + "/customer/password/change/form?pageGb=find"; // 고객 > 비밀번호 찾기> 비밀번호 변경 화면
  16. const _PAGE_CUSTOMER_PWD_CHANGE_TEMP = _frontUrl + "/customer/password/change/form?pageGb=temp"; // 고객 > 임시비밀번호 로그인 > 비밀번호 변경 화면
  17. const _PAGE_CUSTOMER_DORMANT = _frontUrl + "/customer/dormant/certify/form"; // 고객 > 휴면회원
  18. const _PAGE_CUSTOMER_DORMANT_COMPLETE = _frontUrl + "/customer/dormant/certify/complete/form"; // 고객 > 휴면회원 > 완료페이지
  19. //== 상품상세 ==/
  20. const _PAGE_GOODS_DETAIL = _frontUrl + "/goods/detail/form?goodsCd="; // 상품 상세
  21. const _PAGE_GOODS_COUPON_LAYER = _frontUrl + "/goods/coupon/layer/"; // 쿠폰레이어
  22. const _PAGE_GOODS_SHOP_BENEFIT_LAYER = _frontUrl + "/goods/shop/benefit/layer/"; // 쇼핑혜택레이어
  23. const _PAGE_CARD_PRMT_LAYER = _frontUrl + "/goods/card/prmt/layer/"; // 카드혜택레이어
  24. const _PAGE_GOODS_SIZEINFO_LAYER = _frontUrl + "/goods/sizeInfo/layer/"; // 사이즈정보레이어
  25. const _PAGE_GOODS_INSTOCK_ALARM_LAYER = _frontUrl + "/goods/instock/alarm/layer/"; // 재입고알림레이어
  26. const _PAGE_GOODS_QNA_LAYER = _frontUrl + "/goods/qna/layer/"; // 상품문의레이어
  27. const _PAGE_GOODS_QNA_CREATE_LAYER = _frontUrl + "/goods/qna/create/layer/"; // 상품문의레이어
  28. const _PAGE_GOODS_DELIVERY_LAYER = _frontUrl + "/goods/delivery/layer/"; // 배송/교환/반품 레이어
  29. const _PAGE_GOODS_REVIEW_LAYER = _frontUrl + "/goods/review/layer/"; // 상품평 레이어
  30. const _PAGE_GOODS_REVIEW_BEST_LAYER = _frontUrl + "/goods/review/best/layer/"; // 상품평- 베스트 리뷰 (list)
  31. const _PAGE_GOODS_REVIEW_PHOTO_LAYER = _frontUrl + "/goods/review/photo/layer/"; // 상품평- 포토/영상 리뷰 (list)
  32. const _PAGE_GOODS_REVIEW_PHOTO_DETAIL_LAYER = _frontUrl + "/goods/review/photo/detail/layer/"; // 상품평- 포토/영상 리뷰 (detail)
  33. //== 장바구니 ==/
  34. //== 주문 ==/
  35. //== 마이페이지 ==/
  36. const _PAGE_MYPAGE = _frontUrl + "/mypage/main/form"; // 마이페이지 > 메인
  37. const _PAGE_MYPAGE_ORDER_LIST = _frontUrl + "/mypage/order/list/form"; // 마이페이지 > 주문확인/배송조회
  38. const _PAGE_MYPAGE_ORDER_DETAIL = _frontUrl + "/mypage/order/detail/form/"; // 마이페이지 > 주문/배송 상세
  39. const _PAGE_MYPAGE_CRS_LIST = _frontUrl + "/mypage/crs/list/form"; // 마이페이지 > 취소/교환/반품 목록
  40. const _PAGE_MYPAGE_RESTOCK = _frontUrl + "/mypage/restock/form"; // 마이페이지 > 재입고 알림 내역
  41. const _PAGE_MYPAGE_COUPON = _frontUrl + "/mypage/coupon/form"; // 마이페이지 > 쿠폰
  42. const _PAGE_MYPAGE_POINT = _frontUrl + "/mypage/point/form"; // 마이페이지 > 포인트
  43. const _PAGE_MYPAGE_GIFTCARD = _frontUrl + "/mypage/gift/card/form"; // 마이페이지 > 상품권
  44. const _PAGE_MYPAGE_REVIEW = _frontUrl + "/mypage/review/form"; // 마이페이지 > 리뷰
  45. const _PAGE_MYPAGE_DELIVERY_ADDR = _frontUrl + "/mypage/delivery/addr/form"; // 마이페이지 > 배송지 관리
  46. const _PAGE_MYPAGE_WISHLIST = _frontUrl + "/mypage/wish/list/form"; // 마이페이지 > 위시리스트
  47. const _PAGE_MYPAGE_CUSTOMER = _frontUrl + "/mypage/customer/form"; // 마이페이지 > 내정보 관리
  48. const _PAGE_MYPAGE_SECEDE = _frontUrl + "/mypage/customer/secede/form"; // 마이페이지 > 회원탈퇴
  49. const _PAGE_WISHLIST = _frontUrl + "/mypage/wish/list/form"; // 마이페이지 > 위시리스트
  50. const _PAGE_WISHLIST_PUT = _frontUrl + "/mypage/wish/list/put"; // 위시리스트 담기
  51. const _PAGE_WISHLIST_DEL = _frontUrl + "/mypage/wish/list/delete"; // 위시리스트 삭제
  52. //== 검색 ==/
  53. //== 기획전 ==/
  54. const _PAGE_PLANNING_MAIN = _frontUrl + "/planning/main/form"; // 기획전 메인
  55. const _PAGE_PLANNING_DETAIL = _frontUrl + "/planning/detail/form"; // 기획전 상세
  56. //== 이벤트 ==/
  57. const _PAGE_EVENT_MAIN = _frontUrl + "/planning/event/main/form"; // 이벤트 메인
  58. //== 고객센터 ==/
  59. const _PAGE_FAQ = _frontUrl + "/callcenter/faq/form"; // 고객센터 > FAQ
  60. const _PAGE_ONETOONE_QNA = _frontUrl + "/callcenter/onetoone/qna/form"; // 고객센터 > 1:1문의
  61. const _PAGE_ONETOONE_QNA_REG = _frontUrl + "/callcenter/onetoone/qna/register/form"; // 고객센터 > 1:1문의등록
  62. const _PAGE_GOODS_QNA = _frontUrl + "/callcenter/goods/qna/form"; // 고객센터 > 상품문의
  63. const _PAGE_NOTICE = _frontUrl + "/callcenter/notice/form"; // 고객센터 > 공지사항
  64. //== 기타 ==/
  65. /**********************************************************************************************/
  66. /**
  67. * @type : function
  68. * @access : public
  69. * @desc : page 이동
  70. * <pre>
  71. * cfnGoToPage(PAGE_LOGIN);
  72. * </pre>
  73. * @param : page - page
  74. * @return : None
  75. * @author : gagamel
  76. * @since : 2020/02/21
  77. */
  78. var cfnGoToPage = function(page, ithrCd) {
  79. var params = page;
  80. if (ithrCd) params += "&ithrCd=" + ithrCd;
  81. document.location.href = params;
  82. }
  83. /**
  84. * @type : function
  85. * @access : public
  86. * @desc : 나이스 휴대폰 인증
  87. * <pre>
  88. * cfnOpenCellphoneCertify();
  89. * 호출된 페이지에서
  90. * PC : fnNiceCallBack(encData) 콜백 함수 생성 후 encData 가지고 호출 처리
  91. * MO : redirectUrl 호출하는 페이지에서 넣어줘야됨
  92. * </pre>
  93. * @param redirectUrl - 모바일에서 사용 페이지이동으로 하기 때문에
  94. * @param custparams - 회원정보수정 화면에서 사용함
  95. * @since : 2021/02/09
  96. * @author : jsshin
  97. */
  98. var cfnOpenCellphoneCertify = function (redirectUrl, custparams) {
  99. var actionUrl = _frontUrl + "/customer/nice/cellphone/form";
  100. var popupWidth = 420;
  101. var popupHeight = 720;
  102. var popupX = (window.screen.width / 2) - (popupWidth / 2);
  103. var popupY = (window.screen.height / 3) - (popupHeight / 3);
  104. if ('P' === _frontGb) {
  105. 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");
  106. } else {
  107. if (!gagajf.isNull(redirectUrl)) {
  108. actionUrl = actionUrl + "?redirectUrl=" + redirectUrl;
  109. if (!gagajf.isNull(custparams)) {
  110. actionUrl = actionUrl + "&custparams=" + custparams;
  111. }
  112. document.location.href = actionUrl;
  113. }
  114. }
  115. }
  116. /**
  117. * @type : function
  118. * @access : public
  119. * @desc : 나이스 아이핀 인증
  120. * <pre>
  121. * cfnOpenIpinCertify();
  122. * 호출된 페이지에서
  123. * PC : fnNiceCallBack(encData) 콜백 함수 생성 후 encData 가지고 호출 처리
  124. * MO :
  125. * </pre>
  126. * @since : 2021/02/09
  127. * @author : jsshin
  128. */
  129. var cfnOpenIpinCertify = function (redirectUrl) {
  130. var actionUrl = _frontUrl + "/customer/nice/ipin/form";
  131. var popupWidth = 445;
  132. var popupHeight = 550;
  133. var popupX = (window.screen.width / 2) - (popupWidth / 2);
  134. var popupY = (window.screen.height / 3) - (popupHeight / 3);
  135. if ('P' === _frontGb) {
  136. 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");
  137. } else {
  138. if (!gagajf.isNull(redirectUrl)) {
  139. document.location.href = actionUrl + "?redirectUrl=" + redirectUrl;
  140. }
  141. }
  142. };
  143. /**
  144. * @type : function
  145. * @access : public
  146. * @desc : 장바구니 등록 temp.cartGb :C 장바구니, O:바로구매
  147. * <pre>
  148. * cfnAddCart(cartList);
  149. * cartList는 Array로 등록해주셔야합니다.
  150. * ex) 일반 & deal 상품 장바구니 등록 (일반&딜 상품도 배열에 담아서 전송해주세요.)
  151. * let compsList = [];
  152. * let temp = new Object;
  153. * temp.goodsCd = "14373703";
  154. * temp.optCd = "블랙140";
  155. * temp.goodsQty = 1;
  156. * temp.goodsType = "G056_D";
  157. * temp.dealGoodsCd = "STY"
  158. * temp.cartGb = "C";
  159. * temp.afLinkCd = "afLinkCd";
  160. * temp.ithrCd = "G027_ZZZ";
  161. * temp.contentsLoc = "G028_YYY";
  162. * temp.planDtlSq = "123";
  163. * compsList.push(temp);
  164. * cfnAddCart(compsList);
  165. *
  166. * ex) 세트상품 장바구니 등록
  167. * let compsList = [];
  168. * for(let j = 0 ; j < length ; j++) { // 구성품 수량 만큼 for
  169. * let temp = new Object;
  170. * temp.goodsCd = "STYS000000016";
  171. * temp.itemCd = '14373757';
  172. * temp.optCd = "핑크120";
  173. * temp.goodsQty = 1;
  174. * temp.goodsType = "G056_S";
  175. * temp.cartGb = "C";
  176. * temp.afLinkCd = "afLinkCd";
  177. * temp.ithrCd = "G027_ZZZ";
  178. * temp.contentsLoc = "G028_YYY";
  179. * temp.planDtlSq = "123";
  180. * compsList.push(temp);
  181. * }
  182. * cfnAddCart(compsList);
  183. * </pre>
  184. * @since : 2021/02/24
  185. * @author : xodud1202
  186. */
  187. function cfnAddCart(cartList) {
  188. let jsonData = JSON.stringify(cartList);
  189. $.ajax( {
  190. type: "POST",
  191. url : '/cart/save',
  192. data : jsonData,
  193. contentType: 'application/json',
  194. dataType : 'text',
  195. success : function(result) {
  196. if(cartList[0].cartGb == "C") {
  197. mcxDialog.confirm("<div class="+"dialog-title"+">"+"상품이 쇼핑백에 추가되었습니다.</div><p>쇼핑백으로 이동하시겠습니까?</p>", {
  198. cancelBtnText: "계속 쇼핑하기",
  199. sureBtnText: "쇼핑백 가기",
  200. sureBtnClick: function(){
  201. location.href='/cart/list/form'; //내 쇼핑백 이동url
  202. }
  203. });
  204. }
  205. }
  206. });
  207. }
  208. /**
  209. * @type : function
  210. * @access : public
  211. * @desc : 네이버 로그인
  212. * <pre>
  213. * cfnLoginNaver();
  214. * 호출된 페이지에서
  215. * PC: fnSnsSigninCallback(userInfo) 콜백 함수 생성 후 가지고 호출 처리
  216. * MO :
  217. * </pre>
  218. * @since : 2021/02/23
  219. * @author : jsshin
  220. */
  221. var cfnLoginNaver = function (requestGb, chkRememberMe) {
  222. let actionUrl = _frontUrl + '/signin/naverlogin?rememberMe=' + chkRememberMe;
  223. let popupHeight = 800;
  224. let popupWidth = 600;
  225. let popupX = (window.screen.width / 2) - (popupWidth / 2);
  226. let popupY = (window.screen.height / 3) - (popupHeight / 3);
  227. if ('P' === _frontGb) {
  228. 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', '');
  229. } else {
  230. document.location.href = actionUrl + '&requestGb=' + requestGb;
  231. }
  232. };
  233. /**
  234. * @type : function
  235. * @access : public
  236. * @desc : 카카오 로그인
  237. * <pre>
  238. * cfnLoginKakao();
  239. * 호출된 페이지에서
  240. * PC: fnSnsSigninCallback(userInfo) 콜백 함수 생성 후 가지고 호출 처리
  241. * MO :
  242. * </pre>
  243. * @since : 2021/02/23
  244. * @author : jsshin
  245. */
  246. var cfnLoginKakao = function (requestGb, chkRememberMe) {
  247. let actionUrl = _frontUrl + '/signin/kakologin?rememberMe=' + chkRememberMe;
  248. let popupWidth = 450;
  249. let popupHeight = 700;
  250. let popupX = (window.screen.width / 2) - (popupWidth / 2);
  251. let popupY = (window.screen.height / 3) - (popupHeight / 3);
  252. if ('P' === _frontGb) {
  253. //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', '');
  254. } else {
  255. //document.location.href = actionUrl + '&requestGb=' + requestGb;
  256. }
  257. };
  258. /**
  259. * @type : function
  260. * @access : public
  261. * @desc : Yes24 로그인
  262. * <pre>
  263. * cfnLoginYes24();
  264. * 호출된 페이지에서
  265. * PC: fnSnsSigninCallback(userInfo) 콜백 함수 생성 후 가지고 호출 처리
  266. * MO :
  267. * </pre>
  268. * @since : 2021/02/23
  269. * @author : jsshin
  270. */
  271. var cfnLoginYes24 = function (requestGb, chkRememberMe) {
  272. let actionUrl = _frontUrl + '/signin/yes24login?rememberMe=' + chkRememberMe;
  273. let popupWidth = 987;
  274. let popupHeight = 862;
  275. let popupX = (window.screen.width / 2) - (popupWidth / 2);
  276. let popupY = (window.screen.height / 3) - (popupHeight / 3);
  277. if ('P' === _frontGb) {
  278. 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', '');
  279. } else {
  280. document.location.href = actionUrl + '&requestGb=' + requestGb;
  281. }
  282. };
  283. /**
  284. * @type : function
  285. * @access : public
  286. * @desc : 상품상세로 이동
  287. * <pre>
  288. * cfnGoToGoodsDetail('A83U-TS058S');
  289. * </pre>
  290. * @param : goodsCd - 상품코드코드. 필수
  291. * @param : ithrCd - 유입경로. 필수
  292. * @param : contentsLoc - 컨텐츠위치.
  293. * @since : 2021/03/02
  294. * @author : eskim
  295. */
  296. var cfnGoToGoodsDetail = function (goodsCd, colorCd, ithrCd, contentsLoc, planDtlSq) {
  297. var params = goodsCd;
  298. params += "&colorCd=" + colorCd;
  299. if (typeof (ithrCd) != 'undefined') params += "&ithrCd=" + ithrCd;
  300. if (typeof (contentsLoc) != 'undefined' && contentsLoc != "") params += "&contentsLoc=" + contentsLoc;
  301. if (typeof (planDtlSq) != 'undefined') params += "&planDtlSq=" + planDtlSq;
  302. cfnGoToPage(_PAGE_GOODS_DETAIL + params);
  303. }
  304. /**
  305. * @type : function
  306. * @access : public
  307. * @desc : 공통 레이어 띄우기
  308. * <pre>
  309. * cfOpenLayer(_PAGE_CARD_LAYER, 'layer_card_benefit');
  310. * </pre>
  311. * @param : page - page. 필수
  312. * @param : tgt - 레이어가 표시될 위치(예, div 태크의 ID). 필수
  313. * @param : oParam - Parameter Object. 옵션
  314. * @param : callbackFnc - 콜백함수. 옵션
  315. */
  316. function cfOpenLayer(page, tgt, oParam, callbackFnc) {
  317. if (!oParam) oParam = new Object();
  318. $.post(page
  319. , oParam
  320. , function (result) {
  321. $('#' + tgt).html(result);
  322. $('#' + tgt).modal("show");
  323. //$('#' + tgt).show();
  324. //layerPop_resize(tgt);
  325. if (callbackFnc && $.isFunction(callbackFnc))
  326. callbackFnc();
  327. }
  328. , "html");
  329. return false;
  330. }
  331. /**
  332. * @type : function
  333. * @access : public
  334. * @desc : 공통 레이어 위치 조정
  335. * <pre>
  336. * layerPop_resize('layer_card_benefit');
  337. * </pre>
  338. * @param : tgt - 레이어가 표시될 위치(예, div 태크의 ID). 필수
  339. */
  340. function layerPop_resize(tgt) {
  341. var thisH = $("#" + tgt).find(".modal").outerHeight();
  342. var thisT = ($(window).height() / 2) - (thisH / 2);
  343. $("#" + tgt).find(".modal").css('top', thisT + 'px');
  344. }
  345. /**
  346. * @type : function
  347. * @access : public
  348. * @desc : 공통 레이어 닫기(레이어 숨기기)
  349. * <pre>
  350. * cfCloseLayer("layer_card_benefit");
  351. * </pre>
  352. * @param : tgt - 숨길 레이어 ID(예, div 태크의 ID). 필수
  353. */
  354. function cfCloseLayer(tgt) {
  355. if (_frontGb == "M"){
  356. btnClose(tgt);
  357. }else{
  358. $('#' + tgt).hide();
  359. $('#' + tgt).remove();
  360. }
  361. return false;
  362. }
  363. /**
  364. * @type : function
  365. * @access : public
  366. * @desc : 카드혜택보기
  367. * <pre>
  368. * cfCardInfo();
  369. * </pre>
  370. */
  371. function cfCardInfo() {
  372. 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>';
  373. if ($('#layer_card_benefit').length == 0) {
  374. $('body').append(str);
  375. }
  376. cfOpenLayer(_PAGE_CARD_PRMT_LAYER, 'layer_card_benefit');
  377. }
  378. /**
  379. * @type : function
  380. * @access : public
  381. * @desc : 상품쿠폰목록보기
  382. * <pre>
  383. * cfGoodsCouponInfo(goodsCd);
  384. * </pre>
  385. */
  386. function cfGoodsCouponInfo(goodsCd) {
  387. var str = '<div class="modal fade pd_pop salecoupon_pop" id="layer_goods_coupon" tabindex="-1" role="dialog" aria-labelledby="saleCouponLabel" aria-hidden="true">';
  388. if ($('#layer_goods_coupon').length == 0) {
  389. $('body').append(str);
  390. }
  391. cfOpenLayer(_PAGE_GOODS_COUPON_LAYER+goodsCd, 'layer_goods_coupon');
  392. }
  393. /**
  394. * @type : function
  395. * @access : public
  396. * @desc : 상품쇼핑혜택목록보기
  397. * <pre>
  398. * cfGoodsShopBenefitInfo(goodsCd);
  399. * </pre>
  400. */
  401. function cfGoodsShopBenefitInfo(goodsCd) {
  402. 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">';
  403. if ($('#layer_shopping_benefit').length == 0) {
  404. $('body').append(str);
  405. }
  406. cfOpenLayer(_PAGE_GOODS_SHOP_BENEFIT_LAYER+goodsCd, 'layer_shopping_benefit');
  407. }
  408. /**
  409. * @type : function
  410. * @access : public
  411. * @desc : 상품사이즈정보보기
  412. * <pre>
  413. * cfGoodsSizeInfo(goodsCd);
  414. * </pre>
  415. */
  416. function cfGoodsSizeInfo(goodsCd) {
  417. 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">';
  418. if ($('#layer_size_info').length == 0) {
  419. $('body').append(str);
  420. }
  421. cfOpenLayer(_PAGE_GOODS_SIZEINFO_LAYER+goodsCd, 'layer_size_info');
  422. }
  423. /**
  424. * @type : function
  425. * @access : public
  426. * @desc : 상품재입고알림보기
  427. * <pre>
  428. * cfGoodsInstockAlarmInfo(goodsCd);
  429. * </pre>
  430. */
  431. function cfGoodsInstockAlarmInfo(goodsCd, colorCd) {
  432. 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">';
  433. if ($('#layer_instock_alarm').length == 0) {
  434. $('body').append(str);
  435. }
  436. cfOpenLayer(_PAGE_GOODS_INSTOCK_ALARM_LAYER+goodsCd+'/'+colorCd, 'layer_instock_alarm');
  437. }
  438. /**
  439. * @type : function
  440. * @access : public
  441. * @desc : 상품평- 베스트 리뷰 보기
  442. * <pre>
  443. * cfGoodsBestReviewInfo(goodsCd);
  444. * </pre>
  445. */
  446. function cfGoodsBestReview(goodsCd) {
  447. var str = '<div class="modal fade pd_pop pd_bestreviewdetail_pop" id="layer_review_best" tabindex="-1" role="dialog" aria-labelledby="pdBestReviewLabel" aria-hidden="true">';
  448. if ($('#layer_review_best').length == 0) {
  449. $('body').append(str);
  450. }
  451. cfOpenLayer(_PAGE_GOODS_REVIEW_BEST_LAYER+goodsCd, 'layer_review_best');
  452. }
  453. /**
  454. * @type : function
  455. * @access : public
  456. * @desc : 상품평- 포토/영상 리뷰 리스트 보기
  457. * <pre>
  458. * cfGoodsPhotoReview(goodsCd);
  459. * </pre>
  460. */
  461. function cfGoodsReviewPhoto(goodsCd) {
  462. 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">';
  463. if ($('#layer_review_photo').length == 0) {
  464. $('body').append(str);
  465. }
  466. cfOpenLayer(_PAGE_GOODS_REVIEW_PHOTO_LAYER+goodsCd, 'layer_review_photo');
  467. }
  468. /**
  469. * @type : function
  470. * @access : public
  471. * @desc : 상품평- 포토/영상 리뷰 상세 보기
  472. * <pre>
  473. * cfGoodsPhotoReviewDetail(goodsCd);
  474. * </pre>
  475. */
  476. function cfGoodsReviewPhotoDetail(goodsCd) {
  477. var str = '<div class="modal fade pd_pop pd_photoreviewdetail_pop" id="layer_review_photo_detail" tabindex="-1" role="dialog" aria-labelledby="pdPhotoReviewDetailLabel" aria-hidden="true">';
  478. if ($('#layer_review_photo_detail').length == 0) {
  479. $('body').append(str);
  480. }
  481. cfOpenLayer(_PAGE_GOODS_REVIEW_PHOTO_DETAIL_LAYER+goodsCd, 'layer_review_photo_detail');
  482. }
  483. /**
  484. * @type : function
  485. * @access : public
  486. * @desc : 공통 full 레이어 띄우기
  487. * <pre>
  488. * cfOpenFullLayer(_PAGE_CARD_LAYER, 'layer_card_benefit');
  489. * </pre>
  490. * @param : page - page. 필수
  491. * @param : tgt - 레이어가 표시될 위치(예, div 태크의 ID). 필수
  492. * @param : oParam - Parameter Object. 옵션
  493. * @param : callbackFnc - 콜백함수. 옵션
  494. */
  495. function cfOpenFullLayer(page, tgt, oParam, callbackFnc) {
  496. if (!oParam) oParam = new Object();
  497. $.post(page
  498. , oParam
  499. , function (result) {
  500. $('body').addClass('lock');
  501. $('#' + tgt).html(result);
  502. $('#' + tgt).show();
  503. if (callbackFnc && $.isFunction(callbackFnc))
  504. callbackFnc();
  505. }
  506. , "html");
  507. return false;
  508. }
  509. /**
  510. * @type : function
  511. * @access : public
  512. * @desc : 공통 full 레이어 닫기(레이어 숨기기)
  513. * <pre>
  514. * cfCloseFullLayer("layer_card_benefit");
  515. * </pre>
  516. * @param : tgt - 숨길 레이어 ID(예, div 태크의 ID). 필수
  517. */
  518. function cfCloseFullLayer(tgt) {
  519. //if (_frontGb == "M"){
  520. // btnClose(tgt);
  521. //}else{
  522. $('#' + tgt).hide();
  523. $('#' + tgt).remove();
  524. $('body').removeClass('lock');
  525. //}
  526. return false;
  527. }
  528. /**
  529. * @type : function
  530. * @access : public
  531. * @desc : 상품문의 full 팝업
  532. * <pre>
  533. * cfGoodsQngReg();
  534. * </pre>
  535. */
  536. function cfGoodsQng(goodsCd) {
  537. var Param = new Object();
  538. var str = '<div class="pd_pop full_pop pd_qnalist_pop" id="layer_goods_qna">';
  539. if ($('#layer_goods_qna').length == 0) {
  540. $('body').append(str);
  541. }
  542. cfOpenFullLayer(_PAGE_GOODS_QNA_LAYER + goodsCd, 'layer_goods_qna');
  543. }
  544. /**
  545. * @type : function
  546. * @access : public
  547. * @desc : 상품문의 등록 팝업
  548. * <pre>
  549. * cfGoodsQngReg();
  550. * </pre>
  551. */
  552. function cfGoodsQngCreate(goodsCd) {
  553. var Param = new Object();
  554. 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">';
  555. if ($('#layer_goods_qna_reg').length == 0) {
  556. $('body').append(str);
  557. }
  558. cfOpenLayer(_PAGE_GOODS_QNA_CREATE_LAYER + goodsCd, 'layer_goods_qna_reg');
  559. }
  560. /**
  561. * @type : function
  562. * @access : public
  563. * @desc : 상품문의 full 팝업
  564. * <pre>
  565. * cfGoodsDelivery();
  566. * </pre>
  567. */
  568. function cfGoodsDelivery(goodsCd) {
  569. var Param = new Object();
  570. var str = '<div class="pd_pop full_pop pd_delivery_pop" id="layer_goods_delivery">';
  571. if ($('#layer_goods_delivery').length == 0) {
  572. $('body').append(str);
  573. }
  574. cfOpenFullLayer(_PAGE_GOODS_DELIVERY_LAYER + goodsCd, 'layer_goods_delivery');
  575. }
  576. /**
  577. * @type : function
  578. * @access : public
  579. * @desc : 상품 상품평 full 팝업
  580. * <pre>
  581. * cfGoodsReview();
  582. * </pre>
  583. */
  584. function cfGoodsReview(goodsCd) {
  585. var Param = new Object();
  586. var str = '<div class="pd_pop full_pop pd_review_pop" id="layer_goods_review">';
  587. if ($('#layer_goods_review').length == 0) {
  588. $('body').append(str);
  589. }
  590. cfOpenFullLayer(_PAGE_GOODS_REVIEW_LAYER + goodsCd, 'layer_goods_review');
  591. }
  592. /**
  593. * @type : function
  594. * @access : public
  595. * @desc : 로그인 확인
  596. * <pre>
  597. * cfCheckLogin('callbackFn');
  598. * </pre>
  599. */
  600. function cfCheckLogin() {
  601. var result = '';
  602. $.ajax({
  603. type: 'get'
  604. , async: false
  605. , url: '/common/login/check'
  606. , success: function (data) {
  607. result = data;
  608. }
  609. });
  610. return result;
  611. }
  612. /**
  613. * @type : function
  614. * @access : public
  615. * @desc : 위시리스트 담기/삭제
  616. * <pre>
  617. * cfnPutWishList(OBJ);
  618. * </pre>
  619. */
  620. function cfnPutWishList(a) {
  621. if (!cfCheckLogin()) {
  622. cfnGoToPage(_PAGE_LOGIN);
  623. return false;
  624. }
  625. var goodsCd = $(a).attr("goodsCd");
  626. var ithrCd = $(a).attr("ithrCd");
  627. var contentsLoc = $(a).attr("contentsLoc");
  628. var planDtlSq = $(a).attr("planDtlSq");
  629. var flag = 'REG';
  630. if ($(a).hasClass('active')) {
  631. flag = 'DEL'
  632. }
  633. if (gagajf.isNull(goodsCd)) return;
  634. var data = [];
  635. var params = new Object();
  636. params.goodsCd = goodsCd;
  637. if (!gagajf.isNull(ithrCd)) {
  638. params.ithrCd = ithrCd;
  639. }
  640. if (!gagajf.isNull(contentsLoc)) {
  641. params.contentsLoc = contentsLoc;
  642. }
  643. if (!gagajf.isNull(planDtlSq)) {
  644. params.planDtlSq = planDtlSq;
  645. }
  646. data.push(params);
  647. var jsonData = JSON.stringify(data);
  648. if (flag == 'REG') {
  649. gagajf.ajaxJsonSubmit(_PAGE_WISHLIST_PUT, jsonData, function (result) {
  650. var Msg = '';
  651. if (result.status == "200") {
  652. $(a).addClass('active');
  653. if (_frontGb == "M") {
  654. Msg = '위시리스트에 담겼습니다.';
  655. } else {
  656. // mcxDialog.confirm("위시리스트로 이동하시겠습니까?", {
  657. // cancelBtnText: "아니요", //취소 또는 닫기 버튼명
  658. // sureBtnText: "예", //처리문 버튼명
  659. // sureBtnClick: function () {
  660. // cfnGoToPage(_PAGE_WISHLIST);
  661. // }
  662. // });
  663. }
  664. } else if (result.status == "중복") {
  665. Msg = '이미 등록 되어있습니다.';
  666. } else {
  667. //Msg = '오류로 인해 처리되지 않았습니다.';
  668. }
  669. // 메시지 처리
  670. //if (!gagajf.isNull(Msg)) {
  671. // if (_frontGb == "M") {
  672. // mcxDialog.toast(Msg);
  673. // } else {
  674. // mcxDialog.alertC(Msg);
  675. // }
  676. //}
  677. });
  678. } else {
  679. gagajf.ajaxJsonSubmit(_PAGE_WISHLIST_DEL, jsonData, function (result) {
  680. var Msg = '';
  681. if (result.status == "200") {
  682. Msg = '삭제 되었습니다.';
  683. $(a).removeClass('active');
  684. } else {
  685. Msg = '오류로 인해 처리되지 않았습니다.';
  686. }
  687. // 메시지 처리
  688. //if (!gagajf.isNull(Msg)) {
  689. // if (_frontGb == "M") {
  690. // mcxDialog.toast(Msg);
  691. // } else {
  692. // mcxDialog.alertC(Msg);
  693. // }
  694. //}
  695. });
  696. }
  697. return false;
  698. }