PageSourceSearch

https://www.surveylink.co.kr/mypage/js/mypage.js?dummy=1791257417058

js surveylink.co.kr collected 2026-10-06 03:30:53 UTC 12,879 bytes, 453 lines download raw bytes

1let uid = getCookie('uid');
2let gradeObj = {
3	"일반" : {
4		"text":"normal",
5		"addPoint":"0"
6	},
7	"실버" : {
8		"text":"silver",
9		"addPoint":"1"
10	},
11	"골드" : {
12		"text":"gold",
13		"addPoint":"3"
14	},
15	"VIP" : {
16		"text":"vip",
17		"addPoint":"5"
18	}
19}
20let curDate = new Date();
21let curObj = date2obj(curDate);
22
23let score_so = 10;
24let score_comp = 30;
25let score_ad = 3;
26// let score_so = 20;
27// let score_comp = 90;
28// let score_ad = 5;
29
30let recommand_code = '';
31let direct_code = '';
32let url = window.location.protocol + '//' + window.location.host + '/account/signup';
33
34let copyURL = el_ => {
35	let device = navigator.userAgent;
36	if (device.indexOf('ANDROID_APP') > -1) {
37		// globalAlert('안드로이드 앱은 지원하지 않습니다.<br>브라우저나 PC를 이용해주세요.', 'alert');
38		// return;
39		$(el_).select();
40		document.execCommand('copy');
41		$(el_).prop('disabled', true);
42		setTimeout(() => {
43			$(el_).prop('disabled', false);
44		});
45		globalAlert('복사 성공', 'success');
46	} else {	
47		navigator.clipboard.writeText($(el_).val()).then(() => {
48			globalAlert('복사 성공', 'success');
49		});
50	}
51}
52
53let sendKaKao_before = () => {
54	let device = navigator.userAgent;
55	if (device.indexOf('ANDROID_APP') > -1) {
56		// globalAlert('안드로이드 앱은 지원하지 않습니다.<br>브라우저나 PC를 이용해주세요.', 'alert');
57		globalAlert('새 버전으로 업데이트 하신 뒤에 이용할 수 있습니다.', 'alert');
58		return;
59	}
60	if (device.indexOf('IOS_APP') > -1) {
61		// globalAlert('IOS 앱은 지원하지 않습니다.<br>브라우저나 PC를 이용해주세요.', 'alert');
62		globalAlert('새 버전으로 업데이트 하신 뒤에 이용할 수 있습니다.', 'alert');
63		return;
64	}
65
66	let title = `추천코드 : ${recommand_code}`;
67	let desc = '위 추천코드 입력하여 회원가입 완료하면 1,000원 적립!';
68	let imgUrl = 'https://www.surveylink.co.kr/inc/imgs/event/event29_kakaoThum.png';
69	let sendUrl = `${url}?reCode=${direct_code}`;
70	let btnTitle = '가입하고 적립금 받기';
71	sendKakao(title, desc, imgUrl, sendUrl, btnTitle);
72}
73
74let getInfo = () => {
75	let sendData = new Object();
76	sendData.dummy = cr_dummy();
77
78	$.ajax({
79		url: `/serviceApi/mypage/index/${uid}`,
80		type: 'get',
81		data: sendData,
82		dataType: 'json',
83		headers: { authorization: getCookie('token') },
84		success: r => {
85			if (r.success) {
86				$('#recommand-code').text(r.recommand_code);
87				recommand_code = r.recommand_code;
88				$('#user-grade-img').attr({
89					'src':`/inc/imgs/mypage/grade_${gradeObj[r.grade].text}.png`,
90					'alt':`${r.grade}등급`
91				});
92				$('#user-grade-add-point').text(gradeObj[r.grade].addPoint);
93				$('#user-id').text(getCookie('id'));
94				$('#user-grade').text(r.grade);
95				$('#ap-average').text(r.ap_average);
96
97				let nextDate = new Date(parseInt(curObj.year, 10), parseInt(curObj.month, 10));
98				let nextObj = date2obj(nextDate);
99				$('#grade-apply-date').text(`${curObj.year}-${curObj.month}-10 ~ ${nextObj.year}-${nextObj.month}-09`);
100				$('#grade-next-date').text(`${nextObj.year}-${nextObj.month}-10`);
101				
102				if (parseInt(r.ap_month_d1.replace(/년|월/g, '') , 10) < 202302) {
103					score_so = 20;
104					score_comp = 90;
105					score_ad = 5;
106				} else {
107					$('#m0-ad-label').text('출석체크');
108				}
109
110				$('#m0-month').text(r.ap_month_d1.replace(/\d+년(\d+)월/, '$1'));
111				$('#m0-ap').text(r.ap_d1);
112				$('#m0-so').text(commify(r.userDetailInfo_d1[0].SUM));
113				$('#m0-so-cnt').text(r.userDetailInfo_d1[0].SUM / score_so);
114				$('#m0-comp').text(commify(r.userDetailInfo_d1[1].SUM));
115				$('#m0-comp-cnt').text(r.userDetailInfo_d1[1].SUM / score_comp);
116				$('#m0-ad').text(commify(r.userDetailInfo_d1[2].SUM));
117				$('#m0-ad-cnt').text(r.userDetailInfo_d1[2].SUM / score_ad);
118
119				if (parseInt(r.ap_month_d2.replace(/년|월/g, '') , 10) < 202302) {
120					score_so = 20;
121					score_comp = 90;
122					score_ad = 5;
123				} else {
124					$('#m1-ad-label').text('출석체크');
125				}
126
127				$('#m1-month').text(r.ap_month_d2.replace(/\d+년(\d+)월/, '$1'));
128				$('#m1-ap').text(r.ap_d2);
129				$('#m1-so').text(commify(r.userDetailInfo_d2[0].SUM));
130				$('#m1-so-cnt').text(r.userDetailInfo_d2[0].SUM / score_so);
131				$('#m1-comp').text(commify(r.userDetailInfo_d2[1].SUM));
132				$('#m1-comp-cnt').text(r.userDetailInfo_d2[1].SUM / score_comp);
133				$('#m1-ad').text(commify(r.userDetailInfo_d2[2].SUM));
134				$('#m1-ad-cnt').text(r.userDetailInfo_d2[2].SUM / score_ad);
135
136				if (parseInt(r.ap_month_d3.replace(/년|월/g, '') , 10) < 202302) {
137					score_so = 20;
138					score_comp = 90;
139					score_ad = 5;
140				} else {
141					$('#m2-ad-label').text('출석체크');
142				}
143
144				$('#m2-month').text(r.ap_month_d3.replace(/\d+년(\d+)월/, '$1'));
145				$('#m2-ap').text(r.ap_d3);
146				$('#m2-so').text(commify(r.userDetailInfo_d3[0].SUM));
147				$('#m2-so-cnt').text(r.userDetailInfo_d3[0].SUM / score_so);
148				$('#m2-comp').text(commify(r.userDetailInfo_d3[1].SUM));
149				$('#m2-comp-cnt').text(r.userDetailInfo_d3[1].SUM / score_comp);
150				$('#m2-ad').text(commify(r.userDetailInfo_d3[2].SUM));
151				$('#m2-ad-cnt').text(r.userDetailInfo_d3[2].SUM / score_ad);
152			}
153		},
154		error: ajaxError
155	});
156}
157let getPoint = () => {
158	let sendData = new Object();
159	sendData.dummy = cr_dummy();
160	sendData.uid = uid;
161
162	$.ajax({
163		url: `/serviceApi/mypage/userPoint`,
164		type: 'get',
165		data: sendData,
166		dataType: 'json',
167		headers: { authorization: getCookie('token') },
168		success: r => {
169			if (r.success) {
170				$('#user-point').text(commify(r.myPoint.POINT || '0'));
171				$('#user-point-acc').text(commify(r.accPoint.acc || '0'));
172				$('#user-point-refund').text(commify(r.refundPoint.refund || '0'));
173			} else {
174				globalAlert(r.err_desc, 'alert');
175			}
176		},
177		error: ajaxError
178	});
179}
180
181let getRefundHistory = () => {
182	let sendData = new Object();
183	sendData.dummy = cr_dummy();
184	sendData.uid = uid;
185
186	$.ajax({
187		url: `/serviceApi/mypage/refundHistory`,
188		type: 'get',
189		data: sendData,
190		dataType: 'json',
191		headers: { authorization: getCookie('token') },
192		success: r => {
193			if (r.success) {
194				let { list } = r;
195				let tmp = '';
196				let total = 0;
197				for (let i=0; i<list.length; i++) {
198					let item = list[i];
199					let dateObj = date2obj(new Date(item.REQ_DATETIME));
200					tmp += `
201						<tr>
202							<td>${dateObj.year}.${dateObj.month}.${dateObj.date}</td>
203							<td>${commify(item.MONEY)}</td>
204						</tr>	
205					`;
206					total += parseInt(item.MONEY, 10);
207				}
208				tmp += `
209					<tr>
210						<td><strong>TOTAL</strong></td>
211						<td><strong>${commify(total)}</strong></td>
212					</tr>					
213				`;
214
215				$('#m-acc-history').empty();
216				$('#m-acc-history').append(tmp);
217			} else {
218				globalAlert(r.err_desc, 'alert');
219			}
220		},
221		error: ajaxError
222	});
223}
224
225let getDirectCode = () => {
226	let sendData = new Object();
227	sendData.dummy = cr_dummy();
228
229	$.ajax({
230		url: `/serviceApi/mypage/kakaoLink/${uid}`,
231		type: 'get',
232		data: sendData,
233		dataType: 'json',
234		success: r => {
235			if (r.success) {
236				direct_code = r.recommand_send_code;
237				$('#copy-url-area').val(`${url}?reCode=${direct_code}`);
238			}
239		}
240	});
241}
242
243
244
245let ph_startDate = '';
246let ph_endDate = '';
247let ph_curPage = 1;
248let ph_cutPage = 5;
249
250let getPointHistory = function() {
251	// $('tbody').children().remove();
252	showLoader();
253	let obj = new Object();
254	obj.dummy = cr_dummy();
255	obj.page = ph_curPage;
256	obj.startdate = ph_startDate;
257	obj.enddate = ph_endDate;
258
259	$.ajax({
260		url: `/serviceApi/point/history/${uid}`,
261		data: obj,
262		dataType: 'JSON',
263		type: 'get',
264		headers: { authorization: getCookie('token') },
265		success: function(r) {
266			$('#pointHistoryTbd').empty();
267			
268			if(r.success == true) {
269				let pointHistory = r.point_history ?? [];
270				let pointInfo = r.point_info;
271				let temp = "";
272				let point = "";
273				let count = 0;
274				let totalPage = 0;
275
276				// $('#my-point').text(`${pointInfo.POINT_MY}P`);
277
278				for (let i = 0; i < pointHistory.length; i++) {
279					if (pointHistory[i].GUBUN_ENG =="ADD") {
280						point = pointHistory[i].ADD_POINT;
281					} else if (pointHistory[i].GUBUN_ENG =="USE") {
282						point =  '- '+pointHistory[i].USE_POINT;
283					};
284					temp +=`<tr>
285								<td scope="row" data-label="날짜">${pointHistory[i].POINT_DATE}</td>
286								<td data-label="카테고리">${pointHistory[i].GUBUN_TYPE}</td>
287								<td data-label="제목">${pointHistory[i].TITLE}</td>
288								<td data-label="포인트"><strong>${point} P</strong></td>
289							</tr>
290							`;
291					count++;
292
293					if (i == 0) {
294						totalPage = pointHistory[0].TOTAL_PAGE
295					}
296				};
297
298				$('#pointHistoryTbd').append(temp);
299
300				if (totalPage > 0) {
301					cr_pagination($('.pagenation'), ph_curPage, ph_cutPage, totalPage, cb_pageFunc);
302				}
303
304				if(count==0){
305					let historyEmpty = "";
306					historyEmpty += `
307					<tr>
308						<td colspan="4" class="empty">포인트 조회내역이 없습니다.</td>
309					</tr>`
310					$('#pointHistoryTbd').append(historyEmpty);
311				}
312			}
313			
314		},error: ajaxError
315		, complete: function () { 
316			if (getParam('sec') === 'point') {
317				let elemY = $('.point-history')[0].getBoundingClientRect().top + window.scrollY;
318				window.scrollTo(0, elemY-30);
319			} else if ( getParam('sec') === 'mygrade' ) {
320				let elemY = $('.mygrade')[0].getBoundingClientRect().top + window.scrollY;
321				window.scrollTo(0, elemY - 110);
322			}
323			closeLoader(280);
324		}
325	});
326}
327
328let cb_pageFunc = page_ => {
329	ph_curPage = page_;
330	getPointHistory();
331}
332
333let setDate = d_ => {
334	let now = new Date();
335	let obj_now = date2obj(now);
336
337	let prev = new Date(now.setMonth(parseInt(obj_now.month, 10) - 1 + d_));
338	let obj_prev = date2obj(prev);
339	
340	ph_startDate = obj_prev.year + obj_prev.month + obj_prev.date;
341	ph_endDate = obj_now.year + obj_now.month + obj_now.date;
342
343	ph_curPage = 1;
344
345	$(`.tab-item`).removeClass('active');
346	$(`.tab-item[m="${d_}"]`).addClass('active');
347
348	$('#search_startDate').val(ph_startDate.replace(/(\d{4})(\d{2})(\d{2})/,'$1-$2-$3'));
349	$('#search_endDate').val(ph_endDate.replace(/(\d{4})(\d{2})(\d{2})/,'$1-$2-$3'));
350
351	getPointHistory();
352}
353
354let searchHistory = () => {
355	let startDate = $('#search_startDate').val().replace(/-/g, '');
356	let endDate = $('#search_endDate').val().replace(/-/g, '');
357
358	if (startDate == '') {
359		globalAlert('조회 시작 날짜를 선택해주세요.', 'alert');
360		return;
361	}
362	if (endDate == '') {
363		globalAlert('조회 종료 날짜를 선택해주세요.', 'alert');
364		return;
365	}
366	if (parseInt(startDate, 10) > parseInt(endDate, 10)) {
367		globalAlert('조회 날짜를 확인해주세요.', 'alert');
368		return;
369	}
370	let { year, month, date } = date2obj(new Date());
371	let curTime = (new Date(year, parseInt(month, 10)-1, date)).getTime();
372	let sTime = (new Date(startDate.substring(0,4), parseInt(startDate.substring(4,6), 10)-1, startDate.substring(6,8))).getTime();
373	if (
374		(parseInt(startDate.substring(0,4), 10) % 4 == 0 && (curTime - sTime) / (1000*60*60*24) > 366)
375		|| (parseInt(startDate.substring(0,4), 10) % 4 > 0 && (curTime - sTime) / (1000*60*60*24) > 365)
376	) {
377		globalAlert('[시작 날짜] 1년 이내의 날짜를 선택해주세요.', 'alert');
378		return;
379	}
380	let eTime = (new Date(endDate.substring(0,4), parseInt(endDate.substring(4,6), 10)-1, endDate.substring(6,8))).getTime();
381	if (
382		(parseInt(endDate.substring(0,4), 10) % 4 == 0 && (curTime - eTime) / (1000*60*60*24) > 366)
383		|| (parseInt(endDate.substring(0,4), 10) % 4 > 0 && (curTime - eTime) / (1000*60*60*24) > 365)
384	) {
385		globalAlert('[종료 날짜] 1년 이내의 날짜를 선택해주세요.', 'alert');
386		return;
387	}
388	
389	ph_startDate = startDate;
390	ph_endDate = endDate;
391	ph_curPage = 1;
392
393	$(`.tab-item`).removeClass('active');
394
395	getPointHistory();
396}
397
398let goCurrentEventPage = () => {
399	$.ajax({
400		url: '/eventProc/currentEvents',
401		type: 'POST',
402		data: {
403			dummy: cr_dummy(),
404		},
405		success: function(r) {
406			console.log(r.data);
407			if ( r.success ) {
408				for ( let i=0;i < r.data.length;i++ ) {
409					const item = r.data[i];
410					if ( item.EVENT_TYPE == '1' ) {
411						sessionStorage.setItem('event-mypage', '1');
412						location.href = `/event/view/${item.SEQ}`;
413						return;
414					}
415				}
416				// 이벤트가 진행중이지 않을 때.
417				commonCopyTxt($('#copy-url-area'));
418			}
419		}
420	});
421}
422
423$(() => {
424	getInfo();
425	getPoint();
426	getRefundHistory();
427	getDirectCode();
428
429	if (flutterApp) {
430		$('.show-flutter').removeClass('hide');
431	} else {
432		$('.show-not-flutter').removeClass('hide');
433	}
434
435	setDate(-1);
436	// date min, max 설정
437	let now = new Date();
438	let obj_now = date2obj(now);
439
440	let prev = new Date(now);
441	prev.setMonth(prev.getMonth() - 12);
442	let obj_prev = date2obj(prev);
443
444	$('#search_startDate').attr({
445		'min' : `${obj_prev.year}-${obj_prev.month}-${obj_prev.date}`,
446		'max' : `${obj_now.year}-${obj_now.month}-${obj_now.date}`
447	});
448	$('#search_endDate').attr({
449		'min' : `${obj_prev.year}-${obj_prev.month}-${obj_prev.date}`,
450		'max' : `${obj_now.year}-${obj_now.month}-${obj_now.date}`
451	});
452
453});

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.