王传进 8 жил өмнө
parent
commit
8aebc4e83e

+ 33 - 7
src/jfw/front/entsearch.go

@@ -1,8 +1,9 @@
 package front
 
 import (
-	//"fmt"
-	"jfw/jylabutil"
+	"fmt"
+	_ "jfw/jylabutil"
+
 	"log"
 	//"math/rand"
 	"qfw/util"
@@ -36,9 +37,21 @@ func (e *Entsearch) Bidsearchforent() error {
 	defer util.Catch()
 	searchvalue := e.GetString("searchvalue")
 	area := e.GetString("area")
-	minprice, _ := strconv.Atoi(e.GetString("minprice"))
-	maxprice, _ := strconv.Atoi(e.GetString("maxprice"))
+	pricetype := e.GetString("pricetype")
+	minprice, _ := strconv.ParseFloat(e.GetString("minprice"), 64)
+	maxprice, _ := strconv.ParseFloat(e.GetString("maxprice"), 64)
+	if pricetype == "y" {
+		//搜索minprice和maxprice价格区间的数据
+	}
+	if pricetype == "n" || pricetype == "" {
+		//搜索所有价格
+	}
 
+	fmt.Println("searchvalue1==", searchvalue)
+	fmt.Println("area1==", area)
+	fmt.Println("lower1==", minprice)
+	fmt.Println("upper1==", maxprice)
+	fmt.Println("pricetype1==", pricetype)
 
 	if minprice == 0 {
 		e.T["minprice"] = ""
@@ -53,7 +66,7 @@ func (e *Entsearch) Bidsearchforent() error {
 
 	e.T["searchvalue"] = searchvalue
 	e.T["area"] = area
-
+	e.T["pricetype"] = pricetype
 	log.Println("-------中标企业搜索:")
 
 	list := []map[string]interface{}{}
@@ -80,8 +93,21 @@ func (e *Entsearch) PcSearchZbqyAjax() error {
 	defer util.Catch()
 	searchvalue := e.GetString("searchvalue")
 	area := e.GetString("area")
-	minprice, _ := strconv.Atoi(e.GetString("minprice"))
-	maxprice, _ := strconv.Atoi(e.GetString("maxprice"))
+	pricetype := e.GetString("pricetype")
+	minprice, _ := strconv.ParseFloat(e.GetString("minprice"), 64)
+	maxprice, _ := strconv.ParseFloat(e.GetString("maxprice"), 64)
+
+	if pricetype == "y" {
+		//搜索minprice和maxprice价格区间的数据
+	}
+	if pricetype == "n" {
+		//搜索所有价格
+	}
+	fmt.Println("searchvalue==", searchvalue)
+	fmt.Println("area==", area)
+	fmt.Println("lower==", minprice)
+	fmt.Println("upper==", maxprice)
+	fmt.Println("pricetype==", pricetype)
 
 	list := []map[string]interface{}{}
 	list = jylabutil.GetProjectByEntName(searchvalue, area, minprice, maxprice, 1, 10)

+ 0 - 1
src/web/staticres/js/biddingSearch.js

@@ -142,7 +142,6 @@ $(function() {
 			} else {
 				$induAll.addClass("active");
 			}
-			beforeSubmit();
 
 		})
 		/*全部点击*/

+ 1 - 1
src/web/templates/common/pnc.html

@@ -11,7 +11,7 @@
 <link href="/css/animate.css" rel="stylesheet">
 <link rel="stylesheet" href="/css/unicorn.main.css" />
 <link rel="stylesheet" href="/css/unicorn.grey.css" />
-<script src="/js/jquery.js"></script>
+<script src="/js/jquery-3.2.1.min.js?v={{Msg "seo" "version"}}"></script>
 <script src="/js/jquery.cookie.js"></script>
 <script src="/js/bootstrap.min.js"></script>
 <script src="/js/jy.js?v={{Msg "seo" "version"}}"></script>

+ 196 - 12
src/web/templates/pc/biddingsearch_enterprise.html

@@ -13,8 +13,8 @@
 		<link href="/css/dev2/biddingSearch.css?v={{Msg "seo" "version"}}" rel="stylesheet">
 		<link href="/css/dev2/biddingSearch1.css?v={{Msg "seo" "version"}}" rel="stylesheet">
 		<script src="/js/jquery.cookie.js"></script>
-		<script src="/js/jquery-3.2.1.min.js?v={{Msg "seo" "version"}}"></script>
 		<script src="/js/biddingSearch.js?v={{Msg "seo" "version"}}"></script>
+		<script type="text/javascript" src="/js/entsearchscript.js"></script>
 		<script language="javascript" type="text/javascript" src="/My97DatePicker/WdatePicker.js"></script>
 		
 		<style type="text/css">
@@ -97,11 +97,66 @@
 				     -o-animation-fill-mode:forwards;
 				        animation-fill-mode:forwards;
 			}
+			#keyImg{
+				width:198px;
+			}
+			#layerImg{
+				position:absolute;
+				width: 150px !important;
+			    height: 150px !important;
+			    left: 198px;
+			    top: 148px;
+			}
+			.layheader{
+				position: absolute;
+			    color: #fff;
+			    left: 138px;
+			    top: 40px;
+			    line-height: 32px;
+			    font-family: 微软雅黑;
+			    font-weight: bold;
+			}
+			.layheader div:nth-child(1){
+				font-size:20px;
+			}
+			.layheader div:nth-child(2){
+				font-size:16px;
+				margin-top:10px;
+			}
+			.modal-footer{
+				text-align: center;
+			    position: absolute;
+			    bottom: 65px;
+			    left: 110px;
+			    font-size: 14px;
+			    line-height: 22px;
+			    color: #686868;
+			}
+			.modal-dialog{
+				width:500px;
+			}
 		</style>
 	</head>
 
 	<body>
 	{{include "/common/pchead.html"}}
+		<div class="modal fade" id="labModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+		    <div class="modal-dialog">
+		        <div class="modal-content" id="labmodalcont">
+		            <div class="modal-body" id="labmodalbody">
+						<div class="layheader">
+							<div>超级搜索</div>
+							<div>按行业、金额搜索、结果可按表格显示</div>
+						</div>
+						<img src="/images/biddingSearch/labbkimg.png"/>
+						<img id="layerImg" src="/front/share/{{.T.shareid}}"/>
+					</div>
+		            <div class="modal-footer">
+		                此功能尚处在实验阶段,请扫码进入<br>剑鱼实验室,打开相应开关后,即可体验!
+		            </div>
+		        </div><!-- /.modal-content -->
+		    </div><!-- /.modal -->
+		</div>
 		<section id="searchInner">
 			<!--搜索头部 START-->
 			<div class="searchHeader">
@@ -114,7 +169,7 @@
 					<!--搜索-->
 					<div class="searchInput clearfix">
 						<form action="/jylab/bidsearchforent" method="post" id="zbSeatchT" class="clearfix" onsubmit="return true">
-							<input class="searchname" autocomplete="off" type="search" name="keywords" id="searchinput" value="" placeholder="高速公路" />
+							<input class="searchname" autocomplete="off" type="search" name="keywords" id="searchinput" value="{{.T.searchvalue}}" placeholder="高速公路" />
 
 							<input type="button" class="searchBtn" value="搜索" />
 							<!--<div class="searchSlideText">
@@ -150,6 +205,18 @@
 						<!--二维码-->
 						<div class="search-right-wx">
 							<img src="/images/biddingSearch/sea-right-wx.png" />
+							<div class="search-right-wx-inner">
+								<div class="wx-inner-title">
+									扫码关注剑鱼招标订阅
+								</div>
+								<div class="wx-inner-ewm">
+									<img  id="keyImg" src="/front/share/{{.T.shareid}}"/>
+								</div>
+								<div class="wx-inner-bottom">
+									微信扫一扫<br>随时随地掌握招标信息
+		<!--						微信扫一扫,及时获取及时获取<i>"1"</i>相关招标信息-->
+								</div>
+							</div>
 						</div>
 					</div>
 				</div>
@@ -159,7 +226,7 @@
 			<!--招标搜索页面 START-->
 			<div class="searchControl">
 				<!--头部功能-->
-				<div class="searchTender w">
+				<div class="searchTender w" style="display:none;">
 					<!--价格区间-->
 					<div class="Price clearfix">
 						<div class="leftTitle">
@@ -242,8 +309,8 @@
 							</li>
 						</ul>
 						<div class="right-tabBtn">
-							<button class="active">列表</button>
-							<button>表格</button>
+							<button id="listBtn" class="active">列表</button>
+							<button id="tableBtn">表格</button>
 						</div>
 					</div>
 					<!--tab切换内容-->
@@ -312,11 +379,80 @@
 	{{include "/common/baiducc.html"}}
 	<script>
 		var mainList = {{.T.list}};
+		var submitflag = true;
+		var pricetype = "";
+		var areas = {{.T.area}};
+		var searchvalue = {{.T.searchvalue}};
+		
+		//地区回显样式设置
+		if(areas != ""){
+			$("#regionBtn").removeClass("active");
+			areas = areas.split(",");
+			for(var i=0;i<areas.length;i++){
+				$(".region-content>font:not('.parent-node')").each(function(){
+					if($(this).text() == areas[i]){
+						$(this).addClass("active");
+						return false;
+					}
+				});
+			}
+		}
+		$(".region-content .parent-node").each(function(){
+			var fontLen = $(this).nextUntil(".parent-node").filter("font").length;
+			var activeLen = $(this).nextUntil(".parent-node").filter(".active").length;
+			if(fontLen == activeLen){
+				$(this).addClass("active");
+			}
+			if(activeLen >0 && activeLen < fontLen){
+				$(this).addClass("secondActice");
+			}
+		});
+		
+		//搜索关键词回显页面样式设置
+		if(searchvalue != "" && searchvalue != null){
+			$(".seaTender-inner").css({'border':'0px'});
+			$(".lucene-table").css({'padding':'0px','border-bottom':'0px','display':'block'});		
+			$(".tabTitle").addClass("hidden");
+			$(".lucene").attr("style","display:none");
+		}
 		
+		//价格回显样式设置
+		if({{.T.pricetype}} == "y"){
+			$(".Price-content").find("span:first-child").removeClass("active");
+			$(".pricefat").addClass("active");
+		}
 		
 		$(function(){
 			haslogin({{.T.logid}});
 			
+			//筛选关闭和打开
+			//根据cookie值设置筛选是否显示
+			var rsw = localStorage.getItem("entstore");
+			console.log("00000"+rsw);
+			if(rsw == null){
+				setTimeout(function(){
+					$(".searchTender").stop(false,true).slideDown(1000);
+					localStorage.setItem("entstore", "D");
+				},500);
+			}else{
+				if(rsw=="U"){
+					$("#screenBtn").addClass("down");
+					$(".searchTender").hide();
+				}else{
+					$("#screenBtn").removeClass("down");
+					$(".searchTender").show();
+				}
+			}
+				
+			//记录用户刷选按钮状态
+			$("#screenBtn").click(function(){
+				if($(this).attr("class").indexOf("down")>0){
+					localStorage.setItem("entstore", "U");
+				}else{
+					localStorage.setItem("entstore", "D");
+				}
+			})
+					
 			//价格
 			$("#minprice").click(function(){
 				$(".pricebut").show();
@@ -326,10 +462,15 @@
 				$(".pricebut").show();
 				$(".pricefat").addClass("customtime-active");
 			})
+			//价格的全部按钮
 			$(".Price-content").find("span:first-child").click(function(){
 				$(this).addClass("active");
 				$(".pricefat").removeClass("active");
+				pricetype = "n"
+				$("#zbSeatchT input[name='pricetype']").val(pricetype);
+				beforeSubmit();
 			})
+			//价格的确定按钮
 			$(".pricebut").click(function(){
 				var minp = $("#minprice").val();
 				var maxp = $("#maxprice").val();
@@ -344,8 +485,28 @@
 				$(".pricefat").addClass("active");
 				$(".Price-content").find("span:first-child").removeClass("active");
 				$(".pricefat").removeClass("customtime-active");
+				pricetype = "y";
+				$("#zbSeatchT input[name='pricetype']").val(pricetype);
 				beforeSubmit();
-			})		
+			})	
+			
+			//搜索按钮
+			$(".searchBtn").click(function(){
+				var searchname = $("#zbSeatchT input[name='keywords']").val();
+				$("#zbSeatchT input[name='searchvalue']").val($.trim(searchname));
+				$("#zbSeatchT").submit();
+			})	
+			
+			//点击超级搜索按钮
+			$(".superSearch").click(function(){
+				$("#labModal").modal("show");
+			})
+			
+			//关闭登录二维码
+			$(".code-close").click(function(){
+				$("#bidLogin").modal("hide");
+			})
+			
         });
 		function beforeSubmit(){			
 			//地区
@@ -366,28 +527,51 @@
 			var selectMaxPrices =  $(".PriceInput [name='maxprice']").val();
 			$("#zbSeatchT [name='minprice']").val(selectMinPrices);
 			$("#zbSeatchT [name='maxprice']").val(selectMaxPrices);
+			
 			//搜索关键词
 			var searchname = $("#zbSeatchT input[name='keywords']").val();
-			console.log("----"+searchname)
 			$("#zbSeatchT input[name='searchvalue']").val($.trim(searchname))
-			searchOnsubmit();
+			console.log("关键词============"+searchname);
+			if(submitflag){	
+				if($.trim(searchname) != ""){
+					console.log("搜索关键词不为空");
+					getTableInfo();
+				}else{
+					console.log("搜索关键词为空"+"--------------------");
+					
+					$(".tabTitle").removeClass("hidden");
+					$(".lucene").attr("style","display:block");
+					$(".lucene-table").attr("style","display:none");
+					searchOnsubmit();
+				}
+				submitflag=false;
+			}	
+			setTimeout(function(){
+				submitflag=true
+			},200);
 			return true
 		}
-//
+	
+		function getTableInfo(){
+			$(".seaTender-inner").css({'border':'0px'});
+			$(".lucene-table").css({'padding':'0px','border-bottom':'0px','display':'block'});		
+			$(".tabTitle").addClass("hidden");
+			$(".lucene").attr("style","display:none");
+			searchOnsubmit();
+		}
+
 		function searchOnsubmit(){
 			var param = {
 						searchvalue: $("#zbSeatchT [name='searchvalue']").val(),
 						area: $("#zbSeatchT [name='area']").val(),
 						minprice: $("#zbSeatchT [name='minprice']").val(),
 						maxprice: $("#zbSeatchT [name='maxprice']").val(),
+						pricetype: $("#zbSeatchT [name='pricetype']").val()
 					};
 			$.post("/jylab/pcSearchZbqyAjax",param,function(r){
 				
 			});
 		}
-
-
-
 	</script>
 	</body>