浏览代码

Merge branch 'feature/v4.7.62' of http://192.168.3.207:8080/qmx/jy into feature/v4.7.62

tsz 2 年之前
父节点
当前提交
16da49216a

+ 0 - 1
src/config.json

@@ -389,6 +389,5 @@
     "limitDay": 7,
     "limitCount": 3
   },
-  "defaultTotal": 180000000,
   "workDesktopUrl":"/page_workDesktop/work-bench/page?aside=0&link="
 }

+ 10 - 13
src/jfw/front/searchOptimize.go

@@ -633,16 +633,16 @@ func (so *SearchOptimize) GetBidSearchQuery() string {
 
 // GetBidSearchListByCache   查询缓存数据
 //未登录用户默认搜索和关键词搜索改成500条和免费用户保持一致--需求调整P260来自产品经理杨蘭20220116
-func (so *SearchOptimize) GetBidSearchListByCache() (list []*map[string]interface{}, count int64) {
+func (so *SearchOptimize) GetBidSearchListByCache() (list []*map[string]interface{}, count, total int64) {
 	//缓存数据 最大量是5000条  100页数据
-	l, c := func(so *SearchOptimize) (list []*map[string]interface{}, count int64) {
-		//缓存数据: kws.SearchGroup-全部,招标信息,超前信息;kws.PageNum-当前页 免费用户 or 付费用户,BidField:领域化产品
-		redisDataKey := fmt.Sprintf(SearchCacheKey, so.SearchGroup, util.If(so.IsPay, "v", "f").(string), util.If(so.BidField != "", so.BidField, "n").(string))
-		log.Println("redisDataKey:", redisDataKey)
+	l, c, t := func(so *SearchOptimize) (list []*map[string]interface{}, count, total int64) {
 		//缓存数据总量 - 当前平台
 		redisCountKey := fmt.Sprintf(SearchCacheCount, so.SearchGroup, util.If(so.IsPay, "v", "f").(string), util.If(so.BidField != "", so.BidField, "n").(string))
+		total = int64(redis.GetInt(RedisNameNew, redisCountKey))
+		//缓存数据: kws.SearchGroup-全部,招标信息,超前信息;kws.PageNum-当前页 免费用户 or 付费用户,BidField:领域化产品
+		redisDataKey := fmt.Sprintf(SearchCacheKey, so.SearchGroup, util.If(so.IsPay, "v", "f").(string), util.If(so.BidField != "", so.BidField, "n").(string))
+		log.Println("-------redisDataKey:------", redisDataKey)
 		sCache, err := redis.GetNewBytes(RedisNameNew, redisDataKey)
-		count = int64(redis.GetInt(RedisNameNew, redisCountKey))
 		if err == nil {
 			if sCache != nil && len(*sCache) > 0 {
 				err = json.Unmarshal(*sCache, &list)
@@ -656,13 +656,9 @@ func (so *SearchOptimize) GetBidSearchListByCache() (list []*map[string]interfac
 		//查询缓存数据 参数初始化
 		so.DefaultSearchParamsAuto()
 		//缓存数据
-		count, _, list = so.GetBidSearchList(true)
-		limitCount := int64(bidsearch.SearchPageSize_PC * util.If(so.IsPay, bidsearch.SearchMaxPageNum_PAYED, bidsearch.SearchMaxPageNum_PC).(int))
-		if count > limitCount {
-			count = limitCount
-		}
+		count, total, list = so.GetBidSearchList(true)
 		if len(list) > 0 {
-			redis.Put(RedisNameNew, redisCountKey, count, 16*60*60)
+			redis.Put(RedisNameNew, redisCountKey, total, 16*60*60)
 			b, err := json.Marshal(list)
 			if err == nil {
 				if err = redis.PutBytes(RedisNameNew, redisDataKey, &b, 16*60*60); err != nil {
@@ -677,8 +673,9 @@ func (so *SearchOptimize) GetBidSearchListByCache() (list []*map[string]interfac
 		return
 	}(so)
 	if len(l) > 0 {
-		list = l[(so.PageNum-1)*so.PageSize : so.PageNum*so.PageSize]
+		total = t
 		count = c
+		list = l[(so.PageNum-1)*so.PageSize : so.PageNum*so.PageSize]
 	}
 	return
 }

+ 11 - 11
src/jfw/front/supsearch.go

@@ -256,6 +256,7 @@ func (p *Pcsearch) GetNewBids() error {
 				"list":      []map[string]interface{}{},
 				"count":     0,
 				"totalPage": 0,
+				"total":     0,
 			})
 			return nil
 		}
@@ -272,11 +273,10 @@ func (p *Pcsearch) GetNewBids() error {
 	//搜索条件处理
 	so.SearchParamsHandle()
 	var (
-		list  []*map[string]interface{}
-		count int64
-		total = util.Int64All(config.Sysconfig["defaultTotal"])
+		list         []*map[string]interface{}
+		count, total int64
 	)
-	list, count = so.GetBidSearchListByCache()
+	list, count, total = so.GetBidSearchListByCache()
 	if pageType == "" { //最新招标信息仅第一页条展示表格多字段
 		for k, v := range list {
 			if pagenum == 1 && k < 20 {
@@ -295,9 +295,10 @@ func (p *Pcsearch) GetNewBids() error {
 		}
 	}
 	p.ServeJson(map[string]interface{}{
-		"list":  list,
-		"count": count,
-		"total": total,
+		"list":      list,
+		"count":     count,
+		"total":     total,
+		"totalPage": (count + 1) / int64(pageSize),
 	})
 	return nil
 }
@@ -406,7 +407,7 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	}
 	var (
 		list                               []*map[string]interface{}
-		totalPage, count, total            int64
+		count, total                       int64
 		secondFlag                         = ""
 		isSearch                           = true
 		b_word, a_word, s_word, heightKeys = "", "", "", ""
@@ -441,8 +442,7 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 			}
 		} else {
 			p.DisableHttpCache()
-			list, count = so.GetBidSearchListByCache()
-			total = util.Int64All(config.Sysconfig["defaultTotal"])
+			list, count, total = so.GetBidSearchListByCache()
 		}
 	}
 	if noLoginBl {
@@ -490,7 +490,7 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	p.T["selectType"] = selectType
 	p.T["login"] = p.Session().Get("user")
 	p.T["count"] = count
-	p.T["totalPage"] = totalPage
+	p.T["totalPage"] = (count + 1) / int64(pageSize)
 	p.T["keywords"] = keywords      //搜索关键词
 	p.T["heightWords"] = heightKeys //主关键词和附加词合并后
 	p.T["industry"] = industry

+ 1 - 0
src/jfw/front/swordfish.go

@@ -179,6 +179,7 @@ func (m *Front) PcAjaxReq() {
 		"list":               list,
 		"count":              count,
 		"total":              total,
+		"totalPage":          (count + 1) / int64(pageSize),
 		"interceptOtherWord": a_word,                                                //截取后 用于提示的关键词
 		"interceptKeyWords":  b_word,                                                //超出限制长度 截取后的关键词
 		"interceptLimit":     util.IntAllDef(config.Sysconfig["keywordsLimit"], 35), //限制额度

+ 23 - 6
src/web/staticres/css/dev2/biddingSearch.css

@@ -15,9 +15,10 @@
 /*白色字体*/
 #searchInner .searchHeader {
   /*头部*/
+  margin-top: 24px;
   /* height: 110px; */
-  background-color: #f5f5fb;
-  border-top: 1px solid #e0e0e0;
+  /* background-color: #f5f5fb; */
+  /* border-top: 1px solid #e0e0e0; */
 }
 
 #searchInner .searchHeader .searchHeader-container {
@@ -120,11 +121,11 @@
 }
 
 
-@media only screen and (max-width:1440px),only screen and (max-device-width:1440px){
+/* @media only screen and (max-width:1440px),only screen and (max-device-width:1440px){
   #searchInner .searchHeader .searchHeader-container .searchInput form input[type='search'] {
     width: 500px;
   }
-}
+} */
 
 
 #searchInner .searchHeader .searchHeader-container .searchInput form input[type='submit'] {
@@ -389,7 +390,7 @@ margin-left: 176px;
 
 #searchInner .searchControl .searchTender .leftTitle {
   float: left;
-  width: 94px;
+  width: 98px;
   text-align: right;
   color: #686868;
   padding: 4px 15px 4px 0px;
@@ -715,7 +716,7 @@ border-radius:2px;
 
 #searchInner .searchControl .seaTender-inner .tabTitle {
   line-height: 46px;
-  border: 1px solid #e0e0e0;
+  border-bottom: 1px solid #e0e0e0;
 /*  background-color: #f5f4f9;*/
 }
 
@@ -1677,4 +1678,20 @@ position: absolute;
 }
 .change-search-input{
   padding: 16px 24px 10px 32px;
+}
+/* 未登录页面样式调整为与嵌入页面一样 */
+body{
+  background: #f2f2f4;
+}
+#searchInner .searchControl .searchTender,
+#searchInner .searchHeader-container,
+#searchInner .filter-header{
+  background: #fff;
+}
+#searchInner .searchHeader-container,
+#searchInner .searchControl .searchTender{
+  border-radius: 8px;
+}
+#searchInner .searchControl .searchTender{
+  border: 0;
 }

+ 3 - 3
src/web/staticres/css/dev2/superSearch.css

@@ -133,16 +133,16 @@
   display: flex;
   justify-content: space-between;
   align-items: center;
-  padding: 0 16px 0 30px;
+  padding: 0 16px 0 22px;
   margin: 0 -15px;
   height: 50px;
   line-height: 50px;
   background: #F5F5FB;
-  border: 1px solid #ECECEC;
+  border-bottom: 1px solid #ECECEC;
 }
 .filter-header .f-h-label{
   width: 100px;
-  padding-left: 16px;
+  padding-left: 10px;
   background-repeat: no-repeat;
   background-position: right center;
   background-size: 16px 16px;

+ 1 - 1
src/web/staticres/js/superSearch.js

@@ -1104,7 +1104,7 @@ function autoModelFn (r) {
   if (mhFlag) {
     console.log(mhFlag, '模糊flag');
     if (r.list && r.list.length > 0) {
-      toastFn('精准搜索无结果,已为您自动切换到模糊搜索', 2000)
+      toastFn('精准搜索无结果,已为您自动切换到模糊搜索', 5000)
       autoSwitchModel = false
     } else {
       $("#zbSeatchT [name='searchMode']").val(0)

+ 1 - 0
src/web/staticres/public-pc/css/sub-page.css

@@ -37,6 +37,7 @@ body.in-iframe {
 
 /* 标讯搜索 页面 */
 .in-iframe[data-page-name=supsearch] #searchInner .searchHeader {
+  margin-top: 0;
   border-top: unset;
 }
 .in-iframe[data-page-name=supsearch] #searchInner .searchHeader .searchHeader-container {

+ 1 - 1
src/web/templates/pc/index.html

@@ -55,7 +55,7 @@
               <i></i>
             </div>
             <form method="post" action="/jylab/supsearch/index.html" class="form-search" id="zbIndex" name="zbIndex" target="stop" onsubmit="return false">
-              <input class="ser" onkeydown="onkeydownSearch()" autocomplete="off"  type="text" name="keywords" placeholder="请输入您想要查询的招标信息,多个关键词用空格隔开" id="keywords" value="" />
+              <input class="ser" onkeydown="onkeydownSearch()" autocomplete="off"  type="text" name="keywords" placeholder="请输入项目名称等关键词,例如:医疗设备" id="keywords" value="" />
               <input type="hidden" name="searchvalue">
               <input type="hidden" name="selectType" value="title">
               <input type="hidden">

+ 2 - 2
src/web/templates/pc/supsearch.html

@@ -754,7 +754,7 @@ var IframeOnClick = {
 			<div class="searchInput clearfix" :class="{'change-search-input': showAddKeyword || keywordMult}">
         <div class="searchInput-left">
           <form action="/jylab/{{.T.module}}/index.html" method="post" id="zbSeatchT" class="clearfix" onsubmit="return beforeSubmit('F')">
-            <input class="searchname" autocomplete="off" type="search" id="searchinput" value="{{.T.keywords}}" name="keywords" placeholder="请输入您想要查询的招标信息,多个关键词用空格隔开" />
+            <input class="searchname" autocomplete="off" type="search" id="searchinput" value="{{.T.keywords}}" name="keywords" placeholder="请输入项目名称等关键词,例如:医疗设备" />
             <img src='{{Msg "seo" "cdn"}}/images/pc_20.png' id="t-clear" class="j-clearicon" style="display: none;">
             <input type="button" value="搜索" onclick="zbSeatch('zbSeatchT')"/>
             <input type="hidden" name="publishtime" value="{{.T.publishtime}}">
@@ -1628,7 +1628,7 @@ $(function(){
     }
     if (mhModel && autoSwitchModel) {
       if (goTemplateData.params.list) {
-        toastFn('精准搜索无结果,已为您自动切换到模糊搜索', 2000)
+        toastFn('精准搜索无结果,已为您自动切换到模糊搜索', 5000)
         autoSwitchModel = false
       } else {
         // 模糊搜索无结果时 再切回精准