PageSourceSearch

https://www.happycampus.com/js/doc/opinion.js?jsVer=20260921.1

js happycampus.com collected 2026-09-24 09:09:13 UTC 25,903 bytes, 784 lines download raw bytes

1/**
2 *
3 * 구매평가 업로드
4 *
5 * @date 2012-10-22
6 * @author 정병연
7 * @type {Object}
8 **/
9var Opinion = {
10	/**
11	 * 문서번호
12	 * @type {number|string}
13	 */
14	docSeq: '',
15	/**
16	 * 평가 번호
17	 * @type {number|string}
18	 */
19	docOpinionSeq: '',
20	/**
21	 * 평가답변번호
22	 * @type {number|string}
23	 */
24	docOpinionAnswerSeq: '',
25	/**
26	 * 페이지 번호
27	 * @type {number}
28	 */
29	page: 1,
30	/**
31	 * 리턴타입
32	 * @type {string}
33	 */
34	returnType: '',
35	/**
36	 * 평가 점수를 변경하는 경우 입력 내용 확인
37	 * @param newPoint
38	 * @returns {boolean}
39	 */
40	oldPoint: 10, // 클릭 전 평가 점수
41	changePoint: function(newPoint){
42		var pointList = {
43			'point10': '최고예요! 정말 만족합니다.',
44			'point8': '좋아요! 많은 도움이 많이 되었습니다.',
45			'point6': '괜찮아요! 괜찮은 자료입니다.',
46			'point4': '아쉬워요! 도움은 받았지만 다소 아쉽습니다.',
47			'point2': '별로예요! 많은 도움이 되지 않았습니다.'
48		};
49
50		var $form = $('form[name="frm_opinion_insert"]');
51		if(newPoint != Opinion.oldPoint) { // 신규 값이 현재 선택된 값과 달라지는 경우..
52			var currentContents = $form.find('#contents').val();
53			if(currentContents.length > 0) {
54				if (pointList['point' + Opinion.oldPoint] != currentContents) { // 기본값과 다른 경우..
55					if (!confirm("입력된 내용이 삭제됩니다.\n변경하시겠습니까?")) {
56						return false;
57					}
58				}
59				$form.find('#contents').val(pointList['point' + newPoint]);
60				return true;
61			}
62		}
63		return true;
64	},
65	/**
66	 * 구매평가 등록
67	 */
68	submitOpinion: function()
69	{
70		var that = Opinion;
71
72		//set vars: html element
73		var $obj = $('form[name="frm_opinion_insert"]');
74
75		//set vars: form params
76		that.docSeq = $obj.find('input[name="docSeq"]').val();
77		var writeCheck = $obj.find('input[name="writeCheck"]').val();
78		var contents = $.trim($obj.find('textarea[name="contents"]').val());
79		var totalPoint = $obj.find('input[name=totalPoint]:checked').val();
80		if($('input[name=returnType]').length > 0) this.returnType = $('input[name=returnType]').val();
81
82		if(contents == "" || writeCheck == 0) {
83			alert("작성된 내용이 없습니다.\n내용을 입력해주세요.");
84			return false;
85		}
86		if(totalPoint == "") {
87			alert("자료후기 점수를 선택해 주세요.");
88			return false;
89		}
90
91		$.ajax({
92			type:'POST',
93			dataType: 'json',
94			url:'/docOpinion/insert',
95			async:false,
96			data: {
97				"docSeq": that.docSeq,
98				"contents": contents,
99				"writeCheck": writeCheck,
100				"editPoint": totalPoint,
101				"qualityPoint": totalPoint,
102				"pricePoint": totalPoint,
103				"returnType": that.returnType
104			},
105			/**
106			 * @param {{error: {code: number, msg: string}, data: string, point: string, pointStr: string, point: number, count: number, issueTicketType: string}} json
107			 * @return {boolean}
108			 */
109			success:function(json){
110				if (json == null) return  false;
111				if(json.error.code) {
112					alert(json.error.msg);
113					return false;
114				}
115
116				var alertMsg;
117				if (json.issueTicketType == 'DOC_OPINION') {
118					alertMsg = "<span class='f_txt' style='font-size:14px; margin-bottom: 25px; letter-spacing:-0.5px'>" +
119						"	룰렛 이벤트 응모권 1장이 지급되었습니다.<br>" +
120						"	자료후기를 작성해 주셔서 감사합니다." +
121						"</span>";
122				} else if (json.issueTicketType == 'DOC_OPINION2') {
123					alertMsg = "<span class='f_txt' style='font-size:14px; margin-bottom: 25px; letter-spacing:-0.5px'>" +
124					"	룰렛 이벤트 응모권 2장이 지급되었습니다.<br>" +
125					"	자료후기를 작성해 주셔서 감사합니다." +
126					"</span>";
127				} else {
128					alertMsg = "<div style='font-size: 12px;padding: 0 10px;'>자료후기 등록이 완료되었습니다.</div>";
129				}
130
131				Common.closeLayerBox('buyOpinionDiv');
132				$('#opinionListFilterBox').show();
133				Common.divAlert(alertMsg, 300, 250, '', 'reload');
134			},
135			error: function(xhr, status, error) {
136				Common.ajaxErrorProcess(xhr, status, error);
137			}
138		});
139	},
140	/**
141	 * 의견글 체크
142	 */
143	checkWrite: function()
144	{
145		if($("#writeCheck").val()==0)
146		{
147			$("#contents").html("");
148			$('#contents').css({'font-size':'','color':''});
149			$("#writeCheck").val(1);
150		}
151	},
152	/**
153	 * 삭제 폼 로딩
154	 * @param {number|string} docOpinionSeq
155	 * @param {number|string} page
156	 * @param {string} target
157	 */
158	loadDeleteForm: function(docOpinionSeq, page, target) {
159		this.docOpinionSeq = docOpinionSeq;
160		this.page = page;
161		this.returnType = target;
162
163		Common.openWindow('/docOpinion/loadDeleteForm?docSeq='+this.docSeq+"&docOpinionSeq="+docOpinionSeq+'&returnType='+this.returnType + '&page=' + this.page, 300, 170, 'opinionDelete');
164	},
165	/**
166	 * 삭제요청 폼 로딩 (팝업)
167	 * @param {number|string} docSeq
168	 * @param {number|string} page
169	 * @param {number|string} docOpinionSeq
170	 * @param {string} target
171	 * @param {string} [requestConfirm]
172	 */
173	loadDeleteRequestLayerForm: function(docSeq, page, docOpinionSeq, target, requestConfirm) {
174		this.docSeq = docSeq;
175		this.page = page;
176		this.docOpinionSeq = docOpinionSeq;
177		this.returnType = target;
178
179		var param = 'docSeq='+ docSeq +'&docOpinionSeq='+docOpinionSeq+'&page='+page+'&returnType=' + target + '&requestConfirm='+((requestConfirm) ? requestConfirm : 'no');
180
181		$.get('/docOpinion/loadDeleteRequestLayerForm', param, function(data) {
182			Common.openLayerBox("div_opinionDeleteRequest", data, ((Common.isUrlMobileMode()) ? 300 : 460), 238, 'opinionDeleteRequestButton' + docOpinionSeq, true, 'left');
183		});
184	},
185
186	/**
187	 * 삭제 처리
188	 */
189	erase: function() {
190		if($('input[name=returnType]').length>0) this.returnType=$('input[name=returnType]').val();
191		if($('input[name=docSeq]').length>0) this.docSeq=$('input[name=docSeq]').val();
192		if($('input[name=page]').length>0) this.page=$('input[name=page]').val();
193		if($('input[name=docOpinionSeq]').length>0) this.docOpinionSeq=$('input[name=docOpinionSeq]').val();
194
195		var that = Opinion;
196		var param = {
197			docSeq: that.docSeq,
198			docOpinionSeq: that.docOpinionSeq,
199			returnType: that.returnType
200		};
201
202		$.ajax({
203			type:'POST',
204			dataType: 'json',
205			url:'/docOpinion/delete/',
206			async:false,
207			data: param,
208			success:function(json) {
209				if(json != null) {
210					if(json.error.code) {
211						alert(json.error.msg);
212					}
213					else {
214						if(that.returnType == 'view') {
215							window.close();
216							opener.location.reload();
217						} else {
218							document.location.reload();
219						}
220					}
221				}
222			},
223			error: function(xhr, status, error) {
224				Common.ajaxErrorProcess(xhr, status, error);
225			}
226		});
227	},
228	/**
229	 * 답변 삭제요청 폼 로딩
230	 * @deprecated
231	 * @param {number|string} docOpinionSeq
232	 * @param {number|string} page
233	 * @param {number|string} docOpinionAnswerSeq
234	 * @param {string} target
235	 */
236	loadAnswerForm: function(docOpinionSeq, page, docOpinionAnswerSeq, target) {
237		this.docOpinionSeq = docOpinionSeq;
238		this.returnType = target;
239		jQuery("a[name=opinionAnswerButton]").show();
240		jQuery("a[name=opinionAnswerCancelButton]").hide();
241		$.get('/docOpinion/loadAnswerForm', 'docSeq='+this.docSeq+"&docOpinionSeq="+docOpinionSeq+"&docOpinionAnswerSeq="+docOpinionAnswerSeq+"&kind=Update", function(data) {
242			if(data == "ParamError") {
243				alert("답변정보가 전송되지 않았습니다.");
244			}
245			else if(data == "LoginError") {
246				alert("로그인 후 이용하세요.");
247			}
248			else if(data == "AuthError") {
249				alert("권한이 없습니다.");
250			}
251			else {
252				jQuery("#opinionAnswerButton"+docOpinionSeq).hide();
253				jQuery("#opinionAnswerCancelButton"+docOpinionSeq).show();
254			}
255			$("#div_opinion_answer").remove();
256			$("<div id='div_opinion_answer' class='clear'></div>").html(data).appendTo($("#data_list_view_"+ docOpinionSeq + "" + docOpinionAnswerSeq));
257		});
258	},
259	/**
260	 * 버튼 스타일 리셋
261	 * @deprecated
262	 */
263	removeAnswerDiv: function(docOpinionSeq) {
264		$("#opinionAnswerCancelButton"+docOpinionSeq).hide();
265		$("#opinionAnswerButton"+docOpinionSeq).show();
266		$("#div_opinion_answer").remove();
267	},
268	/**
269	 * 삭제요청 처리 (팝업)
270	 */
271	deleteRequestLayer: function() {
272		var $obj = $('form[name="frm_opinion_delete_request"]');
273
274		var that = Opinion;
275		that.docSeq = $obj.find('input[name="docSeq"]').val();
276		that.docOpinionSeq = $obj.find('input[name="docOpinionSeq"]').val();
277		var contents = $obj.find('textarea[name="contents"]').val();
278		if($('input[name="returnType"]').length > 0) that.returnType = $obj.find('input[name="returnType"]').val();
279
280		if(contents == '') {
281			alert("삭제사유를 입력하세요");
282			return;
283		}
284
285		$.ajax({
286			type:'POST',
287			dataType: 'json',
288			url: '/docOpinion/deleteRequest',
289			async:false,
290			data: {
291				docSeq: that.docSeq,
292				docOpinionSeq:  that.docOpinionSeq,
293				contents: contents,
294				page: that.page,
295				returnType: that.returnType
296			},
297			success:function(json) {
298				if(json != null) {
299					if(json.error.code) {
300						alert(json.error.msg);
301					}
302					else {
303						Common.removeLayer("div_opinionDeleteRequest");
304
305						if(that.returnType == 'mypage') {
306							location.reload();
307						}
308						else if(that.returnType == 'view'){
309							that.DocDetail.list(that.docSeq, that.page, false);
310						}
311						else {
312							location.reload();
313						}
314					}
315				}
316			},
317			error: function(xhr, status, error) {
318				Common.ajaxErrorProcess(xhr, status, error);
319			}
320		});
321	},
322	/**
323	 * 답변 등록/수정
324	 */
325	answerInsert: function() {
326		var obj = null;
327		if($("#returnType").length > 0 && $("#returnType").val() == 'mypage')
328			obj = document.forms[arguments[0]];
329		else
330			obj = document.frm_opinionAnswer;
331
332		var contents = obj.contents.value;
333		var docSeq = obj.docSeq.value;
334		var docOpinionSeq = obj.docOpinionSeq.value;
335		var docOpinionAnswerSeq = obj.docOpinionAnswerSeq.value;
336		var kind = obj.kind.value;
337		this.returnType = $("#returnType").val();
338
339		if(contents == '') {
340			alert("답변을 입력하세요");
341			return;
342		}
343
344		// var param = "docSeq="+docSeq+"&docOpinionSeq="+docOpinionSeq+"&docOpinionAnswerSeq="+docOpinionAnswerSeq+"&kind="+kind+"&contents="+contents+"&returnType="+this.returnType;
345		var param = {
346			docSeq : docSeq,
347			docOpinionSeq : docOpinionSeq,
348			docOpinionAnswerSeq : docOpinionAnswerSeq,
349			kind : kind,
350			contents : contents,
351			returnType : this.returnType
352		};
353		$.ajax({
354			type:'POST',
355			dataType: 'json',
356			url: '/docOpinion/answerProcess',
357			async:false,
358			data: param,
359			success:function(json) {
360				if(json != null) {
361					if(json.error.code) {
362						alert(json.error.msg);
363					}
364					else {
365						if(Opinion.returnType == 'mypage' || Opinion.returnType == 'view')
366							location.reload();
367						else
368							Opinion.opinionLoad(docSeq, Opinion.page);
369					}
370				}
371			},
372			error: function(xhr, status, error) {
373				Common.ajaxErrorProcess(xhr, status, error);
374			}
375		});
376
377	},
378	/**
379	 * 삭제 폼 로딩
380	 * @deprecated
381	 */
382	loadAnswerDeleteForm: function(docSeq, docOpinionSeq, page, docOpinionAnswerSeq, target) {
383		this.docOpinionSeq = docOpinionSeq;
384		this.page = page;
385		this.returnType = target;
386		Common.openWindow('/docOpinion/loadAnswerDeleteForm?docSeq='+docSeq+"&docOpinionSeq="+docOpinionSeq+"&docOpinionAnswerSeq="+docOpinionAnswerSeq+"&page="+page+"&returnType="+this.returnType, 350, 180, 'opinionAnswerDeleteForm');
387	},
388	loadAnswerDeleteRequestLayerForm: function(docSeq, docOpinionSeq, page, docOpinionAnswerSeq, target){
389		this.docOpinionSeq = docOpinionSeq;
390		this.page = page;
391		this.returnType = target;
392
393		if($('#div_opinionAnswerDeleteRequest').length > 0){
394			$('#div_opinionAnswerDeleteRequest').remove();
395		}
396
397		var param = "docOpinionSeq="+docOpinionSeq;
398
399		$.ajax({
400			type: 'POST',
401			dataType: 'json',
402			url: '/docOpinion/getDocOpinionDelRequest',
403			async: false,
404			data: param,
405			success: function (json) {
406				if(json.result == 'true'){
407					var popupHtml = '<div class="popupFrame" style="border:1px solid #242d43;"><h1><img src="/images/document/2013/popup_t_seller_del.gif" alt="판매자 답변 삭제"/></h1>' +
408						'<span class="p_logo"><img src="/images/document/2013/popup_logo.gif" alt="HappyCampus"/></span>' +
409						'<div class="containerPopup"><form name="frm_delete_opinion_answer"><input type="hidden" name="returnType" id="returnType" value="' + target + '">' +
410						'<input type="hidden" name="docSeq" id="docSeq" value="' + docSeq + '"><input type="hidden" name="docOpinionAnswerSeq" value="' + docOpinionAnswerSeq + '">' +
411						'<input type="hidden" name="docOpinionSeq" value="' + docOpinionSeq + '"><input type="hidden" name="page" id="page" value="' + page + '"></form>' +
412						'<p class="p_top10">자료후기 삭제요청 중에는 답변 삭제가 불가능합니다.</p></div>' +
413						'<div class="cBtns"><img src="/images/document/2013/btn_p_confirm.gif" alt="확인" onclick="Common.closeLayerBox();return false;" style="cursor:pointer;" /> ' +
414						'</div></div>';
415				}else{
416					var popupHtml = '<div class="popupFrame" style="border:1px solid #242d43;"><h1><img src="/images/document/2013/popup_t_seller_del.gif" alt="판매자 답변 삭제"/></h1>' +
417						'<span class="p_logo"><img src="/images/document/2013/popup_logo.gif" alt="HappyCampus"/></span>' +
418						'<div class="containerPopup"><form name="frm_delete_opinion_answer"><input type="hidden" name="returnType" id="returnType" value="' + target + '">' +
419						'<input type="hidden" name="docSeq" id="docSeq" value="' + docSeq + '"><input type="hidden" name="docOpinionAnswerSeq" value="' + docOpinionAnswerSeq + '">' +
420						'<input type="hidden" name="docOpinionSeq" value="' + docOpinionSeq + '"><input type="hidden" name="page" id="page" value="' + page + '"></form>' +
421						'<p class="p_txt11 p_top10">답변을 <strong>삭제 </strong>하시겠습니까?</p></div>' +
422						'<div class="cBtns"><img src="/images/document/2013/btn_p_confirm.gif" alt="확인" onclick="Opinion.answerDelete();" style="cursor:pointer;" /> ' +
423						'<img src="/images/document/2013/btn_p_cancel.gif" alt="취소" onclick="Common.closeLayerBox();return false;" style="cursor:pointer;"/></div></div>';
424				}
425
426				Common.openLayerBox("div_opinionAnswerDeleteRequest", popupHtml, ((Common.isUrlMobileMode()) ? 300 : 460), 167, 'opinionAnswerDeleteRequestButton' + docOpinionAnswerSeq, true, 'right');
427			}
428		});
429
430
431
432
433	},
434	/**
435	 * 답변 삭제처리
436	 */
437	answerDelete: function() {
438		var that = Opinion;
439		var obj = document.frm_delete_opinion_answer;
440		if(jQuery('input[name=returnType]').length>0) this.returnType=jQuery('input[name=returnType]').val();
441		var docSeq = obj.docSeq.value;
442		var docOpinionSeq = obj.docOpinionSeq.value;
443		var docOpinionAnswerSeq = obj.docOpinionAnswerSeq.value;
444
445		var param = "docSeq="+docSeq+"&docOpinionSeq="+docOpinionSeq+"&docOpinionAnswerSeq="+docOpinionAnswerSeq+"&kind=Delete"+"&returnType="+that.returnType;
446
447		$.ajax({
448			type:'POST',
449			dataType: 'json',
450			url: '/docOpinion/answerProcess',
451			async:false,
452			data: param,
453			success:function(json) {
454				if(json != null) {
455					if(json.error.code) {
456						alert(json.error.msg);
457					}
458					else {
459						if(that.returnType == 'mypage' || that.returnType == 'view') {
460							location.reload();
461						}
462						else {
463							/*
464														Common.removeLayer("data_list_view_"+ docOpinionSeq + "" + docOpinionAnswerSeq);
465														Common.removeLayer("dot_line_"+ docOpinionSeq + "" + docOpinionAnswerSeq);
466							*/
467							$(opener.location).attr("href", "javascript:location.reload();");
468							window.close();
469						}
470						Common.removeLayer('div_opinionAnswerDeleteForm');
471					}
472				}
473			},
474			error: function(xhr, status, error) {
475				Common.ajaxErrorProcess(xhr, status, error);
476			}
477		});
478
479	},
480	/**
481	 * 레이어 토글
482	 * @param {string} layerId
483	 */
484	toggleLayer: function(layerId) {
485		$("#"+layerId).toggle();
486	},
487	/**
488	 * 나의 평가 보기
489	 * @param {number} boughtDocSeq
490	 * @param {number} docOpinionSeq
491	 * @param {string} [from]
492	 */
493	viewMyOpinion: function(boughtDocSeq, docOpinionSeq, from){
494		//from 값에 따라 처리 분리
495		var checkNewAnswer = false;
496		if (from == 'docOpinionList') {
497			Opinion.toggleLayer('opinionView' + boughtDocSeq + '_' + docOpinionSeq);
498			Opinion.toggleLayer('opinionAnswerView' + boughtDocSeq + '_' + docOpinionSeq);
499			if ($('#opinionNewAnswer' + docOpinionSeq).length > 0 && $('#opinionNewAnswer' + docOpinionSeq).val() == 'y') {
500				checkNewAnswer = true;
501			}
502		} else {
503			Opinion.toggleLayer('opinionView' + boughtDocSeq);
504			Opinion.toggleLayer('opinionAnswerView' + boughtDocSeq);
505			if ($('#newIcon' + docOpinionSeq).length > 0) {
506				checkNewAnswer = true;
507			}
508		}
509
510		if(checkNewAnswer) {
511			$.ajax({
512				url: '/docOpinion/setReadOpinionAnswer/',
513				type: "POST",
514				dataType: 'json',
515				data: {
516					docOpinionSeq: docOpinionSeq
517				},
518				success: function (json) {
519					if (json.errorMsg == 'success') {
520						$('#newIcon' + docOpinionSeq).remove();
521					}
522				},
523				error: function (xhr, status, error) {
524					Common.ajaxErrorProcess(xhr, status, error);
525				}
526			});
527		}
528	},
529	/**
530	 * 평가 가능한 상태인지 체크
531	 * @param {number} docSeq 자료번호
532	 * @return {null|{result: boolean, description: string}}
533	 */
534	checkBuyDownloadCheck: function (docSeq) {
535		var returnVar = null;
536
537		$.ajax({
538			url: '/mypage/buyDownloadCheck',
539			method: 'post',
540			data: {docSeq: docSeq},
541			dataType: 'json',
542			async: false,
543			cache: false,
544			success: function (result) {
545				returnVar = result;
546			}
547		});
548
549		return returnVar;
550	},
551	/**
552	 * 자료 평가 form 레이어 팝업 노출
553	 * @param {number|string} docSeq 자료 번호
554	 * @param {boolean} [noAlertMsg]
555	 * @param {string} type 불러오는 페이지
556	 */
557	showOpinionForm: function (docSeq,  noAlertMsg,type) {
558		if (typeof noAlertMsg == 'undefined') noAlertMsg = false;
559
560		var check = this.checkBuyDownloadCheck(docSeq);
561
562		if (check.result == true) {
563			$.ajax({
564				url: '/mypage/buyOpinion',
565				type: 'get',
566				dataType: 'json',
567				data: {docSeq: docSeq, type: type},
568				success: function (response) {
569					if (response.result == false) {
570						alert(response.description);
571						return false;
572					}
573
574					Common.openLayerBox("buyOpinionDiv", response.data.html, 488, 800, '', false);
575				}
576			});
577		} else {
578			// alert 메시지 출력 여부 설정
579			if( noAlertMsg != true ){
580				alert( check.description );
581			}
582		}
583	},
584	/**
585	 * 자료 상세 전용 코드
586	 * @type {Object}
587	 */
588	DocDetail: {
589		/**
590		 * 휴대폰 인증 회원 것만 볼지 여부
591		 * @type {boolean}
592		 */
593		filterMemberAuthPhone: false,
594		/**
595		 * 구매평가 리스트 출력
596		 * @param {number} docSeq 자료 번호
597		 * @param {number|string} page 페이지 번호
598		 * @param {boolean} [isAppend] 이미 존재하는 구매평가 리스트에 추가할지 여부
599		 * @return {boolean}
600		 */
601		list: function (docSeq, page, isAppend) {
602			var _that = Opinion;
603
604			_that.docSeq = docSeq;
605			if (typeof _that.docSeq == 'undefined' || _that.docSeq == '' || _that.docSeq == 0) return  false;
606			_that.page = (typeof page == 'undefined' || isNaN(parseInt(page))) ? 1 : parseInt(page);
607
608			$.ajax({
609				url: '/docOpinion/list/',
610				type: 'get',
611				method: 'get',
612				dataType: 'json',
613				data: {
614					docSeq: _that.docSeq,
615					page: _that.page,
616					idBlind: 'y',
617					limit: 3,
618					memberAuthPhone: (_that.DocDetail.filterMemberAuthPhone == true ? 'y' : 'n')
619				},
620				success: function (json) {
621					if (json == null) return false;
622					if (json.error.code) {
623						alert(json.error.msg);
624						return  false;
625					}
626
627					//set vars: html element
628					var _$opinionArea = $('#docOpinionArea');
629					if (!_$opinionArea.length) return false;
630					var _$opinionCount = _$opinionArea.find('#docOpinionCount');
631					var _$opinionList = _$opinionArea.find('#docOpinionList');
632					var _$btnMore = _$opinionArea.find('#btnDocOpinionMore');
633					if (!_$opinionCount.length || !_$opinionList.length || !_$btnMore.length) return  false;
634
635					//set vars: 전체 평가수, 평균 평가, 다음 페이지 번호
636					var _totalCount = json.totalCount;
637					var _next = json.next;
638
639					//등록된 평가 없으면 끝냄
640					if (_totalCount < 1) {
641						_$opinionCount.empty();
642						_$opinionList.empty().append('<p class="c_none">이 자료에 대해 작성된 후기가 없습니다.</p>');
643						_$btnMore.hide();
644						return false;
645					}
646
647					//등록된 평가 갯수 출력
648					_$opinionCount.html('(' + _totalCount + ')');
649
650					//더보기 버튼 관련 처리
651					if (typeof _next != 'undefined' && _next != '') {
652						_$btnMore.off('click');
653						_$btnMore.on('click', function (e) {
654							e.preventDefault();
655							Opinion.DocDetail.list(_that.docSeq, _next, true);
656						});
657						_$btnMore.show();
658					} else {
659						_$btnMore.hide();
660					}
661
662					//리스트 출력
663					var _html = '';
664					$(json.list).each(function (k, v) {
665						//판매자 답변 html 부분 구성
666						var _answerHtml = '';
667						if (v.isAnswer == 'y') {
668							$(v.answer).each(function (k2, v2) {
669								var _answerBtns = [];
670								if (json.ownerSeq == v.ownerSeq) {
671									_answerBtns.push('<a href="#" id="opinionAnswerModifyButton' + v.docOpinionSeq + '" onclick="Opinion.loadAnswerForm(' + v.docOpinionSeq + ', ' + page + ', ' + v2.docOpinionAnswerSeq + '); return false;">수정</a>');
672									_answerBtns.push('<a href="#" id="opinionAnswerDeleteButton' + v2.docOpinionAnswerSeq + '" onclick="Opinion.loadAnswerDeleteRequestLayerForm(' + docSeq + ', ' + v.docOpinionSeq + ', ' + page + ', ' + v2.docOpinionAnswerSeq + ', \'view\'); return false;">삭제</a>');
673								}
674
675								_answerHtml += '<div class="reply_txt">' +
676									// '	<span class="s_data"><span class="ico_a">답변</span><em>판매자</em>' + v2.regDate + '</span>' +
677									'	<span class="s_data"><em>판매자</em>' + v2.regDate + '</span>' +
678									(_answerBtns.length > 0 ? ('<span class="btn_reply">' + _answerBtns.join('ㅣ') + '</span>') : '') +
679									'	<p class="rp_comment" id="data_list_view_' + v.docOpinionSeq + v2.docOpinionAnswerSeq + '">' + v2.contents + '</p>' +
680									'</div>';
681							});
682						}
683
684						//버튼 html 구성
685						var _btns = [];
686						if (v.isDelete == 'y') {
687							_btns.push('<a href="#" id="opinionDeleteButton' + v.docOpinionSeq + '"  onclick="Opinion.loadDeleteForm(' + v.docOpinionSeq + ',' + page + ', \'view\');return false;">삭제</a>');
688						}
689
690						var _recommendHtml = '';
691						var _recommendBtn = '';
692						//if(Common.newDesign) {
693							if(v.recommendInfo.upCount > 0)
694								_recommendHtml = '<span class="recomm_t">추천<em>' + Common.numberFormat(v.recommendInfo.upCount) + '</em></span>';
695
696							if (json.isBuyer == 'yes' && json.ownerSeq != v.ownerSeq && json.currentMemberSeq > 0 && v.memberSeq != json.currentMemberSeq ) {
697								if(v.recommendInfo.myUpCount > 0) {
698									_recommendBtn = '<div class="btn_recomm"><a class="btn_like' + ((v.recommendInfo.myUpCount > 0) ? ' on' : '') + '" href="#" onclick="alert(\'이미 추천하셨습니다.\');return false;">추천</a>';
699								} else {
700									_recommendBtn = '<div class="btn_recomm"><a class="btn_like' + ((v.recommendInfo.myDownCount > 0) ? ' on' : '') + '" href="#" onclick="Opinion.DocDetail.recommendDocOpinion(' + v.docOpinionSeq + ', true);return false;">추천</a>';
701								}
702							}
703						//}
704
705						//각 구매평가별 html 구성
706						_html += "<li id='data_list_view_" + v.docOpinionSeq + "'>" +
707							"<div class='s_con'>" +
708							"<span class='grade_a'>" + v.pointStr + "</span>" +
709							"<span class='s_data'>" + v.memberIdHtml + v.regDate + "</span>" +
710							_recommendHtml +
711							(_btns.length > 0 ? ('<span class="btn_reply">' + _btns.join('ㅣ') + '</span>') : '') +
712							"</div>" +
713							($.trim(v.contents).length > 0 ? "<p class='s_comment' style='word-wrap: break-word;'>" + v.contents + "</p>" : '') + _recommendBtn + _answerHtml +
714							"</li>";
715					});
716
717					//출력 처리
718					if (isAppend == true) {
719						_$opinionList.find('ul.s_list').append(_html);
720					} else {
721						//if(Common.newDesign){
722							_html = '<ul class="s_list" style="border:none;">' + _html + '</ul>';
723						/*}
724						else{
725							_html = '<ul class="s_list">' + _html + '</ul>';
726						}*/
727						_$opinionList.empty();
728						_$opinionList.append(_html);
729					}
730				},
731				error: function(xhr, status, error) {
732					Common.ajaxErrorProcess(xhr, status, error);
733				}
734			});
735		},
736		/**
737		 * 구매평가 추천, 비추천
738		 * @param {number} docOpinionSeq
739		 * @param {boolean} isRecommend
740		 */
741		recommendDocOpinion: function(docOpinionSeq, isRecommend){
742			var recommendType = ((isRecommend) ? 'up' : 'down');
743			var recommendLabel = ((isRecommend) ? '추천' : '반대');
744			if(confirm(recommendLabel + ' 하시겠습니까?')) {
745				// 평가 가능한 상태인지 확인
746				$.ajax({
747					url: '/docOpinion/recommend',
748					method: 'POST',
749					data: {
750						docOpinionSeq: docOpinionSeq,
751						recommendType: recommendType
752					},
753					dataType: 'JSON',
754					success: function (json) {
755						if (json.errorMsg != '') {
756							alert(json.errorMsg);
757						} else {
758							Opinion.DocDetail.list(Opinion.docSeq, 1);
759						}
760					}
761				});
762			}
763		},
764		/**
765		 * 전체회원/인증회원 필터링 해서 리스트 볼지 설정
766		 * @param {boolean} flag 설정 여부
767		 */
768		setFilterMemberAuthPhone: function (flag) {
769			this.filterMemberAuthPhone = (flag === true);
770
771			var $opinionArea = $('#docOpinionArea');
772			if (this.filterMemberAuthPhone == true) {
773				$opinionArea.find('#docOpinionFilterAll').removeClass('on');
774				$opinionArea.find('#docOpinionFilterAuthPhone').addClass('on');
775			} else {
776				$opinionArea.find('#docOpinionFilterAll').addClass('on');
777				$opinionArea.find('#docOpinionFilterAuthPhone').removeClass('on');
778			}
779
780			this.list(Opinion.docSeq, 1, false);
781		}
782	}
783};
784

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.