40 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <div class="table-content">
 | |
| 	<div class="layui-card p-3 comment-list">
 | |
| 		<h4>项目评论</h4>
 | |
| 		<div class="comment-input my-2">
 | |
| 			<input type="text" id="commentInput" readonly placeholder="发表一下你的看法" class="layui-input" value="">
 | |
| 		</div>
 | |
| 		<div id="comment_project_{$id}"></div>
 | |
| 		
 | |
| 	</div>
 | |
| </div>
 | |
| 
 | |
| <script>
 | |
| function pageInit(){
 | |
| 	let detail_id = {$id};
 | |
| 	let comment = layui.gouguComment;
 | |
| 	//评论
 | |
| 	comment.load(detail_id,'project');
 | |
| 	$('#commentInput').on('click',function(){
 | |
| 		comment.editor(0,detail_id,0,0,'project','');
 | |
| 	})
 | |
| 	//回复
 | |
| 	$('#comment_project_'+detail_id).on('click','[data-event="replay"]',function(){
 | |
| 		let pid = $(this).data('id');
 | |
| 		let padmin_id = $(this).data('uid');
 | |
| 		comment.editor(0,detail_id,pid,padmin_id,'project','');
 | |
| 	})
 | |
| 	//编辑
 | |
| 	$('#comment_project_'+detail_id).on('click','[data-event="edit"]',function(){
 | |
| 		let id = $(this).data('id');
 | |
| 		let mdcontent=$('#comment_'+id).data('mdcontent');
 | |
| 		comment.editor(id,detail_id,0,0,'project',mdcontent);
 | |
| 	})
 | |
| 	
 | |
| 	//删除
 | |
| 	$('#comment_project_'+detail_id).on('click','[data-event="del"]',function(){
 | |
| 		let id = $(this).data('id');
 | |
| 		comment.del(id,detail_id,'project');
 | |
| 	})
 | |
| }		
 | |
| </script> |