PageSourceSearch

https://spsamhwa.com/app/themes/sknk/src/js/product/productCommon.js

js spsamhwa.com collected 2026-10-09 23:36:12 UTC 6,982 bytes, 174 lines download raw bytes

1var ProductFunction = (function(fn) {
2	fn.getProductImgList = function(type, callback) {
3		if (!type)
4			type='list';
5
6		var imgSel ='img[data-prdt-img]';
7		if ($(imgSel).length==0)
8			return;
9
10		var prodIdUniq = [];
11		$(imgSel).each(function(){
12			var prodId = $(this).data('prdt-img');
13			if (prodIdUniq.indexOf(prodId) < 0) {
14				prodIdUniq.push(prodId);
15			}
16		});
17
18		// $.ajax({
19		// 	url: '/wp/wp-admin/admin-ajax.php',
20		// 	dataType : 'json',
21		// 	data : {
22		// 		action: 'get_product',
23		// 		type: 'jsonProductImgByProduct',
24		// 		prodId : prodIdUniq,
25		// 		sort : (type=='list'?1:null),
26		// 	},
27		// 	method : 'POST',
28		// 	success: function(response)
29		// 	{
30		// 		var json = response.data;
31		// 			$.each(json, function(k,v){
32		// 				if (type=='list' || (type=='detail' && v.sort==1)) {
33		// 					$('img[data-prdt-img="'+v.id+'"]').attr('src',encodeURI(v.img_url));
34		// 					$('meta[property="og:image"]').attr('content', encodeURI(v.img_url));
35		// 					// 한번 로딩된 데이터는 재로딩 되지 않도록 처리
36		// 					$('img[data-prdt-img="'+v.id+'"]').attr('data-prdt-img','');
37		// 				}
38		// 			});
39		//
40		// 			if (typeof(callback)=='function')
41		// 				callback(json);
42		// 	}
43		// });
44	};
45	fn.downloadProdInfoAgree = function(prodId){
46		var saleCd = sessionStorage.getItem('saleCd');
47		var html
48		if (saleCd) {
49			html = '<article id="agreeDown" class="pop_wrap" popup-prod-info-download>\n' +
50					'\t\t\t\t<i class="pop_bg"></i>\n' +
51					'\t\t\t\t<div class="pop_cont">\n' +
52					'\t\t\t\t\t<form name="frmProdInfoDownload">\n' +
53					'\t\t\t\t        \n' +
54					'\t\t\t\t\t\t\t<!-- agree down -->\n' +
55					'\t\t\t\t\t\t\t<h2>라이선스 사용안내 및 이용제한</h2>\n' +
56					'\t\t\t\t\t\t\t<button type="button" class="pop_close" onclick="ProductFunction.downloadProdInfoAgreeClose()">팝업닫기</button>\n' +
57					'\t\t\t\t\t\t\t<div class="agree_text">\n' +
58					'\t\t\t\t\t\t\t\t본 자료의 소유권은 에스피삼화(주)에 있으며, 해당자료는 \n' +
59					'\t\t\t\t\t\t\t\t에스피삼화 제품 정보 기술서(온라인쇼핑몰 상세페이지) 용도로만 \n' +
60					'\t\t\t\t\t\t\t\t사용 가능합니다.<br><br>\n' +
61					'\t\t\t\t\t\t\t\t\n' +
62					'\t\t\t\t\t\t\t\t해당자료를 복제, 재가공, 출판, 인쇄 등 기타 방법에 의하여 \n' +
63					'\t\t\t\t\t\t\t\t영리목적으로 이용하거나, 무단사용, 제 3자에게 배포할 경우\n' +
64					'\t\t\t\t\t\t\t\t저작권 법에 따라 법적인 책임을 질 수 있습니다.\n' +
65					'\t\t\t\t\t\t\t</div>\n' +
66					'\t\t\t\t\t\t\t<div class="agree_chk">\n' +
67					'\t\t\t\t\t\t\t\t<label class="checkbox">\n' +
68					'\t\t\t\t\t\t\t\t\t<input type="checkbox" name="prodInfoDownAgree" />\n' +
69					'\t\t\t\t\t\t\t\t\t<i class="lbl"></i>\n' +
70					'\t\t\t\t\t\t\t\t\t위 내용을 확인하였습니다.\n' +
71					'\t\t\t\t\t\t\t\t</label>\n' +
72					'\t\t\t\t\t\t\t\t<label class="checkbox">\n' +
73					'\t\t\t\t\t\t\t\t\t<input type="checkbox" name="prodInfoDownAgree" />\n' +
74					'\t\t\t\t\t\t\t\t\t<i class="lbl"></i>\n' +
75					'\t\t\t\t\t\t\t\t\t라이선스 사용안내 및 이용제한에 동의합니다.\n' +
76					'\t\t\t\t\t\t\t\t</label>\n' +
77					'\t\t\t\t\t\t\t</div>\n' +
78					'\t\t\t\t\t\t\t<a href="javascript:ProductFunction.downloadProdInfo();" class="button btn_download">다운로드</a>\n' +
79					'\t\t\t\t\t\t\n' +
80					'\t\t\t\t\t\n' +
81					'\t            \t\t\n' +
82					'\t\t\t\t\t</form>\n' +
83					'\t\t\t\t</div>\n' +
84					'\t\t\t</article>';
85		} else {
86			html = '<article id="storeConfirm" class="pop_wrap" popup-prod-info-download>\n' +
87					'\t\t\t\t<i class="pop_bg"></i>\n' +
88					'\t\t\t\t<div class="pop_cont">\n' +
89					'\t\t\t\t\t<form name="frmProdInfoDownload">\n' +
90					'\t\t\t\t        \n' +
91					'\t\t\t\t\t\n' +
92					'\t            \t\t\n' +
93					'\t\t\t\t\t\t\t<!-- 판매처 인증 -->\n' +
94					'\t\t\t\t\t\t\t<h2>판매처 인증</h2>\n' +
95					'\t\t\t\t\t\t\t<button type="button" class="pop_close" onclick="ProductFunction.downloadProdInfoAgreeClose()">팝업닫기</button>\n' +
96					'\t\t\t\t\t\t\t<div class="store_number">\n' +
97					'\t\t\t\t\t\t\t\t<h5>사업자번호, 판매처 코드를 입력하면 인증이 완료됩니다.</h5>\n' +
98					'\t\t\t\t\t\t\t\t<dl>\n' +
99					'\t\t\t\t\t\t\t\t   <dt>사업자번호</dt>\n' +
100					'\t\t\t\t\t\t\t\t   <dd><input type="text" name="agencyBizNo" placeholder="사업자번호를 입력해주세요" onkeyup="onlyNumber(this)"/></dd>\n' +
101					'\t\t\t\t\t\t\t\t</dl>\n' +
102					'\t\t\t\t\t\t\t\t<dl>\n' +
103					'\t\t\t\t\t\t\t\t\t<dt>판매처코드</dt>\n' +
104					'\t\t\t\t\t\t\t\t\t<dd><input type="text" name="agencyId" placeholder="판매처코드를 입력해주세요" /></dd>\n' +
105					'\t\t\t\t\t\t\t\t</dl>\n' +
106					'\t\t\t\t\t\t\t\t<p>\n' +
107					'\t\t\t\t\t\t\t\t\t판매처 인증과 관련된 문의사항이 있으신 경우, 담당 비즈니스센터에\n' +
108					'\t\t\t\t\t\t\t\t\t문의해 주세요.\n' +
109					'\t\t\t\t\t\t\t\t</p>\n' +
110					'\t\t\t\t\t\t\t</div>\n' +
111					'\t\t\t\t\t\t\t\n' +
112					'\t\t\t\t\t\t\t<a href="javascript:ProductFunction.authAgency();" class="button btn_confirm">판매처 인증</a>\n' +
113					'\t\t\t\t\t\t\n' +
114					'\t\t\t\t\t</form>\n' +
115					'\t\t\t\t</div>\n' +
116					'\t\t\t</article>';
117		}
118		// 상세 페이지 다운로드 인증
119		// 대상 제품이 여러개일 경우 콤마로 구분
120		sessionStorage.setItem('downloadProdInfo', prodId);
121		$('[popup-prod-info-download]').remove();
122		$('body').append(html);
123	}
124	fn.downloadProdInfo = function(){
125		var frm = $('[name="frmProdInfoDownload"]');
126		if (frm.find('[name="prodInfoDownAgree"]:checked').length!=2){
127			alert("라이선스 사용안내 확인 및 동의를 해주세요");
128			return;
129		}
130		fn.downloadProdInfoAgreeClose();
131		window.location.href="/wp/wp-admin/admin-ajax.php?action=product_download&prodId="+sessionStorage.getItem('downloadProdInfo')+"&saleCd="+sessionStorage.getItem('saleCd');
132	}
133	fn.authAgency = function(){
134		var frm = $('[name="frmProdInfoDownload"]');
135		var bizNo = frm.find('[name="agencyBizNo"]');
136		var id = frm.find('[name="agencyId"]');
137
138		if (!bizNo.val()){
139			alert(bizNo.attr("placeholder"));
140			bizNo.focus();
141			return;
142		}
143		if (!id.val()){
144			alert(id.attr("placeholder"));
145			id.focus();
146			return;
147		}
148		$.ajax({
149			url: '/wp/wp-admin/admin-ajax.php',
150			dataType : 'json',
151			async: false,
152			data : {
153				action: 'auth_agency',
154				bizNo : bizNo.val(),
155				id : id.val()
156			},
157			method : 'POST',
158			success: function(response)
159			{
160				if (response.data==0) {
161					alert("대리점 정보가 일치하지 않습니다.");
162				} else {
163					sessionStorage.setItem('saleCd', id.val());
164					// 라이선스 사용안내 페이지 이동
165					fn.downloadProdInfoAgree(sessionStorage.getItem('downloadProdInfo'));
166				}
167			}
168		});
169	}
170	fn.downloadProdInfoAgreeClose = function(){
171		$('[popup-prod-info-download]').remove();
172	}
173	return fn;
174}(window.ProductCategory || {}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.