Browse Source

feat:搜索高亮分页

wangshan 3 năm trước cách đây
mục cha
commit
f4d75774aa

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

@@ -291,7 +291,8 @@ func (p *Pcsearch) PcSearchIndex() error {
 	secondKWS := ""
 	if len(s_word) > 0 || len(industry) > 0 {
 		status = 2
-		_, _, _, _, secondFlag, count, totalPage, list = bidsearch.SearchData("pc", p.Request, 1, util.ObjToString(p.GetSession("userId")), secondKWS, s_word, area, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, 0, bidsearch.SearchPageSize_PC, true, queryItems, bidSearch_field_1, notkey, isPayedUser)
+		secondKWS, _, _, _, secondFlag, count, totalPage, list = bidsearch.SearchData("pc", p.Request, 1, util.ObjToString(p.GetSession("userId")), secondKWS, s_word, area, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, 0, bidsearch.SearchPageSize_PC, true, queryItems, bidSearch_field_1, notkey, isPayedUser)
+		log.Println("list:", len(*list))
 	} else {
 		p.DisableHttpCache()
 		p.T["list"] = PCS_list("") //Newbids("")[0]
@@ -305,7 +306,10 @@ func (p *Pcsearch) PcSearchIndex() error {
 		} else if len(secondList) > 0 {
 			p.T["secondList"] = secondList
 		}
-
+		if secondKWS != "" {
+			s_word = s_word + "+" + secondKWS
+		}
+		log.Println(len(secondList), "-------", secondFlag)
 		p.T["list"] = list
 		p.T["secondFlag"] = secondFlag
 		p.T["area"] = area

+ 4 - 7
src/jfw/modules/common/src/qfw/util/bidsearch/search.go

@@ -307,7 +307,7 @@ func PublicSearch(userId, selectType, publishtime string, bidSearchOldUserLimit
 }
 
 //所有的再次分词查询 只查标题
-func IntegratedData(platform string, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, secondFlag, area, publishtime, subtype, buyerclass, notkey string, queryItems []string, list *[]map[string]interface{}) (string, string, string, string, []map[string]interface{}) {
+func IntegratedData(platform string, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, secondFlag, area, publishtime, subtype, buyerclass, notkey string, queryItems []string, list *[]map[string]interface{}) (string, string, string, string, *[]map[string]interface{}) {
 	var pcAjaxFlag string
 	secondSearch := false
 	var secRel *[]map[string]interface{}
@@ -339,7 +339,7 @@ func IntegratedData(platform string, s_word, secondKWS, industry, minprice, maxp
 			s_word += "+" + secondKWS
 		}
 	}
-	return s_word, pcAjaxFlag, secondFlag, secondKWS, *secRel
+	return s_word, pcAjaxFlag, secondFlag, secondKWS, secRel
 }
 
 func classify(stp, area, industry string, configData map[string]interface{}) (string, string, string) {
@@ -445,11 +445,8 @@ func SearchData(platform string, request *http.Request, currentPage int, userId,
 		listSize = len(*list)
 	}
 	if len([]rune(s_word)) > 3 && int(count) < SearchPageSize_PC && start == number {
-		var paramList []map[string]interface{}
-		s_word, pcAjaxFlag, secondFlag, second, paramList = IntegratedData(platform, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, secondFlag, area, publishtime, subtype, buyerclass, notkey, queryItems, list)
-		if len(paramList) > 0 {
-			list = &paramList
-		}
+		var paramList *[]map[string]interface{} = list
+		s_word, pcAjaxFlag, secondFlag, second, list = IntegratedData(platform, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, secondFlag, area, publishtime, subtype, buyerclass, notkey, queryItems, paramList)
 	}
 	public.SaveUserSearchLog(request, userId, -1, platform, "超级搜索", map[string]interface{}{
 		"search_word":        util.If(platform == "app" || platform == "wx", searchvalue, s_word),

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

@@ -2249,7 +2249,7 @@ document.querySelector(".searchControl").oncopy = function(){
               $(".tabContainer").show();
               $(".hasNoData").hide();
               //$(".nbnext").addClass("disabled");
-              appendDatas(list,true,false);
+              appendDatas(secondList,true,false);
             }else if(!nbflag&&currentPage>0){
               getNewBiddings();
             }else{