style24_link.js 19 KB

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