renzheng %!s(int64=9) %!d(string=hai) anos
pai
achega
b85e8655f7

+ 4 - 3
core/src/qfw/front/webcentent.go

@@ -193,7 +193,7 @@ func (n *Newscont) viewContent4Front(_id string, temp string) error {
 	if ret := redis.Get("other", n.Url()); ret != nil {
 		return n.SetBody([]byte(ret.(string)))
 	} else {
-		r := elastic.GetByIdField("content", "content", _id, `"_id","s_title","l_createdate","s_pic","s_author","s_editorname","s_contenttype","praise","releasetime","s_subcontent","s_url","s_content","s_source","s_keywords","s_description"`)
+		r := elastic.GetByIdField("content", "content", _id, `"_id","s_title","l_createdate","s_pic","s_author","s_editorname","s_contenttype","praise","releasetime","s_subcontent","s_url","s_content","s_source","s_keywords","s_description","s_contenttype"`)
 		//r := mongodb.FindById("content", _id, `{"_id":1,"s_title":1,"l_createdate":1,"s_editorname":1,"s_contenttype":1,"s_content":1,"s_source":1}`)
 		if nil != r {
 			var i = 0
@@ -234,7 +234,8 @@ func (n *Newscont) viewContent4Front(_id string, temp string) error {
 			if len(author) < 1 {
 				(*r)["s_author"] = ""
 			}
-
+			hotnews := elastic.GetPage("content", "content", `{"s_contenttype": "qykb"}`, `{"praise":-1}`, `{"_id":1,"s_title":1,"praise":1}`, 0, 10)
+			(*r)["hotnews"] = hotnews
 			n.T = *r
 			(*r)["s_content"] = template.HTML((*r)["s_content"].(string))
 			content, _ := n.Render4Cache(temp, &n.T)
@@ -351,7 +352,7 @@ func (n *Newscont) Webregulationscontent(_id string) error {
 			data_7 := (*r)["l_fetchdate"]
 			(*r)["l_fetchdate"] = util.FormatDateWithObj(&data_7, util.Date_Full_Layout)
 			(*r)["s_content"] = template.HTML((*r)["s_content"].(string))
-			content, _ := n.Render4Cache("/manage/webcontent-new.html", &n.T)
+			content, _ := n.Render4Cache("/manage/webcontent.html", &n.T)
 			redis.Put("other", n.Url(), string(content), -1)
 			return n.SetBody(content)
 		} else {

+ 16 - 4
core/src/web/templates/manage/webcontent-new.html

@@ -55,7 +55,7 @@ body{
 }
 .regmul{
 	font-size:12px; 
-	border-bottom:1px dashed #98D6DC; 
+	border-bottom:1px dashed #ccc; 
 	padding-bottom:30px; 
 	color: #999999;
 }
@@ -63,15 +63,17 @@ body{
 	font-size:14px; 
 	line-height:25px; 
 	margin-top:20px;
+	padding:0px 30px;
 }
 .reg-title{
 	font-weight:400; 
 	padding:30px 25px 10px 25px;
 	font-size:32px;
+	line-height: 50px;
 }
 .one{
 	float:left;
-	width:40%;
+	width:50%;
 	text-align:right;
 	color:#000;
 	font-size:14px;
@@ -92,7 +94,7 @@ body{
 <div class="a-content">
 <div class="hidden">{{include "/manage/kb_slider.html"}}</div>
 	<div class="reg-left">
-		<div id="content" style=" border:1px solid #CCCCCC; border-top-left-radius:0px; margin-bottom:30px;">	
+		<div id="content" style="border-top-left-radius:0px; margin-bottom:30px;">	
 			<div class="container-fluid">
 				<div class="row-fluid">
 					<div class="span12">		
@@ -104,7 +106,7 @@ body{
 							<h4><p class="reg-title text-center">{{.T.s_title}}</p></h4>
 							<div class="regmul" >
 								<p class="text-center">    发布日期: {{if eq .T.l_createdate "1970-01-01"}}-------{{else}}{{.T.l_createdate}}{{end}}  文章来源:{{if eq .T.s_url ""}}{{.T.s_source}}{{else}}<a style="font-size:14px; color:#0000FF;" target="_blank" href="{{.T.s_url}}">{{if eq .T.s_code "gjgszj-fl"}}国家工商总局-法律{{else if eq .T.s_code "gjgszj-xzfggfxwj"}}国家工商总局-行政法规、法规性文件{{else}}国家工商总局-行政规章及规范性文件{{end}}</a>{{end}}</p>
-								<div style="width:916px;" class="text-center">
+								<div style="width:916px;margin-top:20px;" class="text-center">
 									<div class="one">
 									【字体:<span onClick="change(1)">大</span><span onClick="change(2)">中</span><span onClick="change(3)">小</span>】
 									</div>
@@ -155,6 +157,16 @@ body{
 {{include "/common/bottom.html"}}
 <script type="text/javascript">
 //setNavbarActive(3);
+function change(i){
+	if (i==1){
+		$(".reg-content .Custom_UnionStyle p font").css("font-size","22px");
+	}else if (i==2){
+		$(".reg-content .Custom_UnionStyle p font").css("font-size","18px");
+	}else if (i==3){
+		$(".reg-content .Custom_UnionStyle p font").css("font-size","14px");
+	}
+	
+}
 function currPos(){
    return [["政策法规","/front/content_zcfg_list.html"]]
 }

+ 380 - 0
core/src/web/templates/manage/webexpresscontent-new.html

@@ -0,0 +1,380 @@
+<html>
+<head>
+<title>{{.T.s_title}}_新闻资讯_企明星</title>
+{{include "/common/inc.html"}}
+<meta name="Keywords" content="{{.T.s_keywords}}"/>
+<meta name="Description" content="{{.T.s_description}}"/>
+<script src="/js/validform-min.js"></script>
+<script src="/js/jquery.cookie.js"></script>
+<style type="text/css">
+
+body{
+background-color:#F0F0F0;
+}
+#content { margin-left:0px;}
+.search li a{font-size:13px;}
+.active{background-color:#6CC3FF}
+.widget-box { background-color:#FFFFFF; border:0px;}
+.widget-content { border:0px;}
+#share a#bds_weixin{ background:url(/images/u78.png);background-position: -13px -6px; width:34; height:34;}
+#share a#bds_tsina{ background:url(/images/u78.png); background-position: -55px -6px; width:34; height:34;}
+#share a#bds_tqq{ background:url(/images/u78.png); background-position: -97px -6px; width:34; height:34;}
+#share a#bds_qzone{ background:url(/images/u78.png); background-position: -137px -6px; width:34; height:34;}
+#share a#bds_douban{ background:url(/images/u78.png); background-position: 144px -6px; width:34; height:34;}
+#share a.bds_dz{ background:url(/images/u78.png); background-position: 62px -6px; width:65; height:34;}
+#share a#bds_more{ background:url(); margin-top:13px;}
+.ftnt:hover{ text-decoration: none;}
+.firstimg{ width:100%;}
+.bdsharebuttonbox{float: left;margin: 0px;}
+.bdsharebuttonbox2{float: left;margin: 0px; display:block;}
+.b-nav-main{
+	background-color: #FF5A5F;
+}
+.b-nav{
+	border-top-color: #FF5A5F;
+}
+.b-head .b-h-search form>span{
+	background-color: #FF5A5F;
+}
+.a-content{
+	margin-top:20px;
+}
+.b-head .head-hidemenu li:hover {
+    background-color: #FF5A5F;
+}
+.b-round-dot {
+    background-color: #FF5A5F;
+}
+.index-new-head .head-hidemenu i {
+    color: #FF5A5F;
+}
+.newcon-left{
+	width:77%;
+	float:left;
+	background-color: #fff;
+}
+.newcon-right{
+	width:22%;
+	float:left;
+	background-color: #fff;
+	margin-left:10px;
+	
+}
+
+.newcon-right .hotnews{
+	width:100%;
+	height:45px;
+	background-color:#F7F8FA;
+	border:1px solid #e5e6e9;
+	line-height:45px;
+	padding-left:20px;
+	font-size: 18px;
+	border-bottom:0px;
+}
+.hotnewslists{
+	width:100%;
+	border:1px solid #e5e6e9;
+	padding:20px 10px;
+	display:block;
+	height:380px;
+	background-color:#fff;
+	
+}
+.hotnewslists ul{
+	width:100%;
+	height:33px;
+	line-height:33px;
+}
+.lifirst{  
+	background-color: #ff5a5f;
+    text-align: center;
+    width: 15px;
+    height: 15px;
+    line-height: 16px;
+    color: #fff;
+    margin-top: 9px;
+	margin-right:5px;
+}
+.lisecond{
+	width:210px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+.lithree{
+	float:right;
+	color:#999;
+}
+.a-content .container-fluid{
+	padding:0px;
+}
+.container-fluid .row-fluid:first-child {
+    margin-top:0px;
+}
+.newscontent{
+	margin:20px 70px;
+	padding-top:30px;
+	font-size:14px; 
+	line-height:32px; 
+}
+.fengexian{
+	border-top:1px dashed #ccc;
+	margin:20px 40px;
+}
+.one{
+	float:left;
+	width:50%;
+	text-align:right;
+	color:#000;
+	font-size:14px;
+}
+.one span{
+	cursor:pointer;
+	margin-left:6px;
+	margin-right:6px;
+}
+.text-muted{
+	margin-left:62px;
+}
+.forwat{
+	color:#ff5a5f !important;
+	font-weight:bold;
+}
+</style>
+<script type="text/javascript">
+$(document).ready(function(){
+	var _screenwidth = document.body.clientWidth-110;//缩放后的最大宽度
+	//所有大图等比缩放
+	$("img").each(function(){
+		if(this.width>_screenwidth){
+			//执行缩放操作
+			var w = this.width;
+			var h = this.height;
+			this.oldWidth=w;
+			this.oldHeight=h;
+			this.cusHeight=h/(new Number(w/_screenwidth));
+			this.cusWidth=_screenwidth;
+			this.height=this.cusHeight+50;
+			this.width=this.cusWidth+55;
+			this.title="点击我,查看原始尺寸图像";
+			$("img").removeAttr("style");
+			$(".container-fluid").css("padding-left","2px").css("padding-right","2px");
+			var obj = $(this);
+			obj.toggleClass('cus');
+			$(this).bind('click',function(){
+				var flag = obj.hasClass('cus')
+				this.width=flag?this.oldWidth:this.cusWidth+55;
+				this.height=flag?this.oldHeight:this.cusHeight+50;
+				obj.toggleClass('cus');
+			});
+		}
+	});
+});
+</script>
+
+</head>
+<body>
+{{include "/common/newshead.html"}}
+<div class="a-content">
+
+	<div class="newcon-left">
+		<!-- 中间 -->
+		<div class="row" style="margin-left:auto; margin-right:auto;">
+			
+				<div id="content" style="border-top-left-radius:0px;border-radius: 4px;  margin-bottom:30px;">
+					
+					<div class="container-fluid">
+						<div class="row-fluid">
+							<div class="span12">		
+								<div class="widget-box">
+									<div class="widget-content nopadding">
+									<div style=" margin:auto; margin-bottom:30px;">
+									
+									<div style="clear:both;"></div>
+									
+									<div class="visible-md visible-lg text-center" style="margin:auto; width:924px; height:450px; ">
+									<img src="{{.T.s_pic}}">
+									
+									</div>
+									<div class="text-center" style="height:100px;width:924px;margin-top:-100px;"><p style=" font-weight:bold; color:#fff; font-size:36px; line-height:50px;">{{.T.s_title}}</p>
+									</div>
+									
+									<div class="visible-sm visible-xs " style="position:relative; margin:auto; margin-top:20px;">
+									<img class="firstimg" src="{{.T.s_pic}}">
+									<div style="position:absolute;top:75%;margin-right:auto;margin-left:auto;background-image:url(/images/u35.png);height:25%;width:100%;">
+									<div style="height:50px;display: table-cell; vertical-align: middle;width:320px;"><h4 ><p style=" color:#000000; font-size: 14px; line-height:18px;" class="text-center">{{.T.s_title}}</p></h4></div>
+									</div>
+									</div>
+									
+									<p style="font-size:12px; padding:25px; padding-top:0px; color: #999999;" class="text-center">{{if eq .T.s_author ""}}{{else}}作者:{{.T.s_author}}  {{end}}文章来源:{{if eq .T.s_url ""}}{{.T.s_source}}{{else}}<a style="font-size:14px; color:#0000FF;" target="_blank" href="{{.T.s_url}}">{{.T.s_source}}</a>{{end}}  发布日期:{{if not .T.releasetime}}{{.T.l_createdate}}{{else}}{{.T.releasetime}}{{end}}</p>
+										<div style="width:916px;margin-top:20px;" class="text-center">
+									<div class="one">
+									【字体:<span onClick="change(1)">大</span><span onClick="change(2)">中</span><span onClick="change(3)">小</span>】
+									</div>
+									<div style="float:left;" class="a-twostage-toolbar text-muted">
+										<a class="pull-left" style="line-height: 25px;" onclick="$('#share').show('normal')"><span class="glyphicon fenxiang " style="font-size:14px;margin:0px 0px 0px 5px;color:#ff5a5f;"></span><span style="font-size:14px;color:#ff5a5f;">分享</span></a>
+										<div class="bdsharebuttonbox " style="margin:-1px 0 0 0px;" id="share">
+											<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
+											<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
+											<a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a>
+											<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
+											<a href="#" class="bds_renren" data-cmd="renren" title="分享到人人"></a>
+										</div>
+									</div>
+									<div style="clear:both;"></div>
+								</div>
+										<div class="fengexian"></div>
+										<div class="newscontent">
+									    {{.T.s_content}}
+										</div>
+										
+			                          </div>
+									<div style="clear:both;"></div>
+									  
+									  <div style="float:left; margin-left:20px;"  id="share">
+										<div class="bdsharebuttonbox" style="display:block;">
+										<a href="#" class="bds_more" id="bds_more" data-cmd="more" style="font-size:14px;">分享到:</a>
+										<a href="#" class="bds_weixin" id="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
+										<a href="#" class="bds_tsina" id="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
+										<a href="#" class="bds_tqq" id="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a>
+										<a href="#" class="bds_qzone" id="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
+										<a href="#" class="bds_douban" id="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a>
+										<a onClick="up({{.T._id}})" class="bds_dz" title="赞一个"><span style="font-size:10px; margin-top:10px; position:absolute; text-align:center; width:45px; color:#FFD101;margin-left:3px;" >{{.T.praise}}</span></a>
+										</div>			
+										<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>	
+										</div>
+									<div style="clear:both;"></div>
+									<div style="padding:20px 33px; margin-top:15px;">{{if .T.firstid }}<span style="font-size:14px;">上一篇: <a href="/front/webcontent/{{.T.firstid}}.html" class="ftnt">{{.T.firsttitle}}</a></span>{{else}}{{end}}</div>
+									<div style="padding:10px 33px;">{{if .T.nextid }}<span>下一篇: <a href="/front/webcontent/{{.T.nextid}}.html" class="ftnt">{{.T.nexttitle}}</a></span>{{else}}{{end}}</div>
+									<div style="clear:both;"></div>
+									</div>
+								</div>
+							</div>
+						</div>
+		
+					</div>
+					
+				</div>
+				
+		</div>
+	
+	</div>
+	
+	<div class="newcon-right">
+		<div class="hotnews">热门资讯</div>
+		<div class="hotnewslists">
+		
+		</div>
+		</div>
+	</div>
+	<div style="clear:both;"></div>
+</div>
+{{include "/common/bottom.html"}}
+<script type="text/javascript">
+	var ctp = {{.T.s_contenttype}};
+	if (ctp == "qykb"){
+		$("#qykb").addClass("forwat");
+	}else if(ctp == "zhsk"){
+		$("#zhsk").addClass("forwat");
+		
+	}
+function change(i){
+	if (i==1){
+		$(".newscontent").css("font-size","22px");
+	}else if (i==2){
+		$(".newscontent").css("font-size","18px");
+	}else if (i==3){
+		$(".newscontent").css("font-size","14px");
+	}
+	
+}
+//setNavbarActive(4);
+	var html = ""
+	{{range $k,$v:=.T.hotnews}}
+		var k = {{$k}}+1
+		html += '<ul><li class="lifirst font-size-12" style="{{if gt $k 2}}background-color:#ccc;{{end}}">'+k+'</li><li class="lisecond"><a target="block" href="/front/webcontent/{{index $v "_id"}}.html">{{index $v "s_title"}}</a></li><li class="lithree text-center font-size-12">{{index $v "praise"}}</li></ul>'
+	{{end}}
+	$(".hotnewslists").append(html);
+function currPos(){
+   return [["新闻资讯","/front/content_qykb_list.html"]]
+}
+$(function (){
+     var key = {{.T.s_keywords}}
+	 var strs = new Array();
+	 strs = key.split(",")
+	 for (i=0;i<strs.length ;i++ ) 
+			{ 
+			 $("#s_keywords").append("<span style='background-color:#D2D2D2; color:#fff; padding:5px 10px; margin-left:5px;font-size:12px;'>"+strs[i]+"</span>") 
+			} 
+
+	$(".backTop").click(function (){
+		$(window).scrollTop(0);
+	});
+ 
+	$('#loginModal').on('shown.bs.modal', function () {
+		$("#username").focus();
+	});
+	var obj = $(".navbar-nav li a.qfw-navbar-active");
+	$(".navbar-nav li a").mouseover(function (){
+		obj.removeClass("qfw-navbar-active");
+		$(this).addClass("qfw-navbar-active");
+	}).mouseout(function (){
+		$(this).removeClass("qfw-navbar-active");
+		obj.addClass("qfw-navbar-active");
+	});
+	$(".registerform").Validform({
+		tiptype:function(msg,o,cssctl){
+			cssctl($(o.obj).prev(),o.type);
+			$(o.obj).prev().text(msg).show();
+		}
+	});
+	$(".bds_weixin").on("click",function(){
+	    clearWeixin();	
+	});
+ 
+});
+
+function clearWeixin(){
+	if($(".bd_weixin_popup_foot").length>0){
+		$(".bd_weixin_popup_foot").html("&nbsp;");
+		return;
+	}else{
+		setTimeout(clearWeixin,30);
+	}
+}
+
+$(function(){
+	var _id = {{.T._id}}
+	var updown = $.cookie("_cms_updown_" + _id);
+	//$(".bds_dz").find("span").text(updown);
+});
+
+var up = function (djno){    
+    var no = djno;
+	var original = {{.T.praise}}
+	var updown = $.cookie("_cms_updown_" + no);
+	if (updown) {
+		alert("您已经赞过了!");
+		return;
+	}else{
+		$.cookie("_cms_updown_"+ no,original+1,{expires:1} );
+		updown = $.cookie("_cms_updown_" + no);
+	}
+	$(".bds_dz").find("span").text(updown);
+
+    $.ajax({    
+        type:'post',        
+        url:'/front/praise/exp',    
+        data:{praise:original,_id:'{{.T._id}}'},    
+        cache:false,    
+        dataType:'json', 
+        success:function(data){
+		 if (data.flag) {
+		     $(".bds_dz").find("span").html(data.praise);
+		 }	  
+        }    
+        });  
+}
+</script>
+</body>
+</html>