PageSourceSearch

https://m.thankqcamping.com/js/coupon.js?version=20260914-1

js thankqcamping.com collected 2026-09-24 12:07:08 UTC 19,795 bytes, 523 lines download raw bytes

1//쿠폰받기
2function getCoupon(tp,seq,s_dt,e_dt,cptp,cnt,resdays) {
3	var reurl = "/join/login.hbb?reurl=" + window.location.href;
4	if(tp=='CAMP') {
5		$.ajax({
6			type: "POST",
7			url: "/resv/ax_camp_coupon_issue.hbb",
8			data:{ campseq:$("#cseq").val(), couponrandseq:seq },
9			success: onSuccess,
10			error: onError
11		});
12		function onSuccess(dataobj) {
13			var result = dataobj.split('^')[0]
14			var msg = dataobj.split('^')[1]
15			if(result == "100") {
16				action_popup.alert(msg)
17			} else
18			if (result == "200") {
19				action_popup.alert(msg, $.fnLogin = function() { goUrl(reurl,'N','');});
20			} else {
21				if(result=="500") $("button[class^='btn_coupon Camp']").addClass('disabled')
22				action_popup.alert(msg);
23			}
24		}
25		function onError() {}
26	} else if(tp=='DL002') {
27		$.ajax({
28			type: "POST",
29			url: "/promotion/easycamp/get_coupon.hbb",
30			data:{s_dt:s_dt,e_dt:e_dt,cnt:cnt},
31			success: onSuccess,
32			error: onError
33		});
34		function onSuccess(dataobj) {
35			if(dataobj.split('@')[0]=='Y') {
36				$('#div_festa_coupon').html(dataobj.split('@')[1])
37				openLayer('pop_easycamp')
38			} else {
39				var result = dataobj.split('^')[1]
40				if (result == "200") {
41					action_popup.alert("로그인 후 이용해주세요", $.fnLogin = function() { goUrl(reurl,'N','');});
42				}else if (result == "300") {
43					action_popup.alert("본인인증이 필요합니다.", $.fnLogin = function() { goUrl('/inc/checkplus/main.hbb','Y','pop');});
44				}else if (result == "400") {
45					action_popup.alert("미성년자는 발급 불가합니다.<br>(2004년 출생자까지 발급 가능합니다.)");
46				}else if (result == "500") {
47					action_popup.alert("쿠폰은 "+parseInt(s_dt.substring(2,2))+"월 "+parseInt(s_dt.substring(5,2))+"일 10시부터 발급 가능합니다.");
48				}else if (result == "600") {
49					action_popup.alert("쿠폰발급시간은<br>당일10:00 ~ 익일07:00까지 입니다.");
50				}else if (result == "700") {
51					action_popup.alert("이벤트 조기 종료 안내<br>(선착순 쿠폰 마감)");
52				}
53			}
54		}
55		function onError() {}
56	} else if(tp=='DL000') {	//숙세페
57		var tot_price = (cnt!='') ? document.form.tot_fee.value : ''
58		$.ajax({
59			type: "POST",
60			url: "/acmfesta/get_coupon.hbb",
61			data:{s_dt:s_dt,e_dt:e_dt,cnt:cnt,tot_price:tot_price,campseq:$("#cseq").val(),resdays:resdays},
62			success: onSuccess,
63			error: onError
64		});
65		function onSuccess(dataobj) {
66			if(dataobj.split('@')[0]=='Y') {
67				$('#div_festa_coupon').html(dataobj.split('@')[1])
68				openLayer('pop_acmfesta')
69			} else {
70				var result = dataobj.split('@')[1]
71				if (result == "200") {
72					action_popup.alert("로그인 후 이용해주세요", $.fnLogin = function() { goUrl(reurl,'N','');});
73				}else if (result == "300") {
74					action_popup.alert("본인인증이 필요합니다.", $.fnLogin = function() { goUrl('/inc/checkplus/main.hbb?festa=Y','Y','pop');});
75				}else if (result == "400") {
76					action_popup.alert("미성년자는 발급 불가합니다.<br>(2005년 출생자까지 발급 가능합니다.)");
77				}else if (result == "500") {
78					action_popup.alert("쿠폰은 8월 20일 10시부터 발급 가능합니다.");
79				}else if (result == "600") {
80					action_popup.alert("쿠폰발급시간은<br>당일10:00 ~ 익일07:00까지 입니다.");
81				}else if (result == "700") {
82					action_popup.alert("이벤트 조기 종료 안내<br>(선착순 쿠폰 마감)");
83				}
84			}
85		}
86		function onError() {alert('error')}
87	} else if(tp=='DL004') {
88		$.ajax({
89			type: "POST",
90			url: "/promotion/taean/get_coupon.hbb",
91			data:{s_dt:s_dt,e_dt:e_dt},
92			success: onSuccess,
93			error: onError
94		});
95		function onSuccess(dataobj) {
96			if(dataobj.split('@')[0]=='Y') {
97				$('#div_festa_coupon').html(dataobj.split('@')[1])
98				openLayer('pop_taean')
99			} else {
100				var result = dataobj.split('@')[1]
101				if (result == "200") {
102					action_popup.alert("로그인 후 이용해주세요", $.fnLogin = function() { goUrl(reurl,'N','');});
103				}else if (result == "300") {
104					action_popup.alert("본인인증이 필요합니다.", $.fnLogin = function() { goUrl('/inc/checkplus/main.hbb?festa=Y','Y','pop');});
105				}else if (result == "400") {
106					action_popup.alert("미성년자는 발급 불가합니다.<br>(2004년 출생자까지 발급 가능합니다.)");
107				}else if (result == "500") {
108					action_popup.alert("쿠폰은 "+parseInt(s_dt.substring(2,2))+"월 "+parseInt(s_dt.substring(5,2))+"일 10시부터 발급 가능합니다.");
109				}else if (result == "600") {
110					action_popup.alert("쿠폰발급시간은<br>당일10:00 ~ 익일07:00까지 입니다.");
111				}else if (result == "700") {
112					action_popup.alert("이벤트 조기 종료 안내<br>(선착순 쿠폰 마감)");
113				}
114			}
115		}
116		function onError() {}
117	} else if (tp=='DL005') {	//Q페스타	
118
119		$.ajax({
120			type: "POST",
121			url: "/resv/ax_qfesta_coupon_issue.hbb",
122			data:{ campseq:$("#cseq").val(),cnt:cnt, couponType:cptp },
123			success: onSuccess,
124			error: onError
125		});
126		function onSuccess(res) {
127			if (res.split('^')[0] == "100") {
128				msg = "쿠폰발급이 완료되었습니다.";
129				action_popup.alert(msg);
130				if(cnt!="") {
131						if (parseInt(cnt) > 0) {
132							$("#UlCouponList").append(res.split('^')[1])
133						} else {
134							$("#UlCouponList").html(res.split('^')[1])
135						}
136						$("#CouponDown_DL005").remove()
137						var offset = $("#LiCoupon"+cnt).offset();
138				    $("html, body").animate({
139				      scrollTop: (offset.top - 70)
140				    }, 1000);
141				    var frm = document.form
142				    var max_use_idx = -1
143				    var max_use_price = 0
144				    var camp_fee = parseInt(frm.camp_fee.value)
145						$("li[id^='LiCoupon']").each(function(index) {
146							if(max_use_price > (frm.coupon_dis_tp_[index].value=='P') ? camp_fee * parseInt(frm.coupon_price_[index].value) / 100 : parseInt(frm.coupon_price_[index].value)) {
147								max_use_idx = index
148							}
149						});
150						$("#LiCoupon"+max_use_idx).children('input').trigger('click'); 				    
151					}
152			}else if (res.split('^')[0] == "200") {
153				msg = "이미 쿠폰을 발급 받으셨습니다.";
154				action_popup.alert(msg);
155			}else if (res.split('^')[0] == "300") {
156				msg = "로그인후 이용해 주세요.";
157				action_popup.alert(msg, $.fnLogin = function() { goUrl(reurl,'N','');});
158			}
159		}
160		function onError() {}
161
162	} else if (tp=='DL006') {	//찜페스타	
163
164		$.ajax({
165			type: "POST",
166			url: "/resv/ax_coupon_zzimfesta_issue.hbb",
167			data:{ campseq:$("#cseq").val() },
168			success: onSuccess,
169			error: onError
170		});
171		function onSuccess(res) {
172			if (res == "100") {
173				msg = "쿠폰발급이 완료되었습니다.";
174				$('.coupon_cont').removeClass('zzim');
175				$('.coupon_cont').addClass('disabled');
176				action_popup.alert(msg);
177			}else if (res == "200") {
178				msg = "이미 쿠폰을 발급 받으셨습니다.";
179				action_popup.alert(msg);
180			}else if (res == "300") {
181				msg = "로그인후 이용해 주세요.";
182				action_popup.alert(msg, $.fnLogin = function() { goUrl(reurl,'N','');});
183			}else if (res == "400") {
184				msg = "찜 선택후 이용해 주세요.";
185				action_popup.alert(msg);
186			}
187		}
188		function onError() {}
189	} else if (tp == 'DL001') {	//충북페스타
190		var tot_price = (cnt!='') ? document.form.tot_fee.value : ''
191		$.ajax({
192			type: "POST",
193			url: "/promotion/cbfesta/get_coupon.hbb",
194			data:{s_dt:s_dt,e_dt:e_dt,cnt:cnt,tot_price:tot_price,campseq:$("#cseq").val()},
195			success: onSuccess,
196			error: onError
197		});
198		function onSuccess(dataobj) {
199			if(dataobj.split('@')[0]=='Y') {
200				$('#div_festa_coupon').html(dataobj.split('@')[1])
201				openLayer('pop_acmfesta')
202			} else {
203				var result = dataobj.split('@')[1]
204				if (result == "200") {
205					action_popup.alert("로그인 후 이용해주세요", $.fnLogin = function() { goUrl(reurl,'N','');});
206				}else if (result == "300") {
207					action_popup.alert("본인인증이 필요합니다.", $.fnLogin = function() { goUrl('/inc/checkplus/main.hbb?festa=Y','Y','pop');});
208				}else if (result == "400") {
209					action_popup.alert("미성년자는 발급 불가합니다.<br>(2005년 출생자까지 발급 가능합니다.)");
210				}else if (result == "500") {
211					action_popup.alert("쿠폰은 6월 9일 10시부터 발급 가능합니다.");
212				}else if (result == "600") {
213					action_popup.alert("쿠폰발급시간은<br>당일10:00 ~ 익일07:00까지 입니다.");
214				}else if (result == "700") {
215					action_popup.alert("이벤트 조기 종료 안내<br>(선착순 쿠폰 마감)");
216				}
217			}
218		}
219		function onError() {}
220	} else if (tp == 'DL009') {	//옥천프로모션
221		var tot_price = (cnt!='') ? document.form.tot_fee.value : ''
222		$.ajax({
223			type: "POST",
224			url: "/promotion/okcheon/get_coupon.hbb",
225			data:{s_dt:s_dt,e_dt:e_dt,cnt:cnt,tot_price:tot_price,campseq:$("#cseq").val()},
226			success: onSuccess,
227			error: onError
228		});
229		function onSuccess(dataobj) {
230			if(dataobj.split('@')[0]=='Y') {
231				$('#div_festa_coupon').html(dataobj.split('@')[1])
232				openLayer('pop_acmfesta')
233			} else {
234				var result = dataobj.split('@')[1]
235				if (result == "200") {
236					action_popup.alert("로그인 후 이용해주세요", $.fnLogin = function() { goUrl(reurl,'N','');});
237				}else if (result == "300") {
238					action_popup.alert("본인인증이 필요합니다.", $.fnLogin = function() { goUrl('/inc/checkplus/main.hbb?festa=Y','Y','pop');});
239				}else if (result == "400") {
240					action_popup.alert("미성년자는 발급 불가합니다.<br>(2006년 출생자까지 발급 가능합니다.)");
241				}else if (result == "500") {
242					action_popup.alert("쿠폰은 2월 10일 10시부터 발급 가능합니다.");
243				}else if (result == "600") {
244					action_popup.alert("쿠폰발급시간은<br>당일10:00 ~ 익일07:00까지 입니다.");
245				}else if (result == "700") {
246					action_popup.alert("이벤트 조기 종료 안내<br>(선착순 쿠폰 마감)");
247				}
248			}
249		}
250		function onError() {}
251	} else if (tp == 'DL008') {	//가평 페스타
252		var tot_price = (cnt!='') ? document.form.tot_fee.value : ''
253		$.ajax({
254			type: "POST",
255			url: "/promotion/gapyeong/get_coupon.hbb",
256			data:{s_dt:s_dt,e_dt:e_dt,cnt:cnt,tot_price:tot_price,campseq:$("#cseq").val()},
257			success: onSuccess,
258			error: onError
259		});
260		function onSuccess(dataobj) {
261			if(dataobj.split('@')[0]=='Y') {
262				$('#div_festa_coupon').html(dataobj.split('@')[1])
263				openLayer('pop_acmfesta')
264			} else {
265				var result = dataobj.split('@')[1]
266				if (result == "200") {
267					action_popup.alert("로그인 후 이용해주세요", $.fnLogin = function() { goUrl(reurl,'N','');});
268				}else if (result == "300") {
269					action_popup.alert("본인인증이 필요합니다.", $.fnLogin = function() { goUrl('/inc/checkplus/main.hbb?festa=Y','Y','pop');});
270				}else if (result == "400") {
271					action_popup.alert("미성년자는 발급 불가합니다.<br>(2006년 출생자까지 발급 가능합니다.)");
272				}else if (result == "500") {
273					action_popup.alert("쿠폰은 2월 19일 10시부터 발급 가능합니다.");
274				}else if (result == "600") {
275					action_popup.alert("쿠폰발급시간은<br>당일10:00 ~ 익일07:00까지 입니다.");
276				}else if (result == "700") {
277					action_popup.alert("이벤트 조기 종료 안내<br>(선착순 쿠폰 마감)");
278				}
279			}
280		}
281		function onError() {}
282	} else if (tp=='DL010') {	//추석숙박할인쿠폰
283
284		$.ajax({
285			type: "POST",
286			url: "/promotion/chuseok/coupon_issue.hbb",
287			data:{ campseq:$("#cseq").val(),cnt:cnt, couponType:cptp },
288			success: onSuccess,
289			error: onError
290		});
291		function onSuccess(res) {
292			if (res.split('^')[0] == "100") {
293				msg = "쿠폰발급이 완료되었습니다.";
294				action_popup.alert(msg);
295				if(cnt!="") {
296						if (parseInt(cnt) > 0) {
297							$("#UlCouponList").append(res.split('^')[1])
298						} else {
299							$("#UlCouponList").html(res.split('^')[1])
300						}
301						$("#CouponDown_DL010").remove()
302						var offset = $("#LiCoupon"+cnt).offset();
303				    $("html, body").animate({
304				      scrollTop: (offset.top - 70)
305				    }, 1000);
306				    var frm = document.form
307				    var max_use_idx = -1
308				    var max_use_price = 0
309				    var camp_fee = parseInt(frm.camp_fee.value)
310						$("li[id^='LiCoupon']").each(function(index) {
311							if(max_use_price > (frm.coupon_dis_tp_[index].value=='P') ? camp_fee * parseInt(frm.coupon_price_[index].value) / 100 : parseInt(frm.coupon_price_[index].value)) {
312								max_use_idx = index
313							}
314						});
315						$("#LiCoupon"+max_use_idx).children('input').trigger('click'); 				    
316					}
317			}else if (res.split('^')[0] == "200") {
318				msg = "이미 쿠폰을 발급 받으셨습니다.";
319				action_popup.alert(msg);
320			}else if (res.split('^')[0] == "300") {
321				msg = "로그인후 이용해 주세요.";
322				action_popup.alert(msg, $.fnLogin = function() { goUrl(reurl,'N','');});
323			}
324		}
325		function onError() {}
326	} else if (tp=='DL012') {	//양평숙박할인쿠폰
327
328		$.ajax({
329			type: "POST",
330			url: "/promotion/yangpyeong/coupon_issue.hbb",
331			data:{ campseq:$("#cseq").val(),cnt:cnt, couponType:cptp },
332			success: onSuccess,
333			error: onError
334		});
335		function onSuccess(res) {
336			if (res.split('^')[0] == "100") {
337				msg = "쿠폰발급이 완료되었습니다.";
338				action_popup.alert(msg);
339				if(cnt!="") {
340						if (parseInt(cnt) > 0) {
341							$("#UlCouponList").append(res.split('^')[1])
342						} else {
343							$("#UlCouponList").html(res.split('^')[1])
344						}
345						$("#CouponDown_DL012").remove()
346						var offset = $("#LiCoupon"+cnt).offset();
347				    $("html, body").animate({
348				      scrollTop: (offset.top - 70)
349				    }, 1000);
350				    var frm = document.form
351				    var max_use_idx = -1
352				    var max_use_price = 0
353				    var camp_fee = parseInt(frm.camp_fee.value)
354						$("li[id^='LiCoupon']").each(function(index) {
355							if(max_use_price > (frm.coupon_dis_tp_[index].value=='P') ? camp_fee * parseInt(frm.coupon_price_[index].value) / 100 : parseInt(frm.coupon_price_[index].value)) {
356								max_use_idx = index
357							}
358						});
359						$("#LiCoupon"+max_use_idx).children('input').trigger('click'); 				    
360					}
361			}else if (res.split('^')[0] == "200") {
362				msg = "이미 쿠폰을 발급 받으셨습니다.";
363				action_popup.alert(msg);
364			}else if (res.split('^')[0] == "300") {
365				msg = "로그인후 이용해 주세요.";
366				action_popup.alert(msg, $.fnLogin = function() { goUrl(reurl,'N','');});
367			}
368		}
369		function onError() {}
370	}
371}
372
373//베너 이동
374function getWelcomeBack() {
375	$.ajax({
376		type: "POST",
377		url: "/my/coupon/ax_welcome_coupon.hbb",
378		data:{ },
379		success: onSuccess,
380		error: onError
381	});		
382	function onSuccess(res) {
383		if (res == "100") {
384			msg = "쿠폰발급이 완료되었습니다.";
385			action_popup.alert(msg, $.fnLogin = function() { goUrl('/my/coupon_list.hbb','N','');});
386		}else if (res == "200") {
387			msg = "이미 쿠폰을 발급 받으셨습니다.";
388			action_popup.alert(msg);
389		}else if (res == "300") {
390			msg = "로그인후 이용해 주세요.";
391			action_popup.alert(msg, $.fnLogin = function() { goUrl(reurl,'N','');});
392		}else if (res == "400") {
393			msg = "이벤트 기간이 만료되었습니다.";
394			action_popup.alert(msg);
395		}else if (res == "400") {
396			msg = "이벤트 대상자가 아닙니다.";
397			action_popup.alert(msg);
398	 	}
399	}
400	function onError() {}
401
402}
403
404const CouponCommonManager = {
405	showToast: function (text) {
406		const toast = document.createElement('div');
407		toast.className = 'toast_message';
408		toast.innerHTML = text;
409		toast.style.display = 'block';
410
411		document.body.appendChild(toast);
412
413		setTimeout(() => {
414			toast.remove();
415		}, 8000);
416	}
417};
418
419function go_getCoupon(gbn,sdt,edt,yn,cptp,resdays) {
420	$.ajax({
421		type: "POST",
422    url: "/resv/axServerTime.hbb",
423    success: onSuccess,
424    error: onError
425	});
426	function onSuccess(dataobj) {
427		var isFesta = "Y"
428		var p_date  = dataobj.substr(0,8)
429		var p_time	= dataobj.substr(8,4)
430		if (p_date == sdt) {
431			if (p_time < "1000") {
432				isFesta = "N"
433			}
434		} else {
435			if (p_time >= "0700" && p_time < "1000") {
436				isFesta = "N"
437			}
438		}
439		if(isFesta=='Y') {
440			var cnt = (yn=='Y') ? $("li[id^='LiCoupon']").length : ''
441			closeLayer('coupon_down_able');
442			getCoupon(gbn,'',sdt,edt,cptp,cnt,resdays);
443		} else {
444			action_popup.alert('10시부터 다음날 오전 7시이전까지 다운가능하며<br>오전 7시에 미사용분은 모두 초기화 됩니다.');
445		}
446  }
447  function onError() {}
448}
449
450//결제페이지 업체쿠폰 다운
451function campCouponDown(cseq,tmpseq) {
452	var cnt = $("li[id^='LiCoupon']").length
453	if(confirm('쿠폰발급을 받으시겠습니까?')) {
454		$.ajax({
455      type: "POST",
456      url: "/coupon/ax_camp_coupon_down.hbb",
457      data: {campseq: cseq, templateseq: tmpseq, cnt:cnt},
458      success: function(res) {    	  	
459      	  if (res.split('^')[0] == "000" || res.split('^')[0] == "100") {
460          		if (cnt > 0) {
461								$("#UlCouponList").append(res.split('^')[1])
462							} else {
463								$("#UlCouponList").html(res.split('^')[1])
464							}
465							var offset = $("#LiCoupon"+cnt).offset();			
466					    $("html, body").animate({
467					      scrollTop: (offset.top - 70)
468					    }, 1000);
469					    var frm = document.form
470					    var max_use_idx = -1
471					    var max_use_price = 0
472					    var camp_fee = parseInt(frm.camp_fee.value)
473							$("li[id^='LiCoupon']").each(function(index) {
474								if(max_use_price > (frm.coupon_dis_tp_[index].value=='P') ? camp_fee * parseInt(frm.coupon_price_[index].value) / 100 : parseInt(frm.coupon_price_[index].value)) {
475									max_use_idx = index
476								}
477							});
478							$("#LiCoupon"+max_use_idx).children('input').trigger('click');
479              CouponCommonManager.showToast("쿠폰 발급이 완료되었습니다.");
480          }else if (res.split('$')[0] == "200") {
481              CouponCommonManager.showToast("이미 쿠폰을 발급 받으셨습니다.");
482          }else if (res.split('$')[0] == "400") {
483              CouponCommonManager.showToast("발급조건 대상자가 아닙니다.");
484          }else if (res.split('$')[0] == "500") {
485              CouponCommonManager.showToast("발급기간이 아닙니다.");
486          }else if (res.split('$')[0] == "600") {
487              CouponCommonManager.showToast("존재하지 않는 쿠폰입니다.");
488          }
489					$("#CouponDownTpl_"+tmpseq).remove()
490					if($("#view_coupon").find('li').length > 0) {
491						$("#coupon_down_able_cnt").html($("#view_coupon").find('li').length)
492					} else {
493						$("#coupon_down_able").hide()
494					}
495      },
496			error: function(error){
497          console.log(error);
498      }
499		});	
500	}
501}
502
503//증정형 쿠폰 사용처리
504function clkCouponUse(seq) {
505	action_popup.confirm("쿠폰 사용처리 하시겠습니까?<br><span>(숙박기간중, 사용처리된 쿠폰은 재사용 불가)</span>",function(res){if(res){
506		$.ajax({
507			type: "POST",
508			url: "/coupon/ax_coupon_use.hbb",
509			data:{ couponlistseq:seq },
510			success: onSuccess,
511			error: onError
512		});		
513		function onSuccess(res) {
514			if (res == "Y") {
515				CouponCommonManager.showToast("사용처리되었습니다.");
516				CouponListManager.getCouponList();
517			}else {
518				CouponCommonManager.showToast("사용처리에 실패하였습니다.");
519		 	}
520		}
521		function onError() {}
522	}});
523}

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.