ソースを参照

공지사항 조회수 갱신 추가

gagamel 4 年 前
コミット
3f04b1e27b

+ 1 - 2
src/main/java/com/style24/front/biz/web/TsfCallcenterController.java

@@ -164,9 +164,8 @@ public class TsfCallcenterController extends TsfBaseController {
 	 */
 	@PostMapping("/notice/readcount/update/{noticeSq}")
 	@ResponseBody
-	public GagaResponse updateNoticeReadCount(@PathVariable Integer noticeSq) {
+	public void updateNoticeReadCount(@PathVariable Integer noticeSq) {
 		noticeService.updateNoticeReadCount(noticeSq);
-		return super.ok();
 	}
 
 	/**

+ 13 - 1
src/main/webapp/WEB-INF/views/mob/callcenter/NoticeFormMob.html

@@ -76,7 +76,7 @@
 			$.each(result.dataList, function(idx, item) {
 				let tag = '<li>\n';
 				tag += '	<div class="fold_head">\n';
-				tag += '		<a href="javascript:void(0)">\n';
+				tag += '		<a href="javascript:void(0)" onclick="fnUpdateFaqReadCount(' + item.noticeSq + ', this);">\n';
 				tag += '			<div>\n';
 				tag += '				<div class="fold_tit">\n';
 				tag += '					<div class="lap1">\n';
@@ -160,6 +160,18 @@
 // 			}
 // 		}
 	}
+	
+	// 조회수 갱신
+	let fnUpdateFaqReadCount = function(noticeSq, obj) {
+		if (!($(obj).parents('.fold_head').hasClass('on'))) {
+			$.post('/callcenter/notice/readcount/update/' + noticeSq
+					, null
+					, function() {
+						// Do nothing
+					}
+					, 'json');
+		}
+	}
 /*]]>*/
 </script>
 

+ 13 - 1
src/main/webapp/WEB-INF/views/web/callcenter/NoticeFormWeb.html

@@ -108,7 +108,7 @@
 				}
 				
 				tag += '	<div class="fold_head">\n';
-				tag += '		<a href="javascript:void(0)">\n';
+				tag += '		<a href="javascript:void(0)" onclick="fnUpdateFaqReadCount(' + item.noticeSq + ', this);">\n';
 				tag += '			<div>\n';
 				
 				if (item.urgentYn == 'Y') {
@@ -149,6 +149,18 @@
 		// Create pagination
 		gagaPaging.createPagination(result.paging.pageable);
 	}
+	
+	// 조회수 갱신
+	let fnUpdateFaqReadCount = function(noticeSq, obj) {
+		if (!($(obj).parents('.fold_head').hasClass('on'))) {
+			$.post('/callcenter/notice/readcount/update/' + noticeSq
+					, null
+					, function() {
+						// Do nothing
+					}
+					, 'json');
+		}
+	}
 /*]]>*/
 </script>