<#-- 用户中心页 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="${baseURL}">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>用户中心页 - ${title}</title>
	<meta name="keywords" content="${keywords}"/>
	<meta name="description" content="${description}"/>
	<#-- 获取令牌 -->
	<meta name="csrfToken" content="${token}"/>
	<link rel="shortcut icon" type="image/x-icon" href="${baseURL}${commonPath}images/favicon.ico" media="screen" />
	<link href="${commonPath}css/common.css" type="text/css" rel="stylesheet">
	<link href="${commonPath}css/themify-icons/style.css" type="text/css" rel="stylesheet">
	<script language="javascript" src="${commonPath}js/tool.js" type="text/javascript"></script>
	<script language="javascript" src="${commonPath}js/ajax.js" type="text/javascript"></script>
	<script language="javascript" src="${commonPath}js/json2.js" type="text/javascript"></script>
	<script type="text/javascript" src="${commonPath}js/lodash.min.js" language="javascript" ></script>
	<script type="text/javascript" src="${commonPath}js/jquery/jquery.min.js" language="javascript"></script>
	<script type="text/javascript" src="${commonPath}js/jquery/jquery.letterAvatar.js" language="javascript"></script>
	<script type="text/javascript" src="${commonPath}js/jquery/readmore.min.js" language="javascript"></script>
	<link href="${commonPath}js/layer/skin/default/layer.css"  type="text/css" rel="stylesheet"/>
	<script type="text/javascript" src="${commonPath}js/layer/layer.js" language="javascript"></script>
	
	
	<script type="text/javascript" src="${commonPath}js/DPlayer/hls.min.js" language="javascript"></script>
	<script type="text/javascript" src="${commonPath}js/DPlayer/DPlayer.min.js" language="javascript"></script>
	
	<link href="${commonPath}js/prism/default-block/prism.css"  type="text/css" rel="stylesheet"/>
	<script type="text/javascript" src="${commonPath}js/prism/default-block/prism.js" language="javascript"></script>
	<script type="text/javascript" src="${commonPath}js/prism/default-block/clipboard.min.js" language="javascript"></script>
</head>
<body>


<#-- 引入页头 -->
<@include action="${newPublic_2}"/>
<div class="skeleton">
	<div class="main wrap" >
		<div class="user-home-header" style="width: 1205px;">
			<div class="avatarRing"></div>
			<div class="inner clearfix">
				<div class="avatar">
					<div class="img-box">
						<#if user.avatarName != null>
							<img src="${user.avatarPath}${user.avatarName}">
						<#else>
							<!--[if (IE)]><img src="${commonPath}images/min_avata.png"><![endif]-->
							<!--[if !(IE)]><!--><img width="140px" height="140px" avatar="${(user.nickname != null && user.nickname??) ?string(user.nickname , user.account)}" ><!--<![endif]-->
						</#if>
					</div>
					<div class="counts clearfix">
						<div class="point">
							<div class="num">
								<#if user.point != null>
									${user.point}
								<#else>
									0
								</#if>
							</div>
							<div class="sub">积分</div>
						</div>
						<div class="follows">
							<div id="followerCount" class="num">0</div>
							<div class="sub" >粉丝</div>
							<input type="hidden" id="_userName" value="${user.userName}"/>
						</div>
						<script language="javascript" type="text/javascript">
							//查询粉丝总数
							function queryFollowerCount(){
								//获取用户名称
								var userName = document.getElementById("_userName").value;
								get_request(function(value){
									if(value != ""){
										var data = JSON.parse(value);
								        document.getElementById("followerCount").innerHTML = data;
							        }
								},
									"queryFollowerCount?userName="+userName+"&timestamp=" + new Date().getTime(), true);
							}
							queryFollowerCount();
						</script>
						
					</div>
				</div>
				<div class="head-line">
					<div class="name">${user.account}</div>
					<#if user.gradeName != null>
						<div class="grade" >${user.gradeName}</div> 
					</#if>
				</div>
				<#if user.nickname != null && user.nickname??>
					<div class="nickname" >
						呢称：${user.nickname}
					</div> 
				</#if>
				<div class="role">
					<#list user.userRoleNameList as roleName>
						<i class="userRoleName">${roleName}</i>				
					</#list>
				</div>
				<#if user.id != null && user.id == -1>
					<div class="staff" >官方人员</div> 
				</#if>
				<#if user.ipAddress != null && user.ipAddress??>
					<div class="ipAddress" >
						<span><i class="cms-map-pin-line"></i> ${user.ipAddress}</span>
					</div> 
				</#if>
				<div class="clearfix"></div>
				<div class="action-button">
					<#if user.userName != null && user.userName != systemUser.userName>
						<#-- 引入关注用户 -->
						<@include action="${followRelated_addFollow_1}"/>
						
						<span class="privateMessageBox" >
							<button type="button" class="privateMessageButton" onClick="javascript:window.location.href='${baseURL}user/control/privateMessageChatList?friendUserName=${user.userName}'">发私信</button>
						</span>
					</#if>
				</div>
				
			</div>						
		</div>
		
		<#if user.userName == systemUser.userName>
		<div class="selfService clearfix">
			<div class="box">
				<ul class="ul">
					<li class="item">
						<a class="a-pic" href="user/control/userDynamicList" >
							<div class="img cms-pulse" ></div>
							<h4 class="title">我的动态</h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/topicList" >
							<div class="img cms-topic" ></div> 	
							<h4 class="title">我的话题</h4>
						</a>
					</li>
		            <li class="item">
						<a class="a-pic" href="user/control/commentList" >
							<div class="img cms-comment" ></div> 	
							<h4 class="title">我的评论</h4>
						</a>
					</li>
					<li class="item" >
						<a class="a-pic" href="user/control/replyList" >
							<div class="img cms-reply "></div> 
							<h4 class="title">我的回复</h4>	
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/questionList" >
							<div class="img cms-question-answer-line" ></div> 
							<h4 class="title">我的问题</h4>	
						</a>
					</li>
		            <li class="item">
						<a class="a-pic" href="user/control/answerList" >
							<div class="img cms-info-alt" ></div> 	
							<h4 class="title">我的答案</h4>
						</a>
					</li>
					<li class="item" >
						<a class="a-pic" href="user/control/answerReplyList" >
							<div class="img cms-reply " ></div> 	
							<h4 class="title">我的答案回复</h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/favoriteList" >
							<div class="img cms-favorites" ></div> 	
							<h4 class="title">收藏夹</h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/likeList" >
							<div class="img cms-thumb-up" ></div> 	
							<h4 class="title">点赞</h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/followList" >
							<div class="img cms-heart" ></div> 	
							<h4 class="title">关注</h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/followerList" >
							<div class="img cms-follower" ></div> 	
							<h4 class="title">粉丝</h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/privateMessageList" >
							<div class="img cms-email" ></div> 	
							<h4 class="title">私信<span id="privateMessage-badge" class="badge" style="position: absolute; top: -60px;  right:65px; display: none;"></span></h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/remindList" >
							<div class="img cms-bell" ></div> 	
							<h4 class="title">提醒<span id="remind-badge" class="badge" style="position: absolute; top: -60px;  right:65px; display: none;"></span></h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/systemNotifyList" >
							<div class="img cms-announcement" ></div> 
							<h4 class="title">系统通知<span id="systemNotify-badge" class="badge" style="position: absolute; top: -60px;  right:65px; display: none; "></span></h4>	
						</a>
					</li>
					<li class="item" onclick="">
						<a class="a-pic" href="user/control/membershipCardOrderList" >
							<div class="img cms-order" ></div> 	
							<h4 class="title">会员卡订单</h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/balance" >
							<div class="img cms-deposit" ></div> 	
							<h4 class="title">余额</h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/giveRedEnvelopeList" >
							<div class="img cms-redEnvelope-2" ></div> 
							<h4 class="title">发红包</h4>	
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/receiveRedEnvelopeList" >
							<div class="img cms-redEnvelope-2" ></div> 
							<h4 class="title">收红包</h4>	
						</a>
					</li>
		            <li class="item">
						<a class="a-pic" href="user/control/editUser" >
							<div class="img cms-pencil-alt" ></div> 
							<h4 class="title">修改个人资料</h4>	
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/realNameAuthentication" >
							<div class="img cms-realNameAuthentication" ></div> 
							<h4 class="title">绑定手机</h4>	
						</a>
					</li>
					 <li class="item">
						<a class="a-pic" href="user/control/reportList" >
							<div class="img cms-error-warning-line" ></div> 	
							<h4 class="title">举报</h4>
						</a>
					</li>
		            <li class="item">
						<a class="a-pic" href="user/control/point" >
							<div class="img cms-point" ></div> 	
							<h4 class="title">积分日志</h4>
						</a>
					</li>
					<li class="item">
						<a class="a-pic" href="user/control/userLoginLogList" >
							<div class="img cms-log" ></div> 	
							<h4 class="title">登录日志</h4>
						</a>
					</li>
				</ul>
			</div>
		</div>
		</#if>
		
		<#if user.userName != systemUser.userName>
		<!-- 动态 -->
		<div id="home-userDynamic" class="home-userDynamic" style="width: 1205px;">
		
		</div>
		<!-- 动态内容加载中 -->
		<div id="load" class="loader" style="display: none;">加载中，请稍后...</div>
		</#if>
		<input type="hidden" id="commonPath" value="${commonPath}"/>
		<!-- 是否登录 -->
		<input type="hidden" id="unhide_isLogin" value="<#if systemUser != null>true<#else>false</#if>">
			
		
		<script type="text/javascript">
			//创建动态列表
			function createUserDynamicList(pageView){
				var html = "";
				var commonPath = document.getElementById("commonPath").value;
				
				if( pageView.records != null && pageView.records.length >0){
					html += "<div class='userDynamicModule' >";
					html += 	"<ol class='userDynamicList'>";
					for(var i = 0; i<pageView.records.length; i++){
						var userDynamic =pageView.records[i];
						
						html += "<div class='userDynamic'>";
						html += 	"<div class='userDynamic-author'>";
						html += 		"<a href='user/control/home?userName="+_.escape(userDynamic.userName)+"'>";
						if(userDynamic.avatarName != null && userDynamic.avatarName != ''){
							html += "<img src='"+userDynamic.avatarPath+"100x100/"+userDynamic.avatarName+"' >";
						}else{
					
							html += "<!--[if (IE)]><img src='"+commonPath+"images/min_avata.png'><![endif]-->";
						
							if(userDynamic.nickname != null && userDynamic.nickname != ''){
								html += "<!--[if !(IE)]><!--><img avatar='"+_.escape(userDynamic.nickname)+"' ><!--<![endif]-->";
							}else{
								html += "<!--[if !(IE)]><!--><img avatar='"+userDynamic.account+"' ><!--<![endif]-->";
							}

						}
						html += "";
						html += "";
						html += 		"<cite>";
						html += 			"<a class='userName' href='user/control/home?userName="+userDynamic.userName+"'>";
						if(userDynamic.nickname != null && userDynamic.nickname != ''){
							html += _.escape(userDynamic.nickname);
						}else{
							html += userDynamic.account;
						}
						html += 			"</a>";
						html += 		"</cite> ";
						html += 	"</div>";		
						html += 	"<div class='userDynamicTime'>"+userDynamic.postTime+"</div>";			
						html += 	"<div class='topicTitle'>";
						if(userDynamic.module == 100){
							html += "<span class='info'>发表了话题</span>";	
							html += 		"<a href='thread?topicId="+userDynamic.topicId+"'>"+_.escape(userDynamic.topicTitle)+"</a>";
						}else if(userDynamic.module == 200){
							html += "<span class='info'>评论了话题</span>";	
							html += 		"<a href='thread?topicId="+userDynamic.topicId+"'>"+_.escape(userDynamic.topicTitle)+"</a>";
						}else if(userDynamic.module == 300){
							html += "<span class='info'>引用了话题</span>";
							html += 		"<a href='thread?topicId="+userDynamic.topicId+"'>"+_.escape(userDynamic.topicTitle)+"</a>";	
						}else if(userDynamic.module == 400){
							html += "<span class='info'>回复了话题</span>";
							html += 		"<a href='thread?topicId="+userDynamic.topicId+"'>"+_.escape(userDynamic.topicTitle)+"</a>";	
						}else if(userDynamic.module == 500){
							html += "<span class='info'>提交了问题</span>";
							html += 		"<a href='question?questionId="+userDynamic.questionId+"'>"+_.escape(userDynamic.questionTitle)+"</a>";	
						}else if(userDynamic.module == 600){
							html += "<span class='info'>回答了问题</span>";	
							html += 		"<a href='question?questionId="+userDynamic.questionId+"'>"+_.escape(userDynamic.questionTitle)+"</a>";	
						}else if(userDynamic.module == 700){
							html += "<span class='info'>回复了问题</span>";	
							html += 		"<a href='question?questionId="+userDynamic.questionId+"'>"+_.escape(userDynamic.questionTitle)+"</a>";	
						}
						
						
						for(var j = 0; j<userDynamic.allowRoleViewList.length; j++){
							var roleName = userDynamic.allowRoleViewList[j];
							html += 	"\n<i class='topicRoleName'>"+_.escape(roleName)+"</i>";//\n换行为了兼容display: inline-block;属性产生的元素间间距
						
						}
						
						for (var key in userDynamic.hideTagTypeMap) {  
            				var flag = userDynamic.hideTagTypeMap[key];
            				html += "<span class='hideTagType hide_"+key+"' data='"+key+"'>";	
            				if(flag == true){
            					html += "<span class='circle point'><i class='cms-unlock-solid' ></i></span>";	
            				}else{
            					html += "<span class='circle'><i class='cms-lock-solid' ></i></span>";	
            				}
            				
           					html += "</span> ";	
						}
				
						html += 	"</div>";	
						if(userDynamic.module == 100){
							html += "<div class='topicContent' topicId='"+userDynamic.topicId+"' >"+userDynamic.topicContent+"</div>";
						}
						if(userDynamic.module == 200){
							html += "<div class='topicContent' >"+userDynamic.commentContent+"</div>";
						}
						if(userDynamic.module == 300){
							html += "<div id='quoteModuleContent' >";	
							html += 	"<div class='commentContent' >"+userDynamic.commentContent+"</div>";	
							html += 	"<div class='quoteContent'>";
							html += 		"<div class='text'>";
							html += 			userDynamic.quoteCommentContent;
							html += 		"</div>";	
							html += 	"</div>";		
							html += "</div>";	
						}
						if(userDynamic.module == 400){
							html += "<div class='replyContent' >"+userDynamic.replyContent+"</div>";	
						}
						if(userDynamic.module == 500){
							html += "<div class='topicContent' >"+userDynamic.questionContent+"</div>";
						}
						if(userDynamic.module == 600){
							html += "<div class='topicContent' >"+userDynamic.answerContent+"</div>";
						}
						if(userDynamic.module == 700){
							html += "<div class='replyContent' >"+userDynamic.answerReplyContent+"</div>";	
						}
						html += "<div class='clearfix'></div>";
						html += "<div class='tipBottom'>";	
						html += 	"<span class='a-toolbar'>";
						
						
						
						
						if(userDynamic.module == 100){
							html += "<a href='thread?topicId="+userDynamic.topicId+"' target='_blank' >查看原文</a>";	

							html += "<span >"+userDynamic.topicViewTotal+"次阅读</span>";	
							html += "<span >"+userDynamic.topicCommentTotal+"个评论</span>";	
							html += "<span id='favoriteCount_"+userDynamic.topicId+"'>0人收藏</span>";	
							html += "<span id='likeCount_"+userDynamic.topicId+"'>0人赞</span>";	
						}else if(userDynamic.module == 200){
							html += "<a href='thread?topicId="+userDynamic.topicId+"&commentId="+userDynamic.commentId+"'  target='_blank' >查看原文</a>";	
						}else if(userDynamic.module == 300){
							html += "<a href='thread?topicId="+userDynamic.topicId+"&commentId="+userDynamic.commentId+"'  target='_blank' >查看原文</a>";	
						}else if(userDynamic.module == 400){
							html += "<a href='thread?topicId="+userDynamic.topicId+"&commentId="+userDynamic.commentId+"'  target='_blank' >查看原文</a>";	
						}else if(userDynamic.module == 500){
							html += "<a href='question?questionId="+userDynamic.questionId+"' target='_blank' >查看原文</a>";
							html += "<span >"+userDynamic.questionViewTotal+"次阅读</span>";	
							html += "<span >"+userDynamic.questionAnswerTotal+"个回答</span>";
							html += "<span id='questionFavoriteCount_"+userDynamic.questionId+"'>0人收藏</span>";		
						}else if(userDynamic.module == 600){
							html += "<a href='question?questionId="+userDynamic.questionId+"&answerId="+userDynamic.answerId+"'  target='_blank' >查看原文</a>";	
						}else if(userDynamic.module == 700){
							html += "<a href='question?questionId="+userDynamic.questionId+"&answerId="+userDynamic.answerId+"'  target='_blank' >查看原文</a>";
						}
						html += 	"</span>";
						html += "</div>";	
						html += "</div>";
						
					}
					html += 	"</ol>";
					html += "</div>";
				}
				//document.getElementById("home-userDynamic").innerHTML = html;
				$("#home-userDynamic").append(html);
				
				setTimeout(function () {
					//生成头像
					LetterAvatar.transform();
				
				
					if(pageView.records != null && pageView.records.length >0){
						for(var i = 0; i<pageView.records.length; i++){
							var userDynamic =pageView.records[i];
							if(userDynamic.module == 100){
								queryFavoriteCount(userDynamic.topicId);
								queryLikeCount(userDynamic.topicId);
							}
							if(userDynamic.module == 500){
								queryQuestionFavoriteCount(userDynamic.questionId);
							}
						}
					}
				}, 100);
					
				
			}
	
			//查询话题用户收藏总数
			function queryFavoriteCount(topicId){	
				get_request(function(value){
					if(value != ""){
						var data = JSON.parse(value);
			        	document.getElementById("favoriteCount_"+topicId).innerHTML = data+"人收藏";
			        }
				},
					"queryFavoriteCount?topicId="+topicId+"&timestamp=" + new Date().getTime(), true);
								           
			}
			//查询话题用户点赞总数
			function queryLikeCount(topicId){	
				get_request(function(value){
					if(value != ""){
						var data = JSON.parse(value);
			        	document.getElementById("likeCount_"+topicId).innerHTML = data+"人赞";
			        }
				},
					"queryLikeCount?topicId="+topicId+"&timestamp=" + new Date().getTime(), true);
								           
			}
			//查询问题用户收藏总数
			function queryQuestionFavoriteCount(questionId){	
				get_request(function(value){
					if(value != ""){
						var data = JSON.parse(value);
			        	document.getElementById("questionFavoriteCount_"+questionId).innerHTML = data+"人收藏";
			        }
				},
					"queryQuestionFavoriteCount?questionId="+questionId+"&timestamp=" + new Date().getTime(), true);
								           
			}
			
			
			// 获取随机数
			function getRandom(m) {
				//生成的随机数截取m位，生成的随机数最大不超过13位，能保证首位不为0
			    m = m > 13 ? 13 : m;
		    	var num = Math.random().toString();
		    	if(num.substr(num.length - m, 1) === '0') {           
		    		return getRandom(m);
		    	}
				return num.substring(num.length - m);
			}
			//设置隐藏标签界面
			function setHideTagUI(){
				//获取<hide>标签属性
				$(".topicContent").find("hide").each(function(){
					var random = getRandom(13);
		
					//等级名称
					var gradeName = $(this).attr("description");
					var hideType = $(this).attr("hide-type");
					
					//话题Id
					var topicId = $(this).parents(".topicContent").attr("topicId");//找到父级元素属性
					
					var inputValue = $(this).attr("input-value");
					if(hideType == '10'){
						var html = "";
						html += '<div class="hide-box">';
						html += 	'<div class="background-image cms-lock-solid-2"></div>';
						html += 	'<div class="background-prompt">此处内容已被隐藏，输入密码可见</div>';
						html += 	'<div class="input-box">';
						html += 		'<input type="password" id="hide_password_'+random+'" class="text" maxlength="30"  placeholder="密码" value="">';
						html += 		'<div class="button" onclick="topicUnhide(10,'+random+','+topicId+');">提交</div>';
						
						html += 	'</div>';
						html += '</div>';
	 					$(this).html(html);
					}else if(hideType == '20'){
						var html = "";
						html += '<div class="hide-box">';
						html += 	'<div class="background-image cms-lock-solid-2"></div>';
						html += 	'<div class="background-prompt">此处内容已被隐藏，评论话题可见</div>';
						html += '</div>';
	 					$(this).html(html);
					}else if(hideType == '30'){
						var html = "";
						html += '<div class="hide-box">';
						html += 	'<div class="background-image cms-lock-solid-2"></div>';
						html += 	'<div class="background-prompt">此处内容已被隐藏，等级达到‘'+_.escape(gradeName)+'’可见</div>';
						html += '</div>';
	 					$(this).html(html);
					}else if(hideType == '40'){
						var html = "";
						html += '<div class="hide-box">';
						html += 	'<div class="background-image cms-lock-solid-2"></div>';
						html += 	'<div class="background-prompt">此处内容已被隐藏，支付 '+inputValue+' 积分可见</div>';
						html += 	'<div class="submit-box">';
						html += 		'<div class="button" onclick="topicUnhide(40,'+random+','+topicId+');">立即购买</div>';
						
						html += 	'</div>';
	 					$(this).html(html);
					}else if(hideType == '50'){
						var html = "";
						html += '<div class="hide-box">';
						html += 	'<div class="background-image cms-lock-solid-2"></div>';
						html += 	'<div class="background-prompt">此处内容已被隐藏，支付￥<span class="highlight">'+inputValue+' </span>元可见</div>';
						html += 	'<div class="submit-box">';
						html += 		'<div class="button" onclick="topicUnhide(50,'+random+','+topicId+');">立即购买</div>';
						
						html += 	'</div>';
	 					$(this).html(html);
					}
				})
			
			}
			//话题取消隐藏
			function topicUnhide(hideType,random,topicId){
			
				//判断是否已登录
				var isLogin = document.getElementById("unhide_isLogin").value;
				if(isLogin == "false"){
					layer.open({
					    type: 1, 
					    title:"提示",
					    content: "<div style='line-height: 36px; font-size: 15px;text-align:center; margin-left: 8px;margin-right: 8px;'>请先登录</div>", 
					    area: ['260px', '120px'],//宽高
						success: function(layero, index){
							 
						}
					});
					return false;
				}
		
			
				var confirm_index = layer.confirm('是否确认解锁？', {
					btn: ['解锁','取消'] //按钮
				}, function(){//解锁
					layer.close(confirm_index); //关闭层
					var parameter = "";
					parameter += "&topicId="+topicId;//话题Id
					
					parameter += "&hideType="+hideType;//隐藏类型
				
					if(hideType == 10){//输入密码可见
						
						var password = $.trim($('#hide_password_'+random).val());
						if(password == ""){
							layer.open({
							    type: 1, 
							    title:"提示",
							    content: "<div style='line-height: 36px; font-size: 15px;text-align:center; margin-left: 8px;margin-right: 8px;'>密码不能为空</div>", 
							    area: ['260px', '120px'],//宽高
								end: function(layero, index){
									
								}
							});
							return;
						}
						parameter += "&password="+encodeURIComponent(password);//获取URL参数
					
					}
					//从meta标签获取令牌
					parameter += "&token="+getCsrf();
					//删除第一个&号,防止因为多了&号而出现警告: Parameters: Invalid chunk ignored.信息
					if(parameter.indexOf("&") == 0){
						parameter = parameter.substring(1,parameter.length);
					}
				   	post_request(function(value){
						var data = JSON.parse(value);
						for(var returnValue in data){
							
							if(returnValue == "success"){
			        			if(data[returnValue] == "true"){
			        				//需引入layer
			        				layer.msg('话题取消隐藏成功，5秒后自动刷新页面', 
										{
										  time: 5000 //3秒关闭（如果不配置，默认是3秒）
										},function(){
											//关闭后的操作
											//刷新页面
								        	document.location.reload();
										}
									);
			        				
			        				
			        			}
			        		}else if(returnValue == "error"){
			        			
			        			var errorValue = data[returnValue];
								var htmlValue = "";
								var i = 0;
								for(var error in errorValue){
									if(error != ""){	
										i++;
										htmlValue += "&nbsp;&nbsp;"+i+"、"+errorValue[error]+"<br>";
									}
								}
								
								layer.open({
								  type: 1,
								  title: '错误', 
								  skin: 'layui-layer-rim', //加上边框
								  area: ['300px', '150px'], //宽高
								  content: "<div style='line-height: 36px; font-size: 15px;text-align:left; margin-left: 8px;margin-right: 8px;'>"+htmlValue+"</div>"
								});
			        		}
			        	}
					},
						"user/control/topic/unhide?timestamp=" + new Date().getTime(), true,parameter);
					
				}, function(){//取消
					
				});
			}
			
			
			//查询动态列表
			function queryUserDynamicList(callback,page){	
				var userName = getUrlParam("userName");//从URL中获取
				if(userName != ""){
					//查询用户动态
			        $.ajax({
						type:"GET",
						cache:false,
						async: true,//默认值: true。默认设置下，所有请求均为异步请求。如果需要发送同步请求，请将此选项设置为 false。
						url : "user/control/userDynamicList?userName="+userName+"&page="+page,
						//data: data, 
						success:function(result) {
							if(result.records != null && result.records.length >0){
								//创建动态内容
								createUserDynamicList(result);
								
								setTimeout(function () {	
									setHideTagUI();
									//设置播放器标签
									setPlayerTag();
									
									//代码高亮
									codeHighlight();
									
									//隐藏高度超过100px的内容
									$('.topicContent,#quoteModuleContent').readmore({
										speed: 100,//速度
										collapsedHeight: 200,//默认高度
										moreLink: '<a href="" class="readMore">阅读全文</a>',
										lessLink: '<a href="" class="readMore">收起</a>',
										afterToggle: function(trigger, element, expanded) {
											console.log();
											if(expanded){//收缩
												element.next().addClass('shrinkMore');
												element.next().removeClass('readMore');
											}else{//展开
												element.next().addClass('readMore');
												element.next().removeClass('shrinkMore');
											}
										}
									});
								}, 100);
								
								//回调
								callback(); 
							}
							
						},
						beforeSend: function(request){
					    	$("#load").show();
					    },
					    complete: function(XMLHttpRequest, textStatus){
					    	$("#load").hide();
					    }
					});
				}	
			
			}
			
			
			$(document).ready(function () {
				if(document.getElementById("home-userDynamic") != null){
					//页码
					var page = 1;
					//滚动到底部触发翻页
					var stop = false;//触发开关，防止多次调用事件  
					
					
					queryUserDynamicList(function(){
						stop = true;  
					},page);
					
					
					
					$(window).scroll(function() {    
						//当内容滚动到底部时加载新的内容 100为当距离最底部100个像素时开始加载.  
						if ($(this).scrollTop() + $(window).height() + 100 >= $(document).height() && $(this).scrollTop() > 100) {   
							if(stop == true){ 
								stop = false;
								page++;//当前要加载的页码 
								queryUserDynamicList(function(){
									stop = true;  
								},page);
						    }  
						}    
					}); 
				}
			});
		</script>
		
		
		<script type="text/javascript">
			// 获取随机数
			function getRandom(m) {
				//生成的随机数截取m位，生成的随机数最大不超过13位，能保证首位不为0
			    m = m > 13 ? 13 : m;
			   	var num = Math.random().toString();
			   	if(num.substr(num.length - m, 1) === '0') {           
			   		return getRandom(m);
			   	}
				return num.substring(num.length - m);
			}
			
			//设置播放器标签
			function setPlayerTag(){
				//获取<player>标签属性
				$(".topicContent").find("player").each(function(){
					var random = getRandom(13);
					var id = "player_"+random;
					var url = $(this).attr("url");
					var cover = $(this).attr("cover");//封面
					var thumbnail = $(this).attr("thumbnail");//缩略图
					//设置Id
					$(this).attr("id",id);
									
					if(cover != undefined && cover != ""){
						var node = '<img class="cover" src="'+cover+'"/><span class="buttonCircle"><span class="iconBox"><i class="cms-control-play playIcon"></i></span></span>';
					
						$(this).append(node);
					}else{
						var node = '<span class="buttonCircle"><span class="iconBox"><i class="cms-control-play playIcon"></i></span></span>';
					
						$(this).append(node);
					}
					
					
					
					$(this).click(function(){
						$(this).unbind('click');//解绑事件
						
						if(url == ""){//如果视频处理中
							var dp = new DPlayer({
				         		container: document.getElementById(id),//播放器容器元素
				         		screenshot: false,//开启截图，如果开启，视频和视频封面需要开启跨域
				         		video: {
				         			    
				         		}
				         	});
							insertProcess(id);
						}else{
							if(cover != undefined && cover != "" && thumbnail != undefined && thumbnail != ""){//切片视频
								var dp = new DPlayer({
									container: document.getElementById(id),//播放器容器元素
									screenshot: false,//开启截图，如果开启，视频和视频封面需要开启跨域
									hotkey: true,
									preload: 'none', //禁止视频预加载
									video: {
									    url: url,
									    type: 'hls',
									    pic: cover,//视频封面
									    thumbnails: thumbnail//视频预览图
									}
								});
								dp.play();//播放视频
							
							}else{
								var dp = new DPlayer({
			            			container: document.getElementById(id),//播放器容器元素
			            			screenshot: false,//开启截图，如果开启，视频和视频封面需要开启跨域
			            			
			            			video: {
			            			    url: url
			            			}
			            		});
			            		dp.play();//播放视频
							}
						}
					});
				})
			}
			//插入处理提示层
			function insertProcess(id){
				$("#"+id).prepend("<div class='dplayer-process'><div class='box'><div class='prompt'>视频处理中，请稍后再刷新</div></div></div>");
			}
		
		</script>
		
		<!-- 代码高亮显示 -->
		<script type="text/javascript">
			//代码语言类
			function languageClassName(originalClass, newClass) {
				var o = new Object()
				o.originalClass = originalClass;//原始样式标签名称
				o.newClass = newClass;//新样式标签名称
				return o;
			}
			//代码高亮
			function codeHighlight(){
			    //代码语言映射集合
			    var languageMapping_arr = new Array();
				var languageClassName_xml = languageClassName("lang-xml","language-xml");
			    languageMapping_arr.push(languageClassName_xml);
			    var languageClassName_css = languageClassName("lang-css","language-css");
			    languageMapping_arr.push(languageClassName_css);
			    var languageClassName_html = languageClassName("lang-html","language-html");
			    languageMapping_arr.push(languageClassName_html);
			    var languageClassName_js = languageClassName("lang-js","language-JavaScript");
			    languageMapping_arr.push(languageClassName_js);
			    var languageClassName_java = languageClassName("lang-java","language-java");
			    languageMapping_arr.push(languageClassName_java);
			    var languageClassName_pl = languageClassName("lang-pl","language-perl");
			    languageMapping_arr.push(languageClassName_pl);
			    var languageClassName_py = languageClassName("lang-py","language-python");
			    languageMapping_arr.push(languageClassName_py);
			    var languageClassName_rb = languageClassName("lang-rb","language-ruby");
			    languageMapping_arr.push(languageClassName_rb);
			    var languageClassName_go = languageClassName("lang-go","language-Go");
			    languageMapping_arr.push(languageClassName_go);  
			    var languageClassName_cpp = languageClassName("lang-cpp","language-C++");
			    languageMapping_arr.push(languageClassName_cpp);  
			    var languageClassName_cs = languageClassName("lang-cs","language-C#");
			    languageMapping_arr.push(languageClassName_cs);  
			    var languageClassName_bsh = languageClassName("lang-bsh","language-Bash + Shell");
			    languageMapping_arr.push(languageClassName_bsh);  
			      
			    
			    var doc_pre = $(".topicContent").find('pre[class^="prettyprint"]');
			    doc_pre.each(function(){
			        var class_val = $(this).attr('class');
			      	var lan_class = "";
			        var class_arr = new Array();
			        class_arr = class_val.split(' ');
			        for(var i=0; i<class_arr.length; i++){
			        	var className = $.trim(class_arr[i]);
			        	
			        	if(className != null && className != ""){
			        		if (className.lastIndexOf('lang-', 0) === 0) {
			        			lan_class = className;
					            break;
					        }
			        	}	
			        }
			        
			        for(var i=0; i<languageMapping_arr.length; i++){
				    	var languageMapping = languageMapping_arr[i];
				    	if(languageMapping.originalClass == lan_class){
					    //	var pre_content = '<code>'+$(this).html()+'</code>';
					        $(this).html($(this).html());
					        $(this).attr("class",'line-numbers '+languageMapping.newClass);
				    	}
				    }
				    if(lan_class == ""){
				    //	var pre_content = '<code>'+$(this).html()+'</code>';
					    $(this).html($(this).html());
					    $(this).attr("class",'line-numbers language-markup');
				    }
				    
				    var code = $(this).find('code')[0];
				    if(code !=undefined){
				    	//渲染
				    	Prism.highlightElement(code, false, function(){});
				    }
				 	
			    });
			}
		</script>
	</div>
</div>



<#-- 引入页脚 -->
<@include action="${newPublic_3}"/>


</body></html>