Переглянути джерело

Merge branch 'dev2.0' of 192.168.3.17:qmx/jy into dev2.0

王传进 8 роки тому
батько
коміт
f106d1f839

+ 2 - 1
src/config.json

@@ -99,5 +99,6 @@
             "bodymsg": "剑鱼-招标信息打赏",
             "detailmsg": "招标推送信息[%s] 打赏%s元钱"
         }
-    }
+    },
+	"industry":"分类综合测试"
 }

+ 41 - 22
src/jfw/front/supsearch.go

@@ -3,6 +3,7 @@ package front
 import (
 	"fmt"
 	"jfw/config"
+	"jfw/jyutil"
 	"log"
 	"math/rand"
 	"qfw/util"
@@ -49,36 +50,53 @@ func (p *Pcsearch) PcSearchIndex() error {
 	defer util.Catch()
 	var shareid = p.GetString("id")
 	p.T["logid"] = config.Seoconfig["jysslby"].(string)
+	industryname := config.Sysconfig["industry"].(string)
 	if len(shareid) == 0 {
 		shareid = fmt.Sprintf("%s%d", config.Seoconfig["jysslby"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
 	}
-	industryData, ok := mongodb.Find("rc_rule", `{"s_name":{$ne:null}}`, `{"i_order":1}`, `{"_id":1,"s_name":1}`, false, -1, -1)
-	if ok && industryData != nil && len(*industryData) > 0 {
-		industry := map[string][]string{}
-		sortArray := []string{}
-		for _, v := range *industryData {
-			fatFlag := 0
-			//childFlag := 0
-			industryname, _ := v["s_name"].(string)
-			if strings.Contains(industryname, "_") {
-				fat := strings.Split(industryname, "_")[0]
-				child := strings.Split(industryname, "_")[1]
-				if len(industry[fat]) == 0 {
-					sortArray = append(sortArray, fat)
+	classdata, ok1 := mongodb.FindOneByField("rc_task", `{"s_name":"`+industryname+`"}`, `{"s_class":1}`)
+	if ok1 && len(*classdata) > 0 {
+		log.Println("---:", (*classdata)["s_class"])
+		classid := ""
+		if util.ObjToString((*classdata)["s_class"]) != "" {
+			classids := strings.Split(util.ObjToString((*classdata)["s_class"]), ",")
+			for k, v := range classids {
+				if k > 0 {
+					classid += `,`
 				}
-				for _, fv := range industry[fat] {
-					if fv == strings.Trim(child, " ") {
-						fatFlag = 1
-						break
+				classid += `"` + v + `"`
+			}
+		}
+		log.Println("caid:", classid)
+		industryData, ok := mongodb.Find("rc_rule", `{"s_pid":{"$ne":""},"s_classid":{"$in":["592f8c14e13823494a0ef74d","5955b9d2e13823524f1c83f3","5955e200e13823050ee481ce","595cb06ae138233628af3a44","595cb0b4e138233628af3a45","597ed6cbe1382369578abf54"]}}`, `{"i_order":1}`, `{"_id":1,"s_name":1}`, false, -1, -1)
+		log.Println("chaud:", len(*industryData))
+		if ok && industryData != nil && len(*industryData) > 0 {
+			industry := map[string][]string{}
+			sortArray := []string{}
+			for _, v := range *industryData {
+				fatFlag := 0
+				//childFlag := 0
+				industryname, _ := v["s_name"].(string)
+				if strings.Contains(industryname, "_") {
+					fat := strings.Split(industryname, "_")[0]
+					child := strings.Split(industryname, "_")[1]
+					if len(industry[fat]) == 0 {
+						sortArray = append(sortArray, fat)
+					}
+					for _, fv := range industry[fat] {
+						if fv == strings.Trim(child, " ") {
+							fatFlag = 1
+							break
+						}
+					}
+					if fatFlag != 1 {
+						industry[fat] = append(industry[fat], child)
 					}
-				}
-				if fatFlag != 1 {
-					industry[fat] = append(industry[fat], child)
 				}
 			}
+			p.T["industry"] = industry
+			p.T["sortArray"] = sortArray
 		}
-		p.T["industry"] = industry
-		p.T["sortArray"] = sortArray
 	}
 	p.DisableHttpCache()
 	Newbids()
@@ -109,6 +127,7 @@ func Newbids() {
 		}
 		for i := 0; i < 10; i++ {
 			_, list = getLastNewsData("", "", "", "", "", intns[i], true)
+			jyutil.BidListConvert("", list)
 			for k, v := range *list {
 				v["k"] = (k + 1) + i*50
 				t := time.Unix(util.Int64All(v["publishtime"]), 0)

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

@@ -66,7 +66,7 @@
   font-size: 16px;
 }
 
-#searchInner .searchHeader .searchHeader-container .searchInput form input[type='submit'] {
+#searchInner .searchHeader .searchHeader-container .searchInput form input[type='button'] {
   float: left;
   width: 106px;
   height: 42px;
@@ -649,7 +649,7 @@ width:1160px;
 }
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-left {
   float: left;
-  width: 860px;
+  width: 854px;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-left em {

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

@@ -121,6 +121,7 @@ $(function() {
 			} else {
 				$prevNode.removeClass("active").addClass("secondActice");
 			}
+			beforeSubmit();
 		});
 		$parentNode.on('click', function() {
 			$(this).toggleClass("active").removeClass("secondActice");
@@ -130,7 +131,7 @@ $(function() {
 			} else {
 				$nextALLChildren.addClass('active');
 			}
-
+			beforeSubmit();
 		});
 		/*如果点击没有内容给全部添加类名*/
 		$content.on("click", "font", function() {
@@ -139,11 +140,13 @@ $(function() {
 			} else {
 				$induAll.addClass("active");
 			}
+			beforeSubmit();
 		})
 		/*全部点击*/
 		$induAll.on("click", function() {
 			$(this).addClass("active");
 			$content.children().not($(this)).removeClass("active secondActice")
+			beforeSubmit();
 		})
 	};
 	/*时间发布*/
@@ -154,6 +157,7 @@ $(function() {
 		$childrenLi.on("click", function() {
 			$(this).addClass("active").siblings().removeClass("active");
 			$(".timerInput").removeClass("active");
+			beforeSubmit();
 		})
 	}
 

+ 108 - 13
src/web/staticres/js/superSearch.js

@@ -50,6 +50,7 @@ $(function() {
 		$(".timerInput").removeClass("customtime-active");
 		$(".timer").find("ul li:first-child").removeClass("active");
 		$(".release-time .timer li").removeClass("active");
+		beforeSubmit()
 	})
 	//
 	$(".nbprev").click(function(){
@@ -62,22 +63,33 @@ $(function() {
 	})
 	//筛选关闭和打开
 	//根据cookie值设置筛选是否显示
-	var rsw = $.cookie("orshow");
-	if(typeof(rsw)=="undefined"){
+	var rsw = localStorage.getItem("hideorshow");
+	if(rsw==null){
 		setTimeout(function(){
 			$(".searchTender").stop(false,true).slideDown(1000);
-			$.cookie("orshow","T",{expires:360,path:"/" });
+			localStorage.setItem("hideorshow", "D");
 		},500);
+	}else{
+		if(rsw=="U"){
+			$("#screenBtn").addClass("down");
+			$(".searchTender").hide();
+		}else{
+			$("#screenBtn").removeClass("down");
+			$(".searchTender").show();
+		}
 	}
-	/////////////////
-//	$(".right-tabBtn button:nth-child(1)").click(function(){
-//		tol="L"
-//		getNewBiddings(1)
-//	})
-//	$(".right-tabBtn button:nth-child(2)").click(function(){
-//		tol="T"
-//		getNewBiddings(1)
-//	})
+	//记录用户刷选按钮状态
+	$("#screenBtn").click(function(){
+		if($(this).attr("class").indexOf("down")>0){
+			localStorage.setItem("hideorshow", "U");
+		}else{
+			localStorage.setItem("hideorshow", "D");
+		}
+	})
+	//
+	$("#zbSeatchT input[type='button']").click(function(){
+		beforeSubmit()
+	})
 })
 //
 function next(){
@@ -176,7 +188,12 @@ function appendDatas(datas,flag){
 				listHtml += '<a href="#" style="display:none;"></a>';
 			}
 			//
-			listHtml += '<a href="/list/stype/'+datas[i].stypeadd+'.html">建筑工程</a>';
+			if(typeof(datas[i].industry) != "undefined" && datas[i].industry != null && datas[i].industry != ""){
+				listHtml += '<a href="#">'+datas[i].industry+'</a>';
+			}else{
+				listHtml += '<a href="#" style="display:none;"></a>';
+			}
+			
 			//
 			if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
 				var diff = timeDiff(new Date(Number(datas[i].publishtime+"000")));
@@ -302,4 +319,82 @@ function getInputTime(){
 		endtime = "";
 	}
 	return [starttime,endtime]
+}
+///
+function beforeSubmit(){
+	//时间
+	var publishtime = null;
+	var timeslot = getInputTime().join("_");
+	if($(".timerInput").hasClass("active")){
+		if(timeslot != "_"){
+			$("#zbSeatchT [name='publishtime']").val(timeslot);
+		}else{
+			$("#zbSeatchT [name='publishtime']").val("");
+		}
+	}else{
+		publishtime = $(".timer .active").attr("data-value");
+		if(typeof(publishtime) != "undefined"){
+			$("#zbSeatchT [name='publishtime']").val(publishtime);
+		}else{
+			$("#zbSeatchT [name='publishtime']").val("");
+		}
+	}
+	if(timeslot != "_"){
+		$("#zbSeatchT [name='timeslot']").val(timeslot);	
+	}else{
+		$("#zbSeatchT [name='timeslot']").val("");
+	}
+	//地区
+	var selectAreas = "";
+	$(".region-content .active:not(.parent-node)").each(function(){
+		var thisText = $(this).text();
+		if(thisText != "全国"){
+			if(selectAreas != ""){
+				selectAreas += ",";
+			}
+			selectAreas += thisText;
+		}
+	});
+	$("#zbSeatchT [name='area']").val(selectAreas);
+	//类型
+	var selectSubTypes = "";
+	$(".info-content .active:not(.parent-node)").each(function(){
+		if($(this).attr("id") == "whole"||$(this).attr("id") == "infoBtn"){
+			return true;
+		}
+		var thisText = $(this).attr("data-value");
+		if(selectSubTypes != ""){
+			selectSubTypes += ",";
+		}
+		selectSubTypes += thisText;
+	});
+	$("#zbSeatchT [name='subtype']").val(selectSubTypes);
+	//行业
+	var selectIndustrys = "";
+	$(".industry-content .active:not(.parent-node)").each(function(){
+		if($(this).attr("id") == "induAll"){
+			return true;
+		}
+		var thisText = $(this).attr("data-value");
+		if(selectIndustrys != ""){
+			selectIndustrys += ",";
+		}
+		selectIndustrys += thisText;
+	});
+	$("#zbSeatchT [name='industry']").val(selectIndustrys);
+	//价格
+	var selectMinPrices = $(".PriceInput [name='minprice']").val();
+	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();
+	return true
+}
+//
+function searchOnsubmit(){
+	
 }

+ 40 - 124
src/web/templates/pc/supsearch.html

@@ -112,7 +112,7 @@ $(function(){
 			industryhtml+='<i class="diver"></i>'
 					+'<font class="parent-node ">'+fat+'</font>'
 			for (var j in childlist){
-				industryhtml+='<font>'+childlist[j]+'</font>'
+				industryhtml+='<font data-value="'+fat+'_'+childlist[j]+'">'+childlist[j]+'</font>'
 			}
 		}
 		$(".industry-content").html(industryhtml)
@@ -135,10 +135,10 @@ $(function(){
 			</div>
 			<!--搜索-->
 			<div class="searchInput clearfix">
-				<form action="" method="" class="clearfix">
-					<input class="searchname" autocomplete="off" type="search" name="" id="searchinput" value="" name="keywords" placeholder="高速公路" />
+				<form action="" method="post"  id="zbSeatchT" class="clearfix" onsubmit="return true">
+					<input class="searchname" autocomplete="off" type="search" id="searchinput" value="" name="keywords" placeholder="高速公路" />
 
-					<input type="submit" value="搜索" />
+					<input type="button" value="搜索" />
 <!--					<div class="searchSlideText">
 						<ul>
 							<li>大连<i>万达集团</i>股份有限公司北京投资管理分公司</li>
@@ -155,6 +155,14 @@ $(function(){
 							<li>大连<i>万达集团</i>股份有限公司北京投资管理分公司</li>
 						</ul>
 					</div>-->
+					<input type="hidden" name="searchvalue" value="{{.T.searchvalue}}">
+					<input type="hidden" name="publishtime" value="{{.T.publishtime}}">
+					<input type="hidden" name="timeslot" value="{{.T.timeslot}}">
+					<input type="hidden" name="area" value="{{.T.area}}">
+					<input type="hidden" name="subtype" value="{{.T.subtype}}">
+					<input type="hidden" name="minprice" value="{{.T.minprice}}">
+					<input type="hidden" name="maxprice" value="{{.T.maxprice}}">
+					<input type="hidden" name="industry" value="{{.T.selectIndustry}}">
 				</form>
 				<!--筛选-->
 				<div id="screenBtn" class="screen up">
@@ -226,10 +234,10 @@ $(function(){
 				</div>
 				<div class="fl timer">
 					<ul>
-						<li class="active">全部</li>
-						<li>最近七天</li>
-						<li>最近30天</li>
-						<li>去年</li>
+						<li class="active" data-value="">全部</li>
+						<li data-value="lately-7">最近七天</li>
+						<li data-value="lately-30">最近30天</li>
+						<li data-value="thisyear">去年</li>
 					</ul>
 				</div>
 				<div class="timerInput fl">
@@ -302,30 +310,32 @@ $(function(){
 					<span id="infoBtn" class=" active">全部</span>
 					<i class="diver"></i>
 					<font class="parent-node infoFist">拟建项目</font>
-					<a><img class="q-mark" id="q-mark"  src="/images/biddingSearch/info-icon1.png" alt="" /></a>
+					<font data-value="拟建" class="hidden">拟建</font>
+					<a id="whole"><img class="q-mark" id="q-mark"  src="/images/biddingSearch/info-icon1.png" alt="" /></a>
 					<i class="diver"></i>
 					<font class="parent-node">招标预告</font>
+					<font data-value="预告" class="hidden">预告</font>
 					<i class="diver"></i>
 					<font class="parent-node">招标公告</font>
-					<font>招标</font>
-					<font>邀标</font>
-					<font>询价</font>
-					<font>竞谈</font>
-					<font>单一</font>
-					<font>竞价</font>
-					<font>变更</font>
-					<font>其他</font>
+					<font data-value="招标">招标</font>
+					<font data-value="邀标">邀标</font>
+					<font data-value="询价">询价</font>
+					<font data-value="竞谈">竞谈</font>
+					<font data-value="单一">单一</font>
+					<font data-value="竞价">竞价</font>
+					<font data-value="变更">变更</font>
+					<font data-value="其他">其他</font>
 					<i class="diver"></i>
 					<font class="parent-node">招标结果</font>
-					<font>中标</font>
-					<font>成交</font>
-					<font>废标</font>
-					<font>流标</font>
+					<font data-value="中标">中标</font>
+					<font data-value="成交">成交</font>
+					<font data-value="废标">废标</font>
+					<font data-value="流标">流标</font>
 					<i class="diver"></i>
 					<font class="parent-node">招标信用信息</font>
-					<font>合同</font>
-					<font>验收</font>
-					<font>违规</font>
+					<font data-value="合同">合同</font>
+					<font data-value="验收">验收</font>
+					<font data-value="违规">违规</font>
 				</div>
 				<span class="remind" style="display:none;">
 					<span class="remindone"></span>
@@ -378,58 +388,11 @@ $(function(){
 								<td width="65">预算<br>(万元)</td>
 								<td width="100">开标时间</td>
 								<td width="180">中标单位</td>
-								<td>中标金额(万元)</td>
+								<td>中标金额<br>(万元)</td>
 							</tr>
 						</thead>
 						<tbody>
-							<tr>
-								<td>1-1</td>
-								<td>2017-6-15</td>
-								<td>中标公告</td>
-								<td class="tt-l"><i>高速</i>公路管理处管理处</td>
-								<td class="tt-l"><i>高速</i>压坏地方<i>公路</i>建设项目</td>
-								<td class="tt-r">1000</td>
-								<td>2017-7-15 9:30</td>
-								<td class="tt-l">河南同济路桥工程技术 有限公司
-								</td>
-								<td class="tt-r">1200</td>
-							</tr>
-							<tr>
-								<td>2</td>
-								<td>2017-6-15</td>
-								<td>中标公告</td>
-								<td class="tt-l"><i>高速</i>公路管理处管理处</td>
-								<td class="tt-l"><i>高速</i>压坏地方<i>公路</i>建设项目</td>
-								<td class="tt-r">1000</td>
-								<td>2017-7-15 9:30</td>
-								<td class="tt-l">河南同济路桥工程技术 有限公司
-								</td>
-								<td class="tt-r">1200</td>
-							</tr>
-							<tr>
-								<td>3</td>
-								<td>2017-6-15</td>
-								<td>中标公告</td>
-								<td class="tt-l"><i>高速</i>公路管理处管理处</td>
-								<td class="tt-l"><i>高速</i>压坏地方<i>公路</i>建设项目</td>
-								<td class="tt-r">1000</td>
-								<td>2017-7-15 9:30</td>
-								<td class="tt-l">河南同济路桥工程技术 有限公司
-								</td>
-								<td class="tt-r">1200</td>
-							</tr>
-							<tr>
-								<td>4</td>
-								<td>2017-6-15</td>
-								<td>中标公告</td>
-								<td class="tt-l"><i>高速</i>公路管理处管理处</td>
-								<td class="tt-l"><i>高速</i>压坏地方<i>公路</i>建设项目</td>
-								<td class="tt-r">1000</td>
-								<td>2017-7-15 9:30</td>
-								<td class="tt-l">河南同济路桥工程技术 有限公司
-								</td>
-								<td class="tt-r">1200</td>
-							</tr>
+							
 						</tbody>
 					</table>
 				</div>
@@ -437,13 +400,13 @@ $(function(){
 			<!--tab切换内容-->
 			<div class="tabContainer tabContainer-2" style="display: none;">
 				<!--全文搜索 列表-->
-				<div class="lucene" style="display: none;">
+				<div class="lucene">
 					<ul>
 						
 					</ul>
 				</div>
 				<!--全文搜索 表格-->
-				<div class="lucene-table">
+				<div class="lucene-table" style="display: none;">
 					<table>
 						<thead>
 							<tr>
@@ -455,58 +418,11 @@ $(function(){
 								<td width="65">预算<br>(万元)</td>
 								<td width="100">开标时间</td>
 								<td width="180">中标单位</td>
-								<td>中标金额(万元)</td>
+								<td>中标金额<br>(万元)</td>
 							</tr>
 						</thead>
 						<tbody>
-							<tr>
-								<td>2-1</td>
-								<td>2017-6-15</td>
-								<td>中标公告</td>
-								<td class="tt-l"><i>高速</i>公路管理处管理处</td>
-								<td class="tt-l"><i>高速</i>压坏地方<i>公路</i>建设项目</td>
-								<td class="tt-r">1000</td>
-								<td>2017-7-15 9:30</td>
-								<td class="tt-l">河南同济路桥工程技术 有限公司
-								</td>
-								<td class="tt-r">1200</td>
-							</tr>
-							<tr>
-								<td>2</td>
-								<td>2017-6-15</td>
-								<td>中标公告</td>
-								<td class="tt-l"><i>高速</i>公路管理处管理处</td>
-								<td class="tt-l"><i>高速</i>压坏地方<i>公路</i>建设项目</td>
-								<td class="tt-r">1000</td>
-								<td>2017-7-15 9:30</td>
-								<td class="tt-l">河南同济路桥工程技术 有限公司
-								</td>
-								<td class="tt-r">1200</td>
-							</tr>
-							<tr>
-								<td>3</td>
-								<td>2017-6-15</td>
-								<td>中标公告</td>
-								<td class="tt-l"><i>高速</i>公路管理处管理处</td>
-								<td class="tt-l"><i>高速</i>压坏地方<i>公路</i>建设项目</td>
-								<td class="tt-r">1000</td>
-								<td>2017-7-15 9:30</td>
-								<td class="tt-l">河南同济路桥工程技术 有限公司
-								</td>
-								<td class="tt-r">1200</td>
-							</tr>
-							<tr>
-								<td>4</td>
-								<td>2017-6-15</td>
-								<td>中标公告</td>
-								<td class="tt-l"><i>高速</i>公路管理处管理处</td>
-								<td class="tt-l"><i>高速</i>压坏地方<i>公路</i>建设项目</td>
-								<td class="tt-r">1000</td>
-								<td>2017-7-15 9:30</td>
-								<td class="tt-l">河南同济路桥工程技术 有限公司
-								</td>
-								<td class="tt-r">1200</td>
-							</tr>
+							
 						</tbody>
 					</table>
 				</div>