style24_link.js 19 KB

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