wangshan 8 lat temu
rodzic
commit
d8c10d8e56

+ 6 - 5
src/jfw/front/supsearch.go

@@ -3,6 +3,7 @@ package front
 import (
 	"fmt"
 	"jfw/config"
+	"jfw/jyutil"
 	"log"
 	"math/rand"
 	"qfw/util"
@@ -50,6 +51,9 @@ func (p *Pcsearch) PcSearchIndex() error {
 	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))
+	}
 	classdata, ok1 := mongodb.FindOneByField("rc_task", `{"s_name":"`+industryname+`"}`, `{"s_class":1}`)
 	if ok1 && len(*classdata) > 0 {
 		log.Println("---:", (*classdata)["s_class"])
@@ -64,10 +68,7 @@ func (p *Pcsearch) PcSearchIndex() error {
 			}
 		}
 		log.Println("caid:", classid)
-		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_pid":{$ne:""},"s_classid":{$in:["592f8c14e13823494a0ef74d","5955b9d2e13823524f1c83f3","5955e200e13823050ee481ce","595cb06ae138233628af3a44","595cb0b4e138233628af3a45","597ed6cbe1382369578abf54"]}}`, `{"i_order":1}`, `{"_id":1,"s_name":1}`, false, -1, -1)
+		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{}
@@ -126,7 +127,7 @@ func Newbids() {
 		}
 		for i := 0; i < 10; i++ {
 			_, list = getLastNewsData("", "", "", "", "", intns[i], true)
-			bidListConvert("", list)
+			jyutil.BidListConvert("", list)
 			for k, v := range *list {
 				v["k"] = (k + 1) + i*50
 				t := time.Unix(util.Int64All(v["publishtime"]), 0)

+ 1 - 1
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;

+ 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();
 		})
 	}
 

+ 102 - 12
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(){
@@ -307,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(){
+	
 }

+ 34 - 24
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>