王传进 8 tahun lalu
induk
melakukan
acfb67e67d

+ 13 - 0
src/jfw/front/entsearch.go

@@ -19,6 +19,7 @@ type Entsearch struct {
 	*xweb.Action
 	bidsearchforent  xweb.Mapper `xweb:"/jylab/bidsearchforent/index.html"`
 	pcSearchZbqyAjax xweb.Mapper `xweb:"/jylab/pcSearchZbqyAjax"`
+	recList 		 xweb.Mapper `xweb:"/jylab/bidsearchforent/recList"`
 }
 
 func init() {
@@ -132,3 +133,15 @@ func (e *Entsearch) PcSearchZbqyAjax() error {
 	})
 	return nil
 }
+
+func (e *Entsearch) RecList() {
+	var entName = e.GetString("entName")
+	//limit,_ := strconv.Atoi(config.Sysconfig["recommendEntLimit"].(string))
+	re := jylabutil.GetEenNameImmediate(entName,50)
+	fmt.Println("RecList",re)
+	if re!=nil && len(re) != 0{
+		e.ServeJson(map[string]interface{}{
+			"recList": re,
+		})
+	}
+}

+ 18 - 0
src/jfw/front/supsearch.go

@@ -3,6 +3,7 @@ package front
 import (
 	"fmt"
 	"jfw/config"
+	"jfw/jylabutil"
 	"jfw/jyutil"
 	"log"
 	"math/rand"
@@ -19,12 +20,29 @@ type Pcsearch struct {
 
 	pcSearchIndex xweb.Mapper `xweb:"/jylab/supsearch/index.html"`
 	getNewBids    xweb.Mapper `xweb:"/jylab/supsearch/getNewBids"`
+	getstatus     xweb.Mapper `xweb:"/jylab/supsearch/getstatus"`
 }
 
 func init() {
 	xweb.AddAction(&Pcsearch{})
 }
 
+//
+func (p *Pcsearch) Getstatus() error {
+	defer util.Catch()
+	var supstatus bool
+	var entstatus bool
+	if p.Session().Get("s_m_openid") != nil {
+		supstatus = jylabutil.IsAuthorized(p.Session().Get("s_m_openid").(string), "i_supersearch")
+		entstatus = jylabutil.IsAuthorized(p.Session().Get("s_m_openid").(string), "i_entsesearch")
+	}
+	p.ServeJson(map[string]interface{}{
+		"supstatus": supstatus,
+		"entstatus": entstatus,
+	})
+	return nil
+}
+
 //
 func (p *Pcsearch) GetNewBids() error {
 	pagenum, _ := p.GetInteger("pageNumber")

+ 3 - 3
src/jfw/modules/behaviorcollect/src/main.go

@@ -24,11 +24,11 @@ type config struct {
 }
 
 //
-type RpcService struct {
+type RpcAccessLog struct {
 }
 
 //
-func (rs *RpcService) Log(args string, reply *string, req *http.Request) error {
+func (rs *RpcAccessLog) Log(args string, req *http.Request, reply *string) error {
 	go processrequest(args, req)
 	return nil
 }
@@ -77,7 +77,7 @@ func main() {
 	http.ListenAndServe(c.WebAddr, nil)
 	//开通json rpc服务
 	newServer := rpc.NewServer()
-	newServer.Register(new(RpcService))
+	newServer.Register(new(RpcAccessLog))
 	l, err := net.Listen("tcp", c.RpcAddr) // any available address
 	if err != nil {
 		fmt.Println(err.Error())

+ 7 - 0
src/jfw/modules/entsesearch/src/search/entsesearch.go

@@ -28,6 +28,13 @@ func init() {
 }
 
 func (e *EntSeSearch) ToSearch() error{
+	if e.Session().Get("s_m_openid") == nil {
+		return e.Redirect("/swordfish/about")
+	}
+	authStatus := jylabutil.IsAuthorized(e.Session().Get("s_m_openid").(string),"i_entsesearch")
+	if !authStatus {
+		return e.Redirect("/jylab/index")
+	}
 	e.T["pageSize"] = wx_pageSize
 	return e.Render("/weixin/entseSearch.html", &e.T)
 }

+ 5 - 0
src/jfw/modules/followent/src/followent/followent.go

@@ -39,6 +39,11 @@ func (f *FollowEnt) EntList() error {
 	if f.Session().Get("s_m_openid") == nil {
 		return f.Redirect("/swordfish/about")
 	}
+	authStatus := jylabutil.IsAuthorized(f.Session().Get("s_m_openid").(string),"i_followent")
+	if !authStatus {
+		return f.Redirect("/jylab/index")
+	}
+
 	f.T["followLimit"] = config.Sysconfig["followentlimit"]
 	datas, ok := mongodb.Find("jylab_followent", `{"s_userid":"`+f.GetSession("userId").(string)+`","s_entname":{"$ne":""}}`, `{"l_createtime":-1}`, `{"_id":1,"s_entname":1,"s_userid":1,"s_openid":1,"l_createtime":1,"s_id":1,"i_ispush":1}`, false, 0, 10)
 	f.T["flag"] = false

+ 1 - 1
src/jfw/modules/pushent/src/followpush/push.go

@@ -214,7 +214,7 @@ func FindData(fid interface{}, title, sname, openid, idrange string, bsave, bpus
 											Remark:  Tip1 + Remark + LastTip,
 											Detail:  WxContent,
 											Service: WxGroup,
-											Url:     ViewDomain + "/front/sess/" + se.EncodeString(openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",wxpushfollowlist") + "__" + infoid + "__" + followid,
+											Url:     ViewDomain + "/front/sess/" + se.EncodeString(openid+",uid,"+strconv.Itoa(int(time.Now().Unix()))+",followent") + "__" + infoid + "__" + followid,
 										})
 									}
 									//}()

+ 1 - 1
src/web/staticres/css/dev2/biddingSearch.css

@@ -363,7 +363,7 @@
   float: left;
   padding: 4px 7px;
   cursor: pointer;
-  margin: 0 2px 4px 0;
+  margin: 0 10px 4px 0;
 }
 
 #searchInner .searchControl .searchTender .release-time .timer li.active {

+ 24 - 3
src/web/staticres/js/login.js

@@ -14,6 +14,8 @@ var semnum = "";//SEM
 var pageshareid = "";
 var kopshareid = "";
 var oldshareid = "";
+var supsearchflag = false;
+var entsearchflag = false;
 //创建websocket连接
 var createWebSocket = function(wsUrl){
 	try{
@@ -206,6 +208,7 @@ var processpage = function(shareid,num){
 				break;
 			}
 			$("#myModal").modal("hide");
+			getlabstatus();
 			if(dataListId!=""){
 				setTimeout(function(){
 					window.open("/article/content/"+dataListId+".html");
@@ -337,10 +340,8 @@ $.post("/front/hasSign",function(data, location){
 		$("#login").html(hhtml);
 		infoListCss();
 		commonMouseEvent();
-		//if(num=="13"||num=="12"||num=="14"){
-			//快照页在登录的情况下也要去渲染模板
 		getNewShareId(num);
-		//}
+		getlabstatus();
 	}else{
 		$("#login").html("<button class='loginBtn' data-toggle='modal' data-target='#bidLogin' style='width:65px; height:30px; padding-left:18px;border-radius:4px; line-height:0px; color:#666666; border: solid 1px #000; border-color:#CCCCCC;' onmouseover='this.style.borderColor=\"#2cb7ca\"; this.style.color=\"#2cb7ca\";' onmouseout='this.style.borderColor=\"#CCCCCC\"; this.style.color=\"#666666\";' '>登录</button>");
 		getNewShareId(num);
@@ -348,4 +349,24 @@ $.post("/front/hasSign",function(data, location){
 		kzyflag = true;//未登录进入快照页面
 		}
 	})
+	
+}
+
+//
+function getlabstatus(){
+	console.log(loginflag+"--2222-----")
+	if(loginflag){
+		$.post("/jylab/supsearch/getstatus",function(r){
+			console.log(JSON.stringify(r))
+			if(r&&r.supstatus){
+				$(".superSearch").hide();
+				$(".bidbut").hide();
+				$(".control-tabBtn a:nth-child(1)").show();
+				supsearchflag = true;
+			}
+			if(r&&r.entstatus){
+				entsearchflag = true;
+			}
+		})
+	}
 }

+ 16 - 0
src/web/staticres/js/superSearch.js

@@ -109,6 +109,22 @@ $(function() {
 			submitflag=false;
 		}
 	})
+	//
+	$("#entsearch").click(function(){
+		if(loginflag){
+			var id = $(this).attr("datahref");
+			if(entsearchflag){
+				window.location.href=id
+			}else{
+				$(".layheader div:nth-child(1)").html("中标企业搜索");
+				$(".layheader div:nth-child(2)").html("搜索企业的所有中标项目信息");
+				$("#labModal").modal("show");
+			}
+		}else{
+			$("#bidLogin").modal("show");
+		}
+			
+	})
 })
 //
 function next(){

+ 6 - 3
src/web/templates/pc/supsearch.html

@@ -117,10 +117,12 @@ a{
 }
 .layheader div:nth-child(1){
 	font-size:20px;
+	width:272px;
 }
 .layheader div:nth-child(2){
 	font-size:16px;
 	margin-top:10px;
+	width:272px;
 }
 .modal-footer{
 	text-align: center;
@@ -195,6 +197,7 @@ $(function(){
 	$("#zbSeatchT [name='searchvalue']").val($.trim(keys));
 	$("#searchinput").focus();
 	if($.trim(keys)!=""){
+		$(".wx-inner-bottom").html('');
 		$("#t-clear").show();
 		searchvalue = $.trim(keys);
 		searchvalueArray = searchvalue.split("+");
@@ -353,7 +356,6 @@ $(function(){
         </div><!-- /.modal-content -->
     </div><!-- /.modal -->
 </div>
-//
 <div class="modal fade" id="myModal"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
   <div class="modal-dialog" style="width:400px;border:0px;" >
 		<div class="j-wx-code" id="myModal-div">
@@ -379,7 +381,7 @@ $(function(){
 			<div class="control-tabBtn">
 				<a href="#" class="on" style="display:none;">超级搜索</a>
 				<span class="bidbut">招标搜索</span>
-				<a href="/jylab/bidsearchforent/index.html">中标企业搜索</a>
+				<a id="entsearch" href="javascript:" datahref="/jylab/bidsearchforent/index.html">中标企业搜索</a>
 			</div>
 			<!--搜索-->
 			<div class="searchInput clearfix">
@@ -681,10 +683,11 @@ $(function(){
 <script type="text/javascript">
 $(function(){
 	haslogin({{.T.logid}});
-	console.log(loginflag+"-------")
 	//点击超级搜索按钮
 	$(".superSearch").click(function(){
 		if(loginflag){
+			$(".layheader div:nth-child(1)").html("超级搜索");
+			$(".layheader div:nth-child(2)").html("按行业、金额搜索、结果可按表格显示");
 			$("#labModal").modal("show");
 		}else{
 			$("#bidLogin").modal("show");