Browse Source

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

wenmenghao 3 years ago
parent
commit
38417082ae

+ 25 - 26
src/jfw/front/applysub.go

@@ -8,7 +8,6 @@ import (
 	"log"
 	"net/url"
 	"qfw/util"
-	"qfw/util/elastic"
 	"qfw/util/jy"
 	"qfw/util/redis"
 	"regexp"
@@ -26,7 +25,7 @@ type Applysub struct {
 	sendMsg       xweb.Mapper `xweb:"/front/applysub/sendMsg"`       //发送验证码
 	checkCode     xweb.Mapper `xweb:"/front/applysub/checkCode"`     //查询手机号是否已使用
 	subInfo       xweb.Mapper `xweb:"/front/applysub/subInfo"`       //查询手机号是否已使用
-	recList       xweb.Mapper `xweb:"/front/entsesearch/recList"`    //获取推荐企业列表
+	//recList       xweb.Mapper `xweb:"/front/entsesearch/recList"`    //获取推荐企业列表
 }
 
 func init() {
@@ -165,30 +164,30 @@ func (a *Applysub) CheckPhoneNum() error {
 }
 
 //
-func (e *Applysub) RecList() {
-	defer util.Catch()
-	//re := []map[string]interface{}{}
-	var entName = e.GetString("entName")
-	limit := 10
-	query := `{"query": {
-			    "bool": {
-			      "must_not":[],
-			      "should": [{
-			          "bool": {"must": [{"multi_match": {"query": "` + entName + `", "type": "phrase","fields": ["entname"], "analyzer": "my_ngram"}}]}
-			        }],
-				  "minimum_should_match": 1
-			    }
-			  },
-			  "_source": ["entname"],
-			  "from": 0,"size": ` + fmt.Sprint(limit) + `
-			}`
-	list := *elastic.Get("entname", "entname", query)
-	if list != nil && len(list) != 0 {
-		e.ServeJson(map[string]interface{}{
-			"recList": list,
-		})
-	}
-}
+//func (e *Applysub) RecList() {
+//	defer util.Catch()
+//	//re := []map[string]interface{}{}
+//	var entName = e.GetString("entName")
+//	limit := 10
+//	query := `{"query": {
+//			    "bool": {
+//			      "must_not":[],
+//			      "should": [{
+//			          "bool": {"must": [{"multi_match": {"query": "` + entName + `", "type": "phrase","fields": ["entname"], "analyzer": "my_ngram"}}]}
+//			        }],
+//				  "minimum_should_match": 1
+//			    }
+//			  },
+//			  "_source": ["entname"],
+//			  "from": 0,"size": ` + fmt.Sprint(limit) + `
+//			}`
+//	list := *elastic.Get("entname", "entname", query)
+//	if list != nil && len(list) != 0 {
+//		e.ServeJson(map[string]interface{}{
+//			"recList": list,
+//		})
+//	}
+//}
 
 //
 func (a *Applysub) Index() error {

+ 4 - 3
src/jfw/front/message.go

@@ -3,8 +3,8 @@ package front
 import (
 	"encoding/json"
 	"html/template"
+	"jfw/public"
 	"qfw/util"
-	"qfw/util/elastic"
 	"qfw/util/redis"
 
 	"github.com/go-xweb/xweb"
@@ -28,8 +28,9 @@ func (m *Message) MesContent(_id string) error {
 		m.T["data"] = retlist
 	} else {
 		id := se.DecodeString(_id)
-		r := elastic.GetByIdField("content", "content", id, `"s_title","l_createdate","releasetime","s_content","s_source"`)
-		if r != nil {
+		//r := elastic.GetByIdField("content", "content", id, `"s_title","l_createdate","releasetime","s_content","s_source"`)
+		r, _ := public.MQFW.FindById("content", id, `{"s_title":1,"s_content":1,"releasetime":1,"s_source":1,"l_createdate":1}`)
+		if r != nil && len(*r) > 0 {
 			tmpdate1 := util.Int64All((*r)["l_createdate"])
 			(*r)["l_createdate"] = util.FormatDateByInt64(&tmpdate1, util.Date_Short_Layout)
 			tmpdate2 := util.Int64All((*r)["releasetime"])

+ 59 - 0
src/jfw/front/shorturl.go

@@ -297,6 +297,35 @@ func (s *Short) Article(stype, id string) error {
 		if len(obj) > 0 {
 			FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, isVip || isMember || isEntniche, true)
 
+			//免费用户正文手机号替换
+			if obj["site"] == "剑鱼信息发布平台" && !isMember {
+				//采购电话中标单位电话置空
+				if util.InterfaceToStr(obj["buyertel"]) != "" {
+					obj["buyertel"] = "freeView"
+				}
+				if util.InterfaceToStr(obj["winnertel"]) != "" {
+					obj["winnertel"] = "freeView"
+				}
+				//正文电话 手机号 邮箱处理
+				if detail, _ := obj["detail"].(string); detail != "" {
+					//手机号
+					re1 := regexp.MustCompile("1[345789]{1}\\d{9}")
+					detail1 := re1.ReplaceAllString(detail, `<span class="freeView">点击查看</span>`)
+					code := util.InterfaceToStr(obj["projectcode"])
+					if code != "" {
+						detail1 = strings.ReplaceAll(detail1, code, "*********")
+					}
+					//座机
+					re2 := regexp.MustCompile("((0\\d{2,3})-)(\\d{7,8})(-(\\d{3,}))?")
+					detail2 := re2.ReplaceAllString(detail1, `<span class="freeView">点击查看</span>`)
+					re4 := regexp.MustCompile("((400)-)(\\d{3,4}-)(\\d{3,})")
+					detail4 := re4.ReplaceAllString(detail2, `<span class="freeView">点击查看</span>`)
+					//邮箱
+					re3 := regexp.MustCompile("([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)")
+					detail3 := re3.ReplaceAllString(detail4, `<span class="freeView">点击查看</span>`)
+					obj["detail"] = strings.ReplaceAll(strings.ReplaceAll(detail3, `<span class="freeView">点击查看</span><span class="freeView">点击查看</span>`, `<span class="freeView">点击查看</span>`), "*********", code)
+				}
+			}
 			//获取打赏文案
 			s.T["rewardText"], s.T["advertText"] = getRewardText()
 			//纠错随机回复
@@ -419,6 +448,36 @@ func (s *Short) Article(stype, id string) error {
 				}
 				FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, isVip || isMember || isEntniche, false)
 
+				//免费用户正文手机号替换
+				if obj["site"] == "剑鱼信息发布平台" && !isMember {
+					//采购电话中标单位电话置空
+					if util.InterfaceToStr(obj["buyertel"]) != "" {
+						obj["buyertel"] = "freeView"
+					}
+					if util.InterfaceToStr(obj["winnertel"]) != "" {
+						obj["winnertel"] = "freeView"
+					}
+					//正文电话 手机号 邮箱处理
+					if detail, _ := obj["detail"].(string); detail != "" {
+						//手机号
+						re1 := regexp.MustCompile("1[345789]{1}\\d{9}")
+						detail1 := re1.ReplaceAllString(detail, `<span class="freeView">点击查看</span>`)
+						code := util.InterfaceToStr(obj["projectcode"])
+						if code != "" {
+							detail1 = strings.ReplaceAll(detail1, code, "*********")
+						}
+						//座机
+						re2 := regexp.MustCompile("((0\\d{2,3})-)(\\d{7,8})(-(\\d{3,}))?")
+						detail2 := re2.ReplaceAllString(detail1, `<span class="freeView">点击查看</span>`)
+						re4 := regexp.MustCompile("((400)-)(\\d{3,4}-)(\\d{3,})")
+						detail4 := re4.ReplaceAllString(detail2, `<span class="freeView">点击查看</span>`)
+						//邮箱
+						re3 := regexp.MustCompile("([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)")
+						detail3 := re3.ReplaceAllString(detail4, `<span class="freeView">点击查看</span>`)
+						obj["detail"] = strings.ReplaceAll(strings.ReplaceAll(detail3, `<span class="freeView">点击查看</span><span class="freeView">点击查看</span>`, `<span class="freeView">点击查看</span>`), "*********", code)
+					}
+				}
+
 				s.T["obj"] = obj
 
 				if obj["projectname"] != nil {

+ 94 - 49
src/jfw/front/supsearch.go

@@ -9,6 +9,7 @@ import (
 	"math/rand"
 	"qfw/util"
 	"qfw/util/bidsearch"
+	"qfw/util/elastic"
 	"qfw/util/jy"
 	"qfw/util/redis"
 	"strconv"
@@ -82,17 +83,17 @@ func PCS_task() {
 
 //返回内存中列表也的数据,只获取首页,其他页面访问量暂时不多
 func PCS_list(page_type string) interface{} {
-	var _page_type = page_type
-	//如果page_type为空,则是获取非拟建数据。
-	if page_type == "" {
-		_page_type = "page_index"
-	}
-	PCSLock.Lock()
-	defer PCSLock.Unlock()
-	if PCS_index[_page_type] == nil {
-		PCS_index[_page_type] = Newbids(page_type)[0]
-	}
-	return PCS_index[_page_type]
+	/*var _page_type = page_type
+	  //如果page_type为空,则是获取非拟建数据。
+	  if page_type == "" {
+	  	_page_type = "page_index"
+	  }
+	  PCSLock.Lock()
+	  defer PCSLock.Unlock()
+	  if PCS_index[_page_type] == nil {
+	  	PCS_index[_page_type] = Newbids(page_type)[0]
+	  }*/
+	return Newbids(page_type)[0]
 }
 
 //
@@ -386,60 +387,104 @@ func (p *Pcsearch) PcSearchIndex() error {
 
 //
 func Newbids(p string) []interface{} {
-	pages, _ := redis.Get("other", "index_list"+p).([]interface{})
+	pages, _ := redis.Get("newother", "index_list"+p).([]interface{})
 	if len(pages) == 0 {
 		var list *[]map[string]interface{}
 		subtype := ""
 		if len(p) > 0 {
 			subtype = "拟建"
 		}
-		intns := make([]int, 0)
-		for i := 0; i < 10; i++ {
-			if len(intns) == 0 {
-				intns = append(intns, rand.Intn(100))
-			} else {
-				for {
-					v := rand.Intn(intns[(i-1)] + 100)
-					if v-intns[(i-1)] >= 30 {
-						intns = append(intns, v)
-						break
+		//查询置顶信息
+		var ss []map[string]interface{}
+		ls := top500(subtype)
+		if ls != nil && len(*ls) > 0 {
+			ss = append(ss, *ls...)
+		}
+		//pages = append(pages, ls)
+		if ls == nil || len(*ls) < 500 {
+			intns := make([]int, 0)
+			for i := 0; i < 10; i++ {
+				if len(intns) == 0 {
+					intns = append(intns, rand.Intn(100))
+					//intns = append(intns, 0)
+				} else {
+					for {
+						v := rand.Intn(intns[(i-1)] + 100)
+						if v-intns[(i-1)] > 50 {
+							intns = append(intns, v)
+							break
+						}
 					}
 				}
 			}
+			for i := 0; i < 10; i++ {
+				_, list = getLastNewsData("", "", "", "", subtype, "", "", "", "", "", "", "", "Y", intns[i], true, false, "")
+				ss = append(ss, *list...)
+				// pages = append(pages, list)
+			}
 		}
-
+		data := duplicateRemoval(ss)
 		for i := 0; i < 10; i++ {
-			_, list = getLastNewsData("", "", "", "", subtype, "", "", "", "", "", "", "", "Y", intns[i], true, false, "")
-			for k, v := range *list {
-				v["k"] = (k + 1) + i*50
-				t := time.Unix(util.Int64All(v["publishtime"]), 0)
-				v["timetemp"] = fmt.Sprint(util.Int64All(v["publishtime"]))
-				v["_id"] = util.EncodeArticleId2ByCheck(v["_id"].(string))
-				v["time"] = util.TimeDiff(t)
-				var stp = ""
-				if v["subtype"] != nil {
-					stp, _ = v["subtype"].(string)
-				} else {
-					stp = ""
-				}
-				if stp == "" && v["toptype"] != nil {
-					stp, _ = v["toptype"].(string)
-				}
-				area, _ := v["area"].(string)
-				indtry := util.ObjToString(v["industry"])
-				v["stypeadd"], v["areaadd"], v["indadd"] = classify(stp, area, indtry)
-				if v["filetext"] != nil {
-					delete(v, "filetext")
-					v["fileExists"] = true
-				}
+			sta := i * 50
+			end := i*50 + 50
+			if end > len(data) {
+				pages = append(pages, data[end:])
+				break
 			}
-			pages = append(pages, list)
+			pages = append(pages, data[sta:end])
 		}
-		redis.Put("other", "index_list"+p, pages, 60*60*24*2)
-		pages, _ = redis.Get("other", "index_list"+p).([]interface{})
+		redis.Put("newother", "index_list"+p, pages, 60*60*24)
+		pages, _ = redis.Get("newother", "index_list"+p).([]interface{})
 	}
 	return pages
 }
+func duplicateRemoval(ss []map[string]interface{}) []map[string]interface{} {
+	d := make(map[string]interface{})
+	data := []map[string]interface{}{}
+	for _, v := range ss {
+		id := util.InterfaceToStr(v["_id"])
+		if _, ok := d[id]; ok || id == "" {
+			continue
+		}
+		t := time.Unix(util.Int64All(v["publishtime"]), 0)
+		v["timetemp"] = fmt.Sprint(util.Int64All(v["publishtime"]))
+		v["_id"] = util.EncodeArticleId2ByCheck(id)
+		v["time"] = util.TimeDiff(t)
+		var stp = ""
+		if v["subtype"] != nil {
+			stp, _ = v["subtype"].(string)
+		} else {
+			stp = ""
+		}
+		if stp == "" && v["toptype"] != nil {
+			stp, _ = v["toptype"].(string)
+		}
+		area, _ := v["area"].(string)
+		indtry := util.ObjToString(v["industry"])
+		v["stypeadd"], v["areaadd"], v["indadd"] = classify(stp, area, indtry)
+		if v["filetext"] != nil {
+			delete(v, "filetext")
+			v["fileExists"] = true
+		}
+		if _, ok := d[id]; ok {
+			continue
+		}
+		d[id] = true
+		v["k"] = util.IntAll(v["k"]) + 1
+		data = append(data, v)
+	}
+	return data
+}
+
+func top500(industry string) (list *[]map[string]interface{}) {
+	qstr := `{"query": {"bool": {"should": [{"term": {"dataweight": 1}}]}}}`
+	repl := elastic.GetAllByNgram(INDEX, TYPE, qstr, `"title"`, `{"publishtime":-1}`, bidSearch_field, 0, 500, 115, false)
+	if repl != nil && *repl != nil && len(*repl) > 0 {
+		public.BidListConvert(industry, repl)
+		list = repl
+	}
+	return
+}
 
 //二维码图片
 func (p *Pcsearch) Qr(t string) error {

+ 60 - 75
src/jfw/front/swordfish.go

@@ -33,9 +33,9 @@ import (
 )
 
 var (
-	bidSearch_field_1    = `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","bidamount","budget","buyerclass","spidercode","site"`
+	bidSearch_field_1    = `"_id","title","publishtime","toptype","subtype","type","area","dataweight","city","s_subscopeclass","bidamount","budget","buyerclass","spidercode","site"`
 	bidSearch_field      = bidSearch_field_1 + `,"bidopentime","winner","buyer","projectname","projectcode","projectinfo"`
-	bidSearch_sort       = `{"publishtime":-1}`
+	bidSearch_sort       = `{"dataweight":-1,"publishtime":-1}`
 	bidSearch_field_file = `,"filetext","isValidFile"`
 )
 
@@ -1364,7 +1364,6 @@ func (f *Front) Jyblog(param /*参数*/ string) error {
 		paramstr := param[1:]
 		bs, _ := base64.StdEncoding.DecodeString(paramstr)
 		json.Unmarshal(bs, &querymap)
-
 	}
 	var shareid = f.GetString("id")
 	if len(shareid) == 0 {
@@ -1391,92 +1390,66 @@ func SearhWebContentblog(querymap map[string]string) (*[]map[string]interface{},
 	}
 	contentType := querymap["contentType"]
 	queryStr := querymap["query"]
-	str := ``
+
+	queryMap := map[string]interface{}{
+		"s_contenttype": contentType,
+	}
+
 	if queryStr != "" {
-		str = `{
-	          "match": {
-	            "s_title": {
-	              "query":"` + queryStr + `",
-	              "operator": "and"
-	            }
-	          }
-	        },{
-	          "match": {
-	            "s_content": {
-	              "query":"` + queryStr + `"
-	            }
-	          }
-	        }`
-	}
-	var tempQuery = `{"query": {
-	    "bool": {
-			"must":[{"term":{"s_contenttype":"` + contentType + `"}}],
-	      	"should": [` + str + `],
-	      	"minimum_should_match": 0
-	    }
-	  }}`
-	var query = tempQuery[:len(tempQuery)-1] +
-		`,"highlight":{
-        "pre_tags":["<span class='highlight'>"],
-        "post_tags":["</span>"],
-        "fields":{
-            "s_title":{"force_source": true}
-			,"s_content":{"force_source": true}
-        }
-    },"_source":["s_title","s_date","s_contenttype","s_content","releasetime","s_description","praise","s_source","s_pic","s_pic1","l_createdate","s_code","_id","s_author"]
-	,"from":` + fmt.Sprintf("%v", ((currentPage-1)*perPage)) + `,
-	"size":` + fmt.Sprintf("%v", perPage) +
-		`,"sort":[{"releasetime":{"order":"desc"}}] }`
-
-	total := elastic.Count("content", "content", tempQuery)
+		queryMap["$or"] = []interface{}{
+			map[string]interface{}{
+				"s_title": map[string]interface{}{"$regex": queryStr},
+			},
+			map[string]interface{}{
+				"s_content": map[string]interface{}{"$regex": queryStr},
+			},
+		}
+	}
+
+	total := public.MQFW.Count("content", queryMap)
+
 	//查询列表数据
 	client := elastic.GetEsConn()
 	defer elastic.DestoryEsConn(client)
 	if client == nil {
 		return nil, nil
 	}
-	searchResult, err := client.Search().Index("content").Type("content").Source(query).Do()
-	if err != nil {
-		return nil, nil
-	}
+	searchResult, _ := public.MQFW.Find("content", queryMap, `{"releasetime":-1}`, `{"s_title":1,"s_contenttype":1,"s_content":1,"releasetime":1,"s_description":1,"praise":1,"s_source":1,"s_pic":1,"s_pic1":1,"l_createdate":1,"_id":1,"s_author":1}`, false, (currentPage-1)*perPage, perPage)
+
 	var res []map[string]interface{}
-	if searchResult.Hits != nil {
-		resNum := len(searchResult.Hits.Hits)
-		res = make([]map[string]interface{}, resNum)
-		for i, hit := range searchResult.Hits.Hits {
-			json.Unmarshal(*hit.Source, &res[i])
-			//查询结果数据加工处理
-			for k, v := range hit.Highlight {
-				res[i][k] = v[0]
-			}
-			s_content, _ := res[i]["s_content"].(string)
+	if searchResult != nil && len(*searchResult) > 0 {
+		for _, m := range *searchResult {
+			s_content, _ := m["s_content"].(string)
 			if len(s_content) > 500 {
-				res[i]["s_content"] = ""
+				m["s_content"] = ""
 			} else {
 				con, _ := regexp.Compile("^[^<]*?>")
 				content := con.ReplaceAllString(s_content, "")
 				con1, _ := regexp.Compile("<[^>]*$")
-				res[i]["s_content"] = template.HTML(con1.ReplaceAllString(content, ""))
-			}
-			s_title, _ := res[i]["s_title"].(string)
-			res[i]["s_title"] = template.HTML(s_title)
-			tmpdate, _ := res[i]["l_createdate"]
-			res[i]["l_createdate"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate.(float64)), 0))
-			tmpdate1, _ := res[i]["releasetime"]
-			res[i]["releasetime"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate1.(float64)), 0))
-			reltime := time.Unix(util.Int64All(tmpdate1.(float64)), 0)
-			res[i]["time"] = reltime.Format(util.Date_Short_Layout) //首页展示
-			s_pic, _ := res[i]["s_pic"].(string)
+				m["s_content"] = template.HTML(con1.ReplaceAllString(content, ""))
+			}
+
+			s_title, _ := m["s_title"].(string)
+			m["s_title"] = template.HTML(s_title)
+
+			tmpdate, _ := m["l_createdate"]
+			m["l_createdate"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate), 0))
+			tmpdate1, _ := m["releasetime"]
+			m["releasetime"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate1), 0))
+			reltime := time.Unix(util.Int64All(tmpdate1), 0)
+			m["time"] = reltime.Format(util.Date_Short_Layout) //首页展示
+			s_pic, _ := m["s_pic"].(string)
 			if s_pic != "" {
 				s_pic = config.Seoconfig["jyadd"].(string) + s_pic
 			}
-			res[i]["s_pic"] = s_pic
-			s_pic1, _ := res[i]["s_pic1"].(string)
+			m["s_pic"] = s_pic
+			s_pic1, _ := m["s_pic1"].(string)
 			if s_pic1 != "" {
 				s_pic1 = config.Seoconfig["jyadd"].(string) + s_pic1
 			}
-			res[i]["s_pic1"] = s_pic1
-			res[i]["_id"] = se.EncodeString(res[i]["_id"].(string))
+			m["s_pic1"] = s_pic1
+			m["_id"] = se.EncodeString(BsonIdToSId(m["_id"]))
+			res = append(res, m)
 		}
 	}
 	//生成分页
@@ -1522,6 +1495,17 @@ func MakePagination(perPage, currentPage, total int, param map[string]string, ur
 	url = fmt.Sprintf(urltpl, paramstr)
 	iscurrent = currentPage == totalPages
 	ret[index] = map[string]interface{}{"page": "下一页 >", "url": url, "iscurrent": iscurrent}
+
+	//
+	u := map[string]interface{}{
+		"currentPage": 1,
+		"query":       "招标",
+		"contentType": param["contentType"],
+	}
+	bs, _ = json.Marshal(u)
+	paramstr = base64.StdEncoding.EncodeToString(bs)
+	fmt.Println("ooooo", paramstr)
+
 	return ret
 }
 
@@ -1542,14 +1526,15 @@ func (f *Front) Jybdetail(_id string) error {
 		f.T["data"] = retlist
 	} else {
 		id := se.DecodeString(_id)
-		r := elastic.GetByIdField("content", "content", id, `"_id","s_title","l_createdate","s_pic","s_author","s_editorname","s_contenttype","praise","releasetime","s_subcontent","s_url","s_content","s_source","s_keywords","s_description","s_contenttype","s_pic1"`)
+		//r := elastic.GetByIdField("content", "content", id, `"_id","s_title","l_createdate","s_pic","s_author","s_editorname","s_contenttype","praise","releasetime","s_subcontent","s_url","s_content","s_source","s_keywords","s_description","s_contenttype","s_pic1"`)
+		r, _ := public.MQFW.FindById("content", id, `{"s_title":1,"s_contenttype":1,"s_content":1,"releasetime":1,"s_description":1,"praise":1,"s_source":1,"s_pic":1,"s_pic1":1,"l_createdate":1,"_id":1,"s_author":1,"s_editorname":1,"s_url":1,"s_subcontent":1,"s_keywords":1}`)
 		if r != nil {
 			tmpdate1, _ := (*r)["l_createdate"]
-			(*r)["l_createdate"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate1.(float64)), 0))
+			(*r)["l_createdate"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate1), 0))
 			tmpdate2, _ := (*r)["releasetime"]
-			(*r)["releasetime"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate2.(float64)), 0))
-			(*r)["s_content"] = template.HTML((*r)["s_content"].(string))
-			(*r)["_id"] = se.EncodeString((*r)["_id"].(string))
+			(*r)["releasetime"] = util.TimeDiff(time.Unix(util.Int64All(tmpdate2), 0))
+			(*r)["s_content"] = template.HTML(util.ObjToString((*r)["s_content"]))
+			(*r)["_id"] = se.EncodeString(BsonIdToSId((*r)["_id"]))
 			s_pic, _ := (*r)["s_pic"].(string)
 			if s_pic != "" {
 				s_pic = config.Seoconfig["jyadd"].(string) + s_pic

+ 4 - 3
src/jfw/modules/app/src/app/front/message.go

@@ -3,8 +3,8 @@ package front
 import (
 	"encoding/json"
 	"html/template"
+	"jfw/public"
 	"qfw/util"
-	"qfw/util/elastic"
 	"qfw/util/redis"
 
 	"github.com/go-xweb/xweb"
@@ -29,8 +29,9 @@ func (m *Message) MesContent(_id string) error {
 		m.T["data"] = retlist
 	} else {
 		id := se.DecodeString(_id)
-		r := elastic.GetByIdField("content", "content", id, `"s_title","l_createdate","releasetime","s_content","s_source"`)
-		if r != nil {
+		//r := elastic.GetByIdField("content", "content", id, `"s_title","l_createdate","releasetime","s_content","s_source"`)
+		r, _ := public.MQFW.FindById("content", id, `{"s_title":1,"s_content":1,"releasetime":1,"s_source":1,"l_createdate":1}`)
+		if r != nil && len(*r) > 0 {
 			tmpdate1 := util.Int64All((*r)["l_createdate"])
 			(*r)["l_createdate"] = util.FormatDateByInt64(&tmpdate1, util.Date_Short_Layout)
 			tmpdate2 := util.Int64All((*r)["releasetime"])

+ 31 - 0
src/jfw/modules/app/src/app/front/shorturl.go

@@ -4,6 +4,7 @@ import (
 	"database/sql"
 	"fmt"
 	"jfw/config"
+	"regexp"
 	"strconv"
 	"strings"
 	"time"
@@ -173,6 +174,36 @@ func (s *Short) Article(stype, id string) error {
 			obj["buyerperson"] = ""
 			obj["buyertel"] = ""
 		}
+		//免费用户正文手机号替换
+		if obj["site"] == "剑鱼信息发布平台" && i_member_status <= 0 {
+			//采购电话中标单位电话置空
+			if util.InterfaceToStr(obj["buyertel"]) != "" {
+				obj["buyertel"] = "freeView"
+			}
+			if util.InterfaceToStr(obj["winnertel"]) != "" {
+				obj["winnertel"] = "freeView"
+			}
+			//正文电话 手机号 邮箱处理
+			if detail, _ := obj["detail"].(string); detail != "" {
+				//手机号
+				re1 := regexp.MustCompile("1[345789]{1}\\d{9}")
+				detail1 := re1.ReplaceAllString(detail, `<span class="freeView">点击查看</span>`)
+				code := util.InterfaceToStr(obj["projectcode"])
+				if code != "" {
+					detail1 = strings.ReplaceAll(detail1, code, "*********")
+				}
+				//座机
+				re2 := regexp.MustCompile("((0\\d{2,3})-)(\\d{7,8})(-(\\d{3,}))?")
+				detail2 := re2.ReplaceAllString(detail1, `<span class="freeView">点击查看</span>`)
+				re4 := regexp.MustCompile("((400)-)(\\d{3,4}-)(\\d{3,})")
+				detail4 := re4.ReplaceAllString(detail2, `<span class="freeView">点击查看</span>`)
+				//邮箱
+				re3 := regexp.MustCompile("([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)")
+				detail3 := re3.ReplaceAllString(detail4, `<span class="freeView">点击查看</span>`)
+				obj["detail"] = strings.ReplaceAll(strings.ReplaceAll(detail3, `<span class="freeView">点击查看</span><span class="freeView">点击查看</span>`, `<span class="freeView">点击查看</span>`), "*********", code)
+			}
+		}
+
 		s.T["obj"] = obj
 		s.T["forceShareFlag"] = public.CheckUserNeedForceShare(userId, public.ShareType_detail)
 		s.T["isIosExam"], s.T["isIosExamPhone"], _, _ = IosExamInfo(s.Action, false, false)

+ 4 - 3
src/jfw/modules/app/src/web/templates/frontRouter/bigmember/free/perfect_info.html

@@ -1019,7 +1019,8 @@
             'ent-manage-app': '请留下联系方式,我们会尽快联系您体验商机管理全部功能!',
             "jypush_see10_plus_app":"请完善个人信息,为您匹配更多精准项目信息",
             "jyarticle_see3_plus_app":"请完善个人信息,获取更多免费查看公告权限",
-            peugeot_supplier_regist:"请完善您的个人信息,抢先对接采购单位"
+            peugeot_supplier_regist:"请完善您的个人信息,抢先对接采购单位",
+            peugeot_view_infor: '请留下联系方式,我们会尽快联系您体验大会员全部功能!',
           }
 
           // 提示语
@@ -1557,8 +1558,8 @@
           this.ajaxParams.mail = this.infoMap.email
           this.ajaxParams.companyType = this.infoMap.companyType
           this.ajaxParams.company = this.infoMap.company
-          if (getParam('source') === 'peugeot_supplier_regist'){
-            this.ajaxParams.publish_id = getParam('infoid')
+          if (this.ajaxParams.source === 'peugeot_supplier_regist' || this.ajaxParams.source === 'peugeot_view_infor'){
+            this.ajaxParams.publish_id = utils.getParam('infoid')
           }
           this.ajaxParams.position = this.infoMap.position
           if (this.infoMap.position === '其他') {

+ 25 - 6
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -43,7 +43,7 @@
         font-size: .22rem;
         color: #2ABDD1;
       }
-      .menu_list,.downfiles{
+      .menu_list,.downfiles,.freeView{
         color: #2ABED1;
         word-break: break-all;
       }
@@ -1003,7 +1003,7 @@
     var agency_ = {{.T.obj.agency}};
     var buyer_ = {{.T.obj.buyer}};
     var buyerperson_ = {{.T.obj.buyerperson}};
-    var buyertel_ = {{.T.obj.buyertel}};
+    var buyertel_ = checkFreeView({{.T.obj.buyertel}});
     var projectname = {{.T.obj.projectname}};
     var isbid =false; //是否是中标,需要显示所有
 
@@ -1181,7 +1181,7 @@
                 }
                 var isVip = {{.T.isVip}}
                 //是大会员
-                var bigWinnerTel = {{.T.obj.winnertel}};
+                var bigWinnerTel = checkFreeView({{.T.obj.winnertel}});
                 var winner_enttel={{.T.obj.winner_enttel}};
                 var tel_source="来源:国家企业公示网站、招标信息等";
                 if(bigWinnerTel==null){
@@ -1196,7 +1196,7 @@
 
                 if({{.T.isVip}}||{{.T.member_status}}>0||{{.T.isEntniche}}){
                     bigInfohtml +='<p style="width:4.2rem">'+bigWinnerTel+'</p><div class="border-tel"><div class="tel"></div></div><div class="tel-source">'+tel_source+'</div>'
-                }else if ({{.T.obj.winnertel}}||({{.T.obj.winner_enttel}}==="无权限")){
+                }else if (checkFreeView({{.T.obj.winnertel}})||({{.T.obj.winner_enttel}}==="无权限")){
                     bigInfohtml +='<div onclick="adv_statistics(this)" adv_name="app_article_getcontact" style="width:4.2rem"><a datalink="/jyapp/vipsubscribe/introducePage" style="color: rgb(44, 183, 202);">获取联系方式</a></div><div onclick="adv_statistics(this)" adv_name="app_article_getcontact" ><a class="border-tel" style="display:block;position: static;" datalink="/jyapp/vipsubscribe/introducePage"><div class="tel"></div></a></div>'
                 }
                 if(count>=5&&!isVip&&!isEntniche&&bigWinnerTel!=""&&isbid){
@@ -2083,7 +2083,7 @@
       if(rerbuyerperson==undefined||rerbuyerperson==null){
           rerbuyerperson=""
       }
-      var rerbuyertel = {{.T.obj.buyertel}};
+      var rerbuyertel = checkFreeView({{.T.obj.buyertel}});
       var buyertel_show = ""
       if(!rerbuyertel || !rerbuyertel){
           rerbuyertel=""
@@ -2124,7 +2124,7 @@
           if(rerbidamount==null){
               rerbidamount=""
           }
-          var winnertel = {{.T.obj.winnertel}};
+          var winnertel = checkFreeView({{.T.obj.winnertel}});
           var winner_enttel={{.T.obj.winner_enttel}};
           var tel_source="来源:国家企业公示网站、招标信息等";
           if(winnertel==null){
@@ -2862,7 +2862,26 @@
       $('.go-buy-file-pack').click(function(){
        location.href = '/jy_mobile/common/order/create/filepack?type=0'
       })
+
+      // 用户发布信息。点击去查看,留资
+      $('.app-layout-content-b .content').on('click', '.freeView', function () {
+        var info = {
+          source: 'peugeot_view_infor',
+          infoid: id
+        }
+        location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + info.source + '&infoid=' + info.infoid
+      })
     })
+
+    // 用户发布的信息的联系方式
+    // 仅大会员可见明文
+    function checkFreeView (key) {
+      if (key === 'freeView') {
+        return '<span class="freeView">点击查看</span>'
+      } else {
+        return key
+      }
+    }
 </script>
 {{include "/common/baiducc.html"}}
 </body>

+ 80 - 29
src/jfw/modules/bigmember/src/service/analysis/potential.go

@@ -596,30 +596,45 @@ func analysisData(res []*AggregationsBucket, mycs map[string]interface{}, omyr m
 		wg          = sync.WaitGroup{}
 		wc          = make(chan bool, 10)
 		entMap      = map[string]*AggregationsBucket{}
+		lock        = &sync.Mutex{}
 	)
 	for ak, av := range res {
+		var isContinue = false
 		//清洗无效数据
 		if av.Key == "" || av.Key == "null" {
-			continue
+			isContinue = true
 		}
 		//清洗无效客户
 		if mycs != nil && mycs[av.Key] != nil {
-			continue
+			isContinue = true
 		}
 		//排除移除的我的潜在竞争对手
 		if omyr != nil && omyr[av.Key] != nil {
-			continue
+			isContinue = true
+		}
+		if isContinue {
+			//防止最后一个企业不匹配  直接跳出
+			if len(res) != ak+1 {
+				continue
+			}
+		} else {
+			entMap[av.Key] = av
+			//并发查询企业库是否包含此企业信息
+			entersFifty = append(entersFifty, av.Key)
 		}
-		entMap[av.Key] = av
-		//并发查询企业库是否包含此企业信息
-		entersFifty = append(entersFifty, av.Key)
 		if len(entersFifty)%50 == 0 || (len(res) == ak+1 && len(entersFifty) > 0) {
 			wg.Add(1)
 			wc <- true
 			go func(entersFifty []string) {
-				entInfos = append(entInfos, entity.GetEntInfo(entersFifty, pcor)...)
-				wg.Done()
-				<-wc
+				defer func() {
+					wg.Done()
+					<-wc
+					qutil.Catch()
+				}()
+				entInfo := entity.GetEntInfo(entersFifty, pcor)
+				lock.Lock()
+				defer lock.Unlock()
+				entInfos = append(entInfos, entInfo...)
 			}(entersFifty)
 			entersFifty = []string{}
 		}
@@ -661,6 +676,8 @@ func analysisDataByBuyer(res []map[string]interface{}, mycs map[string]interface
 	var EnterQYXY = []*entity.EnterQYXYInfo{} //企业信用是否有此企业数据
 	var EnterQYXY_map = map[string]string{}   //企业信用是否有此企业数据
 	var wg sync.WaitGroup
+	var wc = make(chan bool, 10)
+	var wl = &sync.Mutex{}
 	var entersFifty = []string{}
 	for k, v := range res {
 		var isContinue = false
@@ -674,14 +691,22 @@ func analysisDataByBuyer(res []map[string]interface{}, mycs map[string]interface
 		}
 		if isContinue {
 			//防止最后一个企业不匹配  直接跳出
-			// if len(res) == k+1 {
-			// 	wg.Add(1)
-			// 	go func(entersFifty []string) {
-			// 		EnterQYXY = append(EnterQYXY, entity.GetEntInfoByQYXY(entersFifty, "C")...)
-			// 		wg.Done()
-			// 	}(entersFifty)
-			// 	entersFifty = []string{}
-			// }
+			if len(res) == k+1 && len(entersFifty) > 0 {
+				wg.Add(1)
+				wc <- true
+				go func(entersFifty []string) {
+					defer func() {
+						wg.Done()
+						<-wc
+						qutil.Catch()
+					}()
+					entInfo := entity.GetEntInfoByQYXY(entersFifty, "C")
+					wl.Lock()
+					defer wl.Unlock()
+					EnterQYXY = append(EnterQYXY, entInfo...)
+				}(entersFifty)
+				entersFifty = []string{}
+			}
 			continue
 		}
 		var budget_val = qutil.ObjToMap(v["count"])  //预算总金额
@@ -721,9 +746,17 @@ func analysisDataByBuyer(res []map[string]interface{}, mycs map[string]interface
 		entersFifty = append(entersFifty, key_val)
 		if (k+1)%50 == 0 || len(res) == k+1 {
 			wg.Add(1)
+			wc <- true
 			go func(entersFifty []string) {
-				EnterQYXY = append(EnterQYXY, entity.GetEntInfoByQYXY(entersFifty, "C")...)
-				wg.Done()
+				defer func() {
+					wg.Done()
+					<-wc
+					qutil.Catch()
+				}()
+				entInfo := entity.GetEntInfoByQYXY(entersFifty, "C")
+				wl.Lock()
+				defer wl.Unlock()
+				EnterQYXY = append(EnterQYXY, entInfo...)
 			}(entersFifty)
 			entersFifty = []string{}
 		}
@@ -756,6 +789,8 @@ func analysisDataByWinner(res []map[string]interface{}, mycs map[string]interfac
 	var EnterQYXY = []*entity.EnterQYXYInfo{}             //企业信用是否有此企业数据
 	var EnterQYXY_map = map[string]entity.EnterQYXYInfo{} //企业信用是否有此企业数据
 	var wg sync.WaitGroup
+	var wc = make(chan bool, 10)
+	var wl = &sync.Mutex{}
 	var entersFifty = []string{}
 	for k, v := range res {
 		var isContinue = false
@@ -773,14 +808,22 @@ func analysisDataByWinner(res []map[string]interface{}, mycs map[string]interfac
 		}
 		if isContinue {
 			//防止最后一个企业不匹配  直接跳出
-			// if len(res) == k+1 {
-			// 	wg.Add(1)
-			// 	go func(entersFifty []string, pcor string) {
-			// 		EnterQYXY = append(EnterQYXY, entity.GetEntInfoByQYXY(entersFifty, pcor)...)
-			// 		wg.Done()
-			// 	}(entersFifty, pcor)
-			// 	entersFifty = []string{}
-			// }
+			if len(res) == k+1 && len(entersFifty) > 0 {
+				wg.Add(1)
+				wc <- true
+				go func(entersFifty []string, pcor string) {
+					defer func() {
+						wg.Done()
+						<-wc
+						qutil.Catch()
+					}()
+					entInfo := entity.GetEntInfoByQYXY(entersFifty, pcor)
+					wl.Lock()
+					defer wl.Unlock()
+					EnterQYXY = append(EnterQYXY, entInfo...)
+				}(entersFifty, pcor)
+				entersFifty = []string{}
+			}
 			continue
 		}
 		var budget_val = qutil.ObjToMap(v["count"])  //预算总金额
@@ -795,9 +838,17 @@ func analysisDataByWinner(res []map[string]interface{}, mycs map[string]interfac
 		entersFifty = append(entersFifty, key_val)
 		if (k+1)%50 == 0 || len(res) == k+1 {
 			wg.Add(1)
+			wc <- true
 			go func(entersFifty []string, pcor string) {
-				EnterQYXY = append(EnterQYXY, entity.GetEntInfoByQYXY(entersFifty, pcor)...)
-				wg.Done()
+				defer func() {
+					wg.Done()
+					<-wc
+					qutil.Catch()
+				}()
+				entInfo := entity.GetEntInfoByQYXY(entersFifty, pcor)
+				wl.Lock()
+				defer wl.Unlock()
+				EnterQYXY = append(EnterQYXY, entInfo...)
 			}(entersFifty, pcor)
 			entersFifty = []string{}
 		}

+ 3 - 2
src/jfw/modules/common/src/qfw/util/bidsearch/search.go

@@ -18,7 +18,7 @@ import (
 const (
 	INDEX          = "bidding"
 	TYPE           = "bidding"
-	bidSearch_sort = `{"publishtime":-1}`
+	bidSearch_sort = `{"dataweight":-1,"publishtime":-1}`
 
 	//招标搜索分页--每页显示数量
 	SearchPageSize_APP = 50
@@ -30,7 +30,7 @@ const (
 	SearchMaxPageNum_PC    = 10  //免费用户500条记录
 	SearchMaxPageNum_PAYED = 100 //付费用户5000条记录
 
-	bidSearch_field_1 = `"_id","title","publishtime","toptype","subtype","type","area","city","s_subscopeclass","bidamount","budget","buyerclass","filetext","spidercode","site"`
+	bidSearch_field_1 = `"_id","title","dataweight","publishtime","toptype","subtype","type","area","city","s_subscopeclass","bidamount","budget","buyerclass","filetext","spidercode","site"`
 	bidSearch_field   = bidSearch_field_1 + `,"bidopentime","winner","buyer","projectname","projectcode","projectinfo"`
 )
 
@@ -249,6 +249,7 @@ func DetailTitle(findfields string) bool {
 func GetSearchQuery(keyword, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, findfields, mustquery, notkey string, searchTypeSwitch bool) (qstr string) {
 	multi_match := `{"multi_match": {"query": "%s","type": "phrase", "fields": [%s]}}`
 	query := `{"query":{"bool":{"must":[%s],"must_not":[%s]}}}`
+	//query := `{"query": {"function_score": {"query": {"bool": {"must": [%s],"must_not": [%s]}},"field_value_factor": {"field": "dataweight","modifier": "ln1p","missing": 0}}}}`
 	query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
 	query_bools_must := `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
 	query_bool_must := `{"bool":{"must":[{"terms":{"s_subscopeclass":[%s]}}]}}`

+ 2 - 1
src/jfw/modules/common/src/qfw/util/dataexport/dataexport.go

@@ -92,6 +92,7 @@ func getDataExportSql(scd *SieveCondition) string {
 	}
 	multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
 	query := `{"query":{"bool":{"must":[%s],"must_not":[%s],"should":[%s],"minimum_should_match": %d}}}`
+	//query := `{"query": {"function_score": {"query": {"bool": {"must": [%s],"must_not": [%s],"should": [%s],"minimum_should_match": %d}},"field_value_factor": {"field": "dataweight","modifier": "ln1p","missing": 0}}}}`
 	query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
 	query_price := `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
 	query_bool_must := `{"terms":{"%s":[%s]}}`
@@ -918,7 +919,7 @@ func doSearch(sql string, start, count int, dataType string) *[]map[string]inter
 			sql = sql[:len(sql)-1] + `,"_source":[` + dataexport_field + "]}"
 		}
 		//分页排序
-		sql = sql[:len(sql)-1] + `,"sort": {"publishtime":"desc","id":"desc"},"from":` + strconv.Itoa(start) + `,"size":` + strconv.Itoa(count) + "}"
+		sql = sql[:len(sql)-1] + `,"sort": {"dataweight": "desc","publishtime":"desc","id":"desc"},"from":` + strconv.Itoa(start) + `,"size":` + strconv.Itoa(count) + "}"
 	}
 	log.Println("doSearch", sql)
 	return elastic.Get(INDEX, TYPE, sql)

+ 9 - 2
src/web/staticres/common-module/keep-tags/keep-ent-tags-template.js

@@ -558,7 +558,12 @@ function checkBackSuccess () {
   sessionStorage.removeItem('salesBackStatus')
   sessionStorage.removeItem('salesBackData')
 }
-$(function () {
+
+// 没注册过,注册。注册过,则不用再次注册
+window.registerCheckBack = false
+if (!window.registerCheckBack) {
+  $(function () {
+    window.registerCheckBack = true
     checkBackSuccess()
     if (utils.isWeiXinBrowser) {
       var aTime = new Date().getTime()
@@ -571,4 +576,6 @@ $(function () {
         }
       }, false);
     }
-})
+  })
+}
+

+ 9 - 3
src/web/staticres/common-module/keep-tags/keep-tags-template.js

@@ -408,7 +408,7 @@ Vue.component('keep-component', {
       }
       if (type) {
         $.post('/salesLeads/retainedCapital' + '?source=article_collection', { source: 'article_collection' }).done(function (r) {
-          var checkKeys = ['name', 'phone', 'company', 'mail', 'branch', 'position', 'companyType']
+          var checkKeys = ['name', 'phone', 'company', 'branch', 'position', 'companyType']
           var result = checkRequiredKeys(checkKeys, r.info)
           // 判断当前信息否在其他页面留资  如果全部留资 直接弹窗提交成功
           if (result || !window.isFree) {
@@ -632,7 +632,12 @@ function checkBackSuccess () {
   sessionStorage.removeItem('salesBackStatus')
   sessionStorage.removeItem('salesBackData')
 }
-$(function () {
+
+// 没注册过,注册。注册过,则不用再次注册
+window.registerCheckBack = false
+if (!window.registerCheckBack) {
+  $(function () {
+    window.registerCheckBack = true
     checkBackSuccess()
     if (utils.isWeiXinBrowser) {
       var aTime = new Date().getTime()
@@ -645,4 +650,5 @@ $(function () {
         }
       }, false);
     }
-})
+  })
+}

+ 2 - 1
src/web/staticres/js/pc-collect-user-info.js

@@ -400,7 +400,8 @@ var vm = new Vue({
         "jyarticle_see3_plus_pc":"请完善个人信息,获取更多免费查看公告权限",
         'activity_free_plan': '请完善信息,免费获取200剑鱼币',
         super_membership_day: '请留下联系方式,我们会尽快联系您体验大会员全部功能!',
-        peugeot_supplier_regist:'请完善您的个人信息,抢先对接采购单位'
+        peugeot_supplier_regist:'请完善您的个人信息,抢先对接采购单位',
+        peugeot_view_infor: '请留下联系方式,我们会尽快联系您体验大会员全部功能!',
       },
       isRefresh: false // 留完资是否需要刷新页面
     }

+ 5 - 0
src/web/staticres/pccss/pc-detail.css

@@ -833,4 +833,9 @@ a{
   border: 1px solid #ececec;
   border-radius: 4px;
   font-size: 13px;
+}
+
+.freeView {
+  color: #2cb7ca;
+  cursor: pointer;
 }

+ 29 - 0
src/web/staticres/public-pc/js/article-content.js

@@ -2520,4 +2520,33 @@ $(function() {
       })
     }
   })
+
+  // 检查freeView
+  function checkFreeView () {
+    // 采购电话
+    var buyerTelContainer = $('.tab-cont .cont-cont.buyertel')
+    var buyerTel = buyerTelContainer.text()
+    // 中标联系方式
+    var winnerTelContainer = $('#winnertel')
+    var winnerTel = winnerTelContainer.text()
+    
+    if (buyerTel === 'freeView') {
+      buyerTelContainer.html('<span class="freeView">点击查看</span>')
+    }
+    if (winnerTel === 'freeView') {
+      winnerTelContainer.parent().html('<span class="freeView">点击查看</span>')
+    }
+  }
+
+  checkFreeView()
+  // 用户发布信息。点击去查看,留资
+  $('.main-content').on('click', '.freeView', function () {
+    var info = {
+      source: 'peugeot_view_infor',
+      infoid: id
+    }
+    vm.isNeedSubmit(info.source, function () {
+      vm.showSuccess = true
+    },"", info.infoid)
+  })
 })

+ 3 - 2
src/web/templates/frontRouter/wx/bigmember/free/perfect_info.html

@@ -672,7 +672,8 @@
          'ent-manage-wx': '请留下联系方式,我们会尽快联系您体验商机管理全部功能!',
          "jypush_see10_plus_wx":"请完善个人信息,为您匹配更多精准项目信息",
          "jyarticle_see3_plus_wx":"请完善个人信息,获取更多免费查看公告权限",
-          peugeot_supplier_regist:"请完善您的个人信息,抢先对接采购单位"
+          peugeot_supplier_regist:"请完善您的个人信息,抢先对接采购单位",
+          peugeot_view_infor: '请留下联系方式,我们会尽快联系您体验大会员全部功能!',
         }
 
         // 提示语
@@ -1253,7 +1254,7 @@
         this.ajaxParams.mail = this.infoMap.email
         this.ajaxParams.company = this.infoMap.company
         this.ajaxParams.companyType = this.infoMap.companyType
-        if (this.getParam('source') === 'peugeot_supplier_regist'){
+        if (this.getParam('source') === 'peugeot_supplier_regist' || this.ajaxParams.source === 'peugeot_view_infor'){
           this.ajaxParams.publish_id = this.getParam('infoid')
         }
         this.ajaxParams.position = this.infoMap.position

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

@@ -906,7 +906,7 @@
 							<tr>
 								<td class="tab-type">采购电话</td>
 								<td class="tab-cont">
-									<div class="cont-cont">{{.T.obj.buyertel}}</div>
+									<div class="cont-cont buyertel">{{.T.obj.buyertel}}</div>
 									<div class="cont-recy" onclick="recoveryerr(this,'buyertel','')">纠错</div>
 									<div style="display:none;"></div>
 								</td>

+ 36 - 4
src/web/templates/weixin/wxinfocontent_rec.html

@@ -213,7 +213,8 @@ pre {
     left: 70px;
     top: 20px;
 }
-.jykeyword{
+.jykeyword,
+.freeView {
 	color:#2cb7ca;
 }
 .filename{
@@ -1370,7 +1371,7 @@ var city_ = {{.T.obj.city}};
 var agency_ = {{.T.obj.agency}};
 var buyer_ = {{.T.obj.buyer}};
 var buyerperson_ = {{.T.obj.buyerperson}};
-var buyertel_ = {{.T.obj.buyertel}};
+var buyertel_ = checkFreeView({{.T.obj.buyertel}});
 var isbid =false; //是否是中标,需要显示所有
 var canRead = {{.T.canRead}} //免费用户当天查看是否查看三次公告
 //拟建项目广告
@@ -2262,7 +2263,7 @@ $(function(){
 		if(rerbuyerperson==undefined||rerbuyerperson==null){
 			rerbuyerperson=""
 		}
-    var rerbuyertel = {{.T.obj.buyertel}};
+    var rerbuyertel = checkFreeView({{.T.obj.buyertel}});
 		if(rerbuyertel==undefined||rerbuyertel==null){
 			rerbuyertel=""
 		}
@@ -2300,6 +2301,7 @@ $(function(){
       rerbidamount=""
     }
     var winnertel = {{if or .T.isVip .T.isEntniche .T.isMember }}{{.T.obj.winnertel}}{{else}}null{{end}};
+    winnertel = checkFreeView(winnertel)
     var winner_enttel={{.T.obj.winner_enttel}};
     var tel_source="来源:国家企业公示网站、招标信息等";
     if(winnertel==null){
@@ -2324,7 +2326,17 @@ $(function(){
         bidInfohtml +='</li>'
       }
      $("#bidInfo ul").html(bidInfohtml)
-     if (!rerwinner) {
+      // 用户发布,非大会员,中标信息显示freeView
+      // 中标信息tel freeView情况
+      try {
+        if (goTemplateData.params.obj.winnertel === 'freeView') {
+          var html = checkFreeView(goTemplateData.params.obj.winnertel)
+          $('.winnertel .tel-item').html(html)
+        }
+      } catch (error) {
+        console.log(error)
+      }
+      if (!rerwinner) {
         $('.go-winner').hide()
       }
     }
@@ -2953,7 +2965,27 @@ $(function(){
   $('.go-buy-file-pack').click(function(){
    location.href = '/jy_mobile/common/order/create/filepack?type=0'
   })
+
+  // 用户发布信息。点击去查看,留资
+  $('.info .content').on('click', '.freeView', function () {
+    var info = {
+      source: 'peugeot_view_infor',
+      infoid: id
+    }
+    location.href = '/weixin/frontPage/bigmember/free/perfect_info?source=' + info.source + '&infoid=' + info.infoid
+  })
 })
+
+// 用户发布的信息的联系方式
+// 仅大会员可见明文
+function checkFreeView (key) {
+  if (key === 'freeView') {
+    return '<span class="freeView">点击查看</span>'
+  } else {
+    return key
+  }
+}
+
 function reward(){
 	window.location.href = "/jypay/weixin/reward/redirect?id={{.T.obj._id}}&source=m";
 }