style24_link.js 19 KB

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