wangshan 8 vuotta sitten
vanhempi
commit
bdb9b9b52a

+ 12 - 12
src/jfw/front/entsearch.go

@@ -39,6 +39,13 @@ func (e *Entsearch) Bidsearchforentindex() error {
 		shareid = fmt.Sprintf("%s%d", config.Seoconfig["jyzbqyss"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
 	}
 
+	var supstatus = ""
+	if e.GetSession("openid") != nil {
+		if jylabutil.IsAuthorized(e.GetSession("openid").(string), "i_supersearch") {
+			supstatus = "T"
+		}
+	}
+	e.T["supstatus"] = supstatus
 	searchvalue := e.GetString("searchvalue")
 	area := e.GetString("area")
 	pricetype := e.GetString("pricetype")
@@ -98,8 +105,9 @@ func (e *Entsearch) Bidsearchforentindex() error {
 		e.T["list"] = list
 	} else if e.Method() == "POST" {
 		status = 2
-		mine := util.ObjToString(minprice)
-		maxe := util.ObjToString(maxprice)
+		mine := e.GetString("minprice")
+		maxe := e.GetString("maxprice")
+		log.Println(mine + "----" + maxe)
 		count, Lastlist = getLastNewsData("", area, "", "", "", mine, maxe, 0, true, true)
 	} else {
 		e.DisableHttpCache()
@@ -132,12 +140,12 @@ func (e *Entsearch) Bidsearchforentindex() error {
 	if minprice == 0 {
 		e.T["minprice"] = ""
 	} else {
-		e.T["minprice"] = minprice
+		e.T["minprice"] = e.GetString("minprice")
 	}
 	if maxprice == 0 {
 		e.T["maxprice"] = ""
 	} else {
-		e.T["maxprice"] = maxprice
+		e.T["maxprice"] = e.GetString("maxprice")
 	}
 	e.T["searchvalue"] = searchvalue
 	e.T["area"] = area
@@ -307,14 +315,6 @@ func (e *Entsearch) Bidsearchforent() error {
 		if len(list) > 0 {
 			for _, v := range list {
 				v["_id"] = util.DecodeArticleId2ByCheck(util.ObjToString(v["_id"]))
-				//				if v["jgtime"] != "" && v["jgtime"] != nil {
-				//					v["jgtime"] = util.FormatDateWithObj(v["jgtime"], util.Date_Short_Layout)
-				//				} else {
-				//					v["jgtime"] = ""
-				//				}
-				//				if v["bidamount"] != nil {
-				//					v["bidamount"] = fmt.Sprintf("%.2f", v["bidamount"]/10000)
-				//				}
 				itemList := v["list"].([]interface{})
 				var subtypeid string
 				var bidstatusid string

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

@@ -149,6 +149,13 @@ func (p *Pcsearch) PcSearchIndex() error {
 	if len(shareid) == 0 {
 		shareid = fmt.Sprintf("%s%d", config.Seoconfig["jysslby"].(string)+fmt.Sprintf("%d", time.Now().UnixNano())[8:14], rand.Intn(9))
 	}
+	var supstatus = ""
+	if p.GetSession("openid") != nil {
+		if jylabutil.IsAuthorized(p.GetSession("openid").(string), "i_supersearch") {
+			supstatus = "T"
+		}
+	}
+	p.T["supstatus"] = supstatus
 	keywords := p.GetString("keywords")       //关键词
 	searchvalue := p.GetString("searchvalue") //关键词
 	area := p.GetString("area")               //地区

+ 2 - 2
src/jfw/modules/weixin/src/wx/wx.go

@@ -828,7 +828,7 @@ func updateUserLog(openid string) {
 	if openid == "" {
 		return
 	}
-	//date := time.Now()
+	date := time.Now()
 	//infoTime := date.Unix()
 	nickname := ""
 	province := ""
@@ -872,7 +872,7 @@ func updateUserLog(openid string) {
 				{Key: "action", Value: action},
 				{Key: "usersource", Value: usersource},
 				{Key: "model", Value: model},
-				{Key: "s_date", Value: sdate},
+				{Key: "s_date", Value: util.FormatDate(&date, util.Date_Full_Layout)},
 			},
 			map[string]interface{}{
 				"openid":     openid,

BIN
src/web/staticres/images/adv.jpg


+ 2 - 2
src/web/staticres/js/biddingSearch.js

@@ -29,9 +29,9 @@ $(function() {
 		$screenBtn.on("click", function() {
 			$(this).toggleClass("down");
 			if(!$(this).hasClass("down")) {
-				$searchControl.stop().slideDown(1000);
-			} else {
 				$searchControl.stop().slideUp(1000);
+			} else {
+				$searchControl.stop().slideDown(1000);
 			}
 		})
 	}

+ 5 - 5
src/web/staticres/js/proproject.js

@@ -42,20 +42,20 @@ $(function() {
 	//根据cookie值设置筛选是否显示
 	var rsw = localStorage.getItem("hideorshow");
 	if(rsw!=null){
-		if(rsw=="U"){
+		if(rsw=="D"){
 			$("#screenBtn").addClass("down");
-			$(".searchTender").hide();
+			$(".searchTender").show();
 		}else{
 			$("#screenBtn").removeClass("down");
-			$(".searchTender").show();
+			$(".searchTender").hide();
 		}
 	}
 	//记录用户刷选按钮状态
 	$("#screenBtn").click(function(){
 		if($(this).attr("class").indexOf("down")>0){
-			localStorage.setItem("hideorshow", "U");
-		}else{
 			localStorage.setItem("hideorshow", "D");
+		}else{
+			localStorage.setItem("hideorshow", "U");
 		}
 	})
 	

+ 8 - 5
src/web/staticres/js/superSearch.js

@@ -92,20 +92,21 @@ $(function() {
 	//根据cookie值设置筛选是否显示
 	var rsw = localStorage.getItem("hideorshow");
 	if(rsw!=null){
-		if(rsw=="U"){
+		console.log(rsw)
+		if(rsw=="D"){
 			$("#screenBtn").addClass("down");
-			$(".searchTender").hide();
+			$(".searchTender").show();
 		}else{
 			$("#screenBtn").removeClass("down");
-			$(".searchTender").show();
+			$(".searchTender").hide();
 		}
 	}
 	//记录用户刷选按钮状态
 	$("#screenBtn").click(function(){
 		if($(this).attr("class").indexOf("down")>0){
-			localStorage.setItem("hideorshow", "U");
-		}else{
 			localStorage.setItem("hideorshow", "D");
+		}else{
+			localStorage.setItem("hideorshow", "U");
 		}
 	})
 	//
@@ -125,6 +126,7 @@ $(function() {
 	})
 	//全文检索和标题检索切换
 	$("#newsclass li:nth-child(1)").click(function(){
+		$("#allnews .lucene ul").html("");
 		$("#zbSeatchT [name='selectType']").val("all");
 		currentPage=1;
 		if(submitflag){
@@ -135,6 +137,7 @@ $(function() {
 		
 	})
 	$("#newsclass li:nth-child(2)").click(function(){
+		$(".tabContainer-2 .lucene ul").html("");
 		$("#zbSeatchT [name='selectType']").val("title");
 		currentPage=1;
 		if(submitflag){

+ 62 - 50
src/web/templates/pc/biddingsearch_enterprise.html

@@ -283,8 +283,15 @@
 				<div class="w searchHeader-container">
 					<!--整体页面切换tab-->
 					<div class="control-tabBtn">
+						{{if .T.supstatus}}
+						{{if eq .T.supstatus "T"}}
+						<a class="supbtn" href="javascript:void(0)">超级搜索</a>
+						<span style="display:none;" class="bidbut">招标搜索</span>
+						{{else}}
 						<a style="display:none;" class="supbtn" href="javascript:void(0)">超级搜索</a>
-						<span class="bidbtn">招标搜索</span>
+						<span class="bidbut">招标搜索</span>
+						{{end}}
+						{{end}}
 						<a href="#" class="on">中标企业搜索</a>
 					</div>
 					<!--搜索-->
@@ -305,11 +312,11 @@
 							<input type="hidden" name="pricetype" value="{{.T.pricetype}}">
 						</form>
 						<!--筛选-->
-						<div id="screenBtn" class="screen up">
+						<div id="screenBtn" class="screen down">
 							筛选
 						</div>
 						<!--开启超级搜索 -->
-						<div class="superSearch">
+						<div class="superSearch" {{if .T.supstatus}}{{if eq .T.supstatus "T"}} style="display:none;"{{end}}{{end}}>
 							开启超级搜索
 						</div>
 						<!--二维码-->
@@ -622,21 +629,14 @@
 			}
 				
 			//筛选关闭和打开
-			//根据cookie值设置筛选是否显示
+			//根据cookie值设置筛选是否显示 
 			var rsw = localStorage.getItem("entstore");
-			if(rsw == null){
-				setTimeout(function(){
-					$(".searchTender").stop(false,true).slideDown(1000);
-					localStorage.setItem("entstore", "D");
-				},500);
+			if(rsw=="D"){
+				$("#screenBtn").addClass("down");
+				$(".searchTender").show();
 			}else{
-				if(rsw=="U"){
-					$("#screenBtn").addClass("down");
-					$(".searchTender").hide();
-				}else{
-					$("#screenBtn").removeClass("down");
-					$(".searchTender").show();
-				}
+				$("#screenBtn").removeClass("down");
+				$(".searchTender").hide();
 			}
 				
 			//记录用户刷选按钮状态
@@ -672,18 +672,20 @@
 					if(info[0]){
 						var s_supstatus = localStorage.getItem("s_supstatus");
 						if(s_supstatus != "y"){
-							//存入缓存
-							localStorage.setItem("s_supstatus","y");
-							//修改库中状态
-							changeEntAndSupStatus("sup");
-							priceCss();
-							$(".modal-footer-welcome").text("欢迎体验剑鱼实验室—超级搜索功能。实验随时可能结束,或者进行调整,请密切关注剑鱼通知。");
-							$("#welcome").modal("show");
-							$("#welcome").on("shown.bs.modal", function () {
-								setTimeout(function(){
-									labWelClose();
-								},5000);
-							})
+							if(priceCss()){
+								//存入缓存
+								localStorage.setItem("s_supstatus","y");
+								//修改库中状态
+								changeEntAndSupStatus("sup");
+								priceCss();
+								$(".modal-footer-welcome").text("欢迎体验剑鱼实验室—超级搜索功能。实验随时可能结束,或者进行调整,请密切关注剑鱼通知。");
+								$("#welcome").modal("show");
+								$("#welcome").on("shown.bs.modal", function () {
+									setTimeout(function(){
+										labWelClose();
+									},5000);
+								})
+							}
 							$("#welcome").on("hidden.bs.modal", function () {
 	 				 			beforeSubmit();
 							})
@@ -704,7 +706,7 @@
 			//设置输入价格的格式
 			//
 			var reg = /^[\u4e00-\u9fa5]+$/;
-			var minnum = "";
+			var minnum = {{.T.minprice}};
 			$("#minprice").on("input propertychange",function(){
 				var minp = $.trim($(this).val()).replace(/\s/g,"");
 				$(this).val(minp)
@@ -712,7 +714,7 @@
 					if((reg.test(minp)||isNaN(minp))&&minp.indexOf(".")<0){
 						$(this).val(minnum)
 					}else{
-						minp = minp.substr(0,minp.length-1);
+						//minp = minp.substr(0,minp.length-1);
 						if(reg.test(minp)||isNaN(minp)){
 							$(this).val(minnum)
 						}else{
@@ -720,20 +722,23 @@
 								var offront = minp.split(".")[0];
 								var ofafter = minp.split(".")[1];
 								if(offront.length>9||ofafter.length>2){
-									if(offront.length>9){
-										$(this).val(offront.substr(0,9)+"."+ minnum.split(".")[1].substr(0,2))
-										minnum = offront.substr(0,9)+"."+ minnum.split(".")[1].substr(0,2);
-									}else{
-										$(this).val(offront.substr(0,9)+"."+ofafter.substr(0,2))
-										minnum = offront.substr(0,9)+"."+ofafter.substr(0,2);
-									}
+									//if(offront.length>9){
+										$(this).val(minnum)
+									//}else{
+									//	$(this).val(offront.substr(0,9)+"."+ofafter.substr(0,2))
+									//	minnum = offront.substr(0,9)+"."+ofafter.substr(0,2);
+									//}
 								}else{
 									$(this).val(minp)
 									minnum = minp;
 								}
 							}else{
-								$(this).val(minp)
-								minnum = minp;
+								if(minp.length>9){
+									$(this).val(minnum)
+								}else{
+									$(this).val(minp)
+									minnum = minp;
+								}
 							}
 							
 						}
@@ -745,7 +750,7 @@
 			})
 		
 			//
-			var maxnum = "";
+			var maxnum = {{.T.maxprice}};
 			$("#maxprice").on("input propertychange",function(){
 				var maxp = $.trim($(this).val()).replace(/\s/g,"");
 				$(this).val(maxp)
@@ -753,7 +758,7 @@
 					if((reg.test(maxp)||isNaN(maxp))&&maxp.indexOf(".")<0){
 						$(this).val(maxnum)
 					}else{
-						maxp = maxp.substr(0,maxp.length-1);
+						//maxp = maxp.substr(0,maxp.length-1);
 						if(reg.test(maxp)||isNaN(maxp)){
 							$(this).val(maxnum)
 						}else{
@@ -761,20 +766,24 @@
 								var offront = maxp.split(".")[0];
 								var ofafter = maxp.split(".")[1];
 								if(offront.length>9||ofafter.length>2){
-									if(offront.length>9){
-										$(this).val(offront.substr(0,9)+"."+ maxnum.split(".")[1].substr(0,2))
-										maxnum = offront.substr(0,9)+"."+ maxnum.split(".")[1].substr(0,2);
-									}else{
-										$(this).val(offront.substr(0,9)+"."+ofafter.substr(0,2))
-										maxnum = offront.substr(0,9)+"."+ofafter.substr(0,2);
-									}
+									//if(offront.length>9){
+										$(this).val(maxnum);
+									//}else{
+									//	$(this).val(offront.substr(0,9)+"."+ofafter.substr(0,2))
+									//	maxnum = offront.substr(0,9)+"."+ofafter.substr(0,2);
+									//}
 								}else{
 									$(this).val(maxp)
 									maxnum = maxp;
 								}
 							}else{
-								$(this).val(maxp)
-								maxnum = maxp;
+								if(maxp.length>9){
+									$(this).val(maxnum)
+								}else{
+									$(this).val(maxp)
+									maxnum = maxp;
+								}
+								
 							}
 							
 						}
@@ -896,6 +905,8 @@
 				$("#maxprice").val("")
 			}
 			if ($("#minprice").val()==""&&$("#maxprice").val()==""){
+				$(".pricefat").removeClass("customtime-active");
+				$(".pricebut").hide();
 				return false;
 			}
 			if (parseInt(minp)>parseInt(maxp)){
@@ -908,6 +919,7 @@
 			$(".pricefat").removeClass("customtime-active");
 			pricetype = "y";
 			$("#zbSeatchT input[name='pricetype']").val(pricetype);
+			return true;
 		}
 		
 		

+ 44 - 24
src/web/templates/pc/supsearch.html

@@ -407,7 +407,7 @@ $(function(){
 	});
 	//
 	var reg = /^[\u4e00-\u9fa5]+$/;
-	var minnum = "";
+	var minnum = {{.T.minprice}};
 	$("#minprice").on("input propertychange",function(){
 		var minp = $.trim($(this).val()).replace(/\s/g,"");
 		$(this).val(minp)
@@ -415,7 +415,7 @@ $(function(){
 			if((reg.test(minp)||isNaN(minp))&&minp.indexOf(".")<0){
 				$(this).val(minnum)
 			}else{
-				minp = minp.substr(0,minp.length-1);
+				//minp = minp.substr(0,minp.length-1);
 				if(reg.test(minp)||isNaN(minp)){
 					$(this).val(minnum)
 				}else{
@@ -423,20 +423,24 @@ $(function(){
 						var offront = minp.split(".")[0];
 						var ofafter = minp.split(".")[1];
 						if(offront.length>9||ofafter.length>2){
-							if(offront.length>9){
-								$(this).val(offront.substr(0,9)+"."+ minnum.split(".")[1].substr(0,2))
-								minnum = offront.substr(0,9)+"."+ minnum.split(".")[1].substr(0,2);
-							}else{
-								$(this).val(offront.substr(0,9)+"."+ofafter.substr(0,2))
-								minnum = offront.substr(0,9)+"."+ofafter.substr(0,2);
-							}
+							//if(offront.length>9){
+								$(this).val(minnum)
+							//	minnum = offront.substr(0,9)+"."+ minnum.split(".")[1].substr(0,2);
+							//}else{
+							//	$(this).val(offront.substr(0,9)+"."+ofafter.substr(0,2))
+							//	minnum = offront.substr(0,9)+"."+ofafter.substr(0,2);
+							//}
 						}else{
 							$(this).val(minp)
 							minnum = minp;
 						}
 					}else{
-						$(this).val(minp)
-						minnum = minp;
+						if(minp.length>9){
+							$(this).val(minnum)
+						}else{
+							$(this).val(minp)
+							minnum = minp;
+						}
 					}
 					
 				}
@@ -448,7 +452,7 @@ $(function(){
 	})
 
 	//
-	var maxnum = "";
+	var maxnum = {{.T.maxprice}};
 	$("#maxprice").on("input propertychange",function(){
 		var maxp = $.trim($(this).val()).replace(/\s/g,"");
 		$(this).val(maxp)
@@ -456,7 +460,7 @@ $(function(){
 			if((reg.test(maxp)||isNaN(maxp))&&maxp.indexOf(".")<0){
 				$(this).val(maxnum)
 			}else{
-				maxp = maxp.substr(0,maxp.length-1);
+				//maxp = maxp.substr(0,maxp.length-1);
 				if(reg.test(maxp)||isNaN(maxp)){
 					$(this).val(maxnum)
 				}else{
@@ -464,20 +468,24 @@ $(function(){
 						var offront = maxp.split(".")[0];
 						var ofafter = maxp.split(".")[1];
 						if(offront.length>9||ofafter.length>2){
-							if(offront.length>9){
-								$(this).val(offront.substr(0,9)+"."+ maxnum.split(".")[1].substr(0,2))
-								maxnum = offront.substr(0,9)+"."+ maxnum.split(".")[1].substr(0,2);
-							}else{
-								$(this).val(offront.substr(0,9)+"."+ofafter.substr(0,2))
-								maxnum = offront.substr(0,9)+"."+ofafter.substr(0,2);
-							}
+							//if(offront.length>9){
+								$(this).val(maxnum)
+							//	maxnum = offront.substr(0,9)+"."+ maxnum.split(".")[1].substr(0,2);
+							//}else{
+							//	$(this).val(offront.substr(0,9)+"."+ofafter.substr(0,2))
+							//	maxnum = offront.substr(0,9)+"."+ofafter.substr(0,2);
+							//}
 						}else{
 							$(this).val(maxp)
 							maxnum = maxp;
 						}
 					}else{
-						$(this).val(maxp)
-						maxnum = maxp;
+						if(maxp.length>9){
+							$(this).val(maxnum)
+						}else{
+							$(this).val(maxp)
+							maxnum = maxp;
+						}
 					}
 					
 				}
@@ -547,8 +555,15 @@ $(function(){
 		<div class="w searchHeader-container">
 			<!--整体页面切换tab-->
 			<div class="control-tabBtn">
+				{{if .T.supstatus}}
+				{{if eq .T.supstatus "T"}}
+				<a href="#" class="on">超级搜索</a>
+				<span class="bidbut" style="display:none;">招标搜索</span>
+				{{else}}
 				<a href="#" class="on" style="display:none;">超级搜索</a>
 				<span class="bidbut">招标搜索</span>
+				{{end}}
+				{{end}}
 				<a id="entsearch" href="javascript:" datahref="/jylab/bidsearchforent/index.html">中标企业搜索</a>
 			</div>
 			<!--搜索-->
@@ -568,11 +583,16 @@ $(function(){
 					<input type="hidden" name="selectType" value="all">
 				</form>
 				<!--筛选-->
-				<div id="screenBtn" class="screen up">
+				<div id="screenBtn" class="screen down">
 					筛选
 				</div>
 				<!--开启超级搜索 -->
-				<div class="superSearch" style="display:none;">
+				<div class="superSearch" 
+				{{if .T.supstatus}}
+				{{if eq .T.supstatus "T"}}
+				style="display:none;"
+				{{end}}
+				{{end}}>
 					开启超级搜索
 				</div>
 				<!--二维码-->

+ 1 - 0
src/web/templates/weixin/wxinfocontent.html

@@ -822,6 +822,7 @@ $(function(){
 		$(".adv-cont").css("background-color","");
 		$("#adv-left").addClass("hidden");
 		$("#onlyone").removeClass("hidden");
+		$(".adv-cont").css("height","auto");
 	}
 	$(".modal-dialog").css("top",document.body.scrollHeight/3)
 	var id = {{.T.obj._id}};