lianbingjie 2 жил өмнө
parent
commit
33235bfb27
48 өөрчлөгдсөн 8576 нэмэгдсэн , 866 устгасан
  1. 334 0
      src/config.json
  2. 37 17
      src/jfw/front/dataExport.go
  3. 855 0
      src/jfw/front/searchOptimize.go
  4. 16 0
      src/jfw/front/shorturl.go
  5. 170 134
      src/jfw/front/supsearch.go
  6. 139 2
      src/jfw/front/swordfish.go
  7. 28 15
      src/jfw/front/ws_dataExport.go
  8. 5 0
      src/jfw/modules/app/src/app/front/swordfish.go
  9. 55 0
      src/jfw/modules/app/src/app/front/ws_dataExport.go
  10. 2 1
      src/jfw/modules/bigmember/src/config.json
  11. 1 0
      src/jfw/modules/bigmember/src/config/config.go
  12. 1 1
      src/jfw/modules/bigmember/src/service/subscribe/subscribe.go
  13. 118 0
      src/jfw/modules/bigmember/src/service/use/use.go
  14. 601 0
      src/jfw/modules/common/src/qfw/util/bidsearch/search.go
  15. 1218 0
      src/jfw/modules/common/src/qfw/util/dataexport/dataexport.go
  16. 343 0
      src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go
  17. 478 0
      src/jfw/modules/common/src/qfw/util/jy/jy.go
  18. 188 0
      src/jfw/modules/common/src/qfw/util/jy/payUser.go
  19. 14 0
      src/jfw/modules/publicapply/src/attachmentdow/service/service.go
  20. 286 40
      src/jfw/modules/publicapply/src/userbase/entity/entity.go
  21. 7 0
      src/jfw/modules/publicapply/src/userbase/service/service.go
  22. 229 0
      src/jfw/public/dataexport.go
  23. 465 35
      src/web/staticres/css/dev2/biddingSearch.css
  24. 21 1
      src/web/staticres/css/dev2/newBidSearch.css
  25. 5 1
      src/web/staticres/css/dev2/superSearch-inside.css
  26. 26 8
      src/web/staticres/css/dev2/superSearch.css
  27. 29 20
      src/web/staticres/css/pc/index.css
  28. BIN
      src/web/staticres/images/biddingSearch/bidding-search.png
  29. BIN
      src/web/staticres/images/biddingSearch/tab-icon5.png
  30. BIN
      src/web/staticres/images/biddingSearch/tab-icon6.png
  31. BIN
      src/web/staticres/images/pc/icon_voice.png
  32. 181 4
      src/web/staticres/js/common.js
  33. 25 4
      src/web/staticres/js/ent-search-index-pc.js
  34. 8 3
      src/web/staticres/js/login.js
  35. 1 1
      src/web/staticres/js/pc-message-index.js
  36. 18 0
      src/web/staticres/js/pur-search-index-pc.js
  37. 85 0
      src/web/staticres/js/selector/keyword-tags.js
  38. 1660 0
      src/web/staticres/js/superSearch copy.js
  39. 287 306
      src/web/staticres/js/superSearch.js
  40. 42 9
      src/web/staticres/pccss/ent-search-index-pc.css
  41. 40 7
      src/web/staticres/pccss/pur-search-index-pc.css
  42. 1 0
      src/web/staticres/public-pc/css/sub-page.css
  43. 7 6
      src/web/staticres/serviceSystem/css/serviceSystem.css
  44. 61 61
      src/web/templates/frontRouter/pc/serviceSystem/free/index.html
  45. 9 3
      src/web/templates/pc/entsearchindex.html
  46. 12 8
      src/web/templates/pc/index.html
  47. 11 5
      src/web/templates/pc/pursearchindex.html
  48. 457 174
      src/web/templates/pc/supsearch.html

+ 334 - 0
src/config.json

@@ -1,4 +1,5 @@
 {
+<<<<<<< HEAD
   "nodeName": "node1",
   "qrModelID": "2",
   "numTimeNumber": 15,
@@ -67,6 +68,68 @@
     "jy_extend": {
       "activitystartcode": "3202100000",
       "activityendcode": "3202199999"
+=======
+    "nodeName":"node1",
+    "qrModelID": "2",
+    "numTimeNumber": 15,
+    "strTimeNumber": 30,
+    "webport": "83",
+    "webrpcport": "8084",
+    "weixinrpc": "127.0.0.1:8083",
+    "cacheflag": false,
+    "agreement": "http",
+    "webdomain": "https://web-ws.jydev.jianyu360.com",
+    "redirect": {
+        "searchinfo": "/jylab/mainSearch?msg=0",
+        "rssset": "/swordfish/newhistorypush?msg=1",
+        "viewdemo": "/front/viewdemo",
+        "wxpushlist": "/wxpush/bidinfo/%s",
+        "share": "/swordfish/guide/share",
+        "myfollow": "/follow/list",
+        "newInfoFollow": "/jylab/followent/newInfo/%s",
+        "entListFollow": "/jylab/followent/entList",
+        "pcmyfollow": "/follow/set/list/%s",
+        "feedback": "/swordfish/feedback",
+        "wxpushfollowlist": "/follow/notice/%s/%s?advertcode=%s",
+        "community": "http://www.myfans.cc/30a78e9b78",
+        "quickly": "http://mp.weixin.qq.com/s?__biz=MzIyNTM1NDUyNw==&mid=100000001&idx=1&sn=58e6008f0577d529a56c9ed78724decf&scene=0#wechat_redirect",
+        "useskill": "http://mp.weixin.qq.com/mp/homepage?__biz=MzIyNTM1NDUyNw==&hid=1&sn=f9e98da1975f85011ee138a4ee5cfbe8#wechat_redirect",
+        "about": "/swordfish/about?flag=1",
+        "followset": "/follow/set/%s/%s?advertcode=%s",
+        "myfeedbacks": "/swordfish/myFeedbacks",
+        "zqluckdraw": "/active/zqLuckdraw",
+        "followent": "/jylab/followent/entList",
+        "labindex": "/jylab/index",
+        "qrToLab": "/jylab/qrToLab/%s",
+        "searchKeyword": "/jylab/searchKeyword/%s",
+        "sealRep": "/active/sealfriends/%s",
+        "sealIndex": "/active/seal/index",
+        "sealSend": "/active/seal/sealMsg",
+        "futureIndex": "/active/future/index",
+        "keysetIndex": "/wxkeyset/keyset/index?tiptext=%s",
+        "followEntDetail": "/jylab/followent/detail/%s?advertcode=%s",
+        "mymenu": "/front/wxMyOrder/myMenu?msg=4",
+		"historypush": "/swordfish/newhistorypush?times=%s&advertcode=%s&msg=1",
+		"msgremind": "/front/vipsubscribe/msgremind?%s",
+		"treasurebox":"/jyTreasureBox/treasureBox?msg=3",
+		"vipreport":"/subscribepay/report/wxtplmsg?start=%s&end=%s&pushcount=%s&advertcode=%s",
+		"viphomepage":"/front/vipsubscribe/introducePage?advertcode=%s",
+		"viphomepage_new":"/jy_mobile/common/order/create/svip?type=buy",
+		"liveAcitve":"/active/livePage/index",
+		"bigMember":"/big/wx/page/landingPage",
+		"structed":"/front/structed/index?p=wx",
+		"digitalExpo":"/active/digital/index",
+		"docsMobile":"/page_docs_mobile/home",
+		"pointsMobile":"/page_points_mobile/home",
+		"bidedoc":"/weixin/frontPage/bidedoc/sess/index",
+		"memberreport_experience":"/bigmember/report/openpushmsg?t=wx_experience&start=%s&end=%s&pushcount=%s&advertcode=%s",
+		"chanpartner":"/weixin/frontPage/partner/sess/partner?p=wxmeun",
+		"datareport":"/datareport/page/order/detail/%s?advertcode=%s",
+		"vipFree7":"/weixin/frontPage/share/sess/index?p=wxmeun",
+		"toSubVipSetPage":"/front/vipsubscribe/toSubVipSetPage?advertcode=%s",
+		"followProjectList":"/big/wx/page/pro_follow_list?advertcode=%s",
+		"followProjectSet": "/big/wx/page/pro_follow_detail?fid=%s&sid=%s&advertcode=%s"
+>>>>>>> master
     },
     "jy_leaflets": {
       "activitystartcode": "3202200000",
@@ -157,6 +220,7 @@
         "field": "buyertel"
       }
     ],
+<<<<<<< HEAD
     "其他": [
       {
         "proportion": 8,
@@ -380,4 +444,274 @@
     "winnerMap": true
   },
   "keywordsLimitNologin": 25
+=======
+    "recoveryField": {
+        "招标": [
+            {
+                "proportion": 15,
+                "field": "projectname"
+            },
+            {
+                "proportion": 5,
+                "field": "budget"
+            },
+            {
+                "proportion": 15,
+                "field": "buyer"
+            },
+            {
+                "proportion": 5,
+                "field": "agency"
+            },
+            {
+                "proportion": 15,
+                "field": "winner"
+            },
+            {
+                "proportion": 15,
+                "field": "bidopentime"
+            },
+            {
+                "proportion": 15,
+                "field": "buyerperson"
+            },
+            {
+                "proportion": 15,
+                "field": "buyertel"
+            }
+        ],
+        "其他": [
+            {
+                "proportion": 8,
+                "field": "projectname"
+            },
+            {
+                "proportion": 12,
+                "field": "budget"
+            },
+            {
+                "proportion": 8,
+                "field": "buyer"
+            },
+            {
+                "proportion": 12,
+                "field": "agency"
+            },
+            {
+                "proportion": 12,
+                "field": "winner"
+            },
+            {
+                "proportion": 12,
+                "field": "bidamount"
+            },
+            {
+                "proportion": 12,
+                "field": "bidopentime"
+            },
+            {
+                "proportion": 12,
+                "field": "buyerperson"
+            },
+            {
+                "proportion": 12,
+                "field": "buyertel"
+            }
+        ]
+    },
+    "advertImg": "/images/advert.png",
+    "advertName": "广告",
+    "advertUrl": "/swordfish/about",
+    "wxJianyu": {
+        "appid": "wxdedd73f450993685",
+        "appsecret": "d55898fde0b7887e5fe4660bd2494700"
+    },
+    "industry": "行业分类",
+    "recommendEntLimit": "50",
+    "jyapp": {
+        "domain": "https://web-jydev-wcj.jianyu360.cn",
+        "apkurl": "/jyinstallpkg/mobile/%s/jianyu360.apk",
+        "appstoreurl": "https://itunes.apple.com/cn/app/id1354897149",
+        "channelDir": {
+            "s001": "baiduSem",
+            "s003": "shenmaSem",
+            "huawei": "huawei",
+            "xiaomi": "xiaomi",
+            "yingyongbao": "yingyongbao",
+            "douyin": "douyin",
+            "wx01": "jywx",
+            "topnet": "topnet",
+            "duanxin": "duanxin",
+			"active_pullnew": "active_pullnew",
+            "default": "topnet"
+        }
+    },
+    "limitSearchText": {
+        "flag": true,
+        "count": 40,
+        "timeout": 60,
+        "totalPage": 10,
+        "percentage":80,
+        "userIds": [
+        ],
+        "msg": "f 开关状态:%s //-2 从配置文件重置,-1 关闭,1 打开<br><br>c 并发数:%d //-2 不限制并发数,-1 无条件直接限制,>0 限制并发数<br><br>t 个人查询限制时间:%ds //-1 不限制<br><br>p 限制页数:%d",
+        "limitKey":"pc_limit_%s",
+        "noLogin":40
+    },
+    "share": {
+        "forceShareEnabled": false,
+        "onlineDate": "2018-08-20 00:00:00",
+        "regDaysForNewUser": 5,
+        "shareIntervalDays": 7,
+        "startHour": 8,
+        "endHour": 17,
+        "shareTimesUpperLimitR": 4000,
+        "shareTimesUpperLimitIrr": 1000
+    },
+    "cookiedomain": ".jydev.jianyu360.com",
+    "pcHelper": {
+        "subscribeTokenTimeout": 15,
+        "version": "V2.5.1"
+    },
+    "mail": [
+        {
+            "addr": "smtp.exmail.qq.com",
+            "port": 465,
+            "pwd": "ue9Rg9Sf4CVtdm5a",
+            "user": "public03@topnet.net.cn"
+        },
+        {
+            "addr": "smtp.exmail.qq.com",
+            "port": 465,
+            "pwd": "ue9Rg9Sf4CVtdm5a",
+            "user": "public03@topnet.net.cn"
+        }
+    ],
+    "sealAmount": {
+        "销冠王": "30000",
+        "全才": "30000",
+        "社交红人": "30000",
+        "灵魂人物": "30000",
+        "有态度": "20000",
+        "钢铁意志": "20000",
+        "机敏过人": "20000",
+        "行动派": "20000",
+        "细节控": "20000",
+        "神队友": "20000",
+        "业务666": "20000",
+        "靠谱": "20000",
+        "情商贼高": "10000",
+        "嘴皮子溜": "10000",
+        "脑洞倍儿大": "10000",
+        "靠实力说话": "10000"
+    },
+    "makepicurl": "http://39.105.183.186:11120",
+    "intranetip": {
+        "jy": "http://webxzh.qmx.top"
+    },
+    "getpicurl": "https://res.jianyu360.com/",
+    "sealSendTime": 14400,
+    "appPushServiceRpc": "192.168.20.139:5566",
+    "openPlatformUrl": "https://open-jytest.jianyu360.cn/",
+    "sessionEnctryFlushCorn": "0 0 0 1 * ?",
+    "PCS_time":24,
+    "detail_element":["table","div"],
+	  "termValidity":3600,
+    "uploadPath": "./web/staticres/upload/res/",
+    "redisSessionLockSize":20,
+    "accountMergeOnline":"2015-03-30 00:00:00",
+    "bidSearchOldUserLimit": 1626105600,
+    "contextOldVipLimit": 1664553600,
+    "firstBindPop":3,
+    "maxBindPop":111111111111115,
+    "nsq":"192.168.3.240:4260",
+    "nsq_topic": "jy_event",
+    "bindPopRedis":"merge",
+    "phoneFilterFlag":true,
+    "pcindexCacheTime":7200,
+    "pcIndexHotCacheTime":129600,
+    "pcindexCacheKey":"jypcindex3",
+    "dedupUrl":  "http://127.0.0.1:8888/data/deduplication",
+    "bmwxrcoll":"drainage_wxreply_log",
+    "optimalTime":"2021-08-03 12:00:00",
+    "pcFilterFlag":true,
+    "pcSessionFlag":true,
+    "sessionTimeout":168,
+    "pcSessionTimeout":168,
+    "shareRedisName":"other",
+    "wxWebdomain": "https://web-wky.jydev.jianyu360.com",
+    "wxOrgUrl": "/page_entbase_mobile/page/invite/inviting.html",
+    "pcOrgUrl":"/orgpc/inviting",
+    "criticality":2,
+    "indexcontentTimeOut":86400,
+    "seoBeforeTimeHour":12160,
+    "canReadNotice": 3,
+    "smsServiceRpc":"127.0.0.1:932",
+    "searchTypeSwitch": true,
+    "fileSignBool":true,
+    "baseUserFilterFlag":false,
+    "userCenterApi":"https://web-zxl.jydev.jianyu360.com",
+    "resourceCenter": "https://web-zxl.jydev.jianyu360.com",
+    "resourceCenterUrl": {
+	    "haspowers": "/resourceCenter/haspowers"
+	},
+	"keywordsLimit":35,
+	"detailMosaicTxt":"略",
+  "needMosaic":{
+  "projectname":true,
+      "projectcode":true,
+      "budget":true,
+      "bidamount":true,
+      "buyer":true,
+      "buyerperson":true,
+      "buyertel":true,
+      "buyeraddr":true,
+      "agency":true,
+      "agencyperson":true,
+      "agencytel":true,
+      "agencyaddr":true,
+      "winner":true,
+      "s_winner":true,
+      "winnerperson":true,
+      "winnertel":true,
+      "winneraddr":true,
+      "docstarttime":true,
+      "docendtime":true,
+      "bidendtime":true,
+      "bidstarttime":true,
+      "bidopentime":true,
+      "bidopenaddress":true,
+      "contractcode":true,
+      "signaturedate":true,
+      "purchasinglist":true,
+      "item":true,
+      "purchasing":true,
+      "itemname":true,
+      "brandname":true,
+      "specs":true,
+      "model":true,
+      "unitname":true,
+      "dimensions":true,
+      "number":true,
+      "unitprice":true,
+      "totalprice":true,
+      "guaranteetime":true,
+      "orderno":true,
+      "procurementlist":true,
+      "projectscope":true,
+      "reserved_amount":true,
+      "expurasingtime":true,
+      "winnerMap":true
+  },
+  "keywordsLimitNologin":25,
+  "messageCenter": {
+    "appid": "10000",
+    "dbName": "messagetest",
+    "interval": 300,
+    "createtime": "2023-01-04 00:00:00",
+    "limitDay": 7,
+    "limitCount": 3
+  },
+  "workDesktopUrl":"/page_workDesktop/work-bench/page?aside=0&link="
+>>>>>>> master
 }

+ 37 - 17
src/jfw/front/dataExport.go

@@ -390,30 +390,42 @@ func (d *DataExport) GetOrderCode(order_code string) error {
 func (d *DataExport) SuperSearchExport() error {
 	openid := util.ObjToString(d.GetSession("s_m_openid"))
 	userId := util.ObjToString(d.GetSession("userId"))
+	searchGroup, _ := d.GetInteger("searchGroup")
+	searchMode, _ := d.GetInteger("searchMode")
+	wordsMode, _ := d.GetInteger("wordsMode")
+
 	if userId == "" {
 		return errors.New("未登录")
 	}
 	//接收超级搜索页面参数
 	reqData := public.BidSearchExport{
-		Keywords:     d.GetString("keywords"),                     //搜索词
-		Publishtime:  d.GetString("publishtime"),                  //发布时间
-		Area:         d.GetString("area"),                         //地区
-		Subtype:      d.GetString("subtype"),                      //信息类型
-		Minprice:     d.GetString("minprice"),                     //最低价格
-		Maxprice:     d.GetString("maxprice"),                     //最高价格
-		Industry:     strings.TrimSpace(d.GetString("industry")),  //选中的行业
-		SelectType:   d.GetString("selectType"),                   //标题 or 全文
-		Buyerclass:   d.GetString("buyerclass"),                   //采购单位行业
-		Hasbuyertel:  d.GetString("buyertel"),                     //是否有采购电话
-		Haswinnertel: d.GetString("winnertel"),                    //是否有中标电话
-		SelectIds:    strings.TrimSpace(d.GetString("selectIds")), //选择信息id
-		Notkey:       d.GetString("notkey"),                       //排除词
-		FileExists:   d.GetString("fileExists"),                   //是否有附件
-		City:         d.GetString("city"),                         //城市
-		BidField:     d.GetString("bid_field"),                    // 领域数据类型 0101- 医疗行业
-
+		Keywords:        d.GetString("keywords"),                     //搜索词
+		Publishtime:     d.GetString("publishtime"),                  //发布时间
+		Area:            d.GetString("area"),                         //地区
+		Subtype:         d.GetString("subtype"),                      //信息类型
+		Minprice:        d.GetString("minprice"),                     //最低价格
+		Maxprice:        d.GetString("maxprice"),                     //最高价格
+		Industry:        strings.TrimSpace(d.GetString("industry")),  //选中的行业
+		SelectType:      d.GetString("selectType"),                   //标题 or 全文
+		Buyerclass:      d.GetString("buyerclass"),                   //采购单位行业
+		Hasbuyertel:     d.GetString("buyertel"),                     //是否有采购电话
+		Haswinnertel:    d.GetString("winnertel"),                    //是否有中标电话
+		SelectIds:       strings.TrimSpace(d.GetString("selectIds")), //选择信息id
+		Notkey:          d.GetString("notkey"),                       //排除词
+		FileExists:      d.GetString("fileExists"),                   //是否有附件
+		City:            d.GetString("city"),                         //城市
+		BidField:        d.GetString("bid_field"),                    // 领域数据类型 0101- 医疗行业
+		SearchGroup:     searchGroup,                                 //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+		SearchMode:      searchMode,                                  //搜索模式:0:精准搜索;1:模糊搜索
+		WordsMode:       wordsMode,                                   //搜索关键词模式;默认0:包含所有,1:包含任意
+		AdditionalWords: d.GetString("additionalWords"),              //关键词:附加关键词(副:五组,每组最多15个字符)
 	}
+<<<<<<< HEAD
 	selectType := strings.Join(jy.GetVipState( d.Session(), *config.Middleground, userId).GetQueryItems(d.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
+=======
+	entId := util.IntAll(d.GetSession("entId"))
+	selectType := strings.Join(jy.GetVipState(public.Mysql, public.MQFW, userId, entId).GetQueryItems(d.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
+>>>>>>> master
 	//数据回显
 	d.SetSession("Echo_timeslot", d.GetString("timeslot"))
 	d.SetSession("Echo_keywords", reqData.Keywords)
@@ -431,8 +443,16 @@ func (d *DataExport) SuperSearchExport() error {
 	d.SetSession("Echo_fileExists", reqData.FileExists)
 	d.SetSession("Echo_city", reqData.City)
 	d.SetSession("Echo_bid_field", reqData.BidField) // 领域类型 0101-医疗行业
+<<<<<<< HEAD
 
 	saveData := reqData.PassBidSearchExport(config.Sysconfig)
+=======
+	d.SetSession("Echo_searchGroup", reqData.SearchGroup)
+	d.SetSession("Echo_searchMode", reqData.SearchMode)
+	d.SetSession("Echo_wordsMode", reqData.WordsMode)
+	d.SetSession("Echo_additionalWords", reqData.AdditionalWords)
+	saveData := reqData.PassBidSearchExport()
+>>>>>>> master
 	saveData["selectType"] = selectType
 	saveData["s_openid"] = openid
 	saveData["s_userid"] = userId

+ 855 - 0
src/jfw/front/searchOptimize.go

@@ -0,0 +1,855 @@
+package front
+
+import (
+	"encoding/json"
+	"fmt"
+	"jfw/config"
+	"jfw/public"
+	"log"
+	"qfw/util"
+	"qfw/util/bidsearch"
+	"qfw/util/elastic"
+	"qfw/util/jy"
+	"qfw/util/redis"
+	"strconv"
+	"strings"
+	"time"
+)
+
+const (
+	multiMatch              = `{"multi_match": {"query": "%s","type": "phrase", "fields": [%s]}}`
+	query                   = `{"query":{"bool":{"must":[%s],"must_not":[%s]}}}`
+	queryBoolShould         = `{"bool":{"should":[%s],"minimum_should_match": 1}}`
+	queryBoolMustBoolShould = `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
+	queryBoolMust           = `{"bool":{"must":[{"terms":{"s_subscopeclass":[%s]}}]}}`
+	queryBoolMustTerm       = `{"bool": {"must": [{ "term": {"isValidFile": %d }}]}}`
+	queryMissing            = `{"constant_score":{"filter":{"missing":{"field":"%s"}}}}`
+	gte                     = `"gte": %s`
+	lte                     = `"lte": %s`
+	HighlightStr            = `"%s": {"fragment_size": %d,"number_of_fragments": 1}`
+	HL                      = `"highlight": {"pre_tags": [""],"post_tags": [""],"fields": {%s}}`
+	BidSearchSort           = `{"dataweight":-1,"publishtime":-1}`
+	queryBoolMustTermDomain = `{"bool": {"must": [{ "term": {"bid_field": "%s" }}]}}` // 领域化数据类型
+)
+
+var (
+	SR              = strings.Replace
+	DefaultTopTypes = []string{
+		"招标预告,招标公告,招标结果,招标信用信息",
+		"拟建,采购意向",
+	}
+	SearchCacheKey   = "searchDataCache_%d_%s_%s"
+	SearchCacheCount = "searchCountCache_%d_%s_%s"
+	RedisNameNew     = "newother"
+)
+
+type SearchOptimize struct {
+	AppId               string `json:"appId,omitempty"`               //剑鱼默认10000
+	UserId              string `json:"userId,omitempty"`              //用户id
+	Phone               string `json:"phone,omitempty"`               //手机号
+	NewUserId           int64  `json:"newUserId,omitempty"`           //base_user_id 新用户id
+	EntId               int64  `json:"entId,omitempty"`               //企业id 没有企业 企业id=0
+	EntUserId           int64  `json:"entUserId,omitempty"`           //企业用户id  当前企业下的员工id 没有企业默认0
+	PageNum             int    `json:"pageNum,omitempty"`             //当前页码
+	PageSize            int    `json:"pageSize,omitempty"`            //每页数量
+	Province            string `json:"province,omitempty"`            //省份
+	City                string `json:"city,omitempty"`                //城市
+	Subtype             string `json:"subtype,omitempty"`             //信息类型-二级
+	TopType             string `json:"topTypeMap,omitempty"`          //信息类型-一级分类
+	PublishTime         string `json:"publishTime,omitempty"`         //发布时间
+	SelectType          string `json:"selectType,omitempty"`          //搜索范围:标题;正文等
+	Price               string `json:"price,omitempty"`               //价格
+	Industry            string `json:"industry,omitempty"`            //行业
+	BuyerClass          string `json:"buyerClass,omitempty"`          //采购单位类型
+	BuyerTel            string `json:"buyerTel,omitempty"`            //采购单位联系方式
+	WinnerTel           string `json:"winnerTel,omitempty"`           //中标单位联系方式
+	FileExists          string `json:"fileExists,omitempty"`          //是否有附件
+	SearchGroup         int    `json:"searchGroup,omitempty"`         //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+	SearchMode          int    `json:"searchMode,omitempty"`          //搜索模式:0:精准搜索;1:模糊搜索
+	WordsMode           int    `json:"wordsMode,omitempty"`           //搜索关键词模式;默认0:包含所有,1:包含任意
+	KeyWords            string `json:"keyWords,omitempty"`            //关键词:多个空格隔开(主)
+	AdditionalWords     string `json:"additionalWords,omitempty"`     //关键词:附加关键词(副:五组,每组最多15个字符)
+	ExclusionWords      string `json:"exclusionWords,omitempty"`      //关键词:排除词(副:五组,每组最多15个字符)
+	UserType            string `json:"userType,omitempty"`            //用户状态 fType:免费用户;pType:付费用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户
+	Platform            string `json:"platform,omitempty"`            //请求平台
+	IsPay               bool   `json:"isPay,omitempty"`               //是否是付费用户
+	InterceptKeyWords   string `json:"interceptKeyWords,omitempty"`   //关键词截取后的关键词;
+	InterceptOtherWords string `json:"interceptOtherWords,omitempty"` //关键词截取后 后面三个字
+	BidField            string `json:"bidField,omitempty"`            //领域化数据
+	SearchTypeSwitch    bool   `json:"searchTypeSwitch,omitempty"`    //标题+全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
+	IsOldVip            bool   `json:"isOldVip"`                      //超级订阅老用户 超前项目权限
+	VipStatus           int    `json:"vipStatus"`
+	BigMemberStatus     int    `json:"bigMemberStatus"`
+	EntStatus           int    `json:"entStatus"`
+	HeightKeys          string `json:"heightKeys"` //需要高亮的关键词
+}
+
+// NewSearchOptimize  初始化
+func NewSearchOptimize(userId, phone, province, city, subtype, topType, publishTime, selectType, price, industry, buyerClass, buyerTel, winnerTel, fileExists, keyWords, additionalWords, exclusionWords, platform, territorialization string, pageNum, pageSize, searchGroup, searchMode, wordsMode int, userInfo jy.VipState, searchTypeSwitch bool) *SearchOptimize {
+	var so = &SearchOptimize{
+		AppId:            "10000",
+		UserId:           userId,
+		Phone:            phone,
+		PageNum:          pageNum,
+		PageSize:         pageSize,
+		Province:         province,
+		City:             city,
+		Subtype:          subtype,
+		TopType:          topType,
+		PublishTime:      publishTime,
+		SelectType:       selectType,
+		Price:            price,
+		Industry:         industry,
+		BuyerClass:       buyerClass,
+		BuyerTel:         buyerTel,
+		WinnerTel:        winnerTel,
+		FileExists:       fileExists,
+		SearchGroup:      searchGroup,
+		SearchMode:       searchMode,
+		WordsMode:        wordsMode,
+		KeyWords:         keyWords,
+		AdditionalWords:  additionalWords,
+		ExclusionWords:   exclusionWords,
+		Platform:         platform,
+		IsPay:            userInfo.IsPayedUser(),
+		BidField:         territorialization,
+		SearchTypeSwitch: searchTypeSwitch,
+		IsOldVip:         userInfo.VipState > 0 && userInfo.RegisterData < util.Int64All(config.Sysconfig["contextOldVipLimit"]),
+		VipStatus:        userInfo.VipState,
+		BigMemberStatus:  userInfo.BigMember,
+		EntStatus:        userInfo.EntMember,
+	}
+	so.SearchParamsHandle()
+	return so
+}
+
+// DefaultSearchParamsAuto 缓存查询条件初始化
+func (so *SearchOptimize) DefaultSearchParamsAuto() {
+	so.TopType = ""
+	so.City = ""
+	so.Industry = ""
+	so.FileExists = ""
+	so.WinnerTel = ""
+	so.BuyerTel = ""
+	so.BuyerClass = ""
+	so.Price = ""
+	so.SelectType = "title"
+	so.Province = ""
+	so.KeyWords = ""
+	so.AdditionalWords = ""
+	so.ExclusionWords = ""
+}
+
+// SearchParamsHandle 搜索条件 处理
+func (so *SearchOptimize) SearchParamsHandle() {
+	// so.SearchGroup 搜索分组 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+	if so.SearchGroup < 0 || so.SearchGroup > 2 {
+		so.SearchGroup = 1
+	}
+	//信息类型
+	if so.Subtype == "" && so.TopType == "" {
+		// 所有用户都可以搜索,判断是否能使用超前项目  老版超级订阅、大会员、商机管理有权限
+		if so.SearchGroup > 0 && len(DefaultTopTypes) >= so.SearchGroup {
+			so.Subtype = DefaultTopTypes[so.SearchGroup-1]
+		}
+	}
+	// so.SearchMode 搜索模式 搜索模式:0:精准搜索;1:模糊搜索
+	// 精准搜索:不分词,完全匹配;(中间带空格的关键词组自动分词)
+	// 模糊搜索:对用户输入的单个关键词进行分词处理,但必须都存在;
+	if so.SearchMode < 0 {
+		so.SearchMode = 0
+	}
+	// so.WordsMode 搜索关键词模式;默认0:包含所有,1:包含任意
+	if so.WordsMode < 0 {
+		so.WordsMode = 0
+	}
+	//查询时间publishTime
+	if so.PublishTime == "" {
+		//so.UserId == ""||免费用户最新1年 未登录用户默认最近一年的数据
+		so.PublishTime = fmt.Sprintf("%d_%d", time.Now().AddDate(-1, 0, 0).Unix(), time.Now().Unix())
+		//付费用户最新5年
+		if so.IsPay {
+			so.PublishTime = fmt.Sprintf("%d_%d", time.Now().AddDate(-5, 0, 0).Unix(), time.Now().Unix())
+		}
+	}
+	//默认每页数据量
+	if so.PageSize <= 0 {
+		so.PageSize = 50
+	}
+	//第一页
+	if so.PageNum <= 0 {
+		so.PageNum = 1
+	}
+	//行业格式化
+	if so.Industry != "" {
+		so.Industry = strings.TrimSpace(so.Industry)
+	}
+	//默认搜索范围
+	if so.SelectType == "" {
+		so.SelectType = "title,detail"
+	}
+	//免费用户:高级筛选 采购单位类型、采购单位联系方式、中标企业联系方式、排除词、城市
+	if !so.IsPay {
+		so.BuyerClass = ""
+		so.BuyerTel = ""
+		so.WinnerTel = ""
+		so.ExclusionWords = ""
+		so.City = ""
+		so.SearchGroup = util.If(so.SearchGroup > 1, 1, so.SearchGroup).(int) //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+		so.ExclusionWords = ""                                                //排除词
+	}
+	//判断是否有关键词
+	if so.KeyWords != "" {
+		//关键词处理
+		so.KeyWords = strings.TrimSpace(so.KeyWords)
+	}
+	//附加词 每组附加词不能超过15个字符
+	if so.AdditionalWords != "" {
+		var additionalWords []string
+		for _, ak := range strings.Split(so.AdditionalWords, ",") {
+			if len([]rune(ak)) > 15 {
+				additionalWords = append(additionalWords, string([]rune(ak)[:15]))
+			} else {
+				additionalWords = append(additionalWords, ak)
+			}
+		}
+		so.AdditionalWords = strings.Join(additionalWords, ",")
+	}
+	//合并 关键词 & 附加词
+	so.HeightKeys = so.GetSearchKeyWordsQueryStr()
+	//排除词  每组排除词不能超过15个字符
+	if so.ExclusionWords != "" {
+		var exclusionWords []string
+		for _, ak := range strings.Split(so.ExclusionWords, ",") {
+			if len([]rune(ak)) > 15 {
+				exclusionWords = append(exclusionWords, string([]rune(ak)[:15]))
+			} else {
+				exclusionWords = append(exclusionWords, ak)
+			}
+		}
+		so.ExclusionWords = strings.Join(exclusionWords, " ")
+	}
+}
+
+// GetSearchKeyWordsQueryStr 关键词处理 获取关键词查询条件
+func (so *SearchOptimize) GetSearchKeyWordsQueryStr() string {
+	// in.SearchMode 搜索模式:0:精准搜索;1:模糊搜索
+	// 精准搜索:不分词,完全匹配;(中间带空格的关键词组自动分词)
+	// 模糊搜索:对用户输入的单个关键词进行分词处理,但必须都存在;
+	var (
+		searchWords []string
+	)
+	//主关键词词组
+	if so.KeyWords != "" {
+		if so.SearchMode == 1 {
+			if ikWords := jy.HttpEs(so.KeyWords, "ik_smart", public.DbConf.Elasticsearch.Main.Address); ikWords != "" {
+				so.KeyWords = strings.ReplaceAll(ikWords, "+", " ")
+			}
+		}
+		searchWords = append(searchWords, so.KeyWords)
+	}
+	//多组附加词,每组间,号隔开。每组内如果关键词中间有空格,自动分词
+	if so.AdditionalWords != "" {
+		if so.SearchMode == 1 {
+			var (
+				addWords []string
+			)
+			for _, awv := range strings.Split(so.AdditionalWords, ",") {
+				if ikWords := jy.HttpEs(awv, "ik_smart", public.DbConf.Elasticsearch.Main.Address); ikWords != "" {
+					addWords = append(addWords, strings.ReplaceAll(ikWords, "+", " "))
+				}
+			}
+			if len(addWords) > 0 {
+				so.AdditionalWords = strings.Join(addWords, ",")
+			}
+		}
+		searchWords = append(searchWords, strings.Split(so.AdditionalWords, ",")...)
+	}
+	return strings.Join(searchWords, " ")
+}
+
+// GetBidSearchList 搜索 查询
+func (so *SearchOptimize) GetBidSearchList(isCache bool) (count, total int64, list []*map[string]interface{}) {
+	var start = (so.PageNum - 1) * so.PageSize
+	if start >= 0 {
+		t := time.Now()
+		fields := util.If(so.IsPay, BidSearchFieldOfVip, BidSearchFieldBase).(string)
+		biddingSearch := SearchByES{
+			Index:      INDEX,
+			IType:      TYPE,
+			Query:      so.GetSearchQuery(so.GetBidSearchQuery()),
+			FindFields: util.If(isCache, "title", "detail").(string),
+			Order:      BidSearchSort,
+			Fields:     util.If(so.BidField != "", BidSearchDomainField, fields).(string), //BidField ===医疗领域化数据
+			Start:      util.If(isCache, 0, start).(int),
+			Limit:      util.If(isCache, util.If(so.IsPay, bidsearch.SearchMaxPageCount_PAYED, bidsearch.SearchMaxPageCount_PC).(int), so.PageSize).(int), //缓存数据: 付费或未登录用户一次性5000条,100页数据;免费用户一次性500条,10页数据;实时数据:每页50条数据请求
+			Count:      util.If(strings.Contains(so.SelectType, "detail"), 115, 0).(int),                                                                  //高亮正文数量
+			HighLight:  util.If(strings.Contains(so.SelectType, "detail"), true, false).(bool),                                                            //是否高亮正文
+		}
+		var repl *[]map[string]interface{}
+		total, repl = biddingSearch.GetAllByNgramWithCount()
+		if repl != nil && *repl != nil && len(*repl) > 0 {
+			//格式化查询结果
+			list = SearchListFormat(so.Industry, *repl, strings.Contains(so.SelectType, "detail"))
+			count = util.If(so.IsPay, int64(bidsearch.SearchMaxPageCount_PAYED), int64(bidsearch.SearchMaxPageCount_PC)).(int64)
+			//数据如果>最大数据结果量 total==count,否则count = 付费:5000;免费:500;
+			count = util.If(count > total, total, count).(int64)
+		} else {
+			log.Println("查询数据异常")
+		}
+		log.Println("关键词 -1- 查询耗时:", time.Since(t).Seconds())
+	}
+	return
+}
+
+// GetSearchQuery  整理关键词等查询条件
+func (so *SearchOptimize) GetSearchQuery(mustQuery string) (qstr string) {
+	var (
+		musts, mustNot, wordsMusts, wordsShould []string
+		findFields                              string
+		//搜索范围是否只有附件
+		//搜索范围只选择附件,是否有附件条件无效;
+		isFileSearch  = so.SelectType == "filetext"
+		selectTypeArr = strings.Split(so.SelectType, ",")
+	)
+	if mustQuery != "" {
+		musts = append(musts, mustQuery)
+	}
+	if selectTypeArr == nil || len(selectTypeArr) == 0 {
+		findFields = `"title"`
+	} else {
+		findFields = fmt.Sprintf(`"%s"`, strings.Join(selectTypeArr, "\",\""))
+	}
+	switchBool := strings.Contains(findFields, "detail") && strings.Contains(findFields, "title") && so.SearchTypeSwitch
+
+	//此时关键词中间有+进行隔离
+	if so.KeyWords != "" {
+		var (
+			keyWordsMusts []string
+		)
+		for _, v := range strings.Split(so.KeyWords, " ") {
+			if elastic.ReplaceYH(v) == "" {
+				continue
+			}
+			//单个字  搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+			if len([]rune(elastic.ReplaceYH(v))) == 1 && bidsearch.DetailFileORTitle(findFields) {
+				findFields += `,"title"`
+			} else if switchBool && len([]rune(elastic.ReplaceYH(v))) > 1 {
+				//标题 全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
+				if strings.Contains(findFields, `"title",`) {
+					findFields = strings.Replace(findFields, `"title",`, ``, -1)
+				} else if strings.Contains(findFields, `,"title"`) {
+					findFields = strings.Replace(findFields, `,"title"`, ``, -1)
+				}
+			}
+			keyWordsMusts = append(keyWordsMusts, fmt.Sprintf(fmt.Sprintf(multiMatch, "%s", findFields), elastic.ReplaceYH(v)))
+		}
+		//搜索关键词模式;默认0:包含所有,1:包含任意
+		if so.WordsMode == 1 {
+			wordsShould = append(wordsShould, fmt.Sprintf(elastic.NgramMust, strings.Join(keyWordsMusts, ",")))
+		} else {
+			wordsMusts = append(wordsMusts, keyWordsMusts...)
+		}
+	}
+	//附加词
+	if so.AdditionalWords != "" {
+		//多组附加词,每组间,号隔开。每组内如果关键词中间有空格,自动分词
+		var (
+			addWordsMusts []string
+		)
+		for _, aws := range strings.Split(so.AdditionalWords, ",") {
+			var (
+				addWordsMust []string
+			)
+			for _, v := range strings.Split(aws, " ") {
+				if elastic.ReplaceYH(v) == "" {
+					continue
+				}
+				//单个字  搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+				//detail 正文不支持单字查询
+				if len([]rune(elastic.ReplaceYH(v))) == 1 && bidsearch.DetailFileORTitle(findFields) {
+					findFields += `,"title"`
+				} else if switchBool && len([]rune(elastic.ReplaceYH(v))) > 1 {
+					//标题 全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
+					if strings.Contains(findFields, `"title",`) {
+						findFields = strings.Replace(findFields, `"title",`, ``, -1)
+					} else if strings.Contains(findFields, `,"title"`) {
+						findFields = strings.Replace(findFields, `,"title"`, ``, -1)
+					}
+				}
+				addWordsMust = append(addWordsMust, fmt.Sprintf(fmt.Sprintf(multiMatch, "%s", findFields), elastic.ReplaceYH(v)))
+				addWordsMusts = append(addWordsMusts, addWordsMust...)
+				if so.WordsMode == 0 {
+					wordsMusts = append(wordsMusts, addWordsMust...)
+				}
+				addWordsMust = []string{}
+			}
+			//搜索关键词模式;默认0:包含所有,1:包含任意
+			if so.WordsMode == 1 {
+				wordsShould = append(wordsShould, fmt.Sprintf(elastic.NgramMust, strings.Join(addWordsMusts, ",")))
+				addWordsMusts = []string{}
+			}
+		}
+	}
+	//搜索关键词模式;默认0:包含所有,1:包含任意
+	//包含任意一组
+	if len(wordsShould) > 0 {
+		musts = append(musts, fmt.Sprintf(queryBoolShould, strings.Join(wordsShould, ",")))
+	} else if len(wordsMusts) > 0 {
+		musts = append(musts, fmt.Sprintf(elastic.NgramMust, strings.Join(wordsMusts, ",")))
+	}
+	//排除词
+	if notKey := strings.TrimSpace(so.ExclusionWords); notKey != "" {
+		notKeyMultiMatch := fmt.Sprintf(multiMatch, "%s", findFields)
+		var notKeyMustNot []string
+		//多组排除词
+		for _, nks := range strings.Split(notKey, ",") {
+			//单组排除词 空格分割
+			for _, v := range strings.Split(nks, " ") {
+				v = strings.TrimSpace(v)
+				if v == "" {
+					continue
+				}
+				if len([]rune(elastic.ReplaceYH(v))) == 1 {
+					//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+					if bidsearch.DetailFileORTitle(findFields) {
+						notKeyMultiMatch = fmt.Sprintf(multiMatch, "%s", findFields+`,"title"`)
+					}
+				}
+				notKeyMustNot = append(notKeyMustNot, fmt.Sprintf(notKeyMultiMatch, elastic.ReplaceYH(v)))
+			}
+		}
+		mustNot = append(mustNot, fmt.Sprintf(queryBoolShould, strings.Join(notKeyMustNot, ",")))
+	}
+	//行业
+	if so.Industry != "" {
+		musts = append(musts, fmt.Sprintf(queryBoolMust, `"`+strings.ReplaceAll(so.Industry, ",", `","`)+`"`))
+	}
+	//价格
+	if so.Price != "" && len(strings.Split(so.Price, "-")) > 1 {
+		minPrice, maxPrice := strings.Split(so.Price, "-")[0], strings.Split(so.Price, "-")[1]
+		if minPrice != "" || maxPrice != "" {
+			sq := ``
+			if minPrice != "" {
+				min, _ := strconv.ParseFloat(minPrice, 64)
+				minPrice = fmt.Sprintf("%.0f", min*10000)
+				if minPrice == "0" {
+					minPrice = ""
+				}
+			}
+			if maxPrice != "" {
+				max, _ := strconv.ParseFloat(maxPrice, 64)
+				maxPrice = fmt.Sprintf("%.0f", max*10000)
+				if maxPrice == "0" {
+					maxPrice = ""
+				}
+			}
+			if minPrice != "" {
+				sq += fmt.Sprintf(gte, minPrice)
+			}
+			if minPrice != "" && maxPrice != "" {
+				sq += `,`
+			}
+			if maxPrice != "" {
+				sq += fmt.Sprintf(lte, maxPrice)
+			}
+			if minPrice != "" || maxPrice != "" {
+				musts = append(musts, fmt.Sprintf(queryBoolShould, fmt.Sprintf(queryBoolMustBoolShould, sq, sq)))
+			}
+		}
+	}
+	//采购单位联系方式
+	hasBuyerTel := so.BuyerTel
+	if hasBuyerTel != "" {
+		if hasBuyerTel == "y" {
+			mustNot = append(mustNot, fmt.Sprintf(queryMissing, "buyertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(queryMissing, "buyertel"))
+		}
+	}
+	//中标企业联系方式
+	hasWinnerTel := so.WinnerTel
+	if hasWinnerTel != "" {
+		if hasWinnerTel == "y" {
+			mustNot = append(mustNot, fmt.Sprintf(queryMissing, "winnertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(queryMissing, "winnertel"))
+		}
+	}
+	//附件
+	fileExists := so.FileExists
+	if !isFileSearch && fileExists != "" {
+		if fileExists == "1" { //有附件
+			mustNot = append(mustNot, fmt.Sprintf(queryMissing, "isValidFile"))
+			musts = append(musts, fmt.Sprintf(queryBoolMustTerm, 1))
+		} else if fileExists == "-1" { //无附件
+			musts = append(musts, fmt.Sprintf(queryMissing, "isValidFile"))
+		}
+	}
+	// 如果是领域化数据则需要加标签
+	if so.BidField != "" {
+		musts = append(musts, fmt.Sprintf(queryBoolMustTermDomain, so.BidField))
+	}
+	qstr = fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(mustNot, ","))
+	log.Println("qstr:", qstr)
+	return
+}
+
+// GetBidSearchQuery  整理地区、城市、发布时间、信息类型、采购单位类型 查询条件
+func (so *SearchOptimize) GetBidSearchQuery() string {
+	query := ``
+	//省份
+	area := so.Province
+	if area != "" {
+		query += `{"terms":{"area":[`
+		for k, v := range strings.Split(area, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	//
+	city := so.City
+	if city != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"city":[`
+		for k, v := range strings.Split(city, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	if query != "" {
+		query = fmt.Sprintf(queryBoolShould, query)
+	}
+	//发布时间
+	publishTime := so.PublishTime
+	if publishTime != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		startTime, endTime := "", ""
+		now := time.Now()
+		if publishTime == "lately-7" { //最近7天
+			startTime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
+		} else if publishTime == "lately-30" { //最近30天
+			startTime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
+		} else if publishTime == "thisyear" { //最近一年
+			startTime = fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endTime = fmt.Sprint(now.Unix())
+		} else if publishTime == "threeyear" { //最近三年
+			startTime = fmt.Sprint(time.Date(now.Year()-3, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endTime = fmt.Sprint(now.Unix())
+		} else if publishTime == "fiveyear" { //最近五年
+			startTime = fmt.Sprint(time.Date(now.Year()-5, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endTime = fmt.Sprint(now.Unix())
+		} else if len(strings.Split(publishTime, "_")) > 1 {
+			startTime = strings.Split(publishTime, "_")[0]
+			endTime = strings.Split(publishTime, "_")[1]
+			etTime := time.Now()
+			if endTime != "" {
+				et, _ := strconv.ParseInt(endTime, 0, 64)
+				etTime = time.Unix(et, 0)
+			}
+			endTime = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Unix())
+		}
+		query += `{"range":{"publishtime":{`
+		if startTime != "" {
+			query += `"gte":` + startTime
+		}
+		if startTime != "" && endTime != "" {
+			query += `,`
+		}
+		if endTime != "" {
+			query += `"lt":` + endTime
+		}
+		query += `}}}`
+	}
+	//信息类型-二级
+	subtype := so.Subtype
+	topType := util.If(so.TopType != "", strings.Split(so.TopType, ","), []string{}).([]string)
+	allType := ``
+	//二级分类
+	if subtype != "" {
+		var typeInt = 0
+		allType += `{"terms":{"subtype":[`
+		for k, v := range strings.Split(subtype, ",") {
+			if tType := util.If(topTypeMap[v] != "" && so.TopType == "", topTypeMap[v], "").(string); tType != "" {
+				topType = append(topType, tType)
+				typeInt += 1
+				continue
+			}
+			if k > typeInt {
+				allType += `,`
+			}
+			allType += `"` + v + `"`
+		}
+		allType += `]}}`
+	}
+	//信息类型  一级分类
+	log.Println("topType:", topType)
+	if len(topType) > 0 {
+		if allType != "" {
+			allType += ","
+		}
+		allType += `{"terms":{"toptype":[`
+		for k, v := range topType {
+			if k > 0 {
+				allType += `,`
+			}
+			allType += `"` + v + `"`
+		}
+		allType += `]}}`
+	}
+
+	if allType != "" {
+		if query != "" {
+			query += ","
+		}
+		query += fmt.Sprintf(queryBoolShould, allType)
+	}
+	//采购单位类型
+	if so.BuyerClass != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"buyerclass":[`
+		for k, v := range strings.Split(so.BuyerClass, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	return query
+}
+
+// GetBidSearchListByCache   查询缓存数据
+//未登录用户默认搜索和关键词搜索改成500条和免费用户保持一致--需求调整P260来自产品经理杨蘭20220116
+func (so *SearchOptimize) GetBidSearchListByCache() (list []*map[string]interface{}, count, total int64) {
+	//缓存数据 最大量是5000条  100页数据
+	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)
+		if err == nil {
+			if sCache != nil && len(*sCache) > 0 {
+				err = json.Unmarshal(*sCache, &list)
+				if err == nil {
+					//数据如果>最大数据结果量 total==count,否则count = 付费:5000;免费:500;
+					count = util.If(so.IsPay, int64(bidsearch.SearchMaxPageCount_PAYED), int64(bidsearch.SearchMaxPageCount_PC)).(int64)
+					count = util.If(count > total, total, count).(int64)
+					return
+				}
+			}
+		}
+		//无缓存数据 或 缓存数据查询异常
+		//查库>存redis缓存
+		//查询缓存数据 参数初始化
+		so.DefaultSearchParamsAuto()
+		//缓存数据
+		count, total, list = so.GetBidSearchList(true)
+		if len(list) > 0 {
+			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 {
+					log.Println("默认搜索查询结果保存redis缓存异常")
+				}
+			} else {
+				log.Println("默认搜索查询数量保存redis缓存异常")
+			}
+		} else {
+			log.Println("默认搜索 暂无数据")
+		}
+		return
+	}(so)
+	if len(l) > 0 {
+		total = t
+		count = c
+		list = l[(so.PageNum-1)*so.PageSize : so.PageNum*so.PageSize]
+	}
+	return
+}
+
+// SearchByES  es搜索
+type SearchByES struct {
+	Index      string
+	IType      string
+	Query      string
+	FindFields string
+	Order      string
+	Fields     string
+	Start      int
+	Limit      int
+	Count      int
+	HighLight  bool
+}
+
+// GetAllByNgramWithCount  获取es查询结果及总数量
+func (e *SearchByES) GetAllByNgramWithCount() (int64, *[]map[string]interface{}) {
+	if e.Query != "" {
+		queryStr := e.Query
+		if e.HighLight {
+			var ws []string
+			for _, w := range strings.Split(e.FindFields, ",") {
+				ws = append(ws, fmt.Sprintf(HighlightStr, w, e.Count))
+			}
+			queryStr = queryStr[:len(queryStr)-1] + `,` + fmt.Sprintf(HL, strings.Join(ws, ",")) + `}`
+		}
+		if len(e.Fields) > 0 {
+			queryStr = queryStr[:len(queryStr)-1] + `,"_source":[` + e.Fields + "]}"
+		}
+		if len(e.Order) > 0 {
+			queryStr = queryStr[:len(queryStr)-1] + `,"sort":[` + SR(SR(SR(SR(e.Order, ",", "},{", -1), " ", "", -1), ":-1", `:"desc"`, -1), ":1", `:"asc"`, -1) + `]}`
+		}
+		if e.Start > -1 {
+			queryStr = queryStr[:len(queryStr)-1] + `,"from":` + strconv.Itoa(e.Start) + `,"size":` + strconv.Itoa(e.Limit) + "}"
+		}
+		log.Println("queryStr:", queryStr)
+		return elastic.GetWithCount(e.Index, e.IType, queryStr)
+	} else {
+		return 0, nil
+	}
+}
+
+//
+// SearchListFormat  格式化数据
+func SearchListFormat(industry string, repl []map[string]interface{}, b bool) (list []*map[string]interface{}) {
+	for _, v := range repl {
+		//正文
+		if b {
+			//正文匹配检索关键词
+			highlight, _ := v["highlight"].(map[string][]string)
+			detail := ""
+			for _, val := range highlight["detail"] {
+				detail += jy.ClearHtml.ReplaceAllString(val, "")
+			}
+			v["detail"] = detail
+		}
+		v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))                                        //加密信息id
+		v["s_subscopeclass"] = IndustryFormat(industry, strings.Trim(util.ObjToString(v["s_subscopeclass"]), ",")) //行业
+		v["industry"] = IndustryFormat(industry, strings.Trim(util.ObjToString(v["s_subscopeclass"]), ","))        //行业
+		if budget, ok := v["budget"].(float64); ok && budget > 0 {                                                 //预算
+			v["budget"] = int64(budget)
+		}
+		if bidAmount, ok := v["bidamount"].(float64); ok && bidAmount > 0 { //中标金额
+			v["bidamount"] = int64(bidAmount)
+		}
+		//附件
+		if isValidFile, _ := v["isValidFile"].(bool); isValidFile {
+			delete(v, "isValidFile")
+			v["fileExists"] = true
+		}
+		//地区链接、
+		area := v["area"].(string)
+		//信息类型链接
+		finalType, _ := v["subtype"].(string)
+		if finalType == "" {
+			finalType = util.ObjToString(v["toptype"])
+		}
+		if finalType == "" {
+			finalType = util.ObjToString(v["type"])
+			if finalType == "bid" {
+				finalType = "中标"
+			} else if finalType == "tender" {
+				finalType = "招标"
+			} else {
+				finalType = ""
+			}
+		}
+		//行业链接、
+		if industry == "" {
+			industry = util.ObjToString(v["s_subscopeclass"])
+			if industry != "" {
+				if strings.Contains(industry, "它") {
+					industry = strings.Replace(industry, "它", "他", -1)
+				}
+				industry = strings.Split(industry, ",")[0]
+			}
+		}
+		//stypeadd :信息类型链接
+		//areaadd:地址链接;
+		//indadd:行业链接
+		v["stypeadd"], v["areaadd"], v["indadd"] = classify(finalType, area, industry)
+		winnerList := util.ObjToString(v["s_winner"]) //中标企业名称集合
+		if winnerList != "" && len(strings.Split(winnerList, ",")) > 0 {
+			var winnerInfo []*WinnerInfo
+			for wk, wv := range strings.Split(winnerList, ",") {
+				var (
+					winnerId = ""
+				)
+				if v["entidlist"] != nil {
+					if entIdList := util.ObjArrToStringArr(v["entidlist"].([]interface{})); len(entIdList) > wk { //中标企业id集合
+						winnerId = entIdList[wk]
+					}
+				}
+				winnerInfo = append(winnerInfo, &WinnerInfo{
+					Winner:       wv,                                                                                                         //中标企业 需要单独处理
+					WinnerTel:    util.ObjToString(v["winnertel"]),                                                                           //中标企业联系电话
+					WinnerPerson: util.ObjToString(v["winnerperson"]),                                                                        //中标企业联系人
+					WinnerId:     util.If(winnerId != "" && len([]rune(winnerId)) > 12, util.EncodeArticleId2ByCheck(winnerId), "").(string), //中标企业加密id  存在winnerId 异常的情况
+				})
+			}
+			v["winnerInfo"] = winnerInfo
+		}
+		tmp := v
+		list = append(list, &tmp)
+	}
+	return
+}
+
+// WinnerInfo 中标企业信息
+type WinnerInfo struct {
+	Winner       string `json:"winner,omitempty"`
+	WinnerTel    string `json:"winnerTel,omitempty"`
+	WinnerPerson string `json:"winnerPerson,omitempty"`
+	WinnerId     string `json:"winnerId,omitempty"`
+}
+
+// IndustryFormat 行业处理
+func IndustryFormat(industry, subScopeClass string) (newIndustry string) {
+	commonSubstring := func(v string) (value string) {
+		bcs := strings.Split(v, "_")
+		if len(bcs) == 1 {
+			value = bcs[0]
+		} else if len(bcs) == 2 {
+			value = bcs[0]
+			if strings.TrimSpace(value) == "" {
+				value = bcs[0]
+			}
+		}
+		return
+	}
+	bct := strings.Split(subScopeClass, ",")
+	if bct == nil || len(bct) == 0 {
+		return
+	}
+	//搜索条件中没有行业的话,取查询结果中第一个行业
+	if industry == "" {
+		newIndustry = commonSubstring(bct[0])
+	} else { //搜索条件中有行业的话,取行业中和搜索条件相对应的第一个
+		industryArr := strings.Split(industry, ",")
+	L:
+		for _, bc := range bct {
+			for _, is := range industryArr {
+				if bc == is {
+					newIndustry = strings.TrimSpace(commonSubstring(bc))
+					break L
+				}
+			}
+		}
+	}
+	return
+}

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

@@ -398,7 +398,23 @@ func (s *Short) Article(stype, id string) error {
 			return s.Redirect(surl)
 		}
 	} else {
+<<<<<<< HEAD
 		sids := encrypt.CommonDecodeArticle(stype, id)
+=======
+		if stype == "content" {
+			//工作桌面内嵌 快照页
+			if !strings.Contains(s.Request.URL.String(), "aside") {
+				paramSuffix := "aside=0"
+				if strings.Contains(s.Request.URL.String(), "?") {
+					paramSuffix = fmt.Sprintf("&%s", paramSuffix)
+				} else {
+					paramSuffix = fmt.Sprintf("?%s", paramSuffix)
+				}
+				return s.Redirect(fmt.Sprintf("%s%s%s", config.Sysconfig["workDesktopUrl"].(string), config.Sysconfig["webdomain"].(string), url.QueryEscape(fmt.Sprintf("%s%s", s.Request.URL.String(), paramSuffix))))
+			}
+		}
+		sids := util.CommonDecodeArticle(stype, id)
+>>>>>>> master
 		if len(sids) == 0 || (len(sids) > 0 && sids[0] == "") {
 			s.Redirect("/notin/page", 302)
 			return nil

+ 170 - 134
src/jfw/front/supsearch.go

@@ -76,6 +76,9 @@ func init() {
 	if FileSignBool, _ = config.Sysconfig["fileSignBool"].(bool); FileSignBool {
 		bidSearch_field_1 = bidSearch_field_1 + bidSearch_field_file
 		bidSearch_field = bidSearch_field + bidSearch_field_file
+		//搜索优化
+		BidSearchFieldBase += BidSearchFieldFile
+		BidSearchFieldOfVip += BidSearchFieldFile
 	}
 }
 
@@ -245,80 +248,81 @@ func (p *Pcsearch) GetNewBids() error {
 	bidField := p.GetString("bid_field")
 	userId, _ := p.GetSession("userId").(string)
 	baseUserId := p.GetSession("base_user_id")
-	// 如果是领域化数据
+	entId := util.IntAll(p.GetSession("entId"))
+	searchGroup, _ := p.GetInteger("searchGroup") //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
+	vipStatus := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+	// 如果是领域化数据j
 	if bidField != "" {
 		if domainPageType, ok := DomainPageType[bidField]; ok {
 			pageType = domainPageType
+			//bidField = domainPageType
 		}
+<<<<<<< HEAD
 		vipStatus := jy.GetVipState(p.Session(), *config.Middleground, userId)
 		if (vipStatus.BigMember <= 0 && vipStatus.VipState <= 0) || (!jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode)) {
+=======
+		//领域化数据 如果没有权限直接返回空数据
+		if (vipStatus.BigMember <= 0 && vipStatus.VipState <= 0) || (!jy.HasBidFieldPower(config.ResourceApi.HasPowers, fmt.Sprint(util.Int64All(baseUserId)), MedicalFunctionCode)) {
+>>>>>>> master
 			p.ServeJson(map[string]interface{}{
 				"list":      []map[string]interface{}{},
 				"count":     0,
 				"totalPage": 0,
+				"total":     0,
 			})
 			return nil
 		}
 	}
-	rs := Newbids(pageType, userId)
-	var list []map[string]interface{}
-	if len(rs) >= 0 {
-		//标讯数据提取
-		list = rs[(pagenum-1)*pageSize : pagenum*pageSize]
-	}
-
+	so := &SearchOptimize{
+		UserId:      userId,
+		PageNum:     pagenum,
+		PageSize:    pageSize,
+		BidField:    bidField,
+		NewUserId:   util.Int64All(baseUserId),
+		SearchGroup: searchGroup,
+		IsPay:       vipStatus.IsPayedUser(),
+	}
+	//搜索条件处理
+	so.SearchParamsHandle()
+	var (
+		list         []*map[string]interface{}
+		count, total int64
+	)
+	list, count, total = so.GetBidSearchListByCache()
 	if pageType == "" { //最新招标信息仅第一页条展示表格多字段
 		for k, v := range list {
 			if pagenum == 1 && k < 20 {
 				continue
 			}
-			// delete(v, "areaadd")
-			delete(v, "bidopentime")
-			delete(v, "buyer")
-			// delete(v, "indadd")
-			delete(v, "k")
-			delete(v, "projectcode")
-			delete(v, "projectname")
-			// delete(v, "stypeadd")
-			delete(v, "winner")
-			delete(v, "timetemp")
-			delete(v, "budget")
-			delete(v, "s_subscopeclass")
-			delete(v, "toptype")
+			delete((*v), "bidopentime")
+			delete((*v), "buyer")
+			delete((*v), "k")
+			delete((*v), "projectcode")
+			delete((*v), "projectname")
+			delete((*v), "winner")
+			delete((*v), "timetemp")
+			delete((*v), "budget")
+			delete((*v), "s_subscopeclass")
+			delete((*v), "toptype")
 		}
 	}
-	count, totalPage := 500, 10
-	if userId == "" {
-		count = bidsearch.SearchMaxPageCount_NOLOGIN
-		totalPage = 100
-	}
 	p.ServeJson(map[string]interface{}{
 		"list":      list,
 		"count":     count,
-		"totalPage": totalPage,
+		"total":     total,
+		"totalPage": (count + 1) / int64(pageSize),
 	})
 	return nil
 }
 
+// PcSearchIndex 路由搜索
 func (p *Pcsearch) PcSearchIndex(module string) error {
 	defer util.Catch()
 	p.T["logid"] = config.Seoconfig["jysslby"].(string)
-	// 领域化标识
-	bidField := p.GetString("bid_field")
 	pageSize, _ := p.GetInteger("pageSize")
 	if pageSize == 0 {
 		pageSize = 50
 	}
-
-	switch module {
-	case "medical": // 领域类型  医疗-0101
-		if bidField == "" {
-			bidField = "0101"
-		}
-	default:
-		bidField = ""
-	}
-
 	keywords := p.GetString("keywords")
 	industry := strings.TrimSpace(p.GetString("industry")) //选中的行业
 	area := p.GetString("area")                            //地区
@@ -329,9 +333,16 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	minprice := p.GetString("minprice")                    //最低价格
 	maxprice := p.GetString("maxprice")                    //最高价格
 	fileExists := p.GetString("fileExists")                //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
-
+	//搜索优化P260--start--
+	searchGroup, _ := p.GetInteger("searchGroup")     //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
+	searchMode, _ := p.GetInteger("searchMode")       //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
+	wordsMode, _ := p.GetInteger("wordsMode")         //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
+	additionalWords := p.GetString("additionalWords") //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
+	//--end--
 	userId, _ := p.GetSession("userId").(string)
+	phone, _ := p.GetSession("phone").(string)
 	baseUserId := p.GetSession("base_user_id")
+	entId := util.IntAll(p.GetSession("entId"))
 	noLoginBl := false
 	if userId == "" {
 		//未登录用户访问全部信息类型 需要过滤掉 拟建和采购意向
@@ -341,16 +352,33 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 		}
 	}
 	//高级筛选 仅vip用户可查询
-	var hasBuyerTel, hasWinnerTel string = "", "" //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
-	var buyerclass string = ""                    //采购单位类别
-	var notkey string = ""                        //排除词
-	var city string = ""                          //城市 付费用户可用
-
+	var (
+		hasBuyerTel, hasWinnerTel = "", "" //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
+		buyerclass                = ""     //采购单位类别
+		notkey                    = ""     //排除词
+		city                      = ""     //城市 付费用户可用
+	)
+	// 领域化标识
+	territorialization := p.GetString("bid_field")
+	switch module {
+	case "medical": // 领域类型  医疗-0101
+		if territorialization == "" {
+			territorialization = "0101"
+		}
+	default:
+		territorialization = ""
+	}
 	selectType := p.GetString("selectType")
 	if selectType == "" {
 		selectType = "title,content"
 	}
+<<<<<<< HEAD
 	isPayedUser, publishtime, queryItems, _, _ := bidsearch.PublicSearch(userId, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), 0, pageSize, p.Session(), *config.Middleground)
+=======
+	userInfo := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+	queryItems := userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
+	isPayedUser := userInfo.IsPayedUser()
+>>>>>>> master
 	if isPayedUser {
 		buyerclass = p.GetString("buyerclass")
 		hasBuyerTel, hasWinnerTel = p.GetString("buyertel"), p.GetString("winnertel")
@@ -374,12 +402,21 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 		notkey = util.ObjToString(p.GetSession("Echo_notkey"))
 		fileExists = util.ObjToString(p.GetSession("Echo_fileExists"))
 		city = util.ObjToString(p.GetSession("Echo_city"))
+<<<<<<< HEAD
 		bidField = util.ObjToString(p.GetSession("Echo_bid_field")) // 领域化数据 0101-医疗行业
 		_, _, queryItems, _, _ = bidsearch.PublicSearch(userId, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), 0, pageSize, p.Session(), *config.Middleground)
+=======
+		territorialization = util.ObjToString(p.GetSession("Echo_bid_field"))    // 领域化数据 0101-医疗行业
+		searchGroup = util.IntAll(p.GetSession("Echo_searchGroup"))              //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
+		searchMode = util.IntAll(p.GetSession("Echo_searchMode"))                //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
+		wordsMode = util.IntAll(p.GetSession("Echo_wordsMode"))                  //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
+		additionalWords = util.ObjToString(p.GetSession("Echo_additionalWords")) //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
+		queryItems = userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
+>>>>>>> master
 	}
 	keywordsLimit := util.IntAllDef(config.Sysconfig["keywordsLimit"], 35)
 	searchLimit := public.IsSearchLimit(queryItems)
-
+	//-----------------------------未登录用户支持非单字符查询--------------------------
 	if userId == "" {
 		keywordsLimit = util.IntAllDef(config.Sysconfig["keywordsLimitNologin"], 25)
 		//未登录用户标题、正文都限制,已登录用户只限制正文
@@ -389,35 +426,38 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 			keywords = ""
 		}
 	}
-	b_word, a_word, s_word := "", "", ""
+	var (
+		list                               []*map[string]interface{}
+		count, total                       int64
+		secondFlag                         = ""
+		isSearch                           = true
+		b_word, a_word, s_word, heightKeys = "", "", "", ""
+	)
 	if keywords != "" {
 		b_word, a_word, s_word = jy.InterceptSearchKW(keywords, keywordsLimit, len(industry) == 0)
 	}
-	var list *[]map[string]interface{}
-	var status = 1
-	var count, totalPage int64
-	secondFlag := ""
-	secondKWS := ""
-	isSearch := true
-	if bidField != "" {
+	//医疗领域化信息 用户前提是大会员 超级订阅,才有领域化功能的权限
+	if territorialization != "" {
 		isSearch = false
+<<<<<<< HEAD
 		vipStatus := jy.GetVipState(p.Session(), *config.Middleground, userId)
 		if vipStatus.BigMember > 0 || vipStatus.VipState > 0 {
 			if jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode) {
+=======
+		if userInfo.BigMember > 0 || userInfo.VipState > 0 {
+			if jy.HasBidFieldPower(config.ResourceApi.HasPowers, fmt.Sprint(util.Int64All(baseUserId)), MedicalFunctionCode) {
+>>>>>>> master
 				isSearch = true
 			}
 		}
 	}
 	isLimit := 1
 	if isSearch {
-		if len(s_word) > 0 || len(industry) > 0 {
-			searchTypeSwitch, _ := config.Sysconfig["searchTypeSwitch"].(bool)
-			status = 2
-			field := bidSearch_field_1
-			if bidField != "" { // 如果是领域化数据
-				field = bidSearch_domain_field_1
-			}
-
+		searchTypeSwitch, _ := config.Sysconfig["searchTypeSwitch"].(bool)
+		so := NewSearchOptimize(userId, phone, area, city, subtype, toptype, publishtime, strings.Join(queryItems, ","), fmt.Sprintf("%s-%s", minprice, maxprice), industry, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, s_word, additionalWords, notkey, "PC", territorialization, 0, pageSize, searchGroup, searchMode, wordsMode, *userInfo, searchTypeSwitch)
+		heightKeys = so.HeightKeys //主关键词和附加词合并,多组空格隔开,作为前端渲染高亮关键词使用
+		//关键词  行业 附加词
+		if len(s_word) > 0 || len(industry) > 0 || strings.TrimSpace(so.AdditionalWords) != "" {
 			if searchLimit {
 				isLimit = public.Lst.IsLimited(p.Request, p.ResponseWriter, p.Session(), isPayedUser)
 				if isLimit == 1 { //没有被限制
@@ -425,93 +465,88 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 				}
 			}
 			if isLimit == 1 {
+<<<<<<< HEAD
 				secondKWS, _, _, _, secondFlag, count, totalPage, list = bidsearch.SearchData("pc", p.Request, 1, util.ObjToString(p.GetSession("userId")), secondKWS, s_word, area, city, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, fileExists, 0, true, queryItems, field, notkey, isPayedUser, searchTypeSwitch, bidField, pageSize, config.Sysconfig)
+=======
+				count, total, list = so.GetBidSearchList(false)
+>>>>>>> master
 			}
 		} else {
 			p.DisableHttpCache()
-			pageType := ""
-			// 如果是领域化数据
-			if bidField != "" {
-				if domainPageType, ok := DomainPageType[bidField]; ok {
-					pageType = domainPageType
-				}
-			}
-			p.T["list"] = PCS_list(pageType, pageSize, userId) //Newbids("")[0]
-			count, totalPage = 500, 10
-			if userId == "" {
-				//未登录用户可查看5000条
-				count, totalPage = bidsearch.SearchMaxPageCount_NOLOGIN, 100
-			}
+			list, count, total = so.GetBidSearchListByCache()
 		}
 	}
-
-	if status == 2 {
-		secondList, tp, _ := bidsearch.LisetData(1, 0, list, secondFlag, config.Seoconfig, isPayedUser, pageSize, userId)
-		if tp == 1 {
-			p.T["secondList"] = ""
-			totalPage = 1
-		} else if len(secondList) > 0 {
-			p.T["secondList"] = secondList
-		}
-		if secondKWS != "" {
-			s_word = s_word + "+" + secondKWS
-		}
-		if noLoginBl {
-			subtype = ""
-		}
-		p.T["list"] = list
-		p.T["secondFlag"] = secondFlag
-		p.T["area"] = area
-		p.T["publishtime"] = publishtime
-		p.T["timeslot"] = timeslot
-		p.T["toptype"] = toptype
-		p.T["subtype"] = subtype
-		p.T["searchvalue"] = s_word
-		p.T["minprice"] = minprice
-		p.T["maxprice"] = maxprice
-		p.T["buyerclass"] = buyerclass
-		p.T["buyertel"] = hasBuyerTel
-		p.T["winnertel"] = hasWinnerTel
-		p.T["notkey"] = notkey
-		p.T["fileExists"] = fileExists
-		p.T["city"] = city
-		p.T["bid_field"] = bidField
-		p.SetSession("paramkey", b_word)
-		switch publishtime {
-		case "lately-7":
-			p.SetSession("parampublishtime", "最近7天")
-		case "lately-30":
-			p.SetSession("parampublishtime", "最近30天")
-		case "thisyear":
-			p.SetSession("parampublishtime", "近一年")
-		case "threeyear":
-			p.SetSession("parampublishtime", "近三年")
-		case "fiveyear":
-			p.SetSession("parampublishtime", "近五年")
-		default:
-			p.SetSession("parampublishtime", publishtime)
-		}
-		p.SetSession("paramarea", area)
-		if subtype != "" {
-			p.SetSession("paraminfotype", subtype)
-		} else {
-			p.SetSession("paraminfotype", toptype)
-		}
+	if noLoginBl {
+		subtype = ""
+	}
+	p.T["list"] = list
+	p.T["secondFlag"] = secondFlag
+	p.T["area"] = area
+	p.T["publishtime"] = publishtime
+	p.T["timeslot"] = timeslot
+	p.T["toptype"] = toptype
+	p.T["subtype"] = subtype
+	p.T["searchvalue"] = keywords //搜索关键词
+	p.T["minprice"] = minprice
+	p.T["maxprice"] = maxprice
+	p.T["buyerclass"] = buyerclass
+	p.T["buyertel"] = hasBuyerTel
+	p.T["winnertel"] = hasWinnerTel
+	p.T["notkey"] = notkey
+	p.T["fileExists"] = fileExists
+	p.T["city"] = city
+	p.T["bid_field"] = territorialization
+	p.SetSession("paramkey", b_word)
+	switch publishtime {
+	case "lately-7":
+		p.SetSession("parampublishtime", "最近7天")
+	case "lately-30":
+		p.SetSession("parampublishtime", "最近30天")
+	case "thisyear":
+		p.SetSession("parampublishtime", "近一年")
+	case "threeyear":
+		p.SetSession("parampublishtime", "近三年")
+	case "fiveyear":
+		p.SetSession("parampublishtime", "近五年")
+	default:
+		p.SetSession("parampublishtime", publishtime)
+	}
+	p.SetSession("paramarea", area)
+	if subtype != "" {
+		p.SetSession("paraminfotype", subtype)
+	} else {
+		p.SetSession("paraminfotype", toptype)
 	}
+	//}
 	p.T["selectType"] = selectType
 	p.T["login"] = p.Session().Get("user")
 	p.T["count"] = count
-	p.T["totalPage"] = totalPage
-	p.T["keywords"] = b_word
+	p.T["totalPage"] = (count + 1) / int64(pageSize)
+	p.T["keywords"] = keywords      //搜索关键词
+	p.T["heightWords"] = heightKeys //主关键词和附加词合并后
 	p.T["industry"] = industry
 	p.T["industrylist"] = industrylist
 	p.T["sortArray"] = sortArray
 	p.T["showVipScreen"] = isPayedUser
-	p.T["bidField"] = bidField
+	p.T["bidField"] = territorialization
 	p.T["module"] = module
-	p.T["interceptWord"] = a_word
+	p.T["interceptKeyWords"] = b_word   //超出限制关键词限制长度 截取后
+	p.T["interceptOtherWords"] = a_word //超出限制关键词限制长度 截取后 提示关键词
 	p.T["interceptLimit"] = keywordsLimit
 	//
+	p.T["searchGroup"] = searchGroup
+	p.T["searchMode"] = searchMode
+	p.T["wordsMode"] = wordsMode
+	p.T["additionalWords"] = additionalWords
+	p.T["total"] = total
+
+	p.T["isVip"] = userInfo.VipState > 0
+	p.T["isMember"] = userInfo.BigMember > 0
+	p.T["isEntniche"] = userInfo.EntMember > 0
+	p.T["isEntnicheNew"] = userInfo.IsNewEnt
+	p.T["isEntService"] = userInfo.EntService
+	p.T["vipBefore202209"] = userInfo.VipState > 0 && userInfo.VipStartData < util.Int64All(config.Sysconfig["contextOldVipLimit"]) //超级订阅 超强项目
+	//
 	if userId != "" {
 		//企业画像 权限
 		p.T["portraitpower"] = jylabutil.IsAuthorized(userId, "i_portraitpower")
@@ -520,6 +555,7 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	return p.Render("/pc/supsearch.html", &p.T)
 }
 
+// Newbids  最新招标信息
 func Newbids(p, userId string) []map[string]interface{} {
 	//fmt.Println("11111", redis.Get("newother", "index_list"))
 	nologin := ""
@@ -629,7 +665,7 @@ func duplicateRemoval(ss []map[string]interface{}) []map[string]interface{} {
 	return data
 }
 
-var topType = map[string]string{
+var topTypeMap = map[string]string{
 	"招标预告":   "预告",
 	"招标公告":   "招标",
 	"招标结果":   "结果",
@@ -652,7 +688,7 @@ func top500(subtype string, bidField string, userId string) (list *[]map[string]
 			var subTypes []string
 
 			for _, v := range strings.Split(subtype, ",") {
-				if v1, ok := topType[v]; ok {
+				if v1, ok := topTypeMap[v]; ok {
 					topTypes = append(topTypes, fmt.Sprintf(`"%s"`, v1))
 				} else {
 					subTypes = append(subTypes, fmt.Sprintf(`"%s"`, v))

+ 139 - 2
src/jfw/front/swordfish.go

@@ -43,9 +43,14 @@ var (
 	bidSearch_sort           = `{"dataweight":-1,"publishtime":-1}`
 	bidSearch_field_file     = `,"filetext","isValidFile"`
 	bidSearch_domain_field_1 = bidSearch_field_1 + `,"purchasing","s_winner","buyer"` + bidSearch_field_file //领域数据字段基本字段
+
+	BidSearchFieldBase   = `"_id","title","publishtime","dataweight","toptype","subtype","type","area","city","s_subscopeclass","bidamount","budget","buyerclass","spidercode","site","projectname","projectcode"`                        //搜索列表基础字段
+	BidSearchFieldOfVip  = BidSearchFieldBase + `,"buyer","buyertel","buyerperson","agency","agencytel","agencyperson","s_winner","winnertel","winnerperson","signendtime","bidendtime","bidopentime","budget","projectinfo","entidlist"` //付费列表字段
+	BidSearchFieldFile   = `,"isValidFile"`
+	BidSearchDomainField = BidSearchFieldOfVip + `,"purchasing"` //领域数据字段基本字段
 )
 
-// 剑鱼标讯推送三级页点赞暂弃 改成剑鱼标讯实验室点赞功能
+// Praise 剑鱼标讯推送三级页点赞暂弃 改成剑鱼标讯实验室点赞功能
 func (m *Front) Praise() error {
 	defer util.Catch()
 	var flag = "F"
@@ -79,11 +84,122 @@ func (m *Front) Searchinfolist(p string) error {
 	return m.Redirect("/jylab/supsearch/index.html")
 }
 
-// ajax分页请求
+// PcAjaxReq ajax分页请求
 func (m *Front) PcAjaxReq() {
+	territorialization := m.GetString("bid_field") // 领域类型 0101- 医疗
+	tabularflag := m.GetString("tabularflag")
+	userId := util.ObjToString(m.GetSession("userId"))
+	phone := util.ObjToString(m.GetSession("phone"))
+	entId := util.IntAll(m.GetSession("entId"))
+	baseUserId := m.GetSession("base_user_id")
+	currentPage, _ := m.GetInteger("pageNumber")
+	pageSize, _ := m.GetInteger("pageSize")
+	if pageSize == 0 {
+		pageSize = 50
+	}
+	//userId = "63c11681800b227df5874680"//免费
+	//userId = "63d5cc0098f6fae01592ea7f" //付费
+	if tabularflag == "Y" && userId == "" {
+		//判断用户是否登录进行表格查询,否则返回基本数据
+		tabularflag = ""
+	}
+	userInfo := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+	if territorialization != "" { // 如果是领域化数据 判断是否是付费用户 是否有权限
+		if (userInfo.BigMember <= 0 && userInfo.VipState <= 0) || (!jy.HasBidFieldPower(config.ResourceApi.HasPowers, fmt.Sprint(util.Int64All(baseUserId)), MedicalFunctionCode)) {
+			m.ServeJson(map[string]interface{}{
+				"list": []map[string]interface{}{},
+			})
+			return
+		}
+	}
+
+	area := m.GetString("area")
+	subtype := m.GetString("subtype")
+	toptype := m.GetString("toptype") //信息类型
+	publishtime := m.GetString("publishtime")
+	selectType := m.GetString("selectType")
+	if selectType == "" {
+		selectType = "title,content"
+	}
+	industry := strings.TrimSpace(m.GetString("industry"))
+	minprice := m.GetString("minprice")               //最低价格
+	maxprice := m.GetString("maxprice")               //最高价格
+	fileExists := m.GetString("fileExists")           //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
+	searchGroup, _ := m.GetInteger("searchGroup")     //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
+	searchMode, _ := m.GetInteger("searchMode")       //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
+	wordsMode, _ := m.GetInteger("wordsMode")         //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
+	additionalWords := m.GetString("additionalWords") //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
+	var (
+		//高级筛选 仅付费用户可查询
+		hasBuyerTel, hasWinnerTel string //是否有采购单位电话、是否有中标单位电话 y:有 n:没有
+		buyerclass                string //采购单位类别
+		notkey                    string //排除词
+		isPayedUser               bool
+		queryItems                []string
+		city                      string //城市
+		count, total              int64
+		isLimit                   = 1
+		list                      []*map[string]interface{}
+		heightKeys                string //需要高亮的关键词
+	)
+	queryItems = userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
+	isPayedUser = userInfo.IsPayedUser()
+	if isPayedUser {
+		buyerclass = m.GetString("buyerclass")
+		hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
+		notkey = util.If(strings.Contains(m.GetString("notkey"), ","), strings.ReplaceAll(m.GetString("notkey"), ",", " "), m.GetString("notkey")).(string)
+		city = m.GetString("city")
+	}
+	if userId == "" {
+		//未登录用户访问全部信息类型 需要过滤掉 拟建和采购意向
+		if subtype == "" {
+			subtype = "招标预告,招标公告,招标结果,招标信用信息"
+		}
+	}
+	b_word, a_word, s_word := jy.InterceptSearchKW(m.GetString("searchvalue"), util.IntAllDef(config.Sysconfig["keywordsLimit"], 35), len(industry) == 0)
+	if len(s_word) > 0 || len(industry) > 0 || strings.TrimSpace(additionalWords) != "" {
+		searchLimit := public.IsSearchLimit(queryItems)
+		//未登录用户标题、正文都限制,已登录用户只限制正文
+		if userId == "" {
+			searchLimit = true
+		}
+		//全文检索限制
+		if searchLimit {
+			//limitFlag = public.Lst.Flag
+			isLimit = public.Lst.IsLimited(m.Request, m.ResponseWriter, m.Session(), isPayedUser)
+			if isLimit == 1 { //没有被限制
+				defer public.Lst.Limit()
+			}
+		}
+		if isLimit == 1 {
+			searchTypeSwitch, _ := config.Sysconfig["searchTypeSwitch"].(bool)
+			so := NewSearchOptimize(userId, phone, area, city, subtype, toptype, publishtime, strings.Join(queryItems, ","), fmt.Sprintf("%s-%s", minprice, maxprice), industry, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, s_word, additionalWords, notkey, "PC", territorialization, currentPage, pageSize, searchGroup, searchMode, wordsMode, *userInfo, searchTypeSwitch)
+			m.SetSession("selectType", so.SelectType)
+			heightKeys = so.HeightKeys
+			count, total, list = so.GetBidSearchList(false)
+		}
+	}
+	m.ServeJson(map[string]interface{}{
+		"limitFlag":          false,
+		"status":             isLimit,
+		"list":               list,
+		"count":              count,
+		"total":              total,
+		"totalPage":          (count + 1) / int64(pageSize),
+		"interceptOtherWord": a_word,                                                //截取后 用于提示的关键词
+		"interceptKeyWords":  b_word,                                                //超出限制长度 截取后的关键词
+		"interceptLimit":     util.IntAllDef(config.Sysconfig["keywordsLimit"], 35), //限制额度
+		"keywords":           m.GetString("searchvalue"),                            //关键词
+		"heightWords":        heightKeys,                                            //需要高亮的关键词词组  主关键词和附加词合并
+	})
+}
+
+// PcAjaxReq_bak  ajax分页请求 备份
+func (m *Front) PcAjaxReq_Bak() {
 	bidField := m.GetString("bid_field") // 领域类型 0101- 医疗
 	tabularflag := m.GetString("tabularflag")
 	userId := util.ObjToString(m.GetSession("userId"))
+	entId := util.IntAll(m.GetSession("entId"))
 	baseUserId := m.GetSession("base_user_id")
 	currentPage, _ := m.GetInteger("pageNumber")
 	pageSize, _ := m.GetInteger("pageSize")
@@ -96,9 +212,14 @@ func (m *Front) PcAjaxReq() {
 	}
 	reqType := m.GetString("reqType")
 	if bidField != "" { // 如果是领域化数据 判断是否是付费用户 是否有权限
+<<<<<<< HEAD
 
 		vipStatus := jy.GetVipState(m.Session(), *config.Middleground, userId)
 		if (vipStatus.BigMember <= 0 && vipStatus.VipState <= 0) || (!jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode)) {
+=======
+		vipStatus := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+		if (vipStatus.BigMember <= 0 && vipStatus.VipState <= 0) || (!jy.HasBidFieldPower(config.ResourceApi.HasPowers, fmt.Sprint(util.Int64All(baseUserId)), MedicalFunctionCode)) {
+>>>>>>> master
 			m.ServeJson(map[string]interface{}{
 				"list": []map[string]interface{}{},
 			})
@@ -144,7 +265,11 @@ func (m *Front) PcAjaxReq() {
 		start                     int
 		city                      string //城市
 	)
+<<<<<<< HEAD
 	isPayedUser, publishtime, queryItems, currentPage, start = bidsearch.PublicSearch(userId, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), currentPage, pageSize, m.Session(), *config.Middleground)
+=======
+	isPayedUser, publishtime, queryItems, currentPage, start = bidsearch.PublicSearch(userId, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), currentPage, pageSize, entId)
+>>>>>>> master
 	if isPayedUser {
 		buyerclass = m.GetString("buyerclass")
 		hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
@@ -207,6 +332,7 @@ func (m *Front) PcAjaxReq() {
 		"status":         isLimit,
 		"list":           list,
 		"count":          count,
+		"total":          config.Sysconfig["defaultTotal"],
 		"totalPage":      totalPage,
 		"interceptWord":  a_word,
 		"interceptLimit": util.IntAllDef(config.Sysconfig["keywordsLimit"], 35),
@@ -360,6 +486,7 @@ func (m *Front) Getpage() error {
 func (m *Front) WxsearchlistPaging() {
 	defer util.Catch()
 	userId, _ := m.GetSession("userId").(string)
+	entId := util.IntAll(m.GetSession("entId"))
 	var list *[]map[string]interface{}
 	var b_word, a_word, secondFlag, secondKWS string
 	var secondList []map[string]interface{}
@@ -398,7 +525,12 @@ func (m *Front) WxsearchlistPaging() {
 			var notkey string = ""                        //排除词
 			var fileExists = m.GetString("fileExists")    //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
 			var city string = ""                          //城市
+<<<<<<< HEAD
 			vipStatus := jy.GetVipState(m.Session(), *config.Middleground, userId)
+=======
+
+			vipStatus := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+>>>>>>> master
 			isPayedUser = vipStatus.IsPayedUser()
 			queryItems := vipStatus.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
 			if isPayedUser {
@@ -1861,8 +1993,13 @@ func (f *Front) HistorypushPaging() error {
 func (m *Front) Subscribe() error {
 	isBuyed := false
 	if userId, _ := m.GetSession("userId").(string); userId != "" {
+<<<<<<< HEAD
 
 		vStatus := jy.GetVipState(m.Session(), *config.Middleground, userId)
+=======
+		entId := util.IntAll(m.GetSession("entId"))
+		vStatus := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+>>>>>>> master
 		isBuyed = vStatus.VipState > 0
 	}
 	m.T["isBuyed"] = isBuyed

+ 28 - 15
src/jfw/front/ws_dataExport.go

@@ -356,27 +356,40 @@ func (wd *WsDataExport) SearchExport() error {
 	if userId == "" {
 		return errors.New("未登录")
 	}
+	searchGroup, _ := wd.GetInteger("searchGroup")
+	searchMode, _ := wd.GetInteger("searchMode")
+	wordsMode, _ := wd.GetInteger("wordsMode")
 	//接收超级搜索页面参数
 	reqData := public.BidSearchExport{
-		Keywords:     wd.GetString("searchvalue"),                  //搜索词
-		Publishtime:  wd.GetString("publishtime"),                  //发布时间
-		Area:         wd.GetString("scope"),                        //地区
-		Subtype:      wd.GetString("subtype"),                      //信息类型
-		Minprice:     wd.GetString("minprice"),                     //最低价格
-		Maxprice:     wd.GetString("maxprice"),                     //最高价格
-		Industry:     strings.TrimSpace(wd.GetString("industry")),  //选中的行业
-		SelectType:   wd.GetString("selectType"),                   //标题 or 全文
-		Buyerclass:   wd.GetString("buyerclass"),                   //采购单位行业
-		Hasbuyertel:  wd.GetString("buyertel"),                     //是否有采购电话
-		Haswinnertel: wd.GetString("winnertel"),                    //是否有中标电话
-		SelectIds:    strings.TrimSpace(wd.GetString("selectIds")), //选择信息id
-		Notkey:       wd.GetString("notkey"),                       //排除词
-		City:         wd.GetString("city"),                         //城市
-		FileExists:   wd.GetString("fileExists"),                   //有无附件
+		Keywords:        wd.GetString("searchvalue"),                  //搜索词
+		Publishtime:     wd.GetString("publishtime"),                  //发布时间
+		Area:            wd.GetString("scope"),                        //地区
+		Subtype:         wd.GetString("subtype"),                      //信息类型
+		Minprice:        wd.GetString("minprice"),                     //最低价格
+		Maxprice:        wd.GetString("maxprice"),                     //最高价格
+		Industry:        strings.TrimSpace(wd.GetString("industry")),  //选中的行业
+		SelectType:      wd.GetString("selectType"),                   //标题 or 全文
+		Buyerclass:      wd.GetString("buyerclass"),                   //采购单位行业
+		Hasbuyertel:     wd.GetString("buyertel"),                     //是否有采购电话
+		Haswinnertel:    wd.GetString("winnertel"),                    //是否有中标电话
+		SelectIds:       strings.TrimSpace(wd.GetString("selectIds")), //选择信息id
+		Notkey:          wd.GetString("notkey"),                       //排除词
+		City:            wd.GetString("city"),                         //城市
+		FileExists:      wd.GetString("fileExists"),                   //有无附件
+		SearchGroup:     searchGroup,                                  //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+		SearchMode:      searchMode,                                   //搜索模式:0:精准搜索;1:模糊搜索
+		WordsMode:       wordsMode,                                    //搜索关键词模式;默认0:包含所有,1:包含任意
+		AdditionalWords: wd.GetString("additionalWords"),              //关键词:附加关键词(副:五组,每组最多15个字符)
 	}
+<<<<<<< HEAD
 	saveData := reqData.PassBidSearchExport(config.Sysconfig)
 
 	saveData["selectType"] = strings.Join(jy.GetVipState(wd.Session(), *config.Middleground, userId).
+=======
+	entId := util.IntAll(wd.GetSession("entId"))
+	saveData := reqData.PassBidSearchExport()
+	saveData["selectType"] = strings.Join(jy.GetVipState(public.Mysql, public.MQFW, userId, entId).
+>>>>>>> master
 		GetQueryItems(wd.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
 	saveData["s_openid"] = openid
 	saveData["s_userid"] = userId

+ 5 - 0
src/jfw/modules/app/src/app/front/swordfish.go

@@ -262,6 +262,7 @@ func (m *Front) WxsearchlistPaging() {
 	pageNum, _ := m.GetInteger("pageNum")
 	searchvalue := strings.TrimSpace(m.GetString("searchvalue"))
 	userid := util.ObjToString(m.GetSession("userId"))
+	entId := util.IntAll(m.GetSession("entId"))
 	if userid != "" {
 		//历史记录
 		history := redis.GetStr("other", "s_"+userid)
@@ -299,7 +300,11 @@ func (m *Front) WxsearchlistPaging() {
 		var notkey string = ""                        //排除词
 		fileExists = m.GetString("fileExists")        //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
 
+<<<<<<< HEAD
 		isPayedUser, publishtime, queryItems, pageNum, _ = bidsearch.PublicSearch(userid, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), pageNum, 50,  m.Session(),  *config.Middleground)
+=======
+		isPayedUser, publishtime, queryItems, pageNum, _ = bidsearch.PublicSearch(userid, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), pageNum, 50, entId)
+>>>>>>> master
 		if isPayedUser {
 			buyerclass = m.GetString("buyerclass")
 			hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")

+ 55 - 0
src/jfw/modules/app/src/app/front/ws_dataExport.go

@@ -327,6 +327,7 @@ func isPhone(value string) bool {
 
 // 微信数据导出
 func (wd *WsDataExport) SearchExport() error {
+<<<<<<< HEAD
     openid := util.ObjToString(wd.GetSession("s_m_openid"))
     userId := util.ObjToString(wd.GetSession("userId"))
     if userId == "" {
@@ -371,6 +372,60 @@ func (wd *WsDataExport) SearchExport() error {
 
     wd.ServeJson(bson.M{"_id": encrypt.SE.Encode2Hex(_id)})
     return nil
+=======
+	openid := util.ObjToString(wd.GetSession("s_m_openid"))
+	userId := util.ObjToString(wd.GetSession("userId"))
+	if userId == "" {
+		return errors.New("未登录")
+	}
+	searchGroup, _ := wd.GetInteger("searchGroup")
+	searchMode, _ := wd.GetInteger("searchMode")
+	wordsMode, _ := wd.GetInteger("wordsMode")
+	//接收超级搜索页面参数
+	reqData := public.BidSearchExport{
+		Keywords:        wd.GetString("searchvalue"),                  //搜索词
+		Publishtime:     wd.GetString("publishtime"),                  //发布时间
+		Area:            wd.GetString("scope"),                        //地区
+		Subtype:         wd.GetString("subtype"),                      //信息类型
+		Minprice:        wd.GetString("minprice"),                     //最低价格
+		Maxprice:        wd.GetString("maxprice"),                     //最高价格
+		Industry:        strings.TrimSpace(wd.GetString("industry")),  //选中的行业
+		SelectType:      wd.GetString("selectType"),                   //标题 or 全文
+		Buyerclass:      wd.GetString("buyerclass"),                   //采购单位行业
+		Winner:          wd.GetString("winner"),                       //中标单位
+		Hasbuyertel:     wd.GetString("buyertel"),                     //是否有采购电话
+		Haswinnertel:    wd.GetString("winnertel"),                    //是否有中标电话
+		SelectIds:       strings.TrimSpace(wd.GetString("selectIds")), //选择信息id
+		Notkey:          wd.GetString("notkey"),                       //排除词
+		City:            wd.GetString("city"),                         //城市
+		FileExists:      wd.GetString("fileExists"),                   //有无附件
+		SearchGroup:     searchGroup,                                  //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+		SearchMode:      searchMode,                                   //搜索模式:0:精准搜索;1:模糊搜索
+		WordsMode:       wordsMode,                                    //搜索关键词模式;默认0:包含所有,1:包含任意
+		AdditionalWords: wd.GetString("additionalWords"),              //关键词:附加关键词(副:五组,每组最多15个字符)
+	}
+	entId := util.IntAll(wd.GetSession("entId"))
+	saveData := reqData.PassBidSearchExport()
+	saveData["selectType"] = strings.Join(jy.GetVipState(public.Mysql, public.MQFW, userId, entId).
+		GetQueryItems(wd.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
+	saveData["s_openid"] = openid
+	saveData["s_userid"] = userId
+	saveData["comeinfrom"] = "supersearchPage"
+	region := util.If(reqData.Area == "全国", "", reqData.Area).(string)
+	if region != "" && reqData.City != "" {
+		region += "," + reqData.City
+	} else {
+		region = reqData.City
+	}
+	saveData["region"] = strings.Split(region, ",")
+	//是否开启 正文 标题同时搜索只搜正文的开关
+	saveData["searchTypeSwitch"], _ = config.Sysconfig["searchTypeSwitch"].(bool)
+	//存入数据库
+	_id := mongodb.Save(dataexport.ExportTable, saveData)
+
+	wd.ServeJson(bson.M{"_id": util.SE.Encode2Hex(_id)})
+	return nil
+>>>>>>> master
 }
 
 func (m *WsDataExport) ToOrderDetail() error {

+ 2 - 1
src/jfw/modules/bigmember/src/config.json

@@ -177,5 +177,6 @@
   "claim": {
     "details": "https://databi-web.jydev.jianyu360.com/nzj/app/nzj.app/nzj_claim_detail.spg",
     "listPage": "https://databi-web.jydev.jianyu360.com/nzj/app/nzj.app/nzj_claim.spg"
-  }
+  },
+  "contextOldVipLimit": 1664553600
 }

+ 1 - 0
src/jfw/modules/bigmember/src/config/config.go

@@ -64,6 +64,7 @@ type config struct {
 		Details  string `json:"details"`
 		ListPage string `json:"listPage"`
 	} `json:"claim"`
+	ContextOldVipLimit int64 `json:'contextOldVipLimit'` //超级订阅部分用户:--- 超前项目权限
 }
 
 type CustomerInfo struct {

+ 1 - 1
src/jfw/modules/bigmember/src/service/subscribe/subscribe.go

@@ -41,7 +41,7 @@ type Subscribe struct {
 func (s *Subscribe) FreeUserSubscribe() {
 	//isVip, isMember 付费用户 isEntNiche, isEntNicheNew 商机管理用户 iPpStatus 非省份订阅包 promptBool 是否今日已提醒 areaConfig 区域配置
 	var isVip, isMember, isEntNiche, isEntNicheNew, iPpStatus, searchPrompt, promptBool, isAreaConfig bool
-	userId := s.GetSession("userId").(string)
+	userId := qutil.ObjToString(s.GetSession("userId"))
 	if userId == "" {
 		fmt.Println("用户未登录,搜索词不进行校验")
 		s.ServeJson(Result{Data: M{"prompt": false, "areaSet": false, "freeArea": false}})

+ 118 - 0
src/jfw/modules/bigmember/src/service/use/use.go

@@ -694,6 +694,7 @@ type UserInfo struct {
 	EntRoleId       int                   `json:"entRoleId"`       //商机管理角色:1:企业管理员;2:部门管理员
 	MemberPowerType int64                 `json:"memberPowerType"` ////大会员权益类型 0无 1个人 2企业
 	VipPowerType    int64                 `json:"vipPowerType"`    ////超级订阅权益类型 0无 1个人 2企业
+	VipBefore202209 bool                  `json:"vipBefore202209"` //超级订阅:超前项目权限
 }
 
 //是否使用过首次使用
@@ -723,9 +724,126 @@ func (u *Use) IsAdd() {
 			FreeFile:        bigPower.FreeFile,
 			FreeHasKey:      bigPower.FreeHasKey,
 		}
+<<<<<<< HEAD
 		power := []int{}
 		for k, _ := range bigPower.PowerMap {
 			power = append(power, k)
+=======
+		var (
+			userInfo      = &UserInfo{}
+			userCacheBool = false
+		)
+
+		baseInfoCacheKey := fmt.Sprintf(jy.IsGetUserBaseInfoRedisKey, userid)
+		if bytes, err := redis.GetBytes(jy.BaseInfoCacheDb, baseInfoCacheKey); err == nil && len(*bytes) > 0 {
+			err = json.Unmarshal(*bytes, &userInfo)
+			if err == nil {
+				userCacheBool = true
+			} else {
+				log.Println("缓存异常")
+			}
+		}
+		if !userCacheBool {
+			bigPower := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+			userInfo = &UserInfo{
+				BigMemberStatus: bigPower.Status,
+				Combo:           level_map[bigPower.Status],
+				IsSubCount:      bigPower.Pid != "",
+				IsMemberTrial:   bigPower.HasTrial,
+				IsUsed:          bigPower.Used,
+				EntName:         bigPower.EntName,
+				EntNiche:        bigPower.EntnicheStatus > 0,
+				VipStatus:       bigPower.VipStatus,
+				Viper:           bigPower.Vip_BuySet.Upgrade > 0,
+				IsFree:          bigPower.VipStatus <= 0 && bigPower.Status <= 0 && bigPower.EntnicheStatus <= 0,
+				IsFreeUpgrade:   bigPower.IsUpgrade,
+				EntIsNew:        bigPower.EntIsNew,
+				IsEntService:    bigPower.IsEntService,
+				MemberPowerType: bigPower.MemberPowerType,
+				VipPowerType:    bigPower.VipPowerType,
+				VipBefore202209: bigPower.VipStatus > 0 && bigPower.VipStartDate < config.Config.ContextOldVipLimit, //超级订阅 超前项目权限
+			}
+			if entId == 0 && phone != "" {
+				entId = initEntSess(phone)
+			}
+			if entId > 0 && bigPower.EntInfo[entId] != nil {
+				userInfo.EntName = bigPower.EntInfo[entId].Name
+				userInfo.EntRoleId = bigPower.EntInfo[entId].RoleId
+				//是否是商机管理有效用户:1、管理员和员工已分配功能
+				userInfo.EntNiche = bigPower.EntInfo[entId].Status == 1 && bigPower.EntInfo[entId].IsPower
+				userInfo.EntIsNew = bigPower.EntInfo[entId].IsNew && userInfo.EntNiche
+				//有商机管理服务的用户 就不是商机管理用户
+				if userInfo.IsEntService = bigPower.EntInfo[entId].IsService && bigPower.EntInfo[entId].IsPower; userInfo.IsEntService {
+					userInfo.EntIsNew = false
+					userInfo.EntNiche = false
+				}
+			}
+			power := []int{}
+			for k, _ := range bigPower.PowerMap {
+				power = append(power, k)
+			}
+			userInfo.Powers = power
+			//是否是免费用户
+			userInfo.IsFree = bigPower.VipStatus <= 0 && bigPower.Status <= 0 && !userInfo.EntNiche
+			//存储缓存
+			go func() {
+				if bytes, err := json.Marshal(userInfo); err == nil && bytes != nil {
+					if redis.PutBytes(jy.BaseInfoCacheDb, baseInfoCacheKey, &bytes, config.Config.IsAddCacheTime+rand.Intn(120)) != nil {
+						log.Println("信息缓存异常")
+					}
+				}
+			}()
+		}
+		//不存缓存
+		//vip
+		if userInfo.VipStatus > 0 {
+			vipBool := true
+			if len(config.Config.IsAddUrls.Vip) > 0 && uRefer != "" {
+				vipBool = false
+				for _, v := range config.Config.IsAddUrls.Vip {
+					if strings.Contains(uRefer, v) {
+						vipBool = true
+						break
+					}
+				}
+
+			}
+			if vipBool {
+				//没有大会员附件下载权限
+				var notBigFileBool = userInfo.BigMemberStatus <= 0 || !strings.Contains(intStringsJoin(userInfo.Powers), "3")
+				//超级订阅非大会员用户附件下载本月可用次数
+				uk := qu.If(notBigFileBool && userInfo.VipStatus > 0 && userInfo.Viper, "v", "f").(string)
+				//附件下载包的剩余次数
+				filePackKey := fmt.Sprintf(jy.FilePackNumKey, userid, fmt.Sprint(time.Now().Month()))
+				filePackNum := redis.GetInt(jy.PowerCacheDb, filePackKey)
+				userInfo.FileNum = config.Config.FileUploadNum[uk] - redis.GetInt(jy.PowerCacheDb, fmt.Sprintf(jy.VipFileUploadNumKey, userid, fmt.Sprint(time.Now().Month()))) + filePackNum
+			}
+		}
+		//免费用户  // 商机管理用户 可以用免费用户的企业画像权限 留资有一次权限 所以也要验证商机管理用户
+		if userInfo.IsFree || userInfo.EntNiche {
+			freeBool := true
+			if len(config.Config.IsAddUrls.Free) > 0 && uRefer != "" {
+				freeBool = false
+				for _, v := range config.Config.IsAddUrls.Free {
+					if strings.Contains(uRefer, v) {
+						freeBool = true
+						break
+					}
+				}
+
+			}
+			if freeBool {
+				//免费用户是否有关键词
+				user, ok := db.Mgo.FindById("user", userid, `{"o_jy":1}`)
+				if ok && user != nil {
+					o_jy, _ := (*user)["o_jy"].(map[string]interface{})
+					a_key, _ := o_jy["a_key"].([]interface{})
+					userInfo.FreeHasKey = len(a_key) > 0
+				}
+				//免费用户可查看企业画像次数//免费用户可查看采购单位画像次数//免费用户可以进行附件下载次数
+				userInfo.FreeEntPort, userInfo.FreeBuyerPort, userInfo.FreeFile = jy.FreeExperience(userid)
+			}
+>>>>>>> master
 		}
 		userInfo.Powers = power
 		userInfo.CustomerService = config.Config.Customers

+ 601 - 0
src/jfw/modules/common/src/qfw/util/bidsearch/search.go

@@ -0,0 +1,601 @@
+package bidsearch
+
+import (
+	"fmt"
+	"jfw/config"
+	"jfw/public"
+	"log"
+	"net/http"
+	"qfw/util"
+	"qfw/util/elastic"
+	"qfw/util/jy"
+	"strconv"
+	"strings"
+	"time"
+)
+
+//pc、微信、app 招标信息搜索
+
+const (
+	INDEX          = "bidding"
+	TYPE           = "bidding"
+	bidSearch_sort = `{"dataweight":-1,"publishtime":-1}`
+
+	//招标搜索分页--每页显示数量
+	SearchPageSize_APP = 50
+	SearchPageSize_WX  = 50
+	SearchPageSize_PC  = 50
+	//招标搜索分页--最大页数
+	SearchMaxPageNum_APP   = 10
+	SearchMaxPageNum_WX    = 10
+	SearchMaxPageNum_PC    = 10  //免费用户500条记录
+	SearchMaxPageNum_PAYED = 100 //付费用户5000条记录
+
+	SearchMaxPageCount_APP     = 500
+	SearchMaxPageCount_WX      = 500
+	SearchMaxPageCount_PC      = 500  //免费用户500条记录
+	SearchMaxPageCount_PAYED   = 5000 //付费用户5000条记录
+	SearchMaxPageCount_NOLOGIN = 5000 //未登录用户5000条记录
+
+	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"`
+)
+
+// GetWxsearchlistData 移动端招标信息搜索
+func GetWxsearchlistData(keywords, scope, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists string, pageNum int, selectTypeArr []string, field, notkey string, searchTypeSwitch bool, pageSize int) (list *[]map[string]interface{}, b_word, a_word, s_word string) {
+	var hightlightContent bool = false //是否高亮正文
+	for _, v := range selectTypeArr {
+		if v == "detail" {
+			hightlightContent = true
+			break
+		}
+	}
+	b_word, a_word, s_word = jy.InterceptSearchKW(keywords, util.IntAllDef(config.Sysconfig["keywordsLimit"], 35), len(industry) == 0)
+	if len(b_word) == 0 {
+		return list, b_word, a_word, s_word
+	}
+	var findfields string
+	if selectTypeArr == nil || len(selectTypeArr) == 0 {
+		findfields = `"title"`
+	} else {
+		findfields = fmt.Sprintf(`"%s"`, strings.Join(selectTypeArr, "\",\""))
+	}
+	qstr := GetSearchQuery(s_word, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, findfields, GetBidSearchQuery(scope, city, publishtime, subtype, winner, buyerclass), notkey, searchTypeSwitch, "")
+	if hightlightContent { //全文搜索
+		list = elastic.GetAllByNgram(INDEX, TYPE, qstr, `"detail"`, bidSearch_sort, field, (pageNum-1)*pageSize, pageSize, 100, true)
+	} else { //标题搜索
+		list = elastic.GetAllByNgram(INDEX, TYPE, qstr, ``, bidSearch_sort, field, (pageNum-1)*pageSize, pageSize, 100, false)
+	}
+	if list != nil {
+		public.BidListConvert(industry, list)
+		for _, v := range *list {
+			v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
+		}
+	}
+	return list, b_word, a_word, s_word
+}
+
+// GetPcBidSearchData pc端招标信息搜索
+func GetPcBidSearchData(searchvalue, area, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists string, start int, isGetCount bool, selectTypeArr []string, field, notkey string, ispayed, searchTypeSwitch bool, bidField string, pageSize int, userId string) (count, totalPage int64, list *[]map[string]interface{}) {
+	var findfields string
+	var hightlightContent bool = false //是否高亮正文
+	for _, v := range selectTypeArr {
+		if v == "detail" {
+			hightlightContent = true
+			break
+		}
+	}
+	if selectTypeArr == nil || len(selectTypeArr) == 0 {
+		findfields = `"title"`
+	} else {
+		findfields = fmt.Sprintf(`"%s"`, strings.Join(selectTypeArr, "\",\""))
+	}
+	qstr := GetSearchQuery(searchvalue, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, findfields, GetBidSearchQuery(area, city, publishtime, subtype, winner, buyerclass), notkey, searchTypeSwitch, bidField)
+	if isGetCount && qstr != "" && start == 0 {
+		count = elastic.Count(INDEX, TYPE, qstr)
+	}
+	if !isGetCount || count > 0 || start > 0 {
+		var repl *[]map[string]interface{}
+		if hightlightContent {
+			repl = elastic.GetAllByNgram(INDEX, TYPE, qstr, `"detail"`, bidSearch_sort, field, start, pageSize, 115, true)
+		} else {
+			repl = elastic.GetAllByNgram(INDEX, TYPE, qstr, ``, bidSearch_sort, field, start, pageSize, 0, false)
+		}
+		if repl != nil && *repl != nil && len(*repl) > 0 {
+			public.BidListConvert(industry, repl)
+			list = repl
+		}
+	}
+	limitCount := util.If(ispayed, int64(SearchMaxPageCount_PAYED), int64(SearchMaxPageCount_PC)).(int64)
+	if userId == "" {
+		limitCount = SearchMaxPageCount_NOLOGIN
+	}
+	if count > limitCount {
+		count = limitCount
+	}
+	if count > 0 {
+		totalPage = (count + int64(pageSize) - 1) / int64(pageSize)
+	}
+	return
+}
+
+var topType = map[string]string{
+	"招标预告":   "预告",
+	"招标公告":   "招标",
+	"招标结果":   "结果",
+	"招标信用信息": "其它",
+}
+
+func GetBidSearchQuery(area, city, publishtime, subtype, winner, buyerclass string) string {
+	query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
+	query := ``
+	if area != "" {
+		query += `{"terms":{"area":[`
+		for k, v := range strings.Split(area, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	//
+	if city != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"city":[`
+		for k, v := range strings.Split(city, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	if query != "" {
+		query = fmt.Sprintf(query_bool_should, query)
+	}
+	if publishtime != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		starttime, endtime := "", ""
+		now := time.Now()
+		if publishtime == "lately-7" { //最近7天
+			starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
+		} else if publishtime == "lately-30" { //最近30天
+			starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
+		} else if publishtime == "thisyear" { //最近一年
+			starttime = fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endtime = fmt.Sprint(now.Unix())
+		} else if publishtime == "threeyear" { //最近三年
+			starttime = fmt.Sprint(time.Date(now.Year()-3, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endtime = fmt.Sprint(now.Unix())
+		} else if publishtime == "fiveyear" { //最近五年
+			starttime = fmt.Sprint(time.Date(now.Year()-5, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+			endtime = fmt.Sprint(now.Unix())
+		} else {
+			starttime = strings.Split(publishtime, "_")[0]
+			endtime = strings.Split(publishtime, "_")[1]
+			etTime := time.Now()
+			if endtime != "" {
+				et, _ := strconv.ParseInt(endtime, 0, 64)
+				etTime = time.Unix(et, 0)
+			}
+			endtime = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Unix())
+		}
+		query += `{"range":{"publishtime":{`
+		if starttime != "" {
+			query += `"gte":` + starttime
+		}
+		if starttime != "" && endtime != "" {
+			query += `,`
+		}
+		if endtime != "" {
+			query += `"lt":` + endtime
+		}
+		query += `}}}`
+	}
+	if subtype != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		var topTypes []string
+		var subTypes []string
+
+		for _, v := range strings.Split(subtype, ",") {
+			if v1, ok := topType[v]; ok {
+				topTypes = append(topTypes, fmt.Sprintf(`"%s"`, v1))
+			} else {
+				subTypes = append(subTypes, fmt.Sprintf(`"%s"`, v))
+			}
+		}
+		log.Println("信息类型搜索:", topTypes, subTypes)
+		if len(subTypes) > 0 && len(topTypes) > 0 {
+			query += fmt.Sprintf(`{"bool": {"should": [{"terms": {"subtype": [%s]}},{"terms": {"toptype": [%s]}}]}}`, strings.Join(subTypes, ","), strings.Join(topTypes, ","))
+		} else if len(subTypes) > 0 {
+			query += fmt.Sprintf(`{"terms":{"subtype":[%s]}}`, strings.Join(subTypes, ","))
+		} else if len(topTypes) > 0 {
+			query += fmt.Sprintf(`{"terms":{"toptype":[%s]}}`, strings.Join(topTypes, ","))
+		}
+	}
+	if winner != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"s_winner":[`
+		for k, v := range strings.Split(winner, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	if buyerclass != "" {
+		if len(query) > 0 {
+			query += ","
+		}
+		query += `{"terms":{"buyerclass":[`
+		for k, v := range strings.Split(buyerclass, ",") {
+			if k > 0 {
+				query += `,`
+			}
+			query += `"` + v + `"`
+		}
+		query += `]}}`
+	}
+	return query
+}
+
+// 包含正文或 附件 不包含标题
+func DetailFileORTitle(findfields string) bool {
+	return (strings.Contains(findfields, `"detail"`) || strings.Contains(findfields, `"filetext"`)) && !strings.Contains(findfields, `"title"`)
+}
+
+// 包含标题和正文
+func DetailTitle(findfields string) bool {
+	return strings.Contains(findfields, `"detail"`) && strings.Contains(findfields, `"title"`)
+}
+func GetSearchQuery(keyword, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, findfields, mustquery, notkey string, searchTypeSwitch bool, bidField string) (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]}}]}}`
+	query_missing := `{"constant_score":{"filter":{"missing":{"field":"%s"}}}}`
+	query_bool_must_term := `{"bool": {"must": [{ "term": {"isValidFile": %d }}]}}`
+	query_bool_must_term_domain := `{"bool": {"must": [{ "term": {"bid_field": "%s" }}]}}` // 领域化数据类型
+	gte := `"gte": %s`
+	lte := `"lte": %s`
+	musts, must_not := []string{}, []string{}
+	if mustquery != "" {
+		musts = append(musts, mustquery)
+	}
+	//搜索范围是否只有附件
+	//搜索范围只选择附件,是否有附件条件无效;
+	var isFileSearch bool = findfields == `"filetext"`
+	if keyword != "" {
+		keyword_multi_match := fmt.Sprintf(multi_match, "%s", findfields)
+		shoulds := []string{}
+		for _, v := range strings.Split(keyword, "+") {
+			if elastic.ReplaceYH(v) == "" {
+				continue
+			}
+			if len([]rune(elastic.ReplaceYH(v))) == 1 {
+				//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+				if DetailFileORTitle(findfields) {
+					keyword_multi_match = fmt.Sprintf(multi_match, "%s", findfields+`,"title"`)
+				}
+			} else {
+				//标题+全文搜索 搜索类型开关打开 默认搜索全文;(全文包含标题)(单字排除)
+				if searchTypeSwitch && DetailTitle(findfields) {
+					if strings.Contains(findfields, `"title",`) {
+						findfields = strings.Replace(findfields, `"title",`, ``, -1)
+					} else if strings.Contains(findfields, `,"title"`) {
+						findfields = strings.Replace(findfields, `,"title"`, ``, -1)
+					}
+					keyword_multi_match = fmt.Sprintf(multi_match, "%s", findfields)
+				}
+			}
+			shoulds = append(shoulds, fmt.Sprintf(keyword_multi_match, elastic.ReplaceYH(v)))
+		}
+		musts = append(musts, fmt.Sprintf(elastic.NgramMust, strings.Join(shoulds, ",")))
+	}
+	if industry != "" {
+		industrys := strings.Split(industry, ",")
+		musts = append(musts, fmt.Sprintf(query_bool_must, `"`+strings.Join(industrys, `","`)+`"`))
+	}
+	if minprice != "" || maxprice != "" {
+		sq := ``
+		if minprice != "" {
+			min, _ := strconv.ParseFloat(minprice, 64)
+			minprice = fmt.Sprintf("%.0f", min*10000)
+			if minprice == "0" {
+				minprice = ""
+			}
+		}
+		if maxprice != "" {
+			max, _ := strconv.ParseFloat(maxprice, 64)
+			maxprice = fmt.Sprintf("%.0f", max*10000)
+			if maxprice == "0" {
+				maxprice = ""
+			}
+		}
+		if minprice != "" {
+			sq += fmt.Sprintf(gte, minprice)
+		}
+		if minprice != "" && maxprice != "" {
+			sq += `,`
+		}
+		if maxprice != "" {
+			sq += fmt.Sprintf(lte, maxprice)
+		}
+		if minprice != "" || maxprice != "" {
+			query_price := fmt.Sprintf(query_bool_should, fmt.Sprintf(query_bools_must, sq, sq))
+			musts = append(musts, query_price)
+		}
+	}
+	if hasBuyerTel != "" {
+		if hasBuyerTel == "y" {
+			must_not = append(must_not, fmt.Sprintf(query_missing, "buyertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(query_missing, "buyertel"))
+		}
+	}
+	if hasWinnerTel != "" {
+		if hasWinnerTel == "y" {
+			must_not = append(must_not, fmt.Sprintf(query_missing, "winnertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(query_missing, "winnertel"))
+		}
+	}
+	if notkey = strings.TrimSpace(notkey); notkey != "" {
+		notkey_multi_match := fmt.Sprintf(multi_match, "%s", findfields)
+		notkey_must_not := []string{}
+		for _, v := range strings.Split(notkey, " ") {
+			v = strings.TrimSpace(v)
+			if v == "" {
+				continue
+			}
+			if len([]rune(elastic.ReplaceYH(v))) == 1 {
+				//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+				if DetailFileORTitle(findfields) {
+					notkey_multi_match = fmt.Sprintf(multi_match, "%s", findfields+`,"title"`)
+				}
+			}
+			notkey_must_not = append(notkey_must_not, fmt.Sprintf(notkey_multi_match, elastic.ReplaceYH(v)))
+		}
+		must_not = append(must_not, fmt.Sprintf(query_bool_should, strings.Join(notkey_must_not, ",")))
+	}
+	if !isFileSearch && fileExists != "" {
+		if fileExists == "1" { //有附件
+			must_not = append(must_not, fmt.Sprintf(query_missing, "isValidFile"))
+			musts = append(musts, fmt.Sprintf(query_bool_must_term, 1))
+		} else if fileExists == "-1" { //无附件
+			musts = append(musts, fmt.Sprintf(query_missing, "isValidFile"))
+		}
+	}
+	// 如果是领域化数据则需要加标签
+	if bidField != "" {
+		musts = append(musts, fmt.Sprintf(query_bool_must_term_domain, bidField))
+	}
+	qstr = fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(must_not, ","))
+	log.Println(qstr)
+	return
+}
+
+func PublicSearch(userId, selectType, publishtime string, bidSearchOldUserLimit int64, currentPage, pageSize, entId int) (bool, string, []string, int, int) {
+	var start int
+	vipStatus := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+	isPayedUser := vipStatus.IsPayedUser()
+	queryItems := vipStatus.GetQueryItems(selectType, bidSearchOldUserLimit)
+
+	if publishtime == "" {
+		if isPayedUser {
+			publishtime = "fiveyear"
+		} else {
+			publishtime = "thisyear"
+		}
+	}
+
+	if isPayedUser {
+		//if currentPage > SearchMaxPageCount_PAYED {
+		//	currentPage = SearchMaxPageCount_PAYED
+		//}
+	} else {
+		//if currentPage > SearchMaxPageCount_PC {
+		//	currentPage = SearchMaxPageCount_PC
+		//}
+		//时间自定义选择默认是vip 大会员 等权限
+		if len(strings.Split(publishtime, "_")) == 2 || publishtime == "threeyear" || publishtime == "fiveyear" {
+			publishtime = ""
+		}
+	}
+	start = (currentPage - 1) * pageSize
+
+	return isPayedUser, publishtime, queryItems, currentPage, start
+}
+
+// 所有的再次分词查询 只查标题
+func IntegratedData(platform string, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, secondFlag, area, city, publishtime, subtype, buyerclass, notkey string, queryItems []string, list *[]map[string]interface{}, field string, searchTypeSwitch bool, bidField string, pageSize int) (string, string, string, string, *[]map[string]interface{}) {
+	var pcAjaxFlag string
+	var secRel *[]map[string]interface{} = list
+	if secondKWS = jy.HttpEs(s_word, "ik_smart", public.DbConf.Elasticsearch.Main.Address); secondKWS != "" {
+		findfields := `"title"`
+		qstr := GetSearchQuery(secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, findfields, GetBidSearchQuery(area, city, publishtime, subtype, "", buyerclass), notkey, searchTypeSwitch, bidField)
+		secRel = elastic.GetAllByNgram(INDEX, TYPE, qstr, findfields, bidSearch_sort, field, 0, 2*pageSize, 0, false)
+		if secRel != nil && len(*secRel) > 0 {
+			public.BidListConvert(industry, secRel)
+			if platform == "app" || platform == "wx" {
+				for _, v := range *secRel {
+					v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))
+				}
+			}
+		}
+		if list != nil {
+			secRel = public.MapArrSortMerge(*list, *secRel, "_id", "publishtime")
+		}
+		secondFlag = "T"
+		pcAjaxFlag = "T"
+		if secondKWS != "" {
+			s_word += "+" + secondKWS
+		}
+	}
+	return s_word, pcAjaxFlag, secondFlag, secondKWS, secRel
+}
+
+func classify(stp, area, industry string, configData map[string]interface{}) (string, string, string) {
+	var areas, _ = configData["area"].(map[string]interface{})
+	var stypes, _ = configData["stype"].(map[string]interface{})
+	var industrys, _ = configData["industry"].(map[string]interface{})
+	var tpadd = ""
+	var areaadd = ""
+	var induadd = ""
+	if area != "" && area != "A" {
+		for k, v := range areas {
+			if area == v.(map[string]interface{})["NAME"] {
+				areaadd = k
+			}
+		}
+	}
+	//
+	if stp != "" {
+		for k, v := range stypes {
+			if stp == v.(map[string]interface{})["NAME"] {
+				tpadd = k
+			}
+		}
+	}
+	//
+	if industry != "" {
+		for k, v := range industrys {
+			if strings.Contains(util.ObjToString(v.(map[string]interface{})["NAME"]), industry) {
+				induadd = k
+			}
+		}
+	}
+	return tpadd, areaadd, induadd
+}
+
+// list != nil && len(*list) == bidsearch.SearchPageSize_APP && pageNum < util.If(isPayedUser, bidsearch.SearchMaxPageNum_PAYED, bidsearch.SearchMaxPageNum_APP).(int)
+// 数据格式化处理
+func LisetData(stype, pageNum int, list *[]map[string]interface{}, secondFlag string, configData map[string]interface{}, isPayedUser bool, pageSize int, userId string) ([]map[string]interface{}, int64, bool) {
+	var (
+		secondList  []map[string]interface{}
+		totalPage   int64
+		hasNextPage bool
+	)
+	if list != nil && len(*list) > 0 {
+		if stype != 3 && stype != 4 {
+			for _, v := range *list {
+				if v["_id"] != nil {
+					v["_id"] = util.EncodeArticleId2ByCheck(v["_id"].(string))
+				}
+				stp, ok := v["subtype"].(string)
+				if ok && stp == "" {
+					stp = v["toptype"].(string)
+				}
+				area, ok := v["area"].(string)
+				indtry := util.ObjToString(v["industry"])
+				v["stypeadd"], v["areaadd"], v["indadd"] = classify(stp, area, indtry, configData)
+				//正文匹配检索关键词
+				highlight, _ := v["highlight"].(map[string][]string)
+				detail := ""
+				for _, val := range highlight["detail"] {
+					detail += public.ClearHtml.ReplaceAllString(val, "")
+				}
+				v["detail"] = detail
+				v["href"] = util.EncodeArticleId2ByCheck(util.GetRandom(20))
+				if isValidFile, _ := v["isValidFile"].(bool); isValidFile {
+					delete(v, "filetext")
+					v["fileExists"] = true
+				}
+			}
+		}
+		if secondFlag != "" {
+			if len(*list) > pageSize {
+				secondList = (*list)[pageSize:]
+				if len(secondList) > pageSize {
+					secondList = secondList[:pageSize]
+				}
+				*list = (*list)[:pageSize]
+				totalPage = 2
+			} else {
+				totalPage = 1
+			}
+		}
+	}
+
+	if list != nil && len(*list) == pageSize {
+		hasNextPage = true
+	}
+	if isPayedUser && pageNum >= SearchMaxPageCount_PAYED {
+		hasNextPage = false
+	} else if !isPayedUser && pageNum >= SearchMaxPageCount_WX {
+		hasNextPage = false
+	}
+	if userId == "" && pageNum > SearchMaxPageCount_NOLOGIN {
+		hasNextPage = false
+	}
+	return secondList, totalPage, hasNextPage
+}
+
+func SearchData(platform string, request *http.Request, currentPage int, userId, secondKWS, s_word, area, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists string, start int, isGetCount bool, queryItems []string, field, notkey string, isPayedUser, searchTypeSwitch bool, bidField string, pageSize int) (second, b_word, a_word, pcAjaxFlag, secondFlag string, count, totalPage int64, list *[]map[string]interface{}) {
+	//包含标题才能进行二次搜索
+	var secondSearch = strings.Contains(strings.Join(queryItems, ","), "title")
+	var searchvalue = s_word
+	number := util.If(platform == "app" || platform == "wx", 1, 0)
+	if platform == "app" || platform == "wx" {
+		list, b_word, a_word, s_word = GetWxsearchlistData(s_word, area, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, start, queryItems, field, notkey, searchTypeSwitch, pageSize)
+		if list != nil && len(*list) != 0 {
+			count = int64(len(*list))
+		}
+	} else {
+		count, totalPage, list = GetPcBidSearchData(s_word, area, city, publishtime, subtype, industry, minprice, maxprice, winner, buyerclass, hasBuyerTel, hasWinnerTel, fileExists, start, isGetCount, queryItems, field, notkey, isPayedUser, searchTypeSwitch, bidField, pageSize, userId)
+	}
+	if len([]rune(s_word)) > 3 && int(count) < pageSize && start == number && secondSearch {
+		var paramList = list
+		s_word, pcAjaxFlag, secondFlag, second, list = IntegratedData(platform, s_word, secondKWS, industry, minprice, maxprice, hasBuyerTel, hasWinnerTel, fileExists, secondFlag, area, city, publishtime, subtype, buyerclass, notkey, queryItems, paramList, field, searchTypeSwitch, bidField, pageSize)
+	}
+
+	listSize := 0
+	if list != nil {
+		listSize = len(*list)
+	}
+	public.SaveUserSearchLog(request, userId, -1, platform, "超级搜索", map[string]interface{}{
+		"search_word":        util.If(platform == "app" || platform == "wx", searchvalue, s_word),
+		"search_area":        area,
+		"search_city":        city,
+		"search_price":       []string{minprice, maxprice},
+		"search_publishtime": publishtime,
+		"search_type":        subtype,
+		"search_industry":    industry,
+		"pagenum":            currentPage,
+		"pagesize":           listSize,
+		"fileExists":         fileExists,
+		"bid_field":          util.If(bidField != "", bidField, nil),
+	})
+	return
+}
+
+func AddHistory(history, searchvalue string) []string {
+	arrs := strings.Split(history, ",")
+	//新增历史记录
+	if history == "" {
+		arrs = make([]string, 0)
+	}
+	for k, v := range arrs {
+		if v == strings.TrimSpace(searchvalue) {
+			arrs = append(arrs[:k], arrs[k+1:]...)
+			break
+		}
+	}
+	arrs = append(arrs, searchvalue)
+	if len(arrs) > 10 {
+		arrs = arrs[1:11]
+	}
+	return arrs
+}

+ 1218 - 0
src/jfw/modules/common/src/qfw/util/dataexport/dataexport.go

@@ -0,0 +1,1218 @@
+package dataexport
+
+import (
+	//"config"
+	"encoding/json"
+	"errors"
+	"fmt"
+	"log"
+	"math"
+	mg "mongodb"
+	qutil "qfw/util"
+	"qfw/util/elastic"
+	"qfw/util/jy"
+	"regexp"
+	"sort"
+	"strconv"
+	"strings"
+	"sync"
+	"time"
+)
+
+const (
+	SearchModeAccurate        = 0 // 搜索模式:0:精准搜索;
+	SearchModeFuzzy           = 1 // 搜索模式:1:模糊搜索
+	WordsModeAnd              = 0 // 搜索关键词模式;默认0:包含所有
+	WordsModeOr               = 1 // 搜索关键词模式;1:包含任意
+	SearchGroupAll            = 0 // 搜索分组:默认0:全部;
+	SearchGroupBidding        = 1 // 搜索分组:1:招标采购公告;2:超前项目
+	SearchGroupLeadingProject = 2 // 搜索分组:1:招标采购公告;2:超前项目
+	TopTypesBidding           = "招标预告,招标公告,招标结果,招标信用信息"
+	TopTypesLeadingProject    = "拟建项目,采购意向"
+)
+
+/*筛选条件--关键词*/
+type KeyWord struct {
+	Keyword  string   `json:"keyword"`  //关键词
+	Appended []string `json:"appended"` //附加词
+	Exclude  []string `json:"exclude"`  //排除词
+}
+
+/*筛选条件*/
+type SieveCondition struct {
+	Id               string    `json:"id"`
+	PublishTime      string    `json:"publishtime"`      //发布时间
+	Area             []string  `json:"area"`             //地区-省份
+	City             []string  `json:"city"`             //地区-城市
+	Region           []string  `json:"region"`           //地区-省份+城市
+	Industry         []string  `json:"industry"`         //行业
+	Keyword          []KeyWord `json:"keywords"`         //关键词
+	Buyer            []string  `json:"buyer"`            //招标单位(采购单位)
+	Buyerclass       []string  `json:"buyerclass"`       //采购单位类型
+	HasBuyerTel      string    `json:"hasBuyertel"`      //是否有采购单位电话
+	Winner           []string  `json:"winner"`           //中标单位
+	HasWinnerTel     string    `json:"hasWinnertel"`     //是否有中标单位电话
+	ComeInTime       int64     `json:"comeintime"`       //入库时间(秒)
+	OpenId           string    `json:"openid"`           //用户openid
+	MinPrice         string    `json:"minprice"`         //金额——最少
+	MaxPrice         string    `json:"maxprice"`         //金额——最多
+	SelectType       string    `json:"selectType"`       //筛选(正文 or 标题)
+	Subtype          string    `json:"subtype"`          //信息类型
+	SelectIds        []string  `json:"selectId"`         //选择信息导出
+	PushKeyWords     []string  `json:"pushKeyWords"`     //推送历史匹配词
+	Comeinfrom       string    `json:"comeinfrom"`       //查询来源
+	FileExists       string    `json:"fileExists"`       //是否有附件
+	SearchTypeSwitch bool      `json:"searchTypeSwitch"` //是否开启 正文 标题同时搜索只搜正文的开关
+	BidField         string    `json:"bid_field"`        // 领域化数据 0101-医疗行业
+	SearchGroup      int       `json:"searchGroup"`      // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+	SearchMode       int       `json:"searchMode"`       // 搜索模式:0:精准搜索;1:模糊搜索
+	WordsMode        int       `json:"wordsMode"`        // 搜索关键词模式;默认0:包含所有,1:包含任意
+}
+
+const (
+	INDEX          = "bidding"
+	TYPE           = "bidding"
+	bidSearch_sort = `{"publishtime":-1}`
+)
+
+var ClearOther = regexp.MustCompile("[\n\r\\s\u3000\u2003\u00a0]")
+var ClearHtml = regexp.MustCompile("<[^>]*>")
+var onceSearchCount = 500
+var ExportTable string = "export_search"
+var searchPool = make(chan bool, 8)
+
+var topType = map[string]string{
+	"招标预告":   "预告",
+	"招标公告":   "招标",
+	"招标结果":   "结果",
+	"招标信用信息": "其它",
+	"拟建项目":   "拟建",
+	"采购意向":   "采购意向",
+}
+
+// 包含正文或 附件 不包含标题
+func DetailFileORTitle(findfields string) bool {
+	return (strings.Contains(findfields, "detail") || strings.Contains(findfields, "filetext")) && !strings.Contains(findfields, "title")
+}
+
+// 包含正文包含标题
+func DetailANDTitle(findfields string) bool {
+	return strings.Contains(findfields, "detail") && strings.Contains(findfields, "title")
+}
+
+// 获取数据导出查询语句
+func getDataExportSql(scd *SieveCondition) string {
+	if len(scd.SelectIds) > 0 {
+		query := `{"query":{"bool":{"must":[%s]}}}`
+		doSearchSql := fmt.Sprintf(`{"terms":{"_id":[%s]}}`, `"`+strings.Join(scd.SelectIds, `","`)+`"`)
+		return fmt.Sprintf(query, doSearchSql)
+	}
+	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_bool_should_and := `{"bool":{"should":[%s],"minimum_should_match": 1 %s}}`
+	query_price := `{"bool":{"must":[{"range":{"bidamount":{%s}}}]}},{"bool":{"must":[{"range":{"budget":{%s}}}],"must_not":[{"range":{"bidamount":{"gte":-1}}}]}}`
+	query_bool_must := `{"terms":{"%s":[%s]}}`
+	query_bool_must_and := `{"bool":{"must":[%s]%s}}`
+	query_missing := `{"constant_score":{"filter":{"missing":{"field":"%s"}}}}`
+	query_bool_must_term := `{"bool": {"must": [{ "term": {"isValidFile": %d }}]}}`
+	query_bool_must_term_bidField := `{"bool": {"must": [{ "term": {"bid_field": "%s" }}]}}` // 领域化数据类型
+
+	gte := `"gte": %s`
+	lte := `"lte": %s`
+
+	bools := []string{}
+	musts := []string{fmt.Sprintf(`{"range":{"comeintime":{"lt":%d}}}`, scd.ComeInTime)}
+	must_not := []string{}
+	//省份
+	areaCity := []string{}
+	if len(scd.Area) > 0 {
+		areaquery := `{"terms":{"area":[`
+		for k, v := range scd.Area {
+			if k > 0 {
+				areaquery += `,`
+			}
+			areaquery += `"` + v + `"`
+		}
+		areaquery += `]}}`
+		areaCity = append(areaCity, areaquery)
+	}
+	//城市
+	if len(scd.City) > 0 {
+		areaquery := `{"terms":{"city":[`
+		for k, v := range scd.City {
+			if k > 0 {
+				areaquery += `,`
+			}
+			areaquery += `"` + v + `"`
+		}
+		areaquery += `]}}`
+		areaCity = append(areaCity, areaquery)
+	}
+	if len(areaCity) > 0 {
+		musts = append(musts, fmt.Sprintf(query_bool_should, strings.Join(areaCity, ",")))
+	}
+	//检索日期
+
+	starttime := ""
+	now := time.Unix(scd.ComeInTime, 0)
+	endtime := fmt.Sprintf("%d", now.Unix())
+	if scd.PublishTime == "lately-7" { //最近7天
+		starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
+	} else if scd.PublishTime == "lately-30" { //最近30天
+		starttime = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
+	} else if scd.PublishTime == "thisyear" { //去年
+		starttime = fmt.Sprint(time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Unix())
+		endtime = fmt.Sprint(time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Unix())
+	} else if strings.Contains(scd.PublishTime, "_") { //设置检索日期
+		starttime = strings.Split(scd.PublishTime, "_")[0]
+		endTime_tmp := now
+		if etime := strings.Split(scd.PublishTime, "_")[1]; etime != "" {
+			etTime := time.Unix(qutil.Int64All(etime), 0)
+			endTime_tmp = time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local)
+		}
+		//结束时间必须小于筛选时间
+		if endTime_tmp.After(now) {
+			endTime_tmp = now
+		}
+		endtime = fmt.Sprintf("%d", endTime_tmp.Unix())
+	}
+	timequery := `{"range":{"publishtime":{`
+	if starttime != "" {
+		timequery += `"gte":` + starttime
+	}
+	if starttime != "" && endtime != "" {
+		timequery += `,`
+	}
+	if endtime != "" {
+		timequery += `"lt":` + endtime
+	}
+	timequery += `}}}`
+	musts = append(musts, timequery)
+	if scd.Subtype == "" {
+		if scd.SearchGroup == SearchGroupBidding { // 搜索分组处理  招标采购公告 超前项目
+			scd.Subtype = TopTypesBidding
+		} else if scd.SearchGroup == SearchGroupLeadingProject {
+			scd.Subtype = TopTypesLeadingProject
+		}
+	}
+	if scd.Subtype != "" {
+		var subquery string
+		var topTypes []string
+		var subTypes []string
+		for _, v := range strings.Split(scd.Subtype, ",") {
+			if v1, ok := topType[v]; ok {
+				topTypes = append(topTypes, fmt.Sprintf(`"%s"`, v1))
+			} else {
+				subTypes = append(subTypes, fmt.Sprintf(`"%s"`, v))
+			}
+		}
+		log.Println("信息类型搜索:", topTypes, subTypes)
+		if len(subTypes) > 0 && len(topTypes) > 0 {
+			subquery = fmt.Sprintf(`{"bool": {"should": [{"terms": {"subtype": [%s]}},{"terms": {"toptype": [%s]}}]}}`, strings.Join(subTypes, ","), strings.Join(topTypes, ","))
+		} else if len(subTypes) > 0 {
+			subquery = fmt.Sprintf(`{"terms":{"subtype":[%s]}}`, strings.Join(subTypes, ","))
+		} else if len(topTypes) > 0 {
+			subquery = fmt.Sprintf(`{"terms":{"toptype":[%s]}}`, strings.Join(topTypes, ","))
+		}
+		musts = append(musts, subquery)
+	}
+	if len(scd.Industry) > 0 {
+		musts = append(musts, fmt.Sprintf(query_bool_must, "s_subscopeclass", `"`+strings.Join(scd.Industry, `","`)+`"`))
+	}
+	if len(scd.Buyer) > 0 {
+		musts = append(musts, fmt.Sprintf(query_bool_must, "buyer", `"`+strings.Join(scd.Buyer, `","`)+`"`))
+	}
+	if len(scd.Buyerclass) > 0 {
+		musts = append(musts, fmt.Sprintf(query_bool_must, "buyerclass", `"`+strings.Join(scd.Buyerclass, `","`)+`"`))
+	}
+	if len(scd.Winner) > 0 {
+		musts = append(musts, fmt.Sprintf(query_bool_must, "s_winner", `"`+strings.Join(scd.Winner, `","`)+`"`))
+	}
+	_minPrice := ""
+	_maxPrice := ""
+	if scd.MinPrice != "" || scd.MaxPrice != "" {
+		sq := ``
+		if scd.MinPrice != "" {
+			min, _ := strconv.ParseFloat(scd.MinPrice, 64)
+			_minPrice = fmt.Sprintf("%.0f", min*10000)
+			if _minPrice == "0" {
+				_minPrice = ""
+			}
+		}
+		if scd.MaxPrice != "" {
+			max, _ := strconv.ParseFloat(scd.MaxPrice, 64)
+			_maxPrice = fmt.Sprintf("%.0f", max*10000)
+			if _maxPrice == "0" {
+				_maxPrice = ""
+			}
+		}
+		if _minPrice != "" {
+			sq += fmt.Sprintf(gte, _minPrice)
+		}
+		if _minPrice != "" && _maxPrice != "" {
+			sq += `,`
+		}
+		if _maxPrice != "" {
+			sq += fmt.Sprintf(lte, _maxPrice)
+		}
+		if _minPrice != "" || _maxPrice != "" {
+			query_price := fmt.Sprintf(query_bool_should, fmt.Sprintf(query_price, sq, sq))
+			musts = append(musts, query_price)
+		}
+	}
+	boolsNum := 0
+	selectType := scd.SelectType
+	//should
+	if len(scd.Keyword) > 0 {
+		boolsNum = 1
+		queryItem := ""
+		if selectType == "" {
+			queryItem = "title"
+		} else if selectType == "all" {
+			queryItem = "detail\", \"title"
+		} else {
+			if scd.SearchTypeSwitch && DetailANDTitle(selectType) {
+				if strings.Contains(selectType, "title,") {
+					selectType = strings.Replace(selectType, "title,", "", -1)
+				} else if strings.Contains(selectType, ",title") {
+					selectType = strings.Replace(selectType, ",title", "", -1)
+				}
+
+			}
+			queryItem = strings.ReplaceAll(selectType, ",", "\",\"")
+		}
+		multi_match_new := fmt.Sprintf(multi_match, "%s", "\""+queryItem+"\"")
+
+		if scd.Comeinfrom == "supersearchPage" {
+			var keywordArr []string
+			if strings.Contains(scd.Keyword[0].Keyword, "+") {
+				//keywordArr = strings.Split(scd.Keyword[0].Keyword, "+")
+			} else if strings.Contains(scd.Keyword[0].Keyword, " ") {
+				//keywordArr = strings.Split(scd.Keyword[0].Keyword, " ")
+			}
+			if len(keywordArr) > 1 {
+				KeyWordSearch := KeyWord{}
+				for _, v := range keywordArr {
+					KeyWordSearch.Appended = append(KeyWordSearch.Appended, v)
+				}
+				scd.Keyword = []KeyWord{KeyWordSearch}
+			}
+		}
+		for _, v := range scd.Keyword {
+			shoulds := []string{}
+			must_not := []string{}
+			keysShoulds := []string{}
+			if v.Keyword != "" {
+				if strings.Contains(v.Keyword, "+") {
+					for _, vk := range strings.Split(v.Keyword, "+") {
+						if len(vk) == 0 {
+							continue
+						}
+						//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+						if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
+							queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+							shouldsKey := fmt.Sprintf(multi_match, "\""+vk+"\"", "\""+queryItem+"\"")
+							keysShoulds = append(keysShoulds, shouldsKey)
+						} else {
+							keysShoulds = append(keysShoulds, fmt.Sprintf(multi_match_new, "\""+vk+"\""))
+						}
+					}
+				} else if strings.Contains(v.Keyword, " ") {
+					for _, vk := range strings.Split(v.Keyword, " ") {
+						if len(vk) == 0 {
+							continue
+						}
+						//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+						if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
+							queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+							shouldsKey := fmt.Sprintf(multi_match, "\""+vk+"\"", "\""+queryItem+"\"")
+							keysShoulds = append(keysShoulds, shouldsKey)
+						} else {
+							keysShoulds = append(keysShoulds, fmt.Sprintf(multi_match_new, "\""+vk+"\""))
+						}
+					}
+				} else {
+					//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+					if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(v.Keyword))) == 1 {
+						queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+						shouldsKey := fmt.Sprintf(multi_match, "\""+v.Keyword+"\"", "\""+queryItem+"\"")
+						keysShoulds = append(keysShoulds, shouldsKey)
+					} else {
+						keysShoulds = append(keysShoulds, fmt.Sprintf(multi_match_new, "\""+v.Keyword+"\""))
+					}
+				}
+				// 单个关键词分词后都包含
+				shoulds = append(shoulds, fmt.Sprintf(query_bool_must_and, strings.Join(keysShoulds, ","), ""))
+			}
+
+			//附加词
+			for _, vv := range v.Appended {
+				appendedShoulds := []string{}
+				if vv != "" {
+					// 附加词处理分词
+					if strings.Contains(vv, "+") {
+						for _, vk := range strings.Split(vv, "+") {
+							if len(vk) == 0 {
+								continue
+							}
+							//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+							if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
+								queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+								shouldsKey := fmt.Sprintf(multi_match, "\""+vk+"\"", "\""+queryItem+"\"")
+								appendedShoulds = append(appendedShoulds, shouldsKey)
+							} else {
+								appendedShoulds = append(appendedShoulds, fmt.Sprintf(multi_match_new, "\""+vk+"\""))
+							}
+						}
+					} else if strings.Contains(vv, " ") {
+						for _, vk := range strings.Split(vv, " ") {
+							if len(vk) == 0 {
+								continue
+							}
+
+							//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+							if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(vk))) == 1 {
+								queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+								shouldsKey := fmt.Sprintf(multi_match, "\""+vk+"\"", "\""+queryItem+"\"")
+								appendedShoulds = append(appendedShoulds, shouldsKey)
+							} else {
+								appendedShoulds = append(appendedShoulds, fmt.Sprintf(multi_match_new, "\""+vk+"\""))
+							}
+						}
+					} else {
+						appendedShoulds = append(appendedShoulds, fmt.Sprintf(multi_match_new, "\""+vv+"\""))
+
+					}
+					// 单个关键词分词后都包含
+					shoulds = append(shoulds, fmt.Sprintf(query_bool_must_and, strings.Join(appendedShoulds, ","), ""))
+				}
+			}
+			//排除词
+			for _, vv := range v.Exclude {
+				if len(strings.TrimSpace(vv)) == 0 {
+					continue
+				} // 处理每组里面的空格分词
+				for _, notKeySplit := range strings.Split(vv, " ") {
+					if len(notKeySplit) == 0 {
+						continue
+					}
+					//单个字 搜索范围 有全文或者附件 无标题 例如:学 虚拟机 detail  搜索的时候加上标题
+					if scd.Comeinfrom == "supersearchPage" && DetailFileORTitle(selectType) && len([]rune(elastic.ReplaceYH(notKeySplit))) == 1 {
+						queryItem = strings.ReplaceAll(selectType+",title", ",", "\",\"")
+						shouldsKey := fmt.Sprintf(multi_match, "\""+notKeySplit+"\"", "\""+queryItem+"\"")
+						must_not = append(must_not, shouldsKey)
+					} else {
+						must_not = append(must_not, fmt.Sprintf(multi_match_new, "\""+notKeySplit+"\""))
+					}
+				}
+
+			}
+
+			//添加
+			if len(shoulds) > 0 {
+				notStr := ""
+				if len(must_not) > 0 {
+					notStr = fmt.Sprintf(`,"must_not":[%s]`, strings.Join(must_not, ","))
+				}
+				if scd.WordsMode == WordsModeOr { // 包含任意
+					bools = append(bools, fmt.Sprintf(query_bool_should_and, strings.Join(shoulds, ","), notStr))
+				} else {
+					bools = append(bools, fmt.Sprintf(query_bool_must_and, strings.Join(shoulds, ","), notStr))
+				}
+			}
+		}
+	}
+	if scd.HasBuyerTel != "" {
+		if scd.HasBuyerTel == "y" {
+			must_not = append(must_not, fmt.Sprintf(query_missing, "buyertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(query_missing, "buyertel"))
+		}
+	}
+	if scd.HasWinnerTel != "" {
+		if scd.HasWinnerTel == "y" {
+			must_not = append(must_not, fmt.Sprintf(query_missing, "winnertel"))
+		} else {
+			musts = append(musts, fmt.Sprintf(query_missing, "winnertel"))
+		}
+	}
+
+	//搜索范围是否只有附件
+	//搜索范围只选择附件,是否有附件条件无效;
+	var isFileSearch = strings.ReplaceAll(selectType, ",", "\",\"") == "filetext"
+	if !isFileSearch && scd.FileExists != "" {
+		if scd.FileExists == "1" { //有附件
+			must_not = append(must_not, fmt.Sprintf(query_missing, "isValidFile"))
+			musts = append(musts, fmt.Sprintf(query_bool_must_term, 1))
+		} else if scd.FileExists == "-1" { //无附件
+			musts = append(musts, fmt.Sprintf(query_missing, "isValidFile"))
+		}
+	}
+	// 如果是领域化数据则需要加标签
+	if scd.BidField != "" {
+		musts = append(musts, fmt.Sprintf(query_bool_must_term_bidField, scd.BidField))
+	}
+	qstr := fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(must_not, ","), strings.Join(bools, ","), boolsNum)
+	return qstr
+}
+
+// 获取数据导出筛选条件
+func GetSqlObjFromId(mongo mg.MongodbSim, _id string) *SieveCondition {
+	var (
+		query *map[string]interface{}
+		ok    bool
+	)
+	if query, ok = mongo.FindById(ExportTable, _id, nil); !ok {
+		return nil
+	}
+	searchTypeSwitch, _ := (*query)["searchTypeSwitch"].(bool)
+	return &SieveCondition{
+		Id:               _id,
+		Keyword:          getKeyWordArrFromDbResult((*query)["keywords"]),
+		Industry:         getStringArrFromDbResult((*query)["industry"]),
+		MinPrice:         qutil.ObjToString((*query)["minprice"]),
+		MaxPrice:         qutil.ObjToString((*query)["maxprice"]),
+		Subtype:          qutil.ObjToString((*query)["subtype"]),
+		Area:             getStringArrFromDbResult((*query)["area"]),
+		City:             getStringArrFromDbResult((*query)["city"]),
+		SelectType:       qutil.ObjToString((*query)["selectType"]),
+		PublishTime:      qutil.ObjToString((*query)["publishtime"]),
+		Buyer:            getStringArrFromDbResult((*query)["buyer"]),
+		Buyerclass:       getStringArrFromDbResult((*query)["buyerclass"]),
+		HasBuyerTel:      qutil.ObjToString((*query)["hasBuyertel"]),
+		Winner:           getStringArrFromDbResult((*query)["winner"]),
+		HasWinnerTel:     qutil.ObjToString((*query)["hasWinnertel"]),
+		ComeInTime:       qutil.Int64All((*query)["comeintime"]),
+		Comeinfrom:       qutil.ObjToString((*query)["comeinfrom"]),
+		SelectIds:        getStringArrFromDbResult((*query)["selectIds"]),
+		PushKeyWords:     getStringArrFromDbResult((*query)["pushKeyWords"]),
+		FileExists:       qutil.ObjToString((*query)["fileExists"]),
+		SearchTypeSwitch: searchTypeSwitch,
+		BidField:         qutil.ObjToString((*query)["bid_field"]), // 领域化数据
+		SearchGroup:      qutil.IntAll((*query)["searchGroup"]),    //搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+		SearchMode:       qutil.IntAll((*query)["searchMode"]),     // 搜索模式:0:精准搜索;1:模糊搜索
+		WordsMode:        qutil.IntAll((*query)["wordsMode"]),      // 搜索关键词模式;默认0:包含所有,1:包含任意
+	}
+}
+
+// 数据导出-查询结果数量
+func GetDataExportSearchCountByScdId(sim, bid mg.MongodbSim, biddingName, elasticAddress, id string) (count int) {
+	scd := GetSqlObjFromId(sim, id) //用户筛选条件
+	if scd.SelectIds != nil {
+		//部分数据可能已删除、不存在;此处需要统计返回实际数量
+		//return len(scd.SelectIds)
+		return int(GetDataExportSelectReallyCount(bid, biddingName, scd.SelectIds))
+	}
+	return GetDataExportSearchCountBySieveCondition(scd, elasticAddress)
+}
+
+func GetDataExportSearchCountBySieveCondition(scd *SieveCondition, elasticAddress string) (count int) {
+	if isNullSearch(scd) {
+		return -1 //程序端返回最大值
+	}
+	if scd.SearchMode == SearchModeAccurate {
+		qstr := getDataExportSql(scd)
+		log.Printf("GetDataExportSearchCountUseId-%s-sql:%s\n", scd.Id, qstr)
+		count = int(elastic.Count(INDEX, TYPE, qstr))
+	}
+	// 依据用户选择的搜索模式和搜索范围进行匹配,即不限制只能匹配标题,且不限制最多展示100条、针对输入的单个关键词分词后需要都包含
+	//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
+	if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0) && scd.SearchMode == SearchModeFuzzy {
+		if len(scd.Keyword) != 0 {
+			// 关键词分词
+			searchTextSize := 0
+			if len(scd.Keyword) > 0 {
+				searchTextSize = len([]rune(scd.Keyword[0].Keyword))
+			}
+			if searchTextSize > 0 {
+				if secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress); secondKWS != "" {
+					scd.Keyword[0].Keyword = secondKWS
+				}
+			}
+			// 附加词分词
+			for i := 0; i < len(scd.Keyword[0].Appended); i++ {
+				appendTextSize := 0
+				if len(scd.Keyword[0].Appended[i]) > 0 {
+					appendTextSize = len([]rune(scd.Keyword[0].Appended[i]))
+				}
+				if appendTextSize > 0 {
+					if secondKWS := jy.HttpEs(scd.Keyword[0].Appended[i], "ik_smart", elasticAddress); secondKWS != "" {
+						scd.Keyword[0].Appended[i] = secondKWS
+					}
+				}
+			}
+
+		}
+		qstr := getDataExportSql(scd)
+		count = int(elastic.Count(INDEX, TYPE, qstr))
+		log.Printf("GetDataExportSearchCountUseId-%s-count:%d-分词-sql:%s\n", scd.Id, count, qstr)
+		return count
+	}
+	log.Printf("GetDataExportSearchCountUseId-%s-count:%d\n", scd.Id, count)
+	return
+}
+
+// 合并map数据,去重
+func delRepeatMapArr(res *[]map[string]interface{}, res2 *[]map[string]interface{}) *[]map[string]interface{} {
+	if res != nil {
+		for _, v := range *res {
+			for n, m := range *res2 {
+				if qutil.ObjToString(v["_id"]) == qutil.ObjToString(m["_id"]) {
+					*res2 = append((*res2)[0:n], (*res2)[n+1:]...)
+					break
+				}
+			}
+		}
+		*res = append(*res, *res2...)
+	} else {
+		res = res2
+	}
+	return res
+}
+
+// 查询条件是否为空
+func isNullSearch(scd *SieveCondition) (isNull bool) {
+	if scd.PublishTime == "" && len(scd.Area) == 0 && len(scd.Industry) == 0 && len(scd.Keyword) == 0 && len(scd.Buyer) == 0 && len(scd.Winner) == 0 && scd.MinPrice == "" && scd.MaxPrice == "" && scd.Subtype == "" && len(scd.City) == 0 {
+		isNull = true
+	}
+	return isNull
+}
+
+/*
+ * 数据导出 查询结果
+ * _id 数据库查询条件记录id
+ * dataType 1-普通字段 2-高级字段
+ * webdomain 三级页域名
+ * count 返回数量 (-1:预览数据查询)
+ */
+
+func GetDataExportSearchResultByScdId(sim, bid mg.MongodbSim, bidMgoDBName, elasticAddress, id, dataType string, checkCount int) (*[]map[string]interface{}, error) {
+	scd := GetSqlObjFromId(sim, id)
+	list, err := GetDataExportSearchResult(bid, bidMgoDBName, elasticAddress, scd, dataType, checkCount)
+	if list == nil || err != nil {
+		return nil, err
+	}
+	return list, nil
+}
+
+// GetDataExportIdArrByScdId 数据包去重获取导出信息id
+func GetDataExportIdArrByScdId(sim mg.MongodbSim, elasticAddress, id string, checkCount int) ([]string, error) {
+	scd := GetSqlObjFromId(sim, id)
+	return GetDataExportIds(elasticAddress, scd, checkCount)
+}
+
+// 收藏导出
+var contentfilterReg = regexp.MustCompile("<[^>]+>")
+
+// GetDataExportSelectReallyCount 查询实际可调导出数量
+func GetDataExportSelectReallyCount(bid mg.MongodbSim, biddingName string, ids []string) int64 {
+	sess := bid.GetMgoConn()
+	defer bid.DestoryMongoConn(sess)
+	if ids == nil || len(ids) == 0 {
+		return 0
+	}
+	var queryIds []interface{}
+	for _, idStr := range ids {
+		queryIds = append(queryIds, mg.StringTOBsonId(idStr))
+	}
+	lenNum := int64(len(ids))
+	num1, err1 := sess.DB(biddingName).C("bidding").Find(map[string]interface{}{"_id": map[string]interface{}{
+		"$in": queryIds,
+	}}).Count()
+	if err1 == nil {
+		if num1 == lenNum {
+			return lenNum
+		}
+		num2, err2 := sess.DB(biddingName).C("bidding_back").Find(map[string]interface{}{"_id": map[string]interface{}{
+			"$in": queryIds,
+		}}).Count()
+		if err2 == nil {
+			if num2+num1 == lenNum {
+				return lenNum
+			} else if num1+num2 > lenNum {
+				return lenNum
+			} else if num1+num2 < lenNum {
+				return num1 + num2
+			}
+		}
+	}
+	return -2
+}
+
+func GetDataExportSelectResult(bidding mg.MongodbSim, biddingName string, scd *SieveCondition, dataType string, checkCount int) (*[]map[string]interface{}, error) {
+	sess := bidding.GetMgoConn()
+	defer bidding.DestoryMongoConn(sess)
+	var queryIds []interface{}
+	for _, idStr := range scd.SelectIds {
+		queryIds = append(queryIds, mg.StringTOBsonId(idStr))
+	}
+
+	selectMap := map[string]interface{}{
+		"_id": 1, "title": 1, "detail": 1, "area": 1, "city": 1, "publishtime": 1, "projectname": 1, "buyer": 1, "s_winner": 1, "bidamount": 1, "subtype": 1, "toptype": 1, "filetext": 1, "purchasing": 1,
+	}
+	if dataType == "2" {
+		for _, key := range []string{"href", "projectcode", "buyerperson", "buyertel", "budget", "bidopentime", "agency", "projectscope", "winnerperson", "winnertel", "bidendtime"} {
+			selectMap[key] = 1
+		}
+	}
+	returnLsit := make([]map[string]interface{}, 0, len(queryIds))
+	iter := sess.DB(biddingName).C("bidding").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
+		"$in": queryIds,
+	}}).Iter()
+	for m := make(map[string]interface{}); iter.Next(&m); {
+		m["_id"] = mg.BsonIdToSId(m["_id"])
+		detail, _ := m["detail"].(string)
+		if detail != "" {
+			m["detail"] = contentfilterReg.ReplaceAllString(detail, "")
+		}
+		returnLsit = append(returnLsit, m)
+		m = make(map[string]interface{})
+	}
+	if len(returnLsit) == checkCount {
+		return &returnLsit, nil
+	}
+	iter_back := sess.DB(biddingName).C("bidding_back").Select(selectMap).Find(map[string]interface{}{"_id": map[string]interface{}{
+		"$in": queryIds,
+	}}).Iter()
+	for m := make(map[string]interface{}); iter_back.Next(&m); {
+		m["_id"] = mg.BsonIdToSId(m["_id"])
+		detail, _ := m["detail"].(string)
+		if detail != "" {
+			m["detail"] = contentfilterReg.ReplaceAllString(detail, "")
+		}
+		returnLsit = append(returnLsit, m)
+		m = make(map[string]interface{})
+	}
+	if len(returnLsit) == checkCount || checkCount == -1 {
+		return &returnLsit, nil
+	}
+	return nil, fmt.Errorf("选择数据导出异常 数据量期望%d条,实际查询%d条", checkCount, len(returnLsit))
+}
+
+func GetDataExportIds(elasticAddress string, scd *SieveCondition, checkCount int) ([]string, error) {
+	defer qutil.Catch()
+	if scd == nil {
+		return nil, errors.New("GetDataExportIds-未获取到查询信息")
+	}
+	if scd.SelectIds != nil {
+		return scd.SelectIds, nil
+	}
+	var qstr string
+	if scd.SearchMode == SearchModeAccurate {
+		//获取查询语句
+		qstr = getDataExportSql(scd)
+		log.Printf("GetDataExportIds-%s-sql:%s\n", scd.Id, qstr)
+	}
+	//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
+	// 依据用户选择的搜索模式和搜索范围进行匹配,即不限制只能匹配标题,且不限制最多展示100条、针对输入的单个关键词分词后需要都包含
+	if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0) && len(scd.SelectIds) == 0 && scd.SearchMode == SearchModeFuzzy {
+		if len(scd.Keyword) != 0 {
+			searchTextSize := 0
+			// 关键词分词
+			if len(scd.Keyword) > 0 {
+				searchTextSize = len([]rune(scd.Keyword[0].Keyword))
+			}
+			if searchTextSize > 0 {
+				if secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress); secondKWS != "" {
+					scd.Keyword[0].Keyword = secondKWS
+				}
+			}
+			// 附加词分词
+			for i := 0; i < len(scd.Keyword[0].Appended); i++ {
+				appendTextSize := 0
+				if len(scd.Keyword[0].Appended[i]) > 0 {
+					appendTextSize = len([]rune(scd.Keyword[0].Appended[i]))
+				}
+				if appendTextSize > 0 {
+					if secondKWS := jy.HttpEs(scd.Keyword[0].Appended[i], "ik_smart", elasticAddress); secondKWS != "" {
+						scd.Keyword[0].Appended[i] = secondKWS
+					}
+				}
+			}
+
+		}
+		qstr = getDataExportSql(scd)
+		log.Printf("GetDataExportIds-%s-分词查询-sql:%s\n", scd.Id, qstr)
+	}
+	res := doSearchByBatch(qstr, "1", checkCount, fmt.Sprintf("%s-%s", "GetDataExportSearchResult", scd.Id))
+	//获取信息id
+	idArr := make([]string, 0, 0)
+	for _, v := range res {
+		if id := qutil.ObjToString(v["_id"]); id != "" {
+			idArr = append(idArr, id)
+		}
+	}
+	if checkCount != len(idArr) {
+		return nil, fmt.Errorf("GetDataExportIds-%s-数据总量校验异常,期望:%d,实际:%d", scd.Id, checkCount, len(res))
+	}
+	return idArr, nil
+}
+
+// GetDataExportSearchResult 获取数据导出内容
+// entmg 高级字段包查询企业电话邮箱等字段
+// checkCount -1 预览500条
+func GetDataExportSearchResult(bid mg.MongodbSim, bidMgoDBName, elasticAddress string, scd *SieveCondition, dataType string, checkCount int) (*[]map[string]interface{}, error) {
+	defer qutil.Catch()
+	if scd == nil {
+		return nil, errors.New("GetDataExportSearchResult-未获取到查询信息")
+	}
+	if scd.SelectIds != nil {
+		idSelectDates, idSelectErr := GetDataExportSelectResult(bid, bidMgoDBName, scd, dataType, checkCount)
+		if idSelectErr != nil {
+			return nil, idSelectErr
+		}
+		GetDataExportMatchKey(scd, idSelectDates)
+		return idSelectDates, idSelectErr
+	}
+	selectType := scd.SelectType
+	var qstr string
+	var res []map[string]interface{}
+	if scd.SearchMode == SearchModeAccurate { // 搜索模式为精确查找
+		//获取查询语句
+		qstr = getDataExportSql(scd)
+		log.Printf("GetDataExportSearchResult-%s-sql:%s\n", scd.Id, qstr)
+		//数据导出数据查询
+		res = doSearchByBatch(qstr, dataType, checkCount, fmt.Sprintf("%s-%s", "GetDataExportSearchResult", scd.Id))
+	}
+	//超级搜索一致的检索(防止数据导出和超级搜索数据量不一致)
+	if scd.Comeinfrom == "supersearchPage" && (len(scd.Keyword) != 0 || len(scd.Industry) != 0) && len(scd.SelectIds) == 0 && scd.SearchMode == SearchModeFuzzy {
+		if len(scd.Keyword) != 0 {
+			searchTextSize := 0
+			// 关键词分词
+			if len(scd.Keyword) > 0 {
+				searchTextSize = len([]rune(scd.Keyword[0].Keyword))
+			}
+			if searchTextSize > 0 {
+				if secondKWS := jy.HttpEs(scd.Keyword[0].Keyword, "ik_smart", elasticAddress); secondKWS != "" {
+					scd.Keyword[0].Keyword = secondKWS
+				}
+			}
+			// 附加词分词
+			for i := 0; i < len(scd.Keyword[0].Appended); i++ {
+				appendTextSize := 0
+				if len(scd.Keyword[0].Appended[i]) > 0 {
+					appendTextSize = len([]rune(scd.Keyword[0].Appended[i]))
+				}
+				if appendTextSize > 0 {
+					if secondKWS := jy.HttpEs(scd.Keyword[0].Appended[i], "ik_smart", elasticAddress); secondKWS != "" {
+						scd.Keyword[0].Appended[i] = secondKWS
+					}
+				}
+			}
+
+		}
+		qstr = getDataExportSql(scd)
+		log.Printf("GetDataExportSearchResult-%s-分词查询-sql:%s\n", scd.Id, qstr)
+		res = doSearchByBatch(qstr, dataType, checkCount, fmt.Sprintf("%s-%s", "GetDataExportSearchResult", scd.Id))
+	}
+	//校验数量
+	if checkCount != len(res) && checkCount != -1 {
+		return nil, fmt.Errorf("GetDataExportSearchResult-%s-数据总量校验异常,期望:%d,实际:%d", scd.Id, checkCount, len(res))
+	}
+	if selectType != scd.SelectType {
+		scd.SelectType = selectType
+	}
+	GetDataExportMatchKey(scd, &res)
+	return &res, nil
+}
+
+func doSearchByBatch(query, dataType string, searchCount int, flag string) (res []map[string]interface{}) {
+	if searchCount > onceSearchCount { //分批次查询
+		batchNum := qutil.IntAll(math.Ceil(float64(searchCount) / float64(onceSearchCount)))
+		var searchWaitGroup = &sync.WaitGroup{}
+		var lock sync.Mutex
+		for n := 0; n < batchNum; n++ {
+			searchWaitGroup.Add(1)
+			searchPool <- true
+			go func(start int) {
+				defer func() {
+					searchWaitGroup.Done()
+					<-searchPool
+				}()
+				checkNum, checkOk := onceSearchCount, false
+				if start == (batchNum - 1) {
+					if searchCount%onceSearchCount != 0 {
+						checkNum = searchCount % onceSearchCount
+					}
+				}
+
+				var tmp *[]map[string]interface{}
+				for i := 0; i < 3; i++ {
+					tmp = doSearch(query, start*onceSearchCount, onceSearchCount, dataType)
+					if tmp != nil && (len(*tmp) == checkNum) { //校验数据量是否够
+						checkOk = true
+						break
+					}
+				}
+				if tmp == nil {
+					log.Printf("%s-第%d页数据查询结果为空\n", flag, start+1)
+					return
+				}
+				if checkOk {
+					log.Printf("%s-第%d页数据加载完成,共%d条\n", flag, start+1, len(*tmp))
+				} else {
+					log.Printf("%s-第%d页数据加载异常,共%d条,预期%d条\n", flag, start+1, len(*tmp), checkNum)
+				}
+				lock.Lock()
+				res = append(res, *tmp...)
+				lock.Unlock()
+			}(n)
+		}
+		searchWaitGroup.Wait()
+		log.Printf("%s-分批次加载数据总量为%d\n", flag, len(res))
+	} else {
+		queryCount := qutil.If(searchCount == -1, onceSearchCount, searchCount).(int)
+		searchPool <- true
+		tmp := doSearch(query, 0, queryCount, dataType)
+		<-searchPool
+		if tmp == nil || len(*tmp) == 0 {
+			log.Printf("%s-一次性加载数据异常\n", flag)
+		} else {
+			res = *tmp
+			log.Printf("%s-一次性加载数据总量为%d\n", flag, len(res))
+		}
+	}
+	return
+}
+
+func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdomain string, dataType string, encry ...bool) *[]map[string]interface{} {
+	//格式化输出
+	isEncry := false
+	if len(encry) > 0 {
+		isEncry = true
+	}
+	for _, v := range *data {
+		//有中标企业 且 高级字段查询
+		if dataType == "2" {
+			if qutil.Int64All(v["bidendtime"]) > 0 {
+				v["bidendtime"] = strings.Split(time.Unix(qutil.Int64All(v["bidendtime"]), 0).Format("2006-01-02 15:04:05"), " ")[0]
+			} else {
+				v["bidendtime"] = ""
+			}
+			//查询企业公示 法人 公司电话 公司邮箱地址
+			s_winner, ok := v["s_winner"].(string) //改为entidlistxx?
+			if ok && s_winner != "" {
+				if entData, ok := entmg.Find("winner_enterprise", map[string]interface{}{"company_name": s_winner}, nil, `{"company_name":1,"company_email":1,"legal_person":1,"company_phone":1}`, false, -1, -1); ok {
+					if entData != nil && *entData != nil && len(*entData) > 0 {
+						for _, ev := range *entData {
+							if v["s_winner"] == ev["company_name"] {
+								legal_person := ""
+								if ev["legal_person"] != nil {
+									legal_person = ev["legal_person"].(string)
+									if isEncry {
+										var xx = "*"
+										switch len([]rune(legal_person)) {
+										case 3:
+											xx = "**"
+										case 4:
+											xx = "***"
+										}
+										legal_person = string([]rune(legal_person)[:1]) + xx
+									}
+								}
+								company_phone := ""
+								if ev["company_phone"] != nil {
+									company_phone = ev["company_phone"].(string)
+									if isEncry {
+										if len([]rune(company_phone)) > 7 {
+											company_phone = company_phone[:7] + "****"
+										} else {
+											company_phone = "****"
+										}
+									}
+								}
+								company_email := ""
+								if ev["company_email"] != nil && ev["company_email"] != "无" {
+									company_email = ev["company_email"].(string)
+									if isEncry {
+										if len(strings.Split(company_email, "@")) > 1 {
+											company_email = "******" + "@" + strings.Split(company_email, "@")[1]
+										}
+									}
+								}
+								v["legal_person"] = legal_person
+								v["company_phone"] = company_phone
+								v["company_email"] = company_email
+							}
+						}
+					}
+				}
+			}
+		}
+		//====================字段补漏=========================
+		if v["toptype"] == "结果" && dataType == "2" && !(v["agency"] != nil && v["budget"] != nil && v["buyerperson"] != nil && v["buyertel"] != nil) {
+			r := elastic.Get("projectset", "projectset", fmt.Sprintf(`{"query":{"term":{"list.infoid":"%s"}},"_source": ["list"]}`, v["_id"]))
+			if r != nil && len(*r) > 0 {
+				MsgList := (*r)[0]["list"]
+				if MsgList != nil {
+					list := qutil.ObjArrToMapArr(MsgList.([]interface{}))
+					for _, vv := range list {
+						if vv["subtype"] == "招标" {
+							if v["agency"] == nil && vv["agency"] != nil {
+								v["agency"] = vv["agency"]
+							}
+							if v["budget"] == nil && vv["budget"] != nil {
+								v["budget"] = vv["budget"]
+							}
+							if v["buyerperson"] == nil && vv["buyerperson"] != nil {
+								v["buyerperson"] = vv["buyerperson"]
+							}
+							if v["buyertel"] == nil && vv["buyertel"] != nil {
+								v["buyertel"] = vv["buyertel"]
+							}
+							break
+						}
+					}
+				}
+			}
+		}
+		if v["area"] == "A" {
+			v["area"] = "全国"
+		}
+		if v["bidamount"] != nil {
+			v["bidamount"] = formatFloat(qutil.Float64All(v["bidamount"]))
+		}
+		if v["budget"] != nil {
+			v["budget"] = formatFloat(qutil.Float64All(v["budget"]))
+		}
+		if v["publishtime"] != nil {
+			date := v["publishtime"]
+			v["publishtime"] = qutil.FormatDateWithObj(&date, qutil.Date_Short_Layout)
+		}
+		if v["bidopentime"] != nil {
+			date := v["bidopentime"]
+			v["bidopentime"] = qutil.FormatDateWithObj(&date, qutil.Date_Short_Layout)
+		}
+		if v["_id"] != nil {
+			encodeId := qutil.CommonEncodeArticle("content", v["_id"].(string))
+			v["url"] = webdomain + "/article/content/" + encodeId + ".html"
+			v["url_jump"] = webdomain + "/front/reloadTo/article/content/" + encodeId + ".html"
+		}
+		if v["currency"] == "" || v["currency"] == nil {
+			v["currency"] = "人民币"
+		}
+
+		if isEncry {
+			if v["projectscope"] != "" && v["projectscope"] != nil {
+				str := ClearHtml.ReplaceAllString(v["projectscope"].(string), "")
+				str = ClearOther.ReplaceAllString(str, "")
+				str = strings.Replace(str, " ", "", -1)
+				if len([]rune(str)) > 100 {
+					str = qutil.SubString(str, 0, 100) + "..."
+				}
+				v["projectscope"] = str
+			}
+			if v["detail"] != "" && v["detail"] != nil {
+				str := ClearHtml.ReplaceAllString(v["detail"].(string), "")
+				str = ClearOther.ReplaceAllString(str, "")
+				str = strings.Replace(str, " ", "", -1)
+				if len([]rune(str)) > 100 {
+					str = qutil.SubString(str, 0, 100) + "..."
+				}
+				v["detail"] = str
+			}
+			if v["title"] != "" && v["title"] != nil {
+				str := ClearHtml.ReplaceAllString(v["title"].(string), "")
+				str = ClearOther.ReplaceAllString(str, "")
+				str = strings.Replace(str, " ", "", -1)
+				if len([]rune(str)) > 100 {
+					str = qutil.SubString(str, 0, 100) + "..."
+				}
+				v["title"] = str
+			}
+
+		}
+
+		if v["subtype"] == nil && v["toptype"] != nil {
+			v["subtype"] = v["toptype"]
+		}
+	}
+	return data
+}
+
+// 保留到0.01分
+func formatFloat(value float64) string {
+	str := strings.TrimRight(fmt.Sprintf("%.7f", value*10000/100000000), "0")
+	if str[len(str)-1:] == "." {
+		return str[:len(str)-1]
+	}
+	return str
+}
+
+func doSearch(sql string, start, count int, dataType string) *[]map[string]interface{} {
+	if sql != "" {
+		//筛选字段
+		if dataType != "" {
+			dataexport_field := `"_id","title","detail","area","city","publishtime","projectname","buyer","s_winner","bidamount","subtype","toptype","filetext","purchasing"`
+			if dataType == "2" {
+				dataexport_field += `,"href","projectcode","buyerperson","buyertel","budget","bidopentime","agency","projectscope","winnerperson","winnertel","bidendtime"`
+			}
+			sql = sql[:len(sql)-1] + `,"_source":[` + dataexport_field + "]}"
+		}
+		//分页排序
+		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)
+}
+
+func getKeyWordArrFromDbResult(k interface{}) (arr []KeyWord) {
+	if k == nil {
+		return
+	}
+	kArr := k.([]interface{})
+	for _, v := range kArr {
+		kw := KeyWord{}
+		b, e := json.Marshal(v)
+		if e != nil {
+			log.Println(e.Error())
+		}
+		json.Unmarshal(b, &kw)
+		arr = append(arr, kw)
+	}
+	return
+}
+
+func getStringArrFromDbResult(c interface{}) (arr []string) {
+	if c != nil {
+		cArr := c.([]interface{})
+		arr = qutil.ObjArrToStringArr(cArr)
+	}
+	return
+}
+
+// 获取结果,空字段最少的数据
+func ScreenData(arr *[]map[string]interface{}, dataType string, resultNum int, kws []KeyWord) (res []map[string]interface{}) {
+	AllMap := map[int][]map[string]interface{}{}
+
+	NoKwsMap := map[int][]map[string]interface{}{}
+	lastNum := resultNum
+	for _, v := range *arr {
+		emptyNum := countOfTheEmpty(v, dataType)
+		if emptyNum == -1 {
+			continue
+		}
+		if len(kws) > 0 && kws[0].Keyword != "" {
+			var kwsFlag = true
+			for _, vk := range kws {
+				if strings.Contains(qutil.ObjToString(v["title"]), strings.Replace(vk.Keyword, "+", "", -1)) {
+					kwsFlag = false
+					continue
+				}
+			}
+			if kwsFlag {
+				if NoKwsMap[emptyNum] == nil {
+					NoKwsMap[emptyNum] = []map[string]interface{}{v}
+				} else {
+					NoKwsMap[emptyNum] = append(NoKwsMap[emptyNum], v)
+				}
+				continue
+			}
+		}
+		if AllMap[emptyNum] == nil {
+			AllMap[emptyNum] = []map[string]interface{}{v}
+			continue
+		}
+		AllMap[emptyNum] = append(AllMap[emptyNum], v)
+	}
+	//获取key
+	keys := []int{}
+	for k, _ := range AllMap {
+		keys = append(keys, k)
+	}
+	sort.Ints(keys)
+	//选取结果
+	for _, v := range keys {
+		if len(AllMap[v]) >= resultNum {
+			return append(res, AllMap[v][:resultNum]...)
+		} else {
+			resultNum = resultNum - len(AllMap[v])
+			tmp := append(res, AllMap[v][:len(AllMap[v])]...)
+			res = tmp
+		}
+	}
+	if len(res) < lastNum {
+		resultNum = lastNum - len(res)
+		//获取key
+		Nokeys := []int{}
+		for k, _ := range NoKwsMap {
+			Nokeys = append(Nokeys, k)
+		}
+		sort.Ints(Nokeys)
+		log.Println("没关键词的空字段数量", Nokeys)
+		//选取结果
+		for _, v := range Nokeys {
+			if len(NoKwsMap[v]) >= resultNum {
+				return append(res, NoKwsMap[v][:resultNum]...)
+			} else {
+				resultNum = resultNum - len(NoKwsMap[v])
+				tmp := append(res, NoKwsMap[v][:len(NoKwsMap[v])]...)
+				res = tmp
+			}
+		}
+	}
+	return res
+}
+func countOfTheEmpty(m map[string]interface{}, dataType string) int {
+	MsgType := m["subtype"]
+	//	if MsgType == "拟建" {
+	//		return -1
+	//	}
+	//计算空字段数量
+	var count int = 0
+	//高级字段包
+	if dataType == "2" {
+		if m["href"] == "" || m["href"] == nil {
+			count++
+		}
+		if m["projectcode"] == "" || m["projectcode"] == nil {
+			count++
+		}
+		if m["buyerperson"] == "" || m["buyerperson"] == nil {
+			count++
+		}
+		if m["buyertel"] == "" || m["buyertel"] == nil {
+			count++
+		}
+		if m["budget"] == "" || m["budget"] == nil {
+			count++
+		}
+		if m["bidopentime"] == "" || m["bidopentime"] == nil {
+			count++
+		}
+		if m["agency"] == "" || m["agency"] == nil {
+			count++
+		}
+		if m["projectscope"] == "" || m["projectscope"] == nil {
+			count++
+		}
+	}
+	if m["city"] == "" || m["city"] == nil {
+		count++
+	}
+	if m["publishtime"] == "" || m["publishtime"] == nil {
+		count++
+	}
+	if m["projectname"] == "" || m["projectname"] == nil {
+		count++
+	}
+	if m["buyer"] == "" || m["buyer"] == nil {
+		count++
+	}
+	if m["s_winner"] == "" || m["s_winner"] == nil {
+		if MsgType != "招标" {
+			count++
+		}
+	}
+	if m["bidamount"] == "" || m["bidamount"] == nil {
+		if MsgType != "招标" {
+			count++
+		}
+	}
+	if m["subtype"] == "" || m["subtype"] == nil {
+		count++
+	}
+	return count
+}

+ 343 - 0
src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go

@@ -0,0 +1,343 @@
+package jy
+
+import (
+	"encoding/json"
+	"fmt"
+	"log"
+	"math/rand"
+	. "mongodb"
+	qutil "qfw/util"
+	"qfw/util/mysql"
+	"qfw/util/redis"
+	"strings"
+	"time"
+)
+
+// 大会员状态redis缓存
+type BigVipBaseMsg struct {
+	Status          int                    `json:"status"`          //大会员状态
+	Used            bool                   `json:"used"`            //是否首次使用大会员
+	PowerMap        map[int]bool           `json:"p_map"`           //权限列表
+	ProNum          int                    `json:"p_num"`           //可关注项目数量
+	EntNum          int                    `json:"e_num"`           //可关注企业数量(取企业情报监控和企业中标动态中最大的值)
+	DailyNum        int                    `json:"d_num"`           //数据包导出数量
+	Pid             string                 `json:"pid"`             //若为子账号此处为父节点userid
+	Uid             string                 `json:"uid"`             //用户id
+	HasTrial        bool                   `json:"has_trial"`       //是否试用过
+	Customers       int                    `json:"customers"`       //可关注客户数量
+	VipStatus       int                    `json:"vip_status"`      //超级订阅状态
+	VipStartDate    int64                  `json:"vipStartDate"`    //超级订阅开始时间
+	Vip_BuySet      BuySet                 `json:"vip_buyset"`      //超级订阅套餐内容
+	EntnicheStatus  int                    `json:"entniche_status"` //商机管理状态
+	IsUpgrade       bool                   `json:"isUpgrade"`       //是否是免费用户订阅升级用户 默认true
+	Registedate     int64                  `json:"registedate"`     //用户注册时间
+	EntName         string                 `json:"entname"`         //企业名称
+	EntIsNew        bool                   `json:"entIsNew"`        //是否是新版商机管理用户
+	IsEntService    bool                   `json:"isEntService"`    //是否有商机管理服务
+	PrivateGD       bool                   `json:"PrivateGD"`       //广东移动DICT 用户
+	Email           string                 `json:"email"`
+	EntInfo         map[int]*EntInfoStruct `json:"entInfo"`         //企业信息
+	MemberPowerType int64                  `json:"memberPowerType"` //大会员权益类型 0无 1个人 2企业
+	VipPowerType    int64                  `json:"vipPowerType"`    //超级订阅权益类型 0无 1个人 2企业
+	BaseUserId      int                    `json:"base_user_id"`    //用户base_user_id
+}
+
+type EntInfoStruct struct {
+	IsNew     bool   `json:"isNew"`     //是否是新版商机管理
+	IsPower   bool   `json:"isPower"`   //是否分配了商机管理权限
+	Status    int    `json:"status"`    //是否购买
+	Name      string `json:"name"`      //企业名称
+	IsService bool   `json:"isService"` //企业商机管理服务
+	RoleId    int    `json:"roleId"`    //角色默认0:员工; 1:系统(企业)管理员;2:部门管理员
+}
+
+// 超级订阅购买内容
+type BuySet struct {
+	Upgrade         int `json:"upgrade"`         //是否是升级版;1是 其他不是
+	AreaCount       int `json:"areacount"`       //省份数量
+	BuyerclassCount int `json:"buyerclasscount"` //行业数
+}
+
+var FrontService, BackService map[string][]int
+
+const (
+	IsNewFreeTimeCell       = 1637830020
+	BigmemberServiceTable   = "bigmember_service"
+	BigmemberUserPowerTable = "bigmember_service_user"
+
+	PowerCacheDb              = "other"
+	PowerCacheKey             = "bigmember_power_3_%s"
+	OneDay                    = 60 * 60 * 24
+	UserUpdateAreaKey         = "free_area_num_%s_%s"
+	BaseAreaNum               = 1
+	VipFileUploadNumKey       = "vip_file_num_%s_%s"  //超级订阅附件本月一下载次数 %s:userid ; %s:当前月份-fmt.Sprint(time.Now().Month())
+	FilePackNumKey            = "file_pack_num_%s_%s" //附件下载包本月  剩余次数  %s:userid   %s 当前月份-fmt.Sprint(time.Now().Month())
+	BaseInfoCacheDb           = "newother"
+	IsGetUserBaseInfoRedisKey = "baseinfo_%s"
+	RedisMenuKeyPC            = "jy_workdesktopmenu_10000_PC_%s"  //剑鱼appid:10000
+	RedisMenuKeyWX            = "jy_workdesktopmenu_10000_WX_%s"  //剑鱼appid:10000
+	RedisMenuKeyAPP           = "jy_workdesktopmenu_10000_APP_%s" //剑鱼appid:10000
+	UserPowerRedisKey         = "jy_userpowerredis_10000_%d_%s"   //工作桌面 用户功能缓存(类似bigmember_power_3_%s)
+)
+
+// 初始化大会员权益
+func InitBigVipService(mysql *mysql.Mysql) {
+	serviceList := mysql.Find(BigmemberServiceTable, nil, "id,s_url_front,s_url_back", "id", -1, -1)
+	if serviceList == nil || len(*serviceList) == 0 {
+		panic(fmt.Sprintf("大会员初始权限失败,请检查mysql链接是否正常、查看%s表是否正常", BigmemberServiceTable))
+	}
+	FrontService, BackService = make(map[string][]int), make(map[string][]int)
+	for _, one := range *serviceList {
+		power := qutil.ObjToMap(one)
+		if power == nil {
+			continue
+		}
+		serviceId := qutil.IntAll((*power)["id"])
+		if urlFronts := qutil.ObjToString((*power)["s_url_front"]); urlFronts != "" {
+			for _, urlFront := range strings.Split(urlFronts, "&") {
+				FrontService[urlFront] = append(FrontService[urlFront], serviceId)
+			}
+		}
+
+		if urlBacks := qutil.ObjToString((*power)["s_url_back"]); urlBacks != "" {
+			for _, urlBack := range strings.Split(urlBacks, "&") {
+				BackService[urlBack] = append(BackService[urlBack], serviceId)
+			}
+		}
+	}
+	log.Printf("init BigVipService status \nFrontService:%+v\nBackService:%+v\n", FrontService, BackService)
+}
+
+// 当大会员状态改变时清除此状态
+func ClearBigVipUserPower(userId string) bool {
+	cacheKey := fmt.Sprintf(PowerCacheKey, userId)
+	baseInfoCacheKey := fmt.Sprintf(IsGetUserBaseInfoRedisKey, userId)
+	redisMenuKeyPC := fmt.Sprintf(RedisMenuKeyPC, userId)
+	redisMenuKeyWX := fmt.Sprintf(RedisMenuKeyWX, userId)
+	redisMenuKeyAPP := fmt.Sprintf(RedisMenuKeyAPP, userId)
+	userPowerRedisKey := fmt.Sprintf(UserPowerRedisKey, time.Now().Day(), userId)
+	return redis.Del(BaseInfoCacheDb, cacheKey) && redis.Del(BaseInfoCacheDb, baseInfoCacheKey) && redis.Del(BaseInfoCacheDb, redisMenuKeyPC) && redis.Del(BaseInfoCacheDb, redisMenuKeyWX) && redis.Del(BaseInfoCacheDb, redisMenuKeyAPP) && redis.Del(BaseInfoCacheDb, userPowerRedisKey)
+}
+
+// 获取商机管理个人基本信息
+func GetEntnicheState(userId string, mysql *mysql.Mysql, mg MongodbSim) *BigVipBaseMsg {
+	userPower := BigVipBaseMsg{}
+	userPower.EntnicheStatus = 0
+	//手机号
+	data, ok := mg.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1,"l_registedate":1}`)
+	if ok && *data != nil && len(*data) > 0 {
+		//查询是否是商机管理付费用户
+		phone, _ := qutil.If((*data)["s_phone"] != nil, (*data)["s_phone"], (*data)["s_m_phone"]).(string)
+		if phone != "" {
+			if count := mysql.CountBySql(`SELECT count(1) FROM entniche_user u LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone=? and u.power=1 and i.status=1`, phone); count > 0 {
+				userPower.EntnicheStatus = 1
+			}
+		}
+	}
+	return &userPower
+}
+
+// 获取大会员个人基本信息
+func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *BigVipBaseMsg {
+	userPower := BigVipBaseMsg{}
+	userPower.PowerMap = make(map[int]bool)
+	if userId == "" {
+		return &userPower
+	}
+	userPower.IsUpgrade = false
+	userPower.Uid = userId
+	cacheKey := fmt.Sprintf(PowerCacheKey, userId)
+
+	if bytes, err := redis.GetBytes(BaseInfoCacheDb, cacheKey); err == nil && bytes != nil {
+		if err := json.Unmarshal(*bytes, &userPower); err == nil {
+			return &userPower
+		}
+	}
+	//大会员状态
+	data, ok := mg.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1,"l_registedate":1,"l_vip_starttime":1,"s_myemail":1,"base_user_id":1}`)
+	if ok && *data != nil && len(*data) > 0 {
+		userPower.Email = qutil.ObjToString((*data)["s_myemail"])
+		userPower.BaseUserId = qutil.IntAll((*data)["base_user_id"])
+		userPower.Registedate = qutil.Int64All((*data)["l_registedate"])
+		userPower.VipStartDate = qutil.Int64All((*data)["l_vip_starttime"])
+		userPower.Status = qutil.IntAllDef((*data)["i_member_status"], 0)
+		//子账号被启用
+		i_member_sub_status := qutil.IntAllDef((*data)["i_member_sub_status"], 0)
+		if (*data)["s_member_mainid"] != nil && qutil.ObjToString((*data)["s_member_mainid"]) != "" && i_member_sub_status > 0 {
+			userPower.Pid = qutil.ObjToString((*data)["s_member_mainid"])
+		}
+		if (userPower.Pid != "" && qutil.IntAllDef((*data)["i_member_sub_status"], 0) == 1) || mg.Count("member", map[string]interface{}{"userid": userId}) > 0 {
+			userPower.Used = true
+		}
+		if (*data)["i_member_trial"] != nil {
+			userPower.HasTrial = true
+		}
+		if vipStatus := qutil.IntAll((*data)["i_vip_status"]); vipStatus > 0 {
+			userPower.VipStatus = vipStatus
+			if o_vipjy := qutil.ObjToMap((*data)["o_vipjy"]); o_vipjy != nil {
+				if o_buyset := qutil.ObjToMap((*o_vipjy)["o_buyset"]); o_buyset != nil {
+					userPower.Vip_BuySet = BuySet{
+						Upgrade:         qutil.IntAll((*o_buyset)["upgrade"]),
+						AreaCount:       qutil.IntAll((*o_buyset)["areacount"]),
+						BuyerclassCount: qutil.IntAll((*o_buyset)["buyerclasscount"]),
+					}
+				}
+			}
+			userPower.VipPowerType = 1
+		}
+		if userPower.Status > 0 {
+			userPower.MemberPowerType = 1
+		}
+		//免费用户画像和附件下载权限
+		//if userPower.Status <= 0 && userPower.VipStatus <= 0 {
+		o_jy := qutil.ObjToMap((*data)["o_jy"])
+		//"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
+		//IsNewFreeTimeCell dev3.6.4版本之前发了个紧急版本处理老用户订阅问题,i_newfree字段必须用户选择地区才能生成,不能作为判断是否是新用户得唯一标识,在此版本添加了常量:IsNewFreeTimeCell作为判断标准;--ws
+		if qutil.IntAll((*o_jy)["i_newfree"]) > 0 || IsNewFreeTimeCell < userPower.Registedate {
+			userPower.IsUpgrade = true
+		}
+		//}
+		//查询是否是商机管理付费用户
+		//userPower.EntnicheStatus = 0
+		phone, _ := qutil.If((*data)["s_phone"] != nil, (*data)["s_phone"], (*data)["s_m_phone"]).(string)
+		if phone != "" {
+			res := mysql.SelectBySql(`SELECT i. STATUS AS status, i.isNew, i.power_source, r.role_id, u.power, i.name,i.id FROM (entniche_user u LEFT JOIN entniche_user_role r ON r.user_id = u.id ) LEFT JOIN entniche_info i ON u.ent_id = i.id WHERE u.phone = ? ORDER BY i. STATUS DESC, i.auth_status DESC`, phone)
+			if res != nil && len(*res) > 0 {
+				userPower.EntInfo = map[int]*EntInfoStruct{}
+				//商机管理
+				userPower.EntName = qutil.ObjToString((*res)[0]["name"])
+				//已购买企业未过期-商机管理用户
+				for _, v := range *res {
+					if qutil.IntAll(v["id"]) == 0 {
+						continue
+					}
+					entId := qutil.IntAll(v["id"])
+					userPower.EntInfo[entId] = &EntInfoStruct{
+						IsNew:     qutil.IntAll(v["isNew"]) > 0,
+						IsPower:   qutil.IntAll(v["power"]) > 0,
+						Status:    qutil.IntAll(v["status"]),
+						Name:      qutil.ObjToString(v["name"]),
+						IsService: qutil.IntAll(v["power_source"]) > 0,
+						RoleId:    qutil.IntAll(v["role_id"]),
+					}
+					// 判断是否是新商机管理
+					if qutil.IntAll(v["status"]) == 1 && qutil.IntAll(v["power"]) == 1 {
+						userPower.EntnicheStatus = 1
+						if qutil.IntAll(v["isNew"]) == 1 {
+							userPower.EntIsNew = true
+							// if userPower.EntIsNew && userPower.IsEntService {
+							// 	break
+							// }
+						}
+					}
+					// 判断是否是商机管理服务 (在超级订阅或者大会员、医械通(暂无)的基础上才会有的)
+					// if qutil.IntAll(v["power_source"]) == 1 {
+					// 	userPower.IsEntService = true
+					// 	break
+					// }
+
+				}
+			}
+			// 如果是商机管理服务用户,则不能是旧版商机管理及新版商机管理
+			// if userPower.IsEntService {
+			// 	userPower.EntnicheStatus = 0 // 商机管理状态
+			// 	userPower.EntIsNew = false   // 新版商机管理
+			// }
+			//if count := mysql.CountBySql(`SELECT count(1) FROM entniche_user u LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone=? and u.power=1 and i.status=1`, phone); count > 0 {
+			//	userPower.EntnicheStatus = 1
+			//}
+			//广东移动DICT 用户
+			userPower.PrivateGD = mysql.CountBySql(`select count(1) from privatedata where phone = ?`, phone) > 0
+
+			//用于判断是否含有企业主体的超级订阅、大会员服务
+			epowerData := mysql.SelectBySql(`SELECT c.product_type FROM entniche_user a INNER JOIN entniche_power b
+		 									INNER JOIN entniche_wait_empower c
+		 									ON a.id =b.ent_user_id  AND c.id = b.wait_empower_id WHERE a.phone =? AND c.end_time >?`, phone, time.Now().Format(qutil.Date_Full_Layout))
+			if epowerData != nil && len(*epowerData) > 0 {
+				for _, v := range *epowerData {
+					product_type := qutil.ObjToString(v["product_type"])
+					if strings.Contains(product_type, "VIP订阅") {
+						userPower.VipPowerType = 2
+					} else if strings.Contains(product_type, "大会员") {
+						userPower.MemberPowerType = 2
+					}
+				}
+			}
+		}
+	}
+
+	//子账号查询父节点权限
+	queryId := qutil.If(userPower.Pid == "", userId, userPower.Pid).(string)
+	//用户购买的服务
+	serviceList := mysql.Find(BigmemberUserPowerTable, map[string]interface{}{"s_userid": queryId, "i_status": 0}, "DISTINCT(s_serviceid),i_frequency", "", -1, -1)
+	if serviceList != nil && len(*serviceList) != 0 {
+		pCount, eCount, dailyNum, customers := 0, 0, 0, 10
+		for _, item := range *serviceList {
+			serviceid := qutil.IntAll(item["s_serviceid"])
+			userPower.PowerMap[serviceid] = true
+			if serviceid == 14 { //项目数量
+				pCount = qutil.IntAll(item["i_frequency"])
+			} else if serviceid == 4 || serviceid == 12 || serviceid == 13 { //企业情报监控 企业中标动态
+				tEcount := qutil.IntAll(item["i_frequency"])
+				if tEcount > eCount {
+					eCount = tEcount
+				}
+			} else if serviceid == 17 || serviceid == 18 { //每日数据包
+				dailyNum = qutil.IntAll(item["i_frequency"])
+			} else if serviceid == 7 { //潜在客户 关注客户
+				customers = qutil.IntAll(item["i_frequency"])
+			}
+		}
+		userPower.EntNum = eCount
+		userPower.ProNum = pCount
+		userPower.DailyNum = dailyNum
+		userPower.Customers = customers
+	}
+
+	//存储缓存
+	go func() {
+		if bytes, err := json.Marshal(userPower); err == nil && bytes != nil {
+			oneDayMore := OneDay + rand.Intn(60*60)
+			_ = redis.PutBytes(BaseInfoCacheDb, cacheKey, &bytes, oneDayMore)
+		}
+	}()
+	return &userPower
+}
+
+// 权限判断
+func (this *BigVipBaseMsg) CheckBigVipFrontPower(reqFlag string) (pass bool) {
+	if reqFlag == "ent_portrait" || reqFlag == "unit_portrayal" { //画像页面无权限控制
+		return true
+	}
+	if this.Vip_BuySet.Upgrade == 1 {
+		if reqFlag == "ent_portrait" || reqFlag == "svip" {
+			return true
+		}
+	}
+	return this.checkPower(reqFlag, FrontService)
+}
+
+func (this *BigVipBaseMsg) CheckBigVipBackPower(reqFlag string) (pass bool) {
+	return this.checkPower(reqFlag, BackService)
+}
+
+func (this *BigVipBaseMsg) checkPower(reqFlag string, servicesPower map[string][]int) bool {
+	powers, ok := servicesPower[reqFlag]
+	if !ok {
+		return false
+	}
+	for _, p := range powers {
+		if this.PowerMap[p] {
+			return true
+		}
+	}
+
+	return false
+}
+
+func (this *BigVipBaseMsg) GetUseId() string {
+	if this.Pid != "" {
+		return this.Pid
+	}
+	return this.Uid
+}

+ 478 - 0
src/jfw/modules/common/src/qfw/util/jy/jy.go

@@ -0,0 +1,478 @@
+package jy
+
+import (
+	"crypto/rand"
+	"encoding/json"
+	"fmt"
+	"io/ioutil"
+	"log"
+	"math/big"
+	. "mongodb"
+	"net/http"
+	"net/url"
+	"qfw/util"
+	"qfw/util/mail"
+	"qfw/util/redis"
+	qrpc "qfw/util/rpc"
+	"qfw/util/sms"
+	"regexp"
+	"sort"
+	"strings"
+	"time"
+	"unicode"
+
+	"github.com/go-xweb/httpsession"
+)
+
+//获取用户合并以前,合并以后的openid
+func GetOldOpenid(s_m_openid, a_m_openid, s_phone string, mergeorder interface{}) string {
+	a_mergeorder, _ := mergeorder.([]interface{})
+	openid := ""
+	if len(a_mergeorder) > 0 {
+		first, _ := a_mergeorder[0].(string)
+		if first == "s_m_openid" {
+			openid = s_m_openid
+		} else if first == "a_m_openid" {
+			openid = a_m_openid
+		} else if first == "s_phone" {
+			openid = s_phone
+		}
+	} else {
+		if s_m_openid != "" {
+			openid = s_m_openid
+		} else if a_m_openid != "" {
+			openid = a_m_openid
+		} else if s_phone != "" {
+			openid = s_phone
+		}
+	}
+	return openid
+}
+
+var ClearHtml = regexp.MustCompile("<[^>]*>")
+var MatchSpace = regexp.MustCompile("\\s+")
+var filterReg_3 = regexp.MustCompile("(项目|公告|公示)$")
+var filterReg_2 = regexp.MustCompile("^[)\\)>》】\\]}}〕,,;;::'\"“”。.\\??、/+=\\_—*&……\\^%$¥@!!`~·(\\(<《【\\[{{〔]+$")
+var filterReg_1 = regexp.MustCompile("^([0-9]{1,3}|[零一二三四五六七八九十]{1,2}|联系人?|电话|地址|编号|采购|政府采购|成交|更正|招标|中标|变更|结果)$")
+var filterReg = regexp.MustCompile("^[的人号时元万公告项目地址电话邮编日期联系招标中结果成交项目项目采购采购项目政府采购公告更正公告]+$")
+var PhoneReg = regexp.MustCompile("^[1][3-9][0-9]{9}$")
+var EmailPattern = 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})(\\]?)$")
+
+func FilteKey(k string) string {
+	k = strings.TrimSpace(k)
+	k = filterReg_3.ReplaceAllString(k, "")
+	k = filterReg_2.ReplaceAllString(k, "")
+	k = filterReg_1.ReplaceAllString(k, "")
+	k = filterReg.ReplaceAllString(k, "")
+	return k
+}
+
+// InterceptSearchKW 超过20个字,截断
+//返回截取后的字符串和截取掉中的前3个字
+func InterceptSearchKW(word string, keywordsLimit int, isFilter bool) (b_word, a_word, s_word string) {
+	if word == "" {
+		return
+	}
+	if isFilter {
+		word = FilteKey(word)
+	}
+	word = MatchSpace.ReplaceAllString(strings.TrimSpace(word), " ")
+	words := []rune(word)
+	if len(words) > keywordsLimit {
+		b_word = string(words[:keywordsLimit])
+		b_word = strings.TrimSpace(b_word)
+		if len(words) > keywordsLimit+3 {
+			a_word = string(words[keywordsLimit : keywordsLimit+3])
+		} else {
+			a_word = string(words[keywordsLimit:])
+		}
+	} else {
+		b_word = word
+	}
+	a_word = strings.TrimSpace(a_word)
+	s_word = MatchSpace.ReplaceAllString(b_word, " ")
+	return
+}
+
+func HttpEs(ques, analyzer, esAddress string) (res string) {
+	var addrs []string
+	surl := ""
+	for _, s := range strings.Split(esAddress, ",") {
+		addrs = append(addrs, s)
+	}
+	i, _ := rand.Int(rand.Reader, big.NewInt(int64(len(addrs)))) //随机
+	surl = addrs[int(i.Int64())] + "/bidding/_analyze"
+	URL, _ := url.Parse(surl)
+	Q := URL.Query()
+	Q.Add("text", ques)
+	Q.Add("analyzer", analyzer)
+	URL.RawQuery = Q.Encode()
+	resp, err := http.Get(URL.String())
+	if err != nil {
+		log.Println("es连接失败 err1:", err)
+		resp, err = getesResp(ques, analyzer, addrs)
+		if err != nil {
+			return
+		}
+	}
+	result, err := ioutil.ReadAll(resp.Body)
+	if err == nil {
+		defer resp.Body.Close()
+		var resmap map[string]interface{}
+		json.Unmarshal(result, &resmap)
+		if resmap != nil && resmap["tokens"] != nil {
+			tokens := util.ObjArrToMapArr(resmap["tokens"].([]interface{}))
+			for _, v := range tokens {
+				token := util.ObjToString(v["token"])
+				if len([]rune(token)) == 1 && !unicode.Is(unicode.Scripts["Han"], []rune(token)[0]) { //(P260保留单个汉字)
+					continue
+				}
+				if res != "" {
+					res += "+"
+				}
+				res += token
+			}
+		}
+	}
+	return
+}
+
+//
+func getesResp(ques, analyzer string, addrs []string) (resp *http.Response, err error) {
+	for _, v := range addrs {
+		surl := v + "/bidding/_analyze"
+		URL, _ := url.Parse(surl)
+		Q := URL.Query()
+		Q.Add("text", ques)
+		Q.Add("analyzer", analyzer)
+		URL.RawQuery = Q.Encode()
+		resp, err = http.Get(URL.String())
+		if err == nil {
+			break
+		}
+	}
+	return resp, err
+}
+
+//发送邮箱验证码
+func SendMailIdentCode(to, code string, auth []*mail.GmailAuth) bool {
+	html := fmt.Sprintf(`<div>
+		<div>
+			%s,您好!
+		</div>
+		<div style="padding: 20px 70px 10px 70px;">
+			<p>您正在进行绑定邮箱地址验证,请在邮件验证码输入框输入下方验证码:</p>
+			<span style="font-weight: bold;font-size: x-large;">%s</span>
+			<p>请勿向任何人泄露您收到的验证码。</p>
+			<p>如果您没有使用剑鱼标讯,请忽略此邮件。</p>
+			<p>此为系统邮件,请勿回复。</p>
+			<p>如有疑问,请联系客服 400-108-6670。</p>
+		</div>
+		<div>
+			<p>此致</p>
+			<p>剑鱼标讯</p>
+		</div>
+	</div>`, to, code)
+
+	for k, v := range auth {
+		if mail.GSendMail("剑鱼标讯", to, "", "", "剑鱼标讯邮箱校验", html, "", "", v) {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件成功", v.User))
+			return true
+		}
+		if k < len(auth)-1 {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件失败!3s后使用其他邮箱尝试", v.User))
+		} else {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件失败!", v.User))
+		}
+		time.Sleep(time.Second * 3)
+	}
+
+	return false
+}
+
+//
+func SendSMS(address, mobile string, params ...string) {
+	sms.SendSms(address, "01", mobile, params...)
+}
+
+//发送验证码
+//增加sessionKey字段 更换手机号防止绕过身份校验
+func SendPhoneIdentCode(address, phone string, session *httpsession.Session, sessionKey ...string) bool {
+	sessionKeyFlag := defaultPhoneFlag
+	if len(sessionKey) > 0 && sessionKey[0] != "" {
+		sessionKeyFlag = sessionKey[0]
+	}
+
+	lastSentTime := util.Int64All(session.Get(fmt.Sprintf("%sTime", sessionKeyFlag)))
+	//60秒之内不允许重复发
+	if lastSentTime > 0 && time.Now().Unix()-lastSentTime <= 60 {
+		return false
+	}
+	s_ranNum := util.GetRandom(6) //生成随机数
+	//s_ranNum = "111111"
+	session.Set(fmt.Sprintf("%sValue", sessionKeyFlag), s_ranNum)
+	session.Set(fmt.Sprintf("%sKey", sessionKeyFlag), phone)
+	session.Set(fmt.Sprintf("%sTime", sessionKeyFlag), time.Now().Unix())
+	//发送短信
+	log.Println("短信验证码", phone, s_ranNum)
+	SendSMS(address, phone, s_ranNum)
+	return true
+}
+
+const defaultPhoneFlag = "identCode"
+
+//短信验证码校验
+func CheckPhoneIdent(session *httpsession.Session, code string, sessionKey ...string) string {
+	sessionKeyFlag := defaultPhoneFlag
+	if len(sessionKey) > 0 && sessionKey[0] != "" {
+		sessionKeyFlag = sessionKey[0]
+	}
+	identCodeValue, _ := session.Get(fmt.Sprintf("%sValue", sessionKeyFlag)).(string)
+	if identCodeValue != "" && identCodeValue == code {
+		identCodeKey, _ := session.Get(fmt.Sprintf("%sKey", sessionKeyFlag)).(string)
+		ClearPhoneIdentSession(session)
+		return identCodeKey
+	}
+	return ""
+}
+
+//删除短信验证码有关的session
+func ClearPhoneIdentSession(session *httpsession.Session, sessionKey ...string) {
+	sessionKeyFlag := defaultPhoneFlag
+	if len(sessionKey) > 0 && sessionKey[0] != "" {
+		sessionKeyFlag = sessionKey[0]
+	}
+	session.Del(fmt.Sprintf("%sValue", sessionKeyFlag))
+	session.Del(fmt.Sprintf("%sKey", sessionKeyFlag))
+	session.Del(fmt.Sprintf("%sTime", sessionKeyFlag))
+}
+
+//邮箱校验
+func IsEmail(value string) bool {
+	return EmailPattern.MatchString(value)
+}
+
+//手机号校验
+func IsPhone(phone string) bool {
+	return PhoneReg.MatchString(phone)
+}
+
+//获取信息行业
+func Getindustrys(industryname string, mongodb MongodbSim) (industry map[string][]string, sortArray []string) {
+	industry = map[string][]string{}
+	sortArray = []string{}
+	classdata, ok1 := mongodb.FindOneByField("rc_task", `{"s_name":"`+industryname+`"}`, `{"s_class":1}`)
+	if ok1 && len(*classdata) > 0 {
+		classid := ""
+		if util.ObjToString((*classdata)["s_class"]) != "" {
+			classids := strings.Split(util.ObjToString((*classdata)["s_class"]), ",")
+			for k, v := range classids {
+				if k > 0 {
+					classid += `,`
+				}
+				classid += `"` + v + `"`
+			}
+		}
+		industryData, ok := mongodb.Find("rc_rule", `{"s_pid":{"$ne":""},"s_classid":{"$in":[`+classid+`]}}`, `{"i_order":1}`, `{"_id":1,"s_name":1}`, false, -1, -1)
+		if ok && industryData != nil && len(*industryData) > 0 {
+			for _, v := range *industryData {
+				fatFlag := 0
+				industryname, _ := v["s_name"].(string)
+				if strings.Contains(industryname, "_") {
+					fat := strings.Split(industryname, "_")[0]
+					child := strings.Split(industryname, "_")[1]
+					if len(industry[fat]) == 0 {
+						sortArray = append(sortArray, fat)
+					}
+					for _, fv := range industry[fat] {
+						if fv == strings.Trim(child, " ") {
+							fatFlag = 1
+							break
+						}
+					}
+					if fatFlag != 1 {
+						industry[fat] = append(industry[fat], child)
+					}
+				}
+			}
+		}
+	}
+	return industry, sortArray
+}
+
+//对应月份
+//
+func GetMonth(mon string) int {
+	month := map[string]int{
+		"January":   1,
+		"February":  2,
+		"March":     3,
+		"April":     4,
+		"May":       5,
+		"June":      6,
+		"July":      7,
+		"August":    8,
+		"September": 9,
+		"October":   10,
+		"November":  11,
+		"December":  12,
+	}
+	return month[mon]
+}
+
+//value unlimited 并发限制登陆用户
+func LoginRedisKey(userid string) string {
+	return fmt.Sprintf("unlimited_%s", userid)
+}
+
+//获取loginSess
+func GetLoginSess(userid string) []string {
+	key := LoginRedisKey(userid)
+	if data, ok := redis.Get("other", key).([]interface{}); ok {
+		return util.ObjArrToStringArr(data)
+	}
+	return []string{}
+}
+
+//判断是否在内
+func IsInLoginSess(key string, arr []string) bool {
+	for _, v := range arr {
+		if key == v {
+			return true
+		}
+	}
+	return false
+}
+
+type TtlMap struct {
+	key   string //sessionid
+	value int    //ttl
+}
+
+type AppLoginPush struct {
+	JgPushId    string `json:"jpushId"`
+	OtherPushId string `json:"opushId"`
+	PhoneType   string `json:"phoneType"`
+}
+
+//更新存储用户sessionid的队列 【sessionid ttl小于三天的清除】  key:sessionid
+func PutLoginSess(mongodb MongodbSim, apppushRpc, key, userid string, limit, max int) bool {
+	value := GetLoginSess(userid)
+	if !IsInLoginSess(key, value) {
+		value = append(value, key)
+	}
+	ttlmap := []TtlMap{}
+	if len(value) >= int(limit*max/100) {
+		new_value := []string{}
+		//如果已存的session大于限制 则清除三天后到期的session
+		for _, vv := range value {
+			ttl := redis.GetTTL("session", vv)
+			if ttl <= 86400*1 && ttl != -1 {
+				// if ttl <= 600 && ttl != -1 {
+				if ok := redis.Del("session", vv); ok {
+					LoginOutPush(mongodb, userid, vv, apppushRpc)
+					log.Println(fmt.Sprintf("%s用户的sessionid 到期时间还有%v 小于三天 清除 %s", userid, ttl, vv))
+				}
+				continue
+			}
+			new_value = append(new_value, vv)
+			ttlmap = append(ttlmap, TtlMap{vv, int(ttl)})
+		}
+		value = new_value
+	}
+	//清除并发最大限制的某个sessionid
+	if len(value) > max {
+		//排序 获取马上过期的session 清除
+		sort.Slice(ttlmap, func(i, j int) bool {
+			return ttlmap[i].value < ttlmap[j].value
+		})
+		if len(ttlmap) > 0 {
+			//清除sessionid
+			delId := ttlmap[0].key
+			redis.Del("session", delId)
+			value = removeArr(value, delId)
+			LoginOutPush(mongodb, userid, delId, apppushRpc)
+			log.Println(fmt.Sprintf("%s用户的sessionid 超过最大限制 清除 %s ,到期时间%v", userid, delId, ttlmap[0].value))
+			for _, v := range ttlmap {
+				log.Println(v.key, "===", v.value)
+			}
+		}
+	}
+	return redis.Put("other", LoginRedisKey(userid), value, -1)
+}
+
+//清除数组中的s
+func removeArr(arr []string, s string) []string {
+	result := []string{}
+	for _, v := range arr {
+		if v == s {
+			continue
+		}
+		result = append(result, v)
+	}
+	return result
+}
+
+//
+func LoginOutPush(mongodb MongodbSim, userid, sessid, apppushRpc string) {
+	rediskey := fmt.Sprintf("app_%s", sessid)
+	r := redis.Get("other", rediskey)
+	if r == nil {
+		return
+	}
+	arr, err := json.Marshal(r)
+	if err != nil {
+		log.Println("json Marshal err:", err)
+	}
+	apppush := AppLoginPush{}
+	// 反序列化
+	err2 := json.Unmarshal(arr, &apppush)
+	if err2 != nil {
+		log.Println("json Unmarshal err:", err)
+	}
+	if apppush.JgPushId == "" {
+		return
+	}
+	mongodb.UpdateById("user", userid, map[string]interface{}{
+		"$unset":    map[string]interface{}{"s_jpushid": "", "s_opushid": ""},
+		"$addToSet": map[string]interface{}{"a_jpushid": apppush.JgPushId},
+	})
+	//
+	log.Println("多账号登陆:", userid, apppush.PhoneType, apppush.JgPushId, apppush.OtherPushId, "踢人下线")
+	ok := qrpc.AppPush(apppushRpc, map[string]interface{}{
+		"type":        "signOut",
+		"descript":    "您的账号在其他设备登录,如有需要请重新登录。",
+		"jgPushId":    apppush.JgPushId,
+		"otherPushId": apppush.OtherPushId,
+		"phoneType":   apppush.PhoneType,
+		"userId":      userid,
+	})
+	log.Println("ok:", ok)
+}
+
+//session数组清除某个value[针对多账号同时在线的方法、退出登录时调用]
+func DelUnlimitSessionId(sessid, userid string) []string {
+	sessArr := GetLoginSess(userid)
+	newArr := []string{}
+	for _, v := range sessArr {
+		if v == sessid {
+			continue
+		}
+		newArr = append(newArr, v)
+	}
+	return newArr
+}
+
+//获取当天结束时间 单位秒
+func GetExpire() int {
+	t, _ := time.ParseInLocation(util.Date_Short_Layout, time.Now().AddDate(0, 0, 1).Format(util.Date_Short_Layout), time.Local)
+	t2, _ := time.ParseInLocation(util.Date_Full_Layout, time.Now().Format(util.Date_Full_Layout), time.Local)
+	return int(t.Unix() - t2.Unix())
+}
+
+func TimeProcessing(hour interface{}, duration int) time.Time {
+	todayZero, _ := time.ParseInLocation(util.Date_Full_Layout, fmt.Sprint(hour), time.Local)
+	mm, _ := time.ParseDuration(fmt.Sprint(duration) + "m")
+	t := todayZero.Add(mm)
+	return t
+}

+ 188 - 0
src/jfw/modules/common/src/qfw/util/jy/payUser.go

@@ -0,0 +1,188 @@
+package jy
+
+import (
+	"bytes"
+	"encoding/json"
+	"errors"
+	"io"
+	"io/ioutil"
+	"log"
+	"mongodb"
+	"net/http"
+	qu "qfw/util"
+	"qfw/util/mysql"
+	"strings"
+)
+
+//是否是付费用户
+type VipState struct {
+	VipState     int   //超级订阅状态(1普通 2升级版)
+	BigMember    int   //大会员状态
+	EntMember    int   //商机管理用户状态
+	RegisterData int64 //注册时间
+	VipStartData int64 //超级订阅开始时间
+	IsNewEnt     bool  //新版商机管理
+	EntService   bool  //企业服务权限
+}
+
+func GetVipState(mysql *mysql.Mysql, mg mongodb.MongodbSim, userId string, entId int) (vs *VipState) {
+	vs = &VipState{}
+	if userId == "" {
+		return
+	}
+	phone := ""
+	data, ok := mg.FindById("user", userId, `"i_member_status":1,"i_vip_status":1,"s_m_phone":1,"s_phone":1,"o_vipjy":1,"l_registedate":1,"l_vip_starttime":1`)
+	if data != nil && len(*data) > 0 && ok {
+		iVipStatus := qu.IntAll((*data)["i_vip_status"])
+		if iVipStatus > 1 {
+			vs.VipState = 1
+			oVipJY, _ := (*data)["o_vipjy"].(map[string]interface{})
+			if oVipJY["o_buyset"] != nil {
+				oBuySet := oVipJY["o_buyset"].(map[string]interface{})
+				if oBuySet["upgrade"] != nil {
+					vs.VipState = 2
+				}
+			}
+		}
+		if iMemberStatus := qu.IntAllDef((*data)["i_member_status"], 0); iMemberStatus > 0 {
+			vs.BigMember = iMemberStatus
+		}
+		if sPhone, _ := (*data)["s_phone"].(string); sPhone != "" {
+			phone = sPhone
+		} else if sMPhone, _ := (*data)["s_m_phone"].(string); sMPhone != "" {
+			phone = sMPhone
+		}
+		if phone != "" && entId > 0 {
+			entNicheInfos := mysql.SelectBySql(`SELECT i.status,i.isNew,i.power_source,r.role_id,u.power FROM (entniche_user u LEFT JOIN entniche_user_role r ON r.user_id = u.id)  LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone = ? and i.id = ? `, phone, entId)
+			//商机管理用户信息判断
+			if entNicheInfos != nil && len(*entNicheInfos) > 0 {
+				entNicheInfo := (*entNicheInfos)[0]
+				vs.IsNewEnt = qu.Int64All(entNicheInfo["isNew"]) > 0
+				vs.EntService = qu.Int64All(entNicheInfo["power_source"]) > 0
+				//非企业管理服务  商机管理
+				if !vs.EntService && qu.IntAll(entNicheInfo["status"]) > 0 && (qu.IntAll(entNicheInfo["power"]) == 1 || qu.IntAll(entNicheInfo["role_id"]) > 0) {
+					vs.EntMember = 1
+				}
+			}
+		}
+		vs.RegisterData, _ = ((*data)["l_registedate"]).(int64)
+		vs.VipStartData, _ = ((*data)["l_vip_starttime"]).(int64)
+	}
+	return
+}
+
+//是否是付费账户
+func (vs *VipState) IsPayedUser() bool {
+	return vs.VipState > 0 || vs.BigMember > 0 || vs.EntMember > 0
+}
+
+//免费 标题(title)  正文(content) 老用户【中标企业(winner)】
+//付费用户 全部(all)、标题(title)  正文(content)  会员: 采购单位(buyer) 中标企业(winner) 招标代理机构(agency) 附件(file)
+//项目名称projectname和标的物purchasing(ppa)
+func (vs *VipState) GetQueryItems(selectType string, limitOldTime int64) (items []string) {
+	if vs.IsPayedUser() {
+		for _, t := range strings.Split(selectType, ",") {
+			if t == "content" {
+				items = append(items, "detail")
+			} else if t == "buyer" {
+				items = append(items, "mbuyer")
+			} else if t == "winner" {
+				items = append(items, "mwinner")
+			} else if t == "agency" {
+				items = append(items, "magency")
+			} else if t == "title" {
+				items = append(items, "title")
+			} else if t == "ppa" {
+				items = append(items, []string{"purchasing", "projectname.pname"}...)
+			} else if t == "file" { //dev4.7.8 标讯优化:搜索范围附件-》全部用户可用
+				items = append(items, "filetext")
+			}
+		}
+		return
+	}
+	isOldUser := vs.RegisterData != 0 && vs.RegisterData < limitOldTime
+	for _, t := range strings.Split(selectType, ",") {
+		if t == "winner" {
+			if isOldUser {
+				items = append(items, "mwinner")
+			}
+		} else if t == "title" {
+			items = append(items, "title")
+		} else if t == "content" {
+			items = append(items, "detail")
+		} else if t == "file" { //dev4.7.8 标讯优化:搜索范围附件-》全部用户可用
+			items = append(items, "filetext")
+		}
+	}
+	return
+}
+
+// HasBidFieldPower 获取用户是否有领域化数据权限
+func HasBidFieldPower(url string, userId string, functionCode string) bool {
+	// 是否开通过权益
+	header := map[string]string{
+		"newUserId": userId,
+	}
+	byJson, err := PostByJson(url, []byte(""), header)
+	if err != nil || byJson == nil {
+		log.Println("查询用户权益", url, userId, functionCode, err)
+		return false
+	}
+	if byJson != nil {
+		powerList := byJson["data"].([]interface{})
+		for i := 0; i < len(powerList); i++ {
+			if powerList[i] == functionCode {
+				return true
+			}
+		}
+	}
+	return false
+}
+
+func PostByJson(reqUrl string, data []byte, header map[string]string) (rs map[string]interface{}, err error) {
+	reqData := bytes.NewBuffer(data)
+	log.Println("请求参数", reqData)
+	method := "POST"
+	client := &http.Client{}
+	req, err2 := http.NewRequest(method, reqUrl, reqData)
+	if err2 != nil {
+		log.Println(err2)
+	}
+	req.Header.Add("Content-Type", "application/json")
+	if header != nil && len(header) > 0 {
+		for k, v := range header {
+			req.Header.Add(k, v)
+
+		}
+	}
+	log.Printf("请求url:%v", reqUrl)
+	log.Printf("请求header:%v", header)
+	res, err3 := client.Do(req)
+	if err3 != nil {
+		log.Println(err3)
+	}
+	log.Printf("err:%v,结果:%v", err3, res)
+	defer func(Body io.ReadCloser) {
+		err6 := Body.Close()
+		if err6 != nil {
+			log.Println("ReadCloser Err", err6)
+		}
+	}(res.Body)
+
+	if err3 != nil {
+		log.Println("请求失败:", err3)
+		return map[string]interface{}{}, errors.New("请求失败")
+	}
+	body, err4 := ioutil.ReadAll(res.Body)
+	if err4 != nil {
+		log.Println("读取响应数据信息失败", err4)
+		return map[string]interface{}{}, errors.New("读取响应信息失败")
+	}
+	err5 := json.Unmarshal(body, &rs)
+	if err5 != nil {
+		log.Println("反序列化数据失败", err5)
+		return map[string]interface{}{}, errors.New("反序列化数据失败")
+	}
+	log.Println("结果:", rs)
+	return rs, nil
+}

+ 14 - 0
src/jfw/modules/publicapply/src/attachmentdow/service/service.go

@@ -35,8 +35,14 @@ func (u *Dow) SupplyInfoFileDownload() {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
 
+<<<<<<< HEAD
 		BaseMsg := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
 		vipStatus := jy.GetVipState(u.Session(), *config.Middleground, userid)
+=======
+		entId := qu.IntAll(u.GetSession("entId"))
+		BaseMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+		vipStatus := jy.GetVipState(db.Mysql, db.Mgo, userid, entId)
+>>>>>>> master
 		isPower := false
 		//大会员下载权限判断
 		if BaseMsg.Status > 0 && BaseMsg.PowerMap[3] {
@@ -119,8 +125,16 @@ func (u *Dow) Subdow() {
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
+<<<<<<< HEAD
 		BaseMsg := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
 		vipStatus := jy.GetVipState(u.Session(), *config.Middleground, userid)
+=======
+
+		entId := qu.IntAll(u.GetSession("entId"))
+		BaseMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+		vipStatus := jy.GetVipState(db.Mysql, db.Mgo, userid, entId)
+
+>>>>>>> master
 		var (
 			mon string
 			ss  int

+ 286 - 40
src/jfw/modules/publicapply/src/userbase/entity/entity.go

@@ -1,6 +1,7 @@
 package entity
 
 import (
+<<<<<<< HEAD
 	"encoding/json"
 	"fmt"
 	"jy/src/jfw/modules/publicapply/src/config"
@@ -24,23 +25,51 @@ type UserInfo struct {
 	Platform string //平台 PC WX APP
 	Names    string //功能名称
 	Session  *httpsession.Session
+=======
+    "config"
+    "db"
+    "encoding/json"
+    "fmt"
+    "net/url"
+    "qfw/util"
+    "qfw/util/jy"
+    "qfw/util/redis"
+    "strings"
+    "time"
+    "userbase/initjson"
+)
+
+type UserInfo struct {
+    UserId   string //用户id
+    Platform string //平台 PC WX APP
+    Names    string //功能名称
+>>>>>>> master
 }
 
 type FuncNames struct {
-	Name string `json:"name"`
-	Url  string `json:"url"`
-	Img  string `json:"img"`
+    Name string `json:"name"`
+    Url  string `json:"url"`
+    Img  string `json:"img"`
 }
 
+<<<<<<< HEAD
 func NewUserInfo(userId, platform, names string, session *httpsession.Session) *UserInfo {
 	if platform == "" {
 		platform = "PC"
 	}
 	return &UserInfo{userId, platform, names, session}
+=======
+func NewUserInfo(userId, platform, names string) *UserInfo {
+    if platform == "" {
+        platform = "PC"
+    }
+    return &UserInfo{userId, platform, names}
+>>>>>>> master
 }
 
 //保存
 func (this *UserInfo) SaveNameByUserId() bool {
+<<<<<<< HEAD
 	queryMap := map[string]interface{}{
 		"s_userId":   this.UserId,
 		"s_platform": this.Platform,
@@ -62,10 +91,34 @@ func (this *UserInfo) SaveNameByUserId() bool {
 		},
 	}
 	return db.Mgo.Update(BaseFuncInfo.Cfcollotion, queryMap, updateMap, true, false)
+=======
+    queryMap := map[string]interface{}{
+        "s_userId":   this.UserId,
+        "s_platform": this.Platform,
+    }
+    var namesarr = []string{}
+    if this.Names != "" {
+        for _, v := range strings.Split(this.Names, ",") {
+            if !ChargeMap[v] || IsPower(v, this.UserId) {
+                namesarr = append(namesarr, v)
+            }
+        }
+    }
+    updateMap := map[string]interface{}{
+        "$set": map[string]interface{}{
+            "l_createtime": time.Now().Unix(),
+            "s_userId":     this.UserId,
+            "s_names":      strings.Join(namesarr, ","),
+            "s_platform":   this.Platform,
+        },
+    }
+    return db.Mgo.Update(initjson.BaseFuncInfo.Cfcollotion, queryMap, updateMap, true, false)
+>>>>>>> master
 }
 
 //获取用户已选功能或基本功能
 func (this *UserInfo) GetNameByUserId() (fns []*FuncNames) {
+<<<<<<< HEAD
 	queryMap := map[string]interface{}{
 		"s_userId":   this.UserId,
 		"s_platform": this.Platform,
@@ -109,12 +162,58 @@ func (this *UserInfo) GetNameByUserId() (fns []*FuncNames) {
 		}
 	}
 	return fns
+=======
+    queryMap := map[string]interface{}{
+        "s_userId":   this.UserId,
+        "s_platform": this.Platform,
+    }
+    res, ok := db.Mgo.FindOne(initjson.BaseFuncInfo.Cfcollotion, queryMap)
+    if ok && len(*res) > 0 {
+        names := util.ObjToString((*res)["s_names"])
+        if names != "" {
+        L:
+            for _, nv := range strings.Split(names, ",") {
+                if len(fns) >= initjson.BaseFuncInfo.Total {
+                    break
+                }
+                for _, v := range initjson.BaseFuncInfo.CommonFunctions {
+                    if v.Name == nv {
+                        fns = append(fns, &FuncNames{
+                            Name: v.Name,
+                            Url:  thisByPlat(this.Platform, "url", &v),
+                            Img:  thisByPlat(this.Platform, "img", &v),
+                        })
+                        continue L
+                    }
+                }
+            }
+        }
+    } else {
+        for _, v := range initjson.BaseFuncInfo.CommonFunctions {
+            if v.Isbase {
+                if v.Name == "订阅管理" && !IsPower(v.Name, this.UserId) {
+                    continue
+                }
+                fns = append(fns, &FuncNames{
+                    Name: v.Name,
+                    Url:  thisByPlat(this.Platform, "url", &v),
+                    Img:  thisByPlat(this.Platform, "img", &v),
+                })
+            }
+            if len(fns) >= initjson.BaseFuncInfo.Total {
+                break
+            }
+        }
+    }
+    return fns
+>>>>>>> master
 }
 
 var ChargeMap = map[string]bool{}
 
 //获取所有用户可用功能
 func (this *UserInfo) AllNames() (fns []*FuncNames) {
+<<<<<<< HEAD
 	for _, v := range BaseFuncInfo.CommonFunctions {
 		ChargeMap[v.Name] = v.Charge
 		if !v.Charge || IsPower(v.Name, this.Session) {
@@ -126,37 +225,51 @@ func (this *UserInfo) AllNames() (fns []*FuncNames) {
 		}
 	}
 	return fns
+=======
+    for _, v := range initjson.BaseFuncInfo.CommonFunctions {
+        ChargeMap[v.Name] = v.Charge
+        if !v.Charge || IsPower(v.Name, this.UserId) {
+            fns = append(fns, &FuncNames{
+                Name: v.Name,
+                Url:  thisByPlat(this.Platform, "url", &v),
+                Img:  thisByPlat(this.Platform, "img", &v),
+            })
+        }
+    }
+    return fns
+>>>>>>> master
 }
 
 //
 func thisByPlat(platform, name string, bcv *initjson.BaseFunc) (res string) {
-	switch platform {
-	case "APP":
-		switch name {
-		case "url":
-			res = bcv.APP.Url
-		case "img":
-			res = bcv.APP.Img
-		}
-	case "WX":
-		switch name {
-		case "url":
-			res = bcv.WX.Url
-		case "img":
-			res = bcv.WX.Img
-		}
-	default:
-		switch name {
-		case "url":
-			res = bcv.PC.Url
-		case "img":
-			res = bcv.PC.Img
-		}
-	}
-	return
+    switch platform {
+    case "APP":
+        switch name {
+        case "url":
+            res = bcv.APP.Url
+        case "img":
+            res = bcv.APP.Img
+        }
+    case "WX":
+        switch name {
+        case "url":
+            res = bcv.WX.Url
+        case "img":
+            res = bcv.WX.Img
+        }
+    default:
+        switch name {
+        case "url":
+            res = bcv.PC.Url
+        case "img":
+            res = bcv.PC.Img
+        }
+    }
+    return
 }
 
 //查看是否有使用此功能的权限
+<<<<<<< HEAD
 func IsPower(name string, session *httpsession.Session) (b bool) {
 	BigPower := jy.GetBigVipUserBaseMsg( session,*config.Middleground)
 	if BigPower.Status > 0 {
@@ -255,36 +368,143 @@ func SellerTokenDecrypt(token string) (uId, sName string, sid int, desc map[stri
 		err = fmt.Errorf("token参数格式异常")
 		return
 	}
+=======
+func IsPower(name, userId string) (b bool) {
+    BigPower := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+    if BigPower.Status > 0 {
+        switch name {
+        case "企业情报监控":
+            b = BigPower.PowerMap[4] || BigPower.PowerMap[12] || BigPower.PowerMap[13]
+        case "潜在客户挖掘", "客户关注":
+            b = BigPower.PowerMap[7]
+        case "潜在竞争对手/合作伙伴挖掘":
+            b = BigPower.PowerMap[8]
+        case "中标企业预测":
+            b = BigPower.PowerMap[15]
+        case "投标决策分析":
+            b = BigPower.PowerMap[6]
+        case "潜在项目预测":
+            b = BigPower.PowerMap[9]
+        case "周报", "月报", "定制化分析报告":
+            b = BigPower.PowerMap[10]
+        case "订阅管理":
+            b = util.If(BigPower.Pid == "", true, false).(bool)
+        default:
+            b = true
+        }
+    }
+    return b
+}
 
-	uId = param.Get("uid")
-	sName = param.Get("sName")
-	sid = util.IntAll(param.Get("sid"))
+// HasIndustryTag  是否有行业标签
+func HasIndustryTag(userId string, entId int) bool {
+    cacheKey := fmt.Sprintf("industryTag_%s", userId) // 缓存的key
+    cacheTimeout := 60 * 3                            // 缓存的时间-三分钟
+    //// 查缓存
+    if res := redis.Get("newother", cacheKey); res != nil {
+        return res.(bool)
+    }
+    var hasTag bool
+    vipStatus := jy.GetVipState(db.Mysql, db.Mgo, userId, entId)
+    if vipStatus.VipState > 0 || vipStatus.BigMember > 0 || vipStatus.EntMember > 0 { // 仅免费用户查询
+        redis.Put("newother", cacheKey, hasTag, cacheTimeout)
+        return hasTag
+    }
+    // 查免费用户订阅的关键词
+    rs, b := db.Mgo.FindById("user", userId, `"o_jy":1`)
+    if !b || rs == nil || len(*rs) == 0 || (*rs)["o_jy"] == nil {
+        // 没查到关键词
+        redis.Put("newother", cacheKey, hasTag, cacheTimeout)
+        return hasTag
+    }
+    oJY := (*rs)["o_jy"].(map[string]interface{})
+    if oJY["a_key"] == nil || oJY["a_key"].([]interface{}) == nil {
+        return hasTag
+    }
+    keys := util.ObjArrToMapArr(oJY["a_key"].([]interface{}))
+    if len(keys) == 0 {
+        redis.Put("newother", cacheKey, hasTag, cacheTimeout)
+        return hasTag
+    }
+    var valuesList []string
+    for i := 0; i < len(keys); i++ {
+        if key, b := keys[i]["key"]; b {
+            tmp := key.([]interface{})
+            if len(tmp) > 0 {
+                valuesList = append(valuesList, util.ObjToString(tmp[0]))
+            }
+        }
+    }
+    // 查是否是标签用户
+    q := "select id FROM rule_equipment where `key` regexp ?  LIMIT 1"
+    existRs := db.MysqlMedical.SelectBySql(q, strings.Join(valuesList, "|"))
+    if existRs == nil || len(*existRs) == 0 {
+        hasTag = false
+    } else {
+        hasTag = true
+    }
+    redis.Put("newother", cacheKey, hasTag, cacheTimeout) // 存缓存
+    return hasTag
+}
 
-	if uId == "" || sName == "" || sid == 0 || len(desc) == 0 {
-		err = fmt.Errorf("缺少参数")
-		return
-	}
-	return
+func SellerTokenDecrypt(token string) (uId, sName string, sid int, desc map[string]interface{}, err error) {
+    if token == "" {
+        err = fmt.Errorf("缺少token")
+        return
+    }
+    param, err := url.ParseQuery(util.SE.Decode4Hex(token))
+    if err != nil {
+        err = fmt.Errorf("token格式异常")
+        return
+    }
+    //if qutil.Int64All(param.Get("t")) < time.Now().Unix()-int64(60*5) {
+    //	err = fmt.Errorf("链接已失效")
+    //	return
+    //}
+    //取参数
+    err = json.Unmarshal([]byte(param.Get("desc")), &desc)
+    if err != nil {
+        err = fmt.Errorf("token参数格式异常")
+        return
+    }
+>>>>>>> master
+
+    uId = param.Get("uid")
+    sName = param.Get("sName")
+    sid = util.IntAll(param.Get("sid"))
+
+    if uId == "" || sName == "" || sid == 0 || len(desc) == 0 {
+        err = fmt.Errorf("缺少参数")
+        return
+    }
+    return
 }
 
 //用户一次性弹窗信息集合
 type TipInfoStruct struct {
+<<<<<<< HEAD
 	UserId  string
 	DoType  string
 	TipName string
 	Session *httpsession.Session
+=======
+    UserId  string
+    DoType  string
+    TipName string
+>>>>>>> master
 }
 
 //
 func NewTipInfo(userId, doType, tipName string) *TipInfoStruct {
-	return &TipInfoStruct{
-		UserId:  userId,
-		DoType:  doType,
-		TipName: tipName,
-	}
+    return &TipInfoStruct{
+        UserId:  userId,
+        DoType:  doType,
+        TipName: tipName,
+    }
 }
 
 //
+<<<<<<< HEAD
 func (this *TipInfoStruct) GetTipInfo() (flag int) {
 	queryMap := map[string]interface{}{
 		"s_userId": this.UserId,
@@ -315,4 +535,30 @@ func (this *TipInfoStruct) GetTipInfo() (flag int) {
 		}
 	}
 	return 0
+=======
+func (this *TipInfoStruct) GetTipInfo() (flag bool) {
+    queryMap := map[string]interface{}{
+        "s_userId": this.UserId,
+    }
+    if this.DoType == "know" { //我知道了 更新
+        flag = db.Mgo.Update("tip_info", queryMap, map[string]interface{}{
+            "$set": map[string]interface{}{
+                this.TipName: 1,
+                fmt.Sprintf("l_%s_updatetime", this.TipName): time.Now().Unix(),
+            },
+        }, true, false)
+    } else { //查询是否提示弹框
+        //判断是否严重用户注册时间
+        if config.Config.TipInfo[this.TipName] > 0 {
+            userBase := jy.GetBigVipUserBaseMsg(this.UserId, db.Mysql, db.Mgo)
+            //此时间点后注册的新用户
+            if userBase.Registedate > config.Config.TipInfo[this.TipName] {
+                return true
+            }
+        }
+        queryMap[this.TipName] = 1
+        flag = db.Mgo.Count("tip_info", queryMap) > 0
+    }
+    return flag
+>>>>>>> master
 }

+ 7 - 0
src/jfw/modules/publicapply/src/userbase/service/service.go

@@ -84,6 +84,7 @@ func (this *ServiceStruct) IndustryTag() {
 	token := this.GetString("token")
 	var userId string
 	var err error
+	var entId int
 	if token != "" {
 		userId, _, _, _, err = entity.SellerTokenDecrypt(token)
 		if err != nil {
@@ -92,13 +93,19 @@ func (this *ServiceStruct) IndustryTag() {
 		}
 	} else {
 		userId, _ = this.GetSession("userId").(string)
+		entId = qu.IntAll(this.GetSession("entId"))
+
 	}
 	defer qu.Catch()
 	r := func() Result {
 		if this.Method() != "POST" {
 			return Result{Data: nil, Error_msg: Error_msg_1005}
 		}
+<<<<<<< HEAD
 		return Result{Data: entity.HasIndustryTag(this.Session(), userId)}
+=======
+		return Result{Data: entity.HasIndustryTag(userId, entId)}
+>>>>>>> master
 	}()
 	this.ServeJson(r)
 }

+ 229 - 0
src/jfw/public/dataexport.go

@@ -0,0 +1,229 @@
+package public
+
+import (
+	"fmt"
+	"jfw/config"
+	"jfw/modules/common/src/qfw/util/jy"
+	"log"
+	"qfw/util"
+	"qfw/util/dataexport"
+	"qfw/util/mail"
+	"strings"
+	"sync"
+	"time"
+)
+
+var ExConf *DataexportConfig
+
+//价格配置文件
+type DataexportConfig struct {
+	MsgMaxCount int  `json:"msgMaxCount"`
+	Font        Font `json:"font"`
+}
+
+type Font struct {
+	Enabled                 bool   `json:"enabled"`
+	ConvertVersionDefault   string `json:"convertVersionDefault"`
+	UnConvertVersionDefault string `json:"unConvertVersionDefault"`
+	MappingFileExt          string `json:"mappingFileExt"`
+	MappingFilePath         string `json:"mappingFilePath"`
+	RedisPool               string `json:"redisPool"`
+	RedisKey                string `json:"redisKey"`
+}
+
+func init() {
+	util.ReadConfig("./dataexport.json", &ExConf)
+}
+
+//发送邮箱验证码
+func SendMailIdentCode(to, code string, auth []*mail.GmailAuth) bool {
+	html := fmt.Sprintf(`<div>
+		<div>
+			%s,您好!
+		</div>
+		<div style="padding: 20px 70px 10px 70px;">
+			<p>您正在进行导出邮箱地址验证,请在邮件验证码输入框输入下方验证码:</p>
+			<span style="font-weight: bold;font-size: x-large;">%s</span>
+			<p>请勿向任何人泄露您收到的验证码。</p>
+			<p>如果您没有使用剑鱼标讯,请忽略此邮件。</p>
+			<p>此为系统邮件,请勿回复。</p>
+			<p>如有疑问,请联系客服 400-108-6670。</p>
+		</div>
+		<div>
+			<p>此致</p>
+			<p>剑鱼标讯</p>
+		</div>
+	</div>`, to, code)
+
+	for k, v := range auth {
+		if mail.GSendMail("剑鱼标讯", to, "", "", "剑鱼标讯邮箱校验", html, "", "", v) {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件成功", v.User))
+			return true
+		}
+		if k < len(auth)-1 {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件失败!3s后使用其他邮箱尝试", v.User))
+		} else {
+			log.Println(to, fmt.Sprintf("使用%s发送邮件失败!", v.User))
+		}
+		time.Sleep(time.Second * 3)
+	}
+
+	return false
+}
+
+var finaceLock *sync.Mutex = &sync.Mutex{}
+
+func GetWaitPayToken(orderid int64, order_money int, ordercode, payway, userid string) string {
+	return util.GetMd5String(fmt.Sprintf("%d_%d_%s_%s_%s", orderid, order_money, ordercode, payway, userid))
+}
+
+/*
+	获取-筛选条件-金额
+*/
+func GetPriceDes_SieveCondition(minPrice, maxPrice string) string {
+	des := ""
+	unit := "万元"
+	if minPrice != "" && maxPrice != "" {
+		des = minPrice + unit + "-" + maxPrice + unit
+	} else if minPrice != "" {
+		des = "大于" + minPrice + unit
+	} else if maxPrice != "" {
+		des = "小于" + maxPrice + unit
+	}
+	return des
+}
+
+//招标数据导出筛选
+type BidSearchExport struct {
+	Keywords        string //搜索词
+	Publishtime     string //发布时间
+	Area            string //地区
+	Subtype         string //信息类型
+	Minprice        string //最低价格
+	Maxprice        string //最高价格
+	Industry        string //选中的行业
+	SelectType      string //标题 or 全文
+	Winner          string //中标单位
+	Buyerclass      string //采购单位行业
+	Hasbuyertel     string //是否有采购电话
+	Haswinnertel    string //是否有中标电话
+	SelectIds       string //选择单条信息id
+	Notkey          string //排除词 排除词(副:五组,每组最多15个字符)
+	FileExists      string //是否有附件
+	City            string //城市
+	BidField        string // 领域化数据: 0101 医疗
+	SearchGroup     int    // 搜索分组:默认0:全部;1:招标采购公告;2:超前项目
+	SearchMode      int    // 搜索模式:0:精准搜索;1:模糊搜索
+	WordsMode       int    // 搜索关键词模式;默认0:包含所有,1:包含任意
+	AdditionalWords string // 关键词:附加关键词(副:五组,每组最多15个字符)
+}
+
+func (this *BidSearchExport) PassBidSearchExport() (returnData map[string]interface{}) {
+	defer util.Catch()
+	areaSave, industrySave, citySave := []string{}, []string{}, []string{}
+	winnerSave, buyerclassSave := []string{}, []string{}
+	publishtimeSave := this.Publishtime
+	if len(this.Area) > 0 {
+		areaSave = strings.Split(this.Area, ",")
+	}
+	if this.City != "" {
+		citySave = strings.Split(this.City, ",")
+	}
+	if len(this.Industry) > 0 {
+		industrySave = strings.Split(this.Industry, ",")
+	}
+	if len(this.Buyerclass) > 0 {
+		buyerclassSave = strings.Split(this.Buyerclass, ",")
+	}
+
+	if len(this.Winner) > 0 {
+		winnerSave = strings.Split(this.Winner, ",")
+	}
+
+	KeyWordSave := []dataexport.KeyWord{}
+	if len(this.Keywords) > 0 || len(this.AdditionalWords) > 0 {
+		_, _, keywords := jy.InterceptSearchKW(this.Keywords, util.IntAllDef(config.Sysconfig["keywordsLimit"], 35), len(this.Industry) == 0)
+		keywords = strings.Replace(keywords, "+", " ", -1)
+		excludes := []string{}    // 排除词
+		appendWords := []string{} // 附加词
+		//排除词  每组排除词不能超过15个字符
+		if this.Notkey != "" && len(strings.Split(this.Notkey, ",")) > 0 {
+			for _, ak := range strings.Split(this.Notkey, ",") {
+				if len([]rune(ak)) > 15 {
+					excludes = append(excludes, string([]rune(ak)[:15]))
+				} else {
+					excludes = append(excludes, ak)
+				}
+			}
+		}
+		//附加词 每组附加词不能超过15个字符
+		if this.AdditionalWords != "" && len(strings.Split(this.AdditionalWords, ",")) > 0 {
+			for _, ak := range strings.Split(this.AdditionalWords, ",") {
+				if len([]rune(ak)) > 15 {
+					appendWords = append(appendWords, string([]rune(ak)[:15]))
+				} else {
+					appendWords = append(appendWords, ak)
+				}
+			}
+		}
+		KeyWordSave = append(KeyWordSave, dataexport.KeyWord{Keyword: keywords, Exclude: excludes, Appended: appendWords})
+	}
+
+	//时间
+	now := time.Now()
+	if this.Publishtime == "lately-7" { //最近7天
+		starttime := fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Unix())
+		publishtimeSave = fmt.Sprintf("%s_%d", starttime, now.Unix())
+	} else if this.Publishtime == "lately-30" { //最近30天
+		starttime := fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Unix())
+		publishtimeSave = fmt.Sprintf("%s_%d", starttime, now.Unix())
+	} else if this.Publishtime == "thisyear" { //去年
+		starttime := fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+		endtime := fmt.Sprint(now.Unix())
+		publishtimeSave = fmt.Sprintf("%s_%s", starttime, endtime)
+	} else if this.Publishtime == "threeyear" { //近三年
+		starttime := fmt.Sprint(time.Date(now.Year()-3, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+		endtime := fmt.Sprint(now.Unix())
+		publishtimeSave = fmt.Sprintf("%s_%s", starttime, endtime)
+	} else if this.Publishtime == "fiveyear" { //近五年
+		starttime := fmt.Sprint(time.Date(now.Year()-5, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+		endtime := fmt.Sprint(now.Unix())
+		publishtimeSave = fmt.Sprintf("%s_%s", starttime, endtime)
+	}
+	returnData = map[string]interface{}{
+		"keywords":     KeyWordSave,
+		"publishtime":  publishtimeSave,
+		"area":         areaSave,
+		"city":         citySave,
+		"subtype":      this.Subtype,
+		"minprice":     this.Minprice,
+		"maxprice":     this.Maxprice,
+		"industry":     industrySave,
+		"selectType":   this.SelectType,
+		"buyerclass":   buyerclassSave,
+		"winner":       winnerSave,
+		"hasBuyertel":  this.Hasbuyertel,
+		"hasWinnertel": this.Haswinnertel,
+		"fileExists":   this.FileExists,
+		"comeintime":   now.Unix(),
+		"bid_field":    this.BidField,
+		"searchGroup":  this.SearchGroup,
+		"searchMode":   this.SearchMode,
+		"wordsMode":    this.WordsMode,
+	}
+	//选择信息id
+	if this.SelectIds != "" {
+		ids := []string{}
+		for _, encodeId := range strings.Split(this.SelectIds, ",") {
+			if tmp := util.CommonDecodeArticle("content", encodeId); len(tmp) > 0 {
+				if id := tmp[0]; id != "" {
+					ids = append(ids, id)
+				}
+			}
+		}
+		if len(ids) > 0 {
+			returnData["selectIds"] = ids
+		}
+	}
+	return returnData
+}

+ 465 - 35
src/web/staticres/css/dev2/biddingSearch.css

@@ -15,15 +15,16 @@
 /*白色字体*/
 #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 {
   height: inherit;
   box-sizing: border-box;
-  padding: 24px 0 24px 110px;
+  /* padding: 24px 0 24px 110px; */
 }
 
 #searchInner .searchHeader .searchHeader-container .control-tabBtn {
@@ -87,43 +88,54 @@
 
 #searchInner .searchHeader .searchHeader-container .searchInput {
   /*搜索框*/
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+#searchInner .searchHeader .searchHeader-container .searchInput .searchInput-left{
+  display: flex;
+  align-items: center;
+  flex: 1;
 }
 
 #searchInner .searchHeader .searchHeader-container .searchInput form {
   float: left;
   position: relative;
+  margin-top: 4px;
+  flex-shrink: 0;
 }
 
 #searchInner .searchHeader .searchHeader-container .searchInput form input[type='search'] {
   float: left;
-  width: 540px;
-  height: 42px;
+  width: 448px;
+  height: 36px;
   box-sizing: border-box;
-  padding-left: 58px;
+  padding-left: 34px;
   padding-right:45px;
-  background: #fff url("/images/biddingSearch/search-icon1.png") 18px center no-repeat;
+  background: #fff url("/images/biddingSearch/bidding-search.png") 10px center no-repeat;
   border: 2px solid #2cb7ca;
   font-size: 14px;
-	border-top-left-radius: 4px;
-    border-bottom-left-radius: 4px;
+	border-top-left-radius: 8px;
+  border-bottom-left-radius: 8px;
+  background-size: 20px 20px;
 }
 
 
-@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'] {
   float: left;
-  width: 100px;
-  height: 42px;
+  width: 80px;
+  height: 36px;
   color: #ffffff;
   background-color: #2cb7ca;
   text-align: center;
-  font-size: 18px;
+  font-size: 16px;
   border: 2px solid #2cb7ca;
   border-left: none;
   cursor: pointer;
@@ -131,17 +143,17 @@
 
 #searchInner .searchHeader .searchHeader-container .searchInput form input[type='button'] {
   float: left;
-  width: 100px;
-  height: 42px;
+  width: 80px;
+  height: 36px;
   color: #ffffff;
   background-color: #2cb7ca;
   text-align: center;
-  font-size: 18px;
+  font-size: 16px;
   border: 2px solid #2cb7ca;
   border-left: none;
   cursor: pointer;
-    border-top-right-radius: 4px;
-    border-bottom-right-radius: 4px;
+    border-top-right-radius: 8px;
+    border-bottom-right-radius: 8px;
 }
 
 #searchInner .searchHeader .searchHeader-container .searchInput form .searchSlideText {
@@ -378,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;
@@ -629,7 +641,7 @@ border-radius:2px;
   vertical-align: middle;
   margin-top: 2px;
   margin-right: 10px;
-  margin-left: 8px !important;
+  margin-left: 2px !important;
 }
 
 #searchInner .searchControl .searchTender .information .info-content span {
@@ -704,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;*/
 }
 
@@ -748,6 +760,7 @@ position: absolute;
   background-color: transparent;
   font-size:14px;
   display:flex;
+  justify-content: flex-end;
 }
 #searchInner .right-tabBtn-superSearch{
   width: 265px;
@@ -765,12 +778,13 @@ position: absolute;
   border-radius: 2px;
   background-color: transparent;
   cursor: pointer;
+  flex-shrink: 0;
 }
 
 #searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(1) {
+  width: 100px!important;
   background: transparent url("/images/biddingSearch/tab-icon4.png") 10px center no-repeat;
   background-size: 16px 14px;
-/*margin-right:20px;*/
 }
 
 #searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(1).active {
@@ -780,20 +794,45 @@ position: absolute;
 }
 
 #searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(2) {
+  width: 100px!important;
+  background: transparent url("/images/biddingSearch/tab-icon5.png") 10px center no-repeat;
+  background-size: 20px 20px;
+}
+
+#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(2).active {
+  background: #fff url("/images/biddingSearch/tab-icon6.png") 10px center no-repeat;
+  color: #2cb7ca;
+  background-size: 20px 20px;
+}
+
+#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(3) {
   background: transparent url("/images/biddingSearch/tab-icon2.png") 10px center no-repeat;
   background-size: 16px 14px;
 }
 
-#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(2).active {
+#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(3).active {
   background: #fff url("/images/biddingSearch/tab-icon1.png") 10px center no-repeat;
   color: #2cb7ca;
   background-size: 16px 14px;
 }
 
-#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(3) {
+#searchInner .searchControl .seaTender-inner .tabTitle .right-tabBtn button:nth-of-type(4) {
   background: transparent url("/images/biddingSearch/icons-export.png") 10px center no-repeat;
   background-size: 18px 16px;
 }
+#searchInner .tab-detail-list{
+  position: relative;
+}
+#searchInner .tab-detail-list::after{
+  position: absolute;
+  content: '';
+  top: -8px;
+  right: -4px;
+  width: 32px;
+  height: 14px;
+  background: url('/images/biddingSearch/VIP.png') no-repeat right center;
+  background-size: contain;
+}
 
 #right-export{
 	width: 100px !important;
@@ -822,7 +861,7 @@ position: absolute;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li {
-  padding: 15px 0px 0;
+  /* padding: 15px 0px 0; */
   overflow: hidden;
   font-size: 16px;
 }
@@ -830,8 +869,9 @@ position: absolute;
   background-color: #F5F6F7;
   box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.05);
 }
+
 #searchInner .searchControl .seaTender-inner .tabContainer-2 .lucene li {
-  padding: 15px 0px 0px;
+  /* padding: 15px 0px 0px; */
   overflow: hidden;
   font-size: 16px;
 }
@@ -847,12 +887,12 @@ position: absolute;
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .liLuceneList {
   border-bottom: 1px solid #EBEBEB;
   overflow: hidden;
-  padding:0px 15px 15px;
-width:1200px;
+  width:1200px;
+  padding: 16px;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer-2 .lucene li .liLuceneList {
-	padding: 0px 15px 0;
+	/* padding: 0px 15px 0; */
 }
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-left {
   float: left;
@@ -917,9 +957,9 @@ width:1200px;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-field{
-  float: left;
+  /* float: left;
   margin: 0 0 10px 22px;
-  width: calc(100% - 34px);
+  width: calc(100% - 34px); */
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-field .nowrap{
@@ -945,7 +985,7 @@ width:1200px;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-field>div{
-  padding-bottom: 10px;
+  /* padding-bottom: 10px; */
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-field>div:nth-child(1){
@@ -962,7 +1002,7 @@ width:1200px;
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-field>div:last-child{
-  padding-bottom: 8px;
+  /* padding-bottom: 8px; */
 }
 
 #searchInner .searchControl .seaTender-inner .tabContainer .lucene li .luce-right a {
@@ -1266,7 +1306,7 @@ width:1200px;
 .haveFile{
   padding: 0px 8px;
   margin: 4px 0 0 15px;
-  width: 52px;
+  /* width: 52px; */
   height: 20px;
   border-radius: 4px;
   border: 1px solid #2CB7CA;
@@ -1275,3 +1315,393 @@ width:1200px;
   color: #2CB7CA;
   line-height: 18px;
 }
+.search-tabs{
+  padding: 0 16px;
+  border-bottom: 1px solid #ECECEC;
+}
+.search-tabs .search-tab-item{
+  display: inline-block;
+  height: 48px;
+  padding: 12px 16px 10px;
+  font-size: 16px;
+  line-height: 24px;
+  color: #686868;
+  cursor: pointer;
+}
+.search-tabs .search-tab-item.tab-active{
+  position: relative;
+  color: #2CB7CA;
+}
+.search-tabs .search-tab-item.tab-active::after{
+  position: absolute;
+  content: '';
+  bottom: 0;
+  left: 50%;
+  width: 32px;
+  height: 2px;
+  transform: translateX(-50%);
+  background: #2CB7CA;
+}
+.search-tabs .search-tab-item.badge-recommend{
+  position: relative;
+}
+.search-tabs .search-tab-item.badge-recommend::before{
+  position: absolute;
+  content: '推荐';
+  top: 0;
+  right: -8px;
+  width: 36px;
+  height: 16px;
+  line-height: 16px;
+  text-align: center;
+  background: #FF3A20;
+  border-radius: 10px 10px 10px 0;
+  color: #fff;
+  font-size: 12px;
+}
+.in-iframe[data-page-name=supsearch] #searchInner .searchHeader .searchHeader-container{
+  padding-right: 0;
+}
+.searchInput{
+  padding: 16px 24px 16px 32px;
+}
+.search-type{
+  position: relative;
+  margin-left: 16px;
+  color: #2CB7CA;
+  font-size: 14px;
+  line-height: 22px;
+  cursor: pointer;
+  flex-shrink: 0;
+}
+.search-type .icon-caret-top-gold,
+.search-type .icon-caret-bottom-gold
+{
+  display: inline-block;
+  width: 16px;
+  height: 16px;
+  cursor: pointer;
+  vertical-align: middle;
+}
+.search-type .icon-caret-top-gold {
+  background: url('/images/biddingSearch/icon-caret-top-gold.png') no-repeat center;
+  background-size: contain;
+}
+.search-type .icon-caret-bottom-gold {
+  background: url('/images/biddingSearch/icon-caret-bottom-gold.png') no-repeat center;
+  background-size: contain;
+}
+.search-type .search-type-dialog{
+  position: absolute;
+  bottom: -70px;
+  left: 50%;
+  width: 104px;
+  padding: 4px 0;
+  border: 1px solid #2CB7CA;
+  border-radius: 4px;
+  transform: translateX(-50%);
+  overflow: hidden;
+  z-index: 9;
+}
+.search-type .s-t-d-item{
+  padding: 4px 16px;
+  font-size: 14px;
+  line-height: 22px;
+  color: #1D1D1D;
+  background: #fff;
+}
+.search-type .s-t-d-item.selected,
+.search-type .s-t-d-item:hover{
+  background: #ECECEC;
+}
+.checkbox-keyword{
+  margin-left: 16px;
+  flex-shrink: 0;
+}
+.checkbox-keyword .search-list-checkbox{
+  padding-left: 20px;
+  cursor: pointer;
+  background: url(/images/biddingSearch/icon-checkbox.png) no-repeat center left;
+  background-size: 14px 14px;
+  border: 0;
+  font-size: 14px;
+  vertical-align: middle;
+}
+.checkbox-keyword .search-list-checkbox.checkbox-checked{
+  background: url(/images/biddingSearch/icon-checked.png) no-repeat center left;
+  background-size: 14px 14px;
+}
+.tooltip-help-class{
+  width: 360px;
+  padding: 16px!important;
+  background: rgba(0, 0, 0, 0.75)!important;
+  border-radius: 4px!important;
+}
+.el-tooltip__popper .popper__arrow{
+  opacity: 0.85!important;
+}
+.tooltip-help-btn{
+  width: 15px;
+  height: 15px;
+  margin: 0 4px;
+  cursor: pointer;
+  vertical-align: middle;
+}
+.tooltip-slot-content{
+  text-align: justify;
+  font-size: 12px;
+  line-height: 18px;
+}
+.add-keyword-input{
+  width: auto!important;
+}
+.add-keyword-input > .el-input__inner{
+  width: 280px;
+  height: 30px;
+  line-height: 30px;
+  border: 1px solid #E0E0E0;
+  border-radius: 4px;
+}
+.keyword-input-container{
+  display: flex;
+  align-items: center;
+  padding: 0 32px 24px;
+  flex-wrap: wrap;
+}
+.add-keyword-container{
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+}
+.add-keyword-btn{
+  margin-left: 8px;
+  font-size: 14px;
+  line-height: 22px;
+  color: #999999;
+  cursor: pointer;
+}
+.add-keyword-btn.focus{
+  color: #2CB7CA;
+}
+.add-keyword-tags{
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+}
+.add-keyword-tags .el-tag{
+  margin-top: 6px;
+  height: 24px;
+  line-height: 22px;
+  padding: 0 8px;
+  background: #F5F6F7;
+  border: 1px solid #ECECEC;
+  border-radius: 4px;
+  margin-right: 8px;
+  color: #1D1D1D;
+  font-size: 14px;
+}
+.add-keyword-tags .el-tag .el-tag__close{
+  color: #AAAAAA;
+}
+.add-keyword-tags .el-tag:hover{
+  color: #2CB7CA;
+  border: 1px solid #2ABED1;
+  background: #fff;
+}
+.add-keyword-tags .el-tag:hover .el-tag__close{
+  background-color: transparent;
+  color: #2CB7CA;
+}
+.keyword-radio-group {
+  margin-left: 16px;
+  margin-top: 6px;
+  display: flex!important;
+}
+.keyword-radio-group .el-radio__label{
+  padding-left: 6px;
+}
+.keyword-radio-group  .el-radio{
+  display: flex;
+  align-items: center;
+  margin-right: 8px;
+}
+.keyword-radio-group .el-radio__input.is-checked+.el-radio__label{
+  color: #686868;
+}
+/* 标讯列表新样式 */
+.liLuceneList {
+  display: flex;
+}
+.liLuceneList .custom-checkbox{
+  float: none;
+  flex-shrink: 0;
+}
+.liLuceneList .list-container{
+  padding-left: 16px;
+  flex: 1;
+  width: calc(100% - 32px);
+}
+.liLuceneList .bid-list-title{
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.liLuceneList .list-title-flex {
+  display: flex;
+}
+.liLuceneList .list-title-flex > a{
+  text-overflow: ellipsis;
+  overflow: hidden;
+  white-space: nowrap;
+  margin-right: 60px!important;
+}
+.liLuceneList .list-title-flex .visited-hd{
+  margin-right: 8px;
+  font-size: 16px;
+  line-height: 24px;
+  color: #1D1D1D;
+  text-decoration: none;
+}
+.liLuceneList .bid-list-title .com-time{
+  color: #999999;
+  font-size: 12px;
+  line-height: 18px;
+  flex-shrink: 0;
+}
+#searchInner .searchControl .seaTender-inner .tabContainer .lucene li:hover .list-title-flex > a,
+#searchInner .searchControl .seaTender-inner .tabContainer .lucene li:hover .list-title-flex > em
+{
+  /* color: #2CB7CA!important; */
+}
+.liLuceneList .bid-list-content {
+  padding: 8px 120px 0 0;
+  font-size: 14px;
+  line-height: 22px;
+  color: #686868;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  white-space: nowrap;
+  text-align: justify
+}
+.liLuceneList .bid-list-tags{
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-top: 8px;
+}
+.liLuceneList .bid-list-tags .tags-item{
+  display: inline-block;
+  padding: 1px 8px;
+  line-height: 18px;
+  font-size: 12px;
+  border-radius: 4px;
+  margin-right: 8px;
+  background: #F5F5FB;
+  color: #686868;
+  box-sizing: border-box;
+  border: 1px solid #ECECEC;
+}
+.liLuceneList .bid-list-tags .tags-item.tags-publish{
+  color: #FF3A20;
+  background: rgba(254, 115, 122, 0.16);
+}
+.liLuceneList .tags-item.tags-file{
+  color: #2CB7CA;
+  background: #fff;
+  border: 1px solid #2CB7CA;
+}
+.liLuceneList .bid-list-tags .icon-collect{
+  position: relative;
+  width: 54px;
+  background-size: 20px 20px;
+  background-position: left center;
+}
+.liLuceneList .bid-list-tags .icon-collect::after{
+  position: absolute;
+  content: '收藏';
+  left: 24px;
+  width: 32px;
+  font-size: 14px;
+  line-height: 22px;
+  color: #1D1D1D;
+}
+.liLuceneList .bid-list-tags .icon-collect.checked{
+  width: 68px;
+}
+.liLuceneList .bid-list-tags .icon-collect.checked::after{
+  position: absolute;
+  content: '已收藏';
+  left: 24px;
+  width: 48px;
+  font-size: 14px;
+  line-height: 22px;
+  color: #1D1D1D;
+}
+.liLuceneList  .luce-field{
+  margin-top: 16px;
+}
+/* .liLuceneList .bid-detail-info{
+  padding-top: 8px;
+} */
+.liLuceneList .bid-detail-info .d-i-item{
+  margin-top: 8px;
+  font-size: 14px;
+  line-height: 22px;
+  color: #686868;
+}
+.liLuceneList .bid-detail-info .d-i-item:nth-child(1) {
+  margin-top: 16px;
+}
+.liLuceneList .bid-detail-info .d-i-item > span{
+  margin-right: 32px;
+  color: #1d1d1d;
+}
+.liLuceneList .bid-detail-info .d-i-item-label{
+  color: #686868;
+}
+.highlight-text{
+  color: #2cb7ca !important;
+  cursor: pointer;
+}
+.highlight-text:hover,
+.highlight-text:active,
+.highlight-text:focus
+{
+  text-decoration: none;
+}
+.over-run-tips{
+  position: absolute;
+  top: 30px;
+  right: 20px;
+  color: #686868;
+  text-align: right;
+  font-size: 14px;
+  line-height: 22px;
+}
+.notkey-component .el-input.is-disabled .el-input__inner{
+  cursor: text!important;
+  background-color: #fff;
+}
+.q-mark-buyer{
+  width: 16px;
+  height: 16px;
+}
+.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;
+}

+ 21 - 1
src/web/staticres/css/dev2/newBidSearch.css

@@ -168,14 +168,27 @@
   border: 1px solid #E0E0E0;
   border-radius: 3px;
   background-color: #fff;
-  margin: 8px 16px 0 0!important;
+  margin: 4px 0 0 0!important;
 }
 .all-text-checkbox{
   margin: 4px 16px 0 0!important;
 }
 .check-all{
+  position: relative;
   margin: 16px 0 0 15px!important;
 }
+.check-all.custom-checkbox:checked::before,
+.check-all::before{
+  position: absolute;
+  content: '全选';
+  left: 28px;
+  width: 40px;
+  height: 24px;
+  top: 50%;
+  transform: translateY(-50%);
+  z-index: 9;
+  font-size: 16px;
+}
 .custom-checkbox:checked{
   width: 14px;
   height: 14px;
@@ -186,6 +199,13 @@
 .custom-checkbox:checked:disabled{
   opacity: 0.5;
 }
+.tab-bid-count{
+  float: left;
+  margin: 12px 0 0 60px;
+  font-size: 14px;
+  color: #686868;
+  line-height: 22px;
+}
 #bid-collect{
   width: 100px!important;
   background: transparent url(/images/collect.png) 10px center no-repeat;

+ 5 - 1
src/web/staticres/css/dev2/superSearch-inside.css

@@ -145,6 +145,8 @@
 	        transform: scale(1.2);
 }
 .j-clearicon{
+  width: 18px;
+  height: 18px;
 	right:118px !important;
 }
 .lucene-table tr{
@@ -274,12 +276,14 @@
   color: #999!important;
 }
 .publish-button {
-  margin-left: 40px;
+  margin-left: 24px;
 }
 .publish-button .el-button--primary {
   background-color: #2cb7ca;
   border-color: #2cb7ca;
   color: #fff;
+  padding: 10px 24px!important;
+  border-radius: 8px;
 }
 .publish-button .el-badge__content {
   padding: 0 6px;

+ 26 - 8
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;
@@ -166,7 +166,7 @@
   align-items: center;
 }
 .filter-header .f-h-action .action-item{
-  min-width: 90px;
+  padding: 0 10px;
   height: 30px;
   line-height: 30px;
   border-radius: 4px;
@@ -219,6 +219,8 @@
   padding: 0 0 32px!important;
 }
 .has-filter-dialog > .el-dialog__body{
+  width: 686px;
+  overflow: hidden;
   padding: 0!important;
 }
 .has-filter-dialog .el-dialog__headerbtn{
@@ -242,6 +244,7 @@
   flex: 1;
   color: #1D1D1D;
   text-align: left;
+  font-size: 12px;
 }
 .filter-save-item .save-value-bg{
   margin-bottom: 8px;
@@ -256,6 +259,12 @@
 .filter-save-item .save-value-bg > span{
   color: #636467;
 }
+.filter-save-item .search_model{
+  margin-top: 4px;
+  font-size: 12px;
+  line-height: 18px;
+  color: #686868;
+}
 .filter-dialog .btn-group,
 .filter-messagebox .btn-group{
   width: 132px;
@@ -280,10 +289,14 @@
 .filter-data-container{
   max-height: 400px;
   overflow-y: scroll;
+  width: 694px;
 }
 .filter-dialog ::-webkit-scrollbar {
   /*滚动条整体样式*/
-  width: 0px!important;
+  width: 8px!important;
+}
+.filter-data-container {
+  scrollbar-width: thin
 }
 .filter-data-container .filter-data-list{
   margin-top: 12px;
@@ -292,7 +305,7 @@
   border-radius: 4px;
 }
 .filter-data-container  .f-l-title{
-  padding: 8px 0;
+  padding: 8px 0 2px;
 }
 .filter-data-container .f-l-content {
   padding: 12px 0;
@@ -328,19 +341,24 @@
   cursor: pointer;
   background-size: contain;
 }
+.filter-data-list .has-search-model{
+  padding:0 0 8px 22px;
+  font-size: 12px;
+  line-height: 18px;
+}
 .filter-data-list .f-l-title{
   display: flex;
   align-items: center;
   justify-content: space-between;
   cursor: pointer;
   font-size: 14px;
-  min-height: 38px;
+  min-height: 22px;
   color: #1D1D1D;
 }
 .filter-data-list .f-l-title .f-l-title-text{
   flex: 1;
   text-align: justify;
-  font-size: 12px;
+  font-size: 14px;
   line-height: 22px;
   max-width: 582px;
 }

+ 29 - 20
src/web/staticres/css/pc/index.css

@@ -65,13 +65,9 @@
   display: flex;
   align-items: center;
   justify-content: space-between;
-  width: 1200px;
-  height: 80px;
-  margin: auto;
-  border-radius: 8px;
-  border: 1px solid #2CB7CA;
-  margin-top: 20px;
-  padding: 0 16px;
+  width: 960px;
+  height: 24px;
+  margin: 24px auto 0;
 }
 .jy-index .noActive {
   margin-top: 56px;
@@ -81,6 +77,11 @@
   flex-direction: initial;
   align-items: center;
 }
+.jy-index .list-msg .l-msg .words .icon_voice{
+  margin-right: 4px;
+  width: 24px;
+  height: 24px;
+}
 .jy-index .list-msg .l-msg .words:nth-child(2) {
   margin-top: 8px;
 }
@@ -98,14 +99,14 @@
 }
 .jy-index .list-msg .l-msg .words h3 {
   font-size: 16px;
-  font-weight: bold;
-  color: #2CB7CA;
+  font-weight: 400;
+  color: #1D1D1D;
   line-height: 24px;
 }
 .jy-index .list-msg .l-msg .words span {
   font-size: 14px;
   color: #1D1D1D;
-  line-height: 22px;
+  line-height: 24px;
   margin: 0 16px;
 }
 .jy-index .list-msg .l-msg .words span:hover {
@@ -115,7 +116,7 @@
 .jy-index .list-msg .l-msg .words p {
   font-size: 12px;
   color: #999999;
-  line-height: 18px;
+  line-height: 24px;
 }
 .jy-index .list-msg .l-msg .words .isActive {
   margin-left: 15px;
@@ -139,7 +140,7 @@
   object-fit: cover;
 }
 .jy-index-banner .custom-dot {
-  bottom: 48px;
+  bottom: 28px;
 }
 .jy-index-banner .custom-dot .swiper-pagination-bullet{
   width: 40px;
@@ -148,6 +149,14 @@
   background: rgba(0, 0, 0, 0.2);
   border-radius: 10px;
   cursor: pointer;
+  opacity: 1;
+}
+.jy-index-banner .custom-dot.light-swiper-bg-light-color .swiper-pagination-bullet {
+  background: rgba(255, 255, 255, 0.32);
+  opacity: 1;
+}
+.jy-index-banner .custom-dot.light-swiper-bg-light-color .swiper-pagination-bullet-active {
+  background: #fff
 }
 .jy-index-banner .custom-dot .swiper-pagination-bullet-active{
   background: #2CB7CA;
@@ -159,7 +168,7 @@
 .jy-index-search{
   position: relative;
   width: 1200px;
-  margin: -20px auto 0;
+  margin: 32px auto 0;
   background: transparent;
   z-index: 1;
 }
@@ -167,12 +176,12 @@
   position: relative;
   display: flex;
   align-items: center;
-  width: 856px;
+  width: 960px;
   margin: 0 auto;
 }
 
 .jy-index-search .search{
-  width: 856px;
+  width: 960px;
   position: relative;
   text-align: center;
   position: relative;
@@ -180,10 +189,10 @@
 }
 
 .jy-index-search .ser {
-  width: 788px;
+  width: 888px;
   height: 48px;
   padding: 0 24px;
-  border: 1px solid #2ABED1;
+  border: 2px solid #2ABED1;
   border-radius: 8px 0 0 8px;
   color: #1d1d1d;
   box-sizing: border-box;
@@ -260,7 +269,7 @@
 .jy-index-search .tips{
   display: inline-block;
   /* width: 620px; */
-  margin-top: 8px;
+  /* margin-top: 8px; */
   text-align: left;
   font-size: 14px;
   line-height: 22px;
@@ -269,7 +278,7 @@
 }
 .jy-index-search .tips i{
   position: absolute;
-  top: 4px;
+  top: 41px;
   left: 58px;
   display: inline-block;
   width: 14px;
@@ -324,7 +333,7 @@
 
 /* 热点事件 */
 .jy-index-hot{
-  margin-top: 32px;
+  margin-top: 48px;
 }
 .jy-index-hot > .hot-container{
   display: flex;

BIN
src/web/staticres/images/biddingSearch/bidding-search.png


BIN
src/web/staticres/images/biddingSearch/tab-icon5.png


BIN
src/web/staticres/images/biddingSearch/tab-icon6.png


BIN
src/web/staticres/images/pc/icon_voice.png


+ 181 - 4
src/web/staticres/js/common.js

@@ -361,7 +361,7 @@ function keyWordHighlight (value, oldChars, newChar) {
   lastArr = lastArr.sort(function (a, b) {
     return b.length - a.length
   })
-  
+
   if (notStrReplacer.length) {
     for (var j = 0; j < notStrReplacer.length; j++) {
       // 正则替换
@@ -371,7 +371,7 @@ function keyWordHighlight (value, oldChars, newChar) {
   if (lastArr.length) {
     value = value.replace(new RegExp('(' + lastArr.join('|') + ')', 'gmi'), newChar)
   }
-  
+
   return value
 }
 function getWxVersion(){
@@ -845,7 +845,7 @@ function isElementVisible (el) {
 	var rect = el.getBoundingClientRect()
 	var vWidth = window.innerWidth || document.documentElement.clientWidth
 	var vHeight = window.innerHeight || document.documentElement.clientHeight
-  
+
 	if (
 	  rect.right < 0 ||
 	  rect.bottom < 0 ||
@@ -854,6 +854,183 @@ function isElementVisible (el) {
 	) {
 	  return false
 	}
-  
+
 	return true
 }
+
+/**
+ * 适用于快速集成不同搜索页面与顶部导航搜索模块的通信
+ * 1. 监听容器 scroll 事件,更新顶部搜索可见状态
+ * 2. 监听容器 input 事件,更新顶部搜索 input 值
+ * 3. 监听顶部搜索 change 事件,更新页面 input 值
+ * 4. 监听顶部搜索 submit 事件,执行传递的页面 submit 函数
+ * 5. 监听 window.onbeforeunload 事件,销毁上述事件监听
+ * 6. 返回 { off: fn, syncInput: fn } 提供手动 off 函数,用于手动销毁上述事件监听, syncInput 用于手动触发同步 input
+ * 7. 初始化时自动触发 change, scroll 事件更新状态
+ *
+ * // 对应支持的搜索类型
+ * types: [
+ *   {
+ *     label: '招标采购搜索',
+ *     key: 'bidding',
+ *   },
+ *   {
+ *     label: '企业搜索',
+ *     key: 'company'
+ *   },
+ *   {
+ *     label: '采购单位搜索',
+ *     key: 'buyer'
+ *   },
+ *   {
+ *     label: '供应搜索',
+ *     key: 'supplier'
+ *   }
+ * ]
+ * @param config
+ * @param config.el - 当前页面 input 搜索框的父容器
+ * @param config.type - 当前页面搜索类型, 对应 key 见上方类型
+ * @param config.submit - 用于实现当前页面搜索事件函数
+ * @param config.change - 用于实现当前页面输入框值改变事件回调函数,vue页面需要使用该函数更新 v-model 值
+ * @param config.inputSelector - 用于实现当前页面搜索 input 输入框选择器特殊处理,默认 input
+ * @param config.submitSelector - 用于实现当前页面搜索提交按钮选择器特殊处理,默认 button
+ * @returns {{off: fn, syncInput: fn}}
+ */
+function initSearchPageEvent (config) {
+  // el 对应容器 submit 自定义提交函数
+  var el = config.el
+  var inputSelector = config.inputSelector || 'input'
+  var submitSelector = config.submitSelector || 'button'
+  // 默认提交函数处理,仅处理相同 type
+  var searchType = config.type || ''
+  var submit = function (item, next) {
+    if (item.params.type === searchType) {
+      return triggerFormSubmit()
+    } else {
+      return next(item)
+    }
+  }
+  if (typeof config.submit === 'function') {
+    submit = config.submit
+  }
+
+  // 需要的工具函数集
+
+  /**
+   * 触发原表单提交按钮点击事件
+   */
+  function triggerFormSubmit () {
+    $(el).find(submitSelector).trigger('click')
+  }
+
+  /**
+   * 返回当前容器可见状态
+   * @returns {boolean}
+   */
+  function getElementVisible () {
+    if (!$(el).get(0)) return false
+    var elRect = $(el).get(0).getBoundingClientRect()
+    var headerTop = 0
+    if ($("#public-nav").is(':visible')) {
+      headerTop = $("#public-nav").height() || 0
+    }
+    return (elRect.top + elRect.height - headerTop) >= 0
+  }
+
+  /**
+   * 检查并更新顶部搜索模块可见状态
+   */
+  function checkShowSearchModule () {
+    if (window.$BRACE && typeof window.$BRACE.$emit === 'function') {
+      window.$BRACE.$emit('nav-search', {
+        type: 'change',
+        params: {
+          show: !getElementVisible()
+        }
+      })
+    }
+  }
+
+  /**
+   * 监听输入值更新并通知顶部搜索模块更新
+   * @param e
+   */
+  function onChangeInput (e) {
+    var nowInput = e.target.value
+    if (window.$BRACE && typeof window.$BRACE.$emit === 'function') {
+      window.$BRACE.$emit('nav-search', {
+        type: 'change',
+        from: 'page',
+        params: {
+          input: nowInput,
+          type: searchType
+        }
+      })
+    }
+  }
+
+  /**
+   * 监听顶部导航搜索模块输入值 change 事件,同步页面 input
+   * @param data
+   */
+  function onListenNavbarSearchChange (data) {
+    if (data.from === 'nav-search' && data.type === 'change') {
+      if (data.params.input !== $(inputEl).val()) {
+        $(inputEl).val(data.params.input)
+        if (typeof config.change === 'function') {
+          config.change(data.params.input)
+        }
+      }
+    }
+  }
+
+  // 绑定滚动事件,切换顶部搜索模块展示
+  $(window).on('scroll', checkShowSearchModule)
+  checkShowSearchModule()
+
+  // 绑定输入事件,通过钩子更新同步搜索 input 值
+  var inputEl = $(el).find(inputSelector)
+  $(inputEl).on('input', onChangeInput)
+  $(inputEl).trigger('input')
+
+  // 绑定提交事件,接手 submit 提交事件
+  if (typeof submit === 'function') {
+    if (window.$BRACE && typeof window.$BRACE.$on === 'function') {
+      window.$BRACE.$on('nav-search-submit', submit)
+    }
+  }
+  // 监听顶部导航搜索模块输入值 change 事件,同步页面 input
+  try {
+    window.$BRACE.$on('nav-search', onListenNavbarSearchChange)
+  } catch (e) {
+    console.warn(e)
+  }
+
+  // 解绑提交事件
+  function offEvent () {
+    $(window).off('scroll', checkShowSearchModule)
+    $(inputEl).off('input', onChangeInput)
+    try {
+      window.$BRACE.$off('nav-search-submit', submit)
+      window.$BRACE.$off('nav-search', onListenNavbarSearchChange)
+    } catch (e) {
+      console.warn(e)
+    }
+  }
+
+  window.onbeforeunload = function () {
+    offEvent()
+  }
+
+  return {
+    off: function () {
+      offEvent()
+    },
+    syncInput: function (val) {
+      if (typeof val === 'string') {
+        $(inputEl).val(val)
+      }
+      $(inputEl).trigger('input')
+    }
+  }
+}

+ 25 - 4
src/web/staticres/js/ent-search-index-pc.js

@@ -175,7 +175,7 @@ var vm = new Vue({
                 entClass: '', // 单位类型
                 entContact: '', // 联系方式
                 establish:[],//成立时间
-                
+
             },
             listState: {
                 loaded: false, // 是否已经搜索过
@@ -288,6 +288,20 @@ var vm = new Vue({
         // 全选按钮逻辑
         // this.searchTypeChange([], true)
         this.industryTab()
+        /**
+         * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js
+         * 需要在 dom 初始化后调用来监听事件,Vue中需要额外在 input 对应事件额外手动触发事件
+         */
+        if (goTemplateData.inIframe) {
+          this._$SearchEvent = initSearchPageEvent({
+            type: 'company',
+            el: '.search-header-top .input-container',
+            submitSelector: '.search-button',
+            change: (val) => {
+              this.searchContent = val
+            }
+          })
+        }
     },
     methods: {
         industryTab: function() {
@@ -486,7 +500,7 @@ var vm = new Vue({
                             // thisList.push(_this.getTimeDate(10)+'-'+_this.getTimeDate(1))
                             thisList.push('10y-')
                             break;
-                    
+
                         default:
                             break;
                     }
@@ -543,7 +557,7 @@ var vm = new Vue({
                     this.endDate = this.getThisDate(e);
                 }
             }
-            
+
         },
         //成立时间自定义区间搜索按钮
         establishSearch:function () {
@@ -664,6 +678,13 @@ var vm = new Vue({
             Object.assign(this.listState, state)
         },
         getPreSearchList: utils.debounce(function () {
+            /**
+             * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js
+             * 需要在 dom 初始化后调用来监听事件,Vue中需要额外在 input 对应事件额外手动触发事件
+             */
+            if (this._$SearchEvent) {
+              this._$SearchEvent.syncInput()
+            }
             var data = {
                 name: this.searchContent.trim()
             }
@@ -980,4 +1001,4 @@ function baiduEvent(name) {
   } catch (e) {
     console.log('未初始化百度统计')
   }
-}
+}

+ 8 - 3
src/web/staticres/js/login.js

@@ -337,6 +337,7 @@ function checkBigStatus () {
         window.entniche = res.data.entniche // 商机管理用户
         window.fileNum = res.data.fileNum // 超级订阅用户可下载附件次数
         window.isLogin = true // 用于其他页面判断是否已登录
+        window.isNewEntNiche = res.data.entIsNew
         sessionStorage.setItem('bidPower', JSON.stringify(res.data.power))
         if (res.data.memberStatus > 0) {
           $(".myorderDiv.lastBox").show()
@@ -493,15 +494,19 @@ var logic = function(data,num){
       phone: '',
       avatar: data.s_headimage || ''
     })
+    if (typeof window.GuideIntroDialog === 'function') {
+      window.guideIntroDialog = new GuideIntroDialog()
+    }
     try{
       checkBigStatus()
       infoListCss();
       message.init()
       checkCounts()
-      initIndexMsgList()
-      window.guideIntroDialog = new GuideIntroDialog()
+      if (typeof window.initIndexMsgList === 'function') {
+        initIndexMsgList()
+      }
 		} catch (e) {
-      console.error(e)
+      console.warn(e)
     }
 	}
 }

+ 1 - 1
src/web/staticres/js/pc-message-index.js

@@ -1,4 +1,4 @@
-var temp = '<div class="list-msg" v-if="lists.length"><div class="l-msg"><div class="words" v-for="item in lists" :key="item.id"><i v-show="item.isRead == 0"></i><h3 :class="{isActive: item.isRead == 1}">@@item.msg_type@@</h3><span @click="titleGoto(item)">@@item.title@@</span><p>@@item.createtime@@</p></div></div><img @click="gotoUrl" class="r-msg" src="/images/pc/msg-arrow.png"></div>'
+var temp = '<div class="list-msg" v-if="lists.length"><div class="l-msg"><div class="words" v-for="item in lists" :key="item.id"><img class="icon_voice" src="/images/pc/icon_voice.png" v-show="item.isRead == 0" /><h3 :class="{isActive: item.isRead == 1}">@@item.msg_type@@</h3><span @click="titleGoto(item)">@@item.title@@</span><p>@@item.createtime@@</p></div></div></div>'
 
 var vmMesg = new Vue({
   // el: '#vue-message-index-pc',

+ 18 - 0
src/web/staticres/js/pur-search-index-pc.js

@@ -184,6 +184,17 @@ var vm = new Vue({
         this.$on('updatescope', (data) => {
             this.setData.keyList = data
         })
+        /**
+         * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js
+         * 需要在 dom 初始化后调用来监听事件,Vue中需要额外在 input 对应事件额外手动触发事件
+         */
+        if (goTemplateData.inIframe) {
+          this._$SearchEvent = initSearchPageEvent({
+            type: 'buyer',
+            el: '.search-header-top .input-container',
+            submitSelector: '.search-button'
+          })
+        }
     },
     methods: {
         updatescope(data) {
@@ -197,6 +208,13 @@ var vm = new Vue({
         },
         // 采购单位模糊搜索
         getPreSearchList: utils.debounce(function () {
+            /**
+             * 初始化页面搜索框与工作台顶部搜索联动事件函数,详情见对应函数 common.js
+             * 需要在 dom 初始化后调用来监听事件,Vue中需要额外在 input 对应事件额外手动触发事件
+             */
+            if (this._$SearchEvent) {
+              this._$SearchEvent.syncInput()
+            }
             var data = {
                 name: this.searchContent.trim()
             }

+ 85 - 0
src/web/staticres/js/selector/keyword-tags.js

@@ -0,0 +1,85 @@
+var keywordTagsComponentTemplate = `
+  <div class="add-keyword-container">
+    <div class="add-keyword-tags">
+      <el-tag
+        :key="tag"
+        v-for="tag in list"
+        closable
+        :disable-transitions="false"
+        @close="handleClose(tag)">
+        {{tag}}
+      </el-tag>
+    </div>
+    <div v-if="list.length < maxListLength" style="margin-top:6px;">
+      <el-input
+        class="add-keyword-input"
+        type="text"
+        :placeholder="placeholder"
+        v-model="addKeywordVal"
+        :maxlength="maxLength"
+        show-word-limit
+        :disabled="disabled"
+        @keyup.native="onKeyup"
+      ></el-input>
+      <span class="add-keyword-btn" :class="{'focus': addKeywordVal}" @click="addKeyTags">添加</span>
+    </div>
+    <slot name="radio"></slot>
+  </div>
+`
+
+// var keywordTagsComponentTemplate = "\n<div class=\"selector-content select-list-content\" ref=\"selectContainer\">\n    <span class=\"action-button show-more\" @click=\"showMore = !showMore\" v-if=\"needShowMore\">\n        <span class=\"action-text\">{{ showMore ? '\u6536\u8D77' : '\u66F4\u591A' }}</span>\n        <span class=\"el-icon-arrow-down\" :class=\"showMore ? 'rotate180' : ''\"></span>\n    </span>\n    <div class=\"select-group-container\" v-if=\"selectButtonType === 'checkbox'\">\n        <el-checkbox\n            v-for=\"(item, index) in selectList\"\n            :key=\"index\"\n            :name=\"item.value\"\n            ref=\"selectItem\"\n            v-model=\"item.selected\"\n            v-show=\"showAll(item)\"\n            @change=\"changeState(item)\"\n        >{{ item.label }}</el-checkbox>\n    </div>\n    <div class=\"select-group-container\" v-else-if=\"selectButtonType === 'button'\">\n        <div\n            v-for=\"(item, index) in selectList\"\n            :key=\"index\"\n            ref=\"selectItem\"\n            class=\"j-button-item bgc\"\n            v-show=\"showAll(item)\"\n            :class=\"{\n                active: item.selected,\n                all: item.label === selectItemExp.label\n            }\"\n            @click=\"changeState(item)\"\n        >{{ item.label }}</div>\n    </div>\n</div>\n";
+
+var keywordTagsComponent = {
+    name: 'keyword-tags-pc',
+    template: keywordTagsComponentTemplate,
+    props: {
+      placeholder: {
+        type: String,
+        default: '请输入关键词'
+      },
+      // 输入框可输入最大长度
+      maxLength: {
+        type: Number,
+        default: 15
+      },
+      list: {
+        type: Array,
+        default: function () {
+          return []
+        }
+      },
+      // 数组最大长度
+      maxListLength: {
+        type: Number,
+        default: 5
+      },
+      // 输入框是否禁用
+      disabled: Boolean,
+      beforeChange: Function
+    },
+    data: function () {
+      return {
+        addKeywordVal: ''
+      }
+    },
+    mounted: function () {},
+    methods: {
+      addKeyTags: function () {
+        var beforeChange = this.beforeChange()
+        if (!beforeChange) return
+        if (!this.addKeywordVal) return
+        this.list.push(this.addKeywordVal.replace(/\s*$/g,''))
+        console.log(this.list);
+        this.$emit('change', this.list)
+        this.addKeywordVal = ''
+      },
+      handleClose: function (tag) {
+        this.list.splice(this.list.indexOf(tag), 1)
+        this.$emit('change', this.list)
+      },
+      onKeyup: function () {
+        // this.addKeywordVal = this.addKeywordVal.replace(/^\s+|\s+$/g, '')
+        this.addKeywordVal = this.addKeywordVal.replace(/^\s*/g, '')
+      }
+    }
+}

+ 1660 - 0
src/web/staticres/js/superSearch copy.js

@@ -0,0 +1,1660 @@
+var pageSize = 50;
+var nbflag = false;//是否显示的是最新招标数据
+var currentPage = 1;//当前页
+var submitflag = true;
+var tabularflag = "Y";
+$(function() {
+	priceTime();
+	$(".Price-content").find("span:first-child").click(function(){
+		$(this).addClass("active");
+		$(".pricefat").removeClass("active");
+		beforeSubmit();
+	})
+	$(".timer").find("ul li:first-child").click(function(){
+		timeshow = false;
+		$("#starttime").css({"border-color":""});
+		$("#endtime").css({"border-color":""});
+		$("#timebut").hide();
+		$(".timerInput").removeClass("customtime-active");
+		$(this).addClass("active");
+		$(".timerInput").removeClass("active");
+	})
+	//
+	$(".pricebut").click(function(){
+		priceCss();
+		beforeSubmit();
+	})
+	//
+	$("#timebut").click(function(){
+		timeshow=false;
+		$(this).hide();
+		$(".timerInput").removeClass("customtime-active");
+		if($("#starttime").val()==""&&$("#endtime").val()==""){
+			$("#starttime").css({"border-color":""});
+			$("#endtime").css({"border-color":""});
+			$("#timebut").hide();
+			$(".timerInput").removeClass("customtime-active");
+			$("#timerAll").addClass("active");
+			$(".timerInput").removeClass("active");
+		}else{
+			$(".timerInput").addClass("active");
+			$(".timer").find("ul li:first-child").removeClass("active");
+			$(".release-time .timer li").removeClass("active");
+		}
+		beforeSubmit()
+	})
+	//
+	$(".nbprev").click(function(){
+		$(window).scrollTop(0);
+		$('.custom-checkbox.check-all').prop('checked', false)
+		prev();
+	})
+	$(".nbnext").click(function(){
+    	$(window).scrollTop(0);
+    	$('.custom-checkbox.check-all').prop('checked', false)
+		next();
+
+	})
+	//筛选关闭和打开
+	//根据cookie值设置筛选是否显示 移除该需求操作
+	// var rsw = localStorage.getItem("hideorshow");
+	// if(rsw!=null){
+	// 	if(rsw=="D"){
+	// 		$("#screenBtn").addClass("down");
+  //     $(".searchTender").show();
+  //     $('#fold').show()
+	// 	}else{
+	// 		$("#screenBtn").removeClass("down");
+  //     $(".searchTender").hide();
+  //     $('#fold').hide()
+	// 	}
+	// }
+	//记录用户刷选按钮状态
+	$("#screenBtn").click(function(){
+		if($(this).attr("class").indexOf("down")>0){
+      // localStorage.setItem("hideorshow", "D");
+      $('#fold').show()
+		}else{
+      // localStorage.setItem("hideorshow", "U");
+      $('#fold').hide()
+		}
+	})
+	//
+	var iuod = localStorage.getItem("industryuod");
+	if(iuod!=null){
+		if(iuod=="U"){
+			$(".stop").click();
+		}
+	}
+	//
+	$(".stop").click(function(){
+		if($(this).attr("class").indexOf("up")>0){
+			localStorage.setItem("industryuod", "U");
+		}else{
+			localStorage.setItem("industryuod", "D");
+		}
+	})
+	//全文检索和标题检索切换
+	$("#newsclass li:nth-child(2)").click(function(){
+    // searchInnerVue.listState.total = totalPage
+    // 重置全选按钮
+    $('.custom-checkbox.check-all').prop('checked', false)
+		$(".tabContainer-2 .lucene ul").html("");
+		$("#zbSeatchT [name='selectType']").val("all");
+		$("#right-list").addClass("active").siblings().removeClass("active");
+		$("#allnews .lucene").show().siblings().hide();
+		$(".tabContainer-2").hide();
+		currentPage=1;
+		if(submitflag){
+			$(".hasNoData").hide();
+      $(".working").show();
+      // 隐藏页码
+      searchInnerVue.showPage = false
+			$(".tabContainer").css("min-height","600px");
+			selectType = "all";
+			searchOnsubmit();
+      submitflag=false;
+    }
+	})
+	$("#newsclass li:nth-child(1)").click(function(){
+    // 重置全选按钮
+    $('.custom-checkbox.check-all').prop('checked', false)
+		$("#allnews .lucene ul").html("");
+		$("#zbSeatchT [name='selectType']").val("title");
+		$("#right-list").addClass("active").siblings().removeClass("active");
+		$(".tabContainer-2 .lucene").show().siblings().hide();
+		$("#allnews").hide();
+		currentPage=1;
+		if(submitflag){
+			$(".hasNoData").hide();
+      $(".working").show();
+      // 隐藏页码
+      searchInnerVue.showPage = false
+			$(".tabContainer").css("min-height","600px");
+			selectType = "title";
+			searchOnsubmit();
+      submitflag=false;
+		}
+	})
+
+  $('#entsearch, #pursearch, #gysearch').on('click', function () {
+    if($(this).attr('datahref')){
+      location.href= $(this).attr('datahref')
+    }
+
+  })
+})
+//
+function next(){
+	if($(".nbnext").hasClass("disabled")){
+		return false;
+	}
+	$(".hasNoData").hide();
+	$(".working").show();
+	$(".tabContainer").hide();
+	$("#allnews").hide();
+	$(".pagination").hide();
+	currentPage = parseInt($(".pagination-inner").find("span").text())+parseInt(1)
+	if(currentPage==10){
+		$(".nbnext").addClass("disabled");
+	}else if(currentPage==2){
+		$(".nbprev").removeClass("disabled");
+	}
+	if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
+		getNewBids(currentPage);
+	}else{
+		if(!$("#right-table").hasClass("active")){
+			if(secondFlag=="T"){
+				$(".tabContainer").show();
+				$(".hasNoData").hide();
+				$(".nbnext").addClass("disabled");
+				appendDatas(secondList,true,false);
+			}else if(!nbflag&&currentPage<11){
+				getNewBiddings();
+			}else{
+				searchOnsubmit(true);
+			}
+		}else{
+//表格点击下一页
+//			if(secondFlag=="T"){
+//				$(".tabContainer").show();
+//				$(".hasNoData").hide();
+//				$(".nbnext").addClass("disabled");
+//				appendDatas(secondList,true,false);
+//			}else{
+//				getVIPData(true);
+//			}
+		}
+	}
+}
+function prev(){
+	if($(".nbprev").hasClass("disabled")){
+		return false;
+	}
+	$(".hasNoData").hide();
+	$(".working").show();
+	$(".tabContainer").hide();
+	$("#allnews").hide();
+	$(".pagination").hide();
+	currentPage = parseInt($(".pagination-inner").find("span").text())-parseInt(1)
+	if(currentPage==1){
+		$(".nbprev").addClass("disabled");
+	}else if(currentPage<10){
+		$(".nbnext").removeClass("disabled");
+	}
+	if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
+		getNewBids(currentPage);
+	}else{
+		if(!$("#right-table").hasClass("active")){
+			if(secondFlag=="T"){
+				$(".tabContainer").show();
+				$(".hasNoData").hide();
+				//$(".nbnext").addClass("disabled");
+				appendDatas(list,true,false);
+			}else if(!nbflag&&currentPage>0){
+				getNewBiddings();
+			}else{
+				searchOnsubmit(true);
+			}
+		}else{
+//表格点击上一页
+//			getVIPData(true);
+		}
+	}
+}
+
+//取redis里的数据
+function getNewBids(pnum, size){
+	$.post("/jylab/supsearch/getNewBids",{pageNumber:pnum,pageSize: size? size : pageSize, pageType:"", fileExists: $("#zbSeatchT [name='fileExists']").val(),bid_field: $("#zbSeatchT [name='bid_field']").val()},function(r){
+		if(r&&r.list!=null&&r.list.length>0){
+			$(".tabContainer").show();
+			//$(".pagination").show();
+			$(".hasNoData").hide();
+			//$(".pagination-inner").find("span").text(currentPage);
+			if(r.list.length<pageSize||currentPage==10){
+				$(".nbnext").addClass("disabled");
+			}else{
+				$(".nbnext").removeClass("disabled");
+      }
+      searchInnerVue.listState.total = Math.ceil(r.count/pageSize)
+      searchInnerVue.checkPageNumAdd1()
+      if (size) {
+        appendDatas(r.list,false,true, true);
+      } else {
+        appendDatas(r.list,false,true);
+      }
+		}else{
+			submitflag=true;
+			$(".tabContainer").hide();
+			$(".pagination").hide();
+			$(".working").hide();
+      $(".hasNoData").show();
+      // 隐藏页码
+      searchInnerVue.showPage = false
+    }
+    // getBidIsColl()
+	})
+}
+
+////最新招标信息
+function getNewBiddings(num, size){
+	// $("#newsclass").hide();
+	// $("#newsnow").show();
+	if(currentPage==1){
+		$(".nbprev").addClass("disabled");
+	}
+	var param = {
+    pageNumber: num ? num : currentPage,
+    pageSize: size ? size : pageSize,
+    reqType: "lastNews",
+    tabularflag: "Y",
+    searchvalue: $("#zbSeatchT [name='keywords']").val(),
+    area: $("#zbSeatchT [name='area']").val(),
+    subtype: $("#zbSeatchT [name='subtype']").val(),
+    publishtime: $("#zbSeatchT [name='publishtime']").val(),
+    selectType : $("#zbSeatchT [name='selectType']").val() || 'title,content',
+    minprice : $("#zbSeatchT [name='minprice']").val(),
+    maxprice : $("#zbSeatchT [name='maxprice']").val(),
+    industry : $("#zbSeatchT [name='industry']").val(),
+    buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
+    buyertel: $("#zbSeatchT [name='buyertel']").val(),
+    winnertel: $("#zbSeatchT [name='winnertel']").val(),
+    notkey: $(".not-key-input-group input").val().slice(0, 10),
+    fileExists: $("#zbSeatchT [name='fileExists']").val(),
+    city: $("#zbSeatchT [name='city']").val(),
+    bid_field: $("#zbSeatchT [name='bid_field']").val()
+  };
+	$.post("/front/pcAjaxReq",param,function(r){
+		if(r&&r.list!=null&&r.list.length>0){
+      // 计算总页码
+      if (currentPage == 1) {
+        searchInnerVue.listState.total = Math.ceil(r.count/pageSize)
+        searchInnerVue.checkPageNumAdd1()
+      }
+			$(".tabContainer").show();
+			//$(".pagination").show();
+			$(".hasNoData").hide();
+			//$(".pagination-inner").find("span").text(currentPage);
+			if(r.list.length<pageSize||currentPage==10){
+				$(".nbnext").addClass("disabled");
+			}else{
+				$(".nbnext").removeClass("disabled");
+			}
+      if (size && num === 1) {
+			  appendDatas(r.list,true,true, true);
+      } else {
+        appendDatas(r.list,false,false);
+      }
+		}else{
+			if(currentPage>1){
+				$(".nbnext").addClass("disabled");
+				if(currentPage==2){
+					$(".nbprev").addClass("disabled");
+				}
+				currentPage = currentPage-1;
+				return false
+			}
+			submitflag=true;
+			$(".tabContainer").hide();
+			$(".pagination").hide();
+			$(".working").hide();
+      $(".hasNoData").show();
+      // 隐藏页码
+      searchInnerVue.showPage = false
+    }
+	})
+}
+//
+
+function appendDatas(datas,flag,isNew,onlyUpdateTable){
+  // flag // 是否有输入
+  let is_field=$("#zbSeatchT [name='bid_field']").val() //是否是领域化
+  let selectContext=selectType.indexOf('content') > -1 //是否正文搜索
+  console.log('selectType: ' + selectType,',flag: ',flag)
+	var listHtml = '';
+	var tableHtml = '';
+	$(".working").hide();
+  $(".pagination").show();
+  // 显示页码
+  searchInnerVue.showPage = true
+	var searchvalueArray = searchvalue.split("+");
+	$(".pagination-inner").find("span").text(currentPage);
+	if(datas.length<pageSize){
+		$(".nbnext").addClass("disabled");
+	}
+	if(!isNew && typeof(totalPage) != "undefined"){
+		if(currentPage == totalPage){
+			$(".nbnext").addClass("disabled");
+		}else{
+			$(".nbnext").removeClass("disabled");
+		}
+	}
+	//(数据够20条显示查看更多遮罩层)
+	if (currentPage==1){//第一页得时候需要判断 是否显示遮罩层
+		if(datas.length>=20){
+			$(".shade_table").css("display","");
+		}else{
+			$(".shade_table").css("display","none");
+		}
+	}
+	for(var i=0;i<datas.length;i++){
+		var index = (currentPage - 1) * pageSize + i + 1;
+		var title = datas[i].title;
+		var detail = datas[i].detail;
+    var fileExists = datas[i].fileExists
+		if(detail){
+			detail = detail.replace(/[^\{\u4e00-\u9fa5]{1,90}{[^\}\u4e00-\u9fa5]+?}/g,"")
+			if(detail.length>200){
+				detail = detail.substring(0,200)+"..."
+			}
+		}
+		if(flag){
+			title = keyWordHighlight(title,searchvalueArray,"<font class='com-highlight'>$1</font>");
+			title=title.replace(/\<br>/g,"")
+			detail = keyWordHighlight(detail,searchvalueArray,"<font class='com-highlight'>$1</font>");
+		}
+		if(title.length<40){
+				title=title+"<span style='color:#fff;display:none;'>"+Math.random().toString(36).substring(2)+"<span>";
+		}
+		var type = datas[i].subtype;
+		if(typeof(type) == "undefined" || type == null || type == ""){
+			type = datas[i].toptype;
+		}
+		if(typeof(type) == "undefined" || type == null || type == ""){
+			type = datas[i].type;
+			if(type == "bid"){
+				type = "中标";
+				datas[i].stypeadd="ZHB"
+			}else if(type == "tender"){
+				datas[i].stypeadd="ZB"
+				type = "招标";
+			}else{
+				type = "";
+			}
+		}
+
+		if (!onlyUpdateTable){ //是否仅更新table
+			listHtml += '<li>'
+			//if(datas.length==(i+1)){
+			//	listHtml +='<div class="liLuceneList">'
+			//}else{
+				listHtml +='<div class="liLuceneList" style="border-bottom: 1px solid #EBEBEB;">'
+      //}
+      // 标题搜索 选择框
+      if (!selectContext || !flag) {
+        listHtml += '<input class="custom-checkbox title-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
+        listHtml +='<div class="luce-left">'
+		if(datas[i].site == '剑鱼信息发布平台') {
+			listHtml += '<span class="userPublish">用户发布</span>'
+		}
+		listHtml += '<em class="visited-hd">'+index+'.</em>'
+						+'<div class="left-title" style="width:auto;max-width:700px">'
+						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
+        if(fileExists) {
+          listHtml+='<span class="haveFile">'+'有附件'+'</span>'
+        }
+        listHtml+='</div>'
+      }
+      // 全文搜索
+			if(flag && selectContext){
+				listHtml +='<div class="luce-left">'
+				if(datas[i].site == '剑鱼信息发布平台') {
+					listHtml += '<span class="userPublish">用户发布</span>'
+					listHtml += '<em class="visited-hd">'+index+'.</em>'
+						+'<div class="left-title" style="width:auto;max-width:1080px">'
+						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
+				} else {
+					listHtml +='<em class="visited-hd" style="padding-left:30px;">'+index+'.</em>'
+						+'<div class="left-title" style="width:auto;max-width:1080px">'
+						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
+				}
+				if(fileExists) {
+					listHtml+='<span class="haveFile">'+'有附件'+'</span>'
+				}
+				listHtml+='</div>'
+				// 全文搜索选择框
+				listHtml += '<div class="left-content" style="width:100%;padding:0;">'
+					+ '<input class="custom-checkbox all-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
+					+'<a style="float:left;width:calc(100% - 32px)" href="javascript:volid(0);">'+detail+'...</a>'
+					+'</div>'
+			}
+			listHtml += '</div><div class="luce-right">'
+			if($.trim(datas[i].area) != "" && datas[i].area != "A"){
+
+          listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/area/"+datas[i].areaadd+".html')"+'">'+datas[i].area+'</a>';
+			}else{
+				listHtml += '<a href="#" style="display:none;"></a>';
+			}
+			if(typeof(type) != "undefined" && type != null && type != ""){
+				// listHtml += '<a href="/list/stype/'+datas[i].stypeadd+'.html">'+type+'</a>';
+        listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/stype/"+datas[i].stypeadd+".html')"+'">'+type+'</a>';
+			}else{
+				listHtml += '<a href="#" style="display:none;"></a>';
+			}
+			//
+			if(typeof(datas[i].industry) != "undefined" && datas[i].industry != null && datas[i].industry != ""&&!is_field){
+				// listHtml += '<a href="/list/industry/'+datas[i].indadd+'.html">'+datas[i].industry+'</a>';
+        listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/industry/"+datas[i].indadd+".html')"+'">'+datas[i].industry+'</a>';
+			}else{
+				listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
+      }
+      // vipState付费用户显示采购单位类型 免费用户不显示
+      // if(typeof(datas[i].buyerclass) != "undefined" && datas[i].buyerclass != null && datas[i].buyerclass != "" && vipState){
+			// 	listHtml += '<a href="javascript:;">'+datas[i].buyerclass+'</a>';
+			// }else{
+			// 	listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
+			// }
+
+			var amount= getacount(datas[i].bidamount,datas[i].budget)
+			if(amount!=""){
+				listHtml += '<a>'+conversionMoeny(amount)+'</a>';
+			}else{
+				listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
+			}
+
+			//
+			if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
+				var diff = utils.dateFromNow(Number(datas[i].publishtime+"000"));
+				if(diff != null){
+					listHtml += '<span class="com-time">'+diff+'</span>';
+				}
+      }
+      // 是否收藏
+      listHtml += '<i class="icon-collect" dataid="'+datas[i]._id+'"></i>'
+      // 是否山川应用嵌入环境 添加操作按钮
+      var inInjectBI = getParam('report') === 'bi' || (location.href.indexOf('/jylab/bi/index') !== -1)
+      if (inInjectBI) {
+        listHtml += '<button class="bi-report-inject-button" data-id="'+datas[i]._id+'">添加</button>'
+      }
+      listHtml += '</div>'
+
+
+      //领域化展示 商品&采购单位&中标单位
+      if (is_field && !selectContext){
+        listHtml += '<div class="luce-field">'
+        if (typeof(datas[i].purchasing) != "undefined" && datas[i].purchasing != null && datas[i].purchasing != ""){
+          listHtml += '<div class="nowrap"><span>产品</span><span>'+datas[i].purchasing +'</span></div>'
+        }
+
+        let secondLine=''
+        if (typeof(datas[i].buyer) != "undefined" && datas[i].buyer != null && datas[i].buyer != ""){
+          secondLine += '<div class="nowrap"><span>采购单位</span><span>'+datas[i].buyer +'</span></div>'
+        }
+
+        if (typeof(datas[i].s_winner) != "undefined" && datas[i].s_winner != null && datas[i].s_winner != ""){
+          secondLine += '<div class="nowrap"><span>中标单位</span><span>'+datas[i].s_winner +'</span></div>'
+        }
+
+        if (secondLine!=='') {
+          listHtml += '<div class="secondLine">'+secondLine+'</div>'
+        }
+
+        listHtml += '</div>'
+      }
+
+      listHtml += '</div></li>';
+
+			if(i == 5) {
+				listHtml += '<div data-list-ad class="_t3di2018y5"></div>'
+			}
+			if(i == 26) {
+				listHtml += '<div data-list-ad class="_6omliqck79a"></div>'
+			}
+		}
+
+		//表格仅显示前20条信息
+		if (i >= 20||currentPage!=1){
+			continue
+		}
+		tableHtml +='<tr onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank">'
+				+'<td width="48"><div>'+index+'</div></td>'
+		if(typeof(datas[i].projectname) != "undefined" && datas[i].projectname != null && datas[i].projectname != ""){
+			datas[i].projectname = keyWordHighlight(datas[i].projectname,searchvalueArray,"<font class='com-highlight'>$1</font>");
+			tableHtml += '<td class="tt-l" width="315"><div>'+datas[i].projectname+'</div></td>';
+		}else{
+			let title=datas[i].title.replace(/\<br>/g,"")
+			tableHtml += '<td class="tt-l" width="315"><div>'+title+'</div></td>';
+		}
+
+		if(typeof(type) != "undefined" && type != null && type != ""){
+			tableHtml += '<td width="84"><div>'+type+'公告</div></td>';
+		}else{
+			tableHtml += '<td width="84"><div></div></td>';
+		}
+
+		if(typeof(datas[i].budget) != "undefined" && datas[i].budget != null && datas[i].budget != ""){
+      var budget = tableFormatMoney(datas[i].budget, {
+        type: 'number',
+        digit: 2,
+        level: 1
+      })
+			tableHtml += '<td class="tt-r" width="73"><div>'+budget+'</div></td>';
+		}else{
+			tableHtml += '<td class="tt-r" width="73"><div></div></td>';
+		}
+		if(typeof(datas[i].buyer) != "undefined" && datas[i].buyer != null && datas[i].buyer != ""){
+			tableHtml += '<td class="tt-l" width="181"><div>'+datas[i].buyer+'</div></td>';
+		}else{
+			tableHtml += '<td class="tt-l" width="181"><div></div></td>';
+		}
+		if(typeof(datas[i].bidopentime) != "undefined" && datas[i].bidopentime != null && datas[i].bidopentime != ""){
+			var diff = formatDate(Number(datas[i].bidopentime),"l");
+			tableHtml += '<td width="103"><div>'+diff+'</div></td>';
+		}else{
+			tableHtml += '<td width="103"><div></div></td>';
+		}
+		if(typeof(datas[i].winner) != "undefined" && datas[i].winner != null && datas[i].winner != ""){
+			tableHtml += '<td class="tt-l" width="174"><div>'+datas[i].winner+'</div></td>';
+		}else{
+			tableHtml += '<td class="tt-l" width="174"><div></div></td>';
+		}
+		if(typeof(datas[i].bidamount) != "undefined" && datas[i].bidamount != null && datas[i].bidamount != ""){
+      var bidamount = tableFormatMoney(datas[i].bidamount, {
+        type: 'number',
+        digit: 2,
+        level: 1
+      })
+			tableHtml += '<td class="tt-r" width="76"><div>'+bidamount+'</div></td>';
+		}else{
+			tableHtml += '<td class="tt-r" width="76"><div></div></td>';
+		}
+
+		if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
+			var diff = formatDate(Number(datas[i].publishtime),"s");
+			if(diff != null){
+				tableHtml += '<td width="103"><div>'+diff+'</div></td>';
+			}
+		}else{
+			tableHtml += '<td width="103"><div></div></td>';
+		}
+			tableHtml+='</tr>'
+  }
+  // 搜索框有输入词
+	if(flag){
+    if(selectContext) {
+      $("#allnews").show();
+      $(".tabContainer-2").hide();
+    } else {
+      $("#allnews").hide();
+		  $(".tabContainer-2").show();
+    }
+	}else{
+		$("#allnews").hide();
+		$(".tabContainer-2").show();
+	}
+
+	if (currentPage!=1){
+		tableHtml = sessionStorage.getItem("table_first_context")
+	}else{
+		sessionStorage.setItem("table_first_context",tableHtml)
+	}
+  //console.log(listHtml)
+  // 没有关键词或者没有选中正文
+	if(!flag||!selectContext){
+		if (!onlyUpdateTable){
+			$(".tabContainer-2 .lucene ul").html(listHtml);
+		}
+		$(".tabContainer-2 .lucene-table table tbody").html(tableHtml);
+	}else{
+		if(selectContext){
+			if (!onlyUpdateTable){
+				$("#allnews .lucene ul").html(listHtml);
+			}
+			$("#allnews .lucene-table table tbody").html(tableHtml);
+		}
+	}
+	$(".tabContainer").css("min-height","");
+	submitflag=true;
+  // backTopAdjust();
+  // 生成dom之后再查标讯有无收藏
+  getBidIsColl()
+  checkVisited()
+  // 生成dom之后再查询是否勾选
+  getCheckList()
+  /**
+   * @date 2022/12/15 山川环境嵌入搜索
+   * 更新是否已添加状态
+   */
+  InBIInjectHooks.check()
+}
+
+function getacount(bidamount,budget){
+	if(typeof(bidamount) != "undefined" && bidamount != null && bidamount != ""){
+		return bidamount
+	}
+	if(typeof(budget) != "undefined" && budget != null && budget != ""){
+		return budget
+	}
+	return ""
+}
+
+//金额转化   金额:0-万元以下单位为元  ,万元以上至亿元以下单位为万元 ,亿元以上单位为亿元。保留 小数点后 2 位,不进行四舍五入。
+function conversionMoeny(money){
+	var m = ""+money;
+	var m_arr = m.split(".")
+	var m_1 = m_arr[0]
+	var len_m1 = m_1.length;
+	if (len_m1 >= 9 ){
+		m = m_1.substring(0,len_m1-8) + "." + m_1.substring(len_m1-8,len_m1-6) + "亿元"
+	} else if (len_m1 >= 5) {
+		m =m_1.substring(0,len_m1-4) + "." + m_1.substring(len_m1-4,len_m1-2) + "万元"
+	} else {
+		if(m_arr.length == 1) {
+			return m + ".00元"
+		}
+		var m_2 = m_arr[1]
+		if (m_2.length > 1) {
+			m_2 = m_2.substring(0,2)
+		} else {
+			m_2 = m_2.substring(0,1) + "0"
+		}
+		m = m_1 + "." + m_2 + "元"
+	}
+	return m
+}
+
+//关闭遮罩层
+function layerClose(){
+	$("#myModal").modal("hide");
+}
+//
+function formatDate(date,sl)   {
+	var myDate = new Date(date*1000);
+    var   year=myDate.getFullYear();
+    var   month=myDate.getMonth()+1;
+    var   date=myDate.getDate();
+	var hour = myDate.getHours()
+	var min = myDate.getMinutes()
+	if(sl=="l"){
+		if(hour<10){
+			hour="0"+hour
+		}
+		if(min<10){
+			min="0"+min
+		}
+		return   year+"-"+month+"-"+date+"<br>"+hour+":"+min;
+	}else{
+		return   year+"-"+month+"-"+date;
+	}
+}
+//
+function onpicking(dp,obj){
+	var time = new Date(dp.cal.newdate.y,dp.cal.newdate.M-1,dp.cal.newdate.d).getTime()+"";
+	time = time.substring(0,time.length - 3);
+	$(obj).attr("data-value",time);
+}
+//
+function onclearing(obj){
+	$(obj).attr("data-value","");
+	//localStorage.removeItem($(obj).attr("id"))
+	if($(".customtime").hasClass("active") && getInputTime().join("") == ""){
+		$(".customtime").removeClass("active");
+		$("#publishtime #alltime").addClass("active");
+	}
+}
+//
+function picked(dp,obj){
+	//localStorage.setItem($(obj).attr("id"),$(obj).val()+"_"+$(obj).attr("data-value"))
+}
+//
+function getInputTime(){
+	var starttime = $("#starttime").attr("data-value");
+	if(starttime){
+		starttime = $.trim(starttime);
+	}else{
+		starttime = "";
+	}
+	var endtime = $("#endtime").attr("data-value");
+	if(endtime){
+		endtime = $.trim(endtime);
+	}else{
+		endtime = "";
+	}
+	return [starttime,endtime]
+}
+
+//---取VIP数据---
+function getVIPData(clickpaging){
+	var this_selectType = $("#zbSeatchT [name='selectType']").val();
+	if(this_selectType != "all"){
+		LimitClass.limitFlag = false;
+		LimitClass.result = null;
+		LimitClass.list = null;
+	}else{
+		if(LimitClass.limitFlag){
+			if(clickpaging){
+				LimitClass.paging(currentPage);
+			}else{
+				$(".tabContainer .lucene").hide();
+				$(".tabContainer .lucene-table").show();
+			}
+			return true;
+		}
+	}
+	var tlflag = false;
+	$(".tabContainer-2 .lucene").hide();
+  $("#allnews").hide();
+	$(".pagination").hide();
+  $(".working").show();
+  // 隐藏页码
+  searchInnerVue.showPage = false
+	if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
+		$(".working").hide();
+    $(".pagination").show();
+    // 显示页码
+    searchInnerVue.showPage = true
+		return true;
+	}
+	var tabflag = false;
+	if($("#zbSeatchT [name='keywords']").val()!=""){
+		// $("#newsclass").show();
+		// $("#newsnow").hide();
+		tlflag = true;
+	}else{
+		// $("#newsclass").hide();
+		// $("#newsnow").show();
+		tlflag = false;
+	}
+	if(currentPage==1){
+		$(".nbprev").addClass("disabled");
+	}
+	var reqType="bidSearch";
+	if($("#zbSeatchT [name='keywords']").val()==""){
+		reqType="lastNews";
+	}
+	var param = {
+				pageNumber: 1,
+        pageSize: pageSize,
+				reqType: reqType,
+				searchvalue: $("#zbSeatchT [name='keywords']").val(),
+				area: $("#zbSeatchT [name='area']").val(),
+				subtype: $("#zbSeatchT [name='subtype']").val(),
+				publishtime: $("#zbSeatchT [name='publishtime']").val(),
+				selectType : this_selectType || 'title,content',
+				minprice : $("#zbSeatchT [name='minprice']").val(),
+				maxprice : $("#zbSeatchT [name='maxprice']").val(),
+				industry : $("#zbSeatchT [name='industry']").val(),
+        tabularflag : tabularflag,
+        buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
+        buyertel: $("#zbSeatchT [name='buyertel']").val(),
+        winnertel: $("#zbSeatchT [name='winnertel']").val(),
+		    notkey: $(".not-key-input-group input").val().slice(0, 10),
+        fileExists: $("#zbSeatchT [name='fileExists']").val(),
+        city: $("#zbSeatchT [name='city']").val(),
+        bid_field: $("#zbSeatchT [name='bid_field']").val()
+      };
+	$.ajax({
+       type:'post',
+       url:'/front/pcAjaxReq',
+       async:false,
+	   data:param,
+       dataType:'json',
+       success:function(r){
+			afterAjaxReq(r);
+			if(r&&r.list!=null&&r.list.length>0){
+				$(".hasNoData").hide();
+				if(r.list.length<pageSize||currentPage==10){
+					$(".nbnext").addClass("disabled");
+				}else{
+					$(".nbnext").removeClass("disabled");
+				}
+				// appendDatas(r.list,tlflag,true,true);
+				appendDatas(r.list,tlflag,true,false);
+			}else{
+				$(".working").hide();
+        $(".hasNoData").show();
+        // 隐藏页码
+        searchInnerVue.showPage = false
+			}
+      tabflag = true;
+		}
+	})
+	return tabflag
+}
+///
+function beforeSubmit(n){
+  // n有值即执行的是点击搜索按钮或回车搜索事件
+  // n有值且关键词不为空时 存sessionStorage值
+  if ($("#zbSeatchT [name='keywords']").val() !=="") {
+    sessionStorage.setItem('is-click-search', 1)
+  } else {
+    sessionStorage.removeItem('is-click-search')
+  }
+  // 重置全选按钮
+  $('.custom-checkbox.check-all').prop('checked', false)
+	$(".hasNoData").hide();
+  $(".working").show();
+  // 隐藏页码
+  searchInnerVue.showPage = false
+	//$(".tabContainer-2 .lucene ul").html("");
+	//$(".tabContainer-2 .lucene-table table tbody").html("");
+	$(".tabContainer .lucene ul").html("");
+	//$(".tabContainer .lucene-table table tbody").html("");
+	$(".tabContainer").css("min-height","600px");
+	$("#right-list").addClass("active").siblings().removeClass("active");
+	$(".tabContainer-2 .lucene").show().siblings().hide();
+	$("#right-list").addClass("active").siblings().removeClass("active");
+	$("#allnews .lucene").show().siblings().hide();
+	$(".tabContainer-2").hide();
+	$("#allnews").hide();
+	$(".pagination").hide();
+	setTimeout(function(){
+    currentPage=1;
+    // 重置element ui页码为1
+    searchInnerVue.listState.num = 1
+		//时间
+		if(currentPage==1){
+			$(".nbprev").addClass("disabled");
+		}
+		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 (thisText!=undefined){
+				if(selectSubTypes != ""){
+				selectSubTypes += ",";
+				}
+				selectSubTypes += thisText;
+			}
+		});
+    // 信息类型二级分类全选只传一级分类文案
+    $(".info-content .parent-node").each(function(){
+			if($(this).attr("id") == "whole"||$(this).attr("id") == "infoBtn"){
+				return true;
+			}
+			var thisHaveClass = $(this).hasClass("active");
+      let thisText = $(this).text()
+			if (thisHaveClass){
+        if(thisText == '招标预告') {
+          selectSubTypes = selectSubTypes.replace(/预告,预审,预审结果,论证意见,需求公示/, "招标预告")
+        } else if(thisText == '招标公告') {
+          selectSubTypes = selectSubTypes.replace(/招标,邀标,询价,竞谈,单一,竞价,变更/, "招标公告")
+        } else if(thisText == '招标结果') {
+          selectSubTypes = selectSubTypes.replace(/中标,成交,废标,流标/, "招标结果")
+        } else if(thisText == '招标信用信息') {
+          selectSubTypes = selectSubTypes.replace(/合同,验收,违规/, "招标信用信息")
+        }
+			}
+		});
+		$("#zbSeatchT [name='subtype']").val(selectSubTypes);
+		//行业
+		var selectIndustrys = "";
+		var thisText = "";
+		$(".industry-content .active").each(function(){
+			if($(this).attr("id") == "induAll"){
+				return true;
+			}else if($(this).hasClass("active")&&$(this).hasClass("parent-node")){
+				$(this).nextUntil(".diver").each(function(){
+					thisText = $(this).attr("data-value");
+					if(selectIndustrys != ""){
+						selectIndustrys += ",";
+          }
+					selectIndustrys += thisText;
+				});
+			}else{
+				thisText = $(this).attr("data-value");
+				if(selectIndustrys != ""){
+					selectIndustrys += ",";
+				}
+				selectIndustrys += thisText;
+			}
+    });
+		$("#zbSeatchT [name='industry']").val(selectIndustrys);
+		//价格
+		if(!$("#priceAll").hasClass("active")){
+			var selectMinPrices = $(".PriceInput [name='minprice']").val();
+			var selectMaxPrices =  $(".PriceInput [name='maxprice']").val();
+			$("#zbSeatchT [name='minprice']").val(selectMinPrices);
+			$("#zbSeatchT [name='maxprice']").val(selectMaxPrices);
+		}else{
+			$("#zbSeatchT [name='minprice']").val("");
+			$("#zbSeatchT [name='maxprice']").val("");
+		}
+		//搜索关键词
+		var searchname = $("#zbSeatchT input[name='keywords']").val();
+    //$("#zbSeatchT input[name='searchvalue']").val($.trim(searchname));
+    // 采购单位类型
+    var buyerTypeArr = ""
+    var buyerText = ""
+    $(".buyclass .active").each(function(){
+      if ($(this).hasClass('buyclass-all')) {
+        return true
+      } else if ($(this).hasClass('buy-list')) {
+        if ($(this).attr("data-value")) {
+          buyerText = $(this).attr("data-value");
+          if(buyerTypeArr != ""){
+            buyerTypeArr += ",";
+          }
+          buyerTypeArr += buyerText;
+        }
+      }
+    })
+    //采购单位类型
+    $("#zbSeatchT [name='buyerclass']").val(buyerTypeArr)
+    // $("#buyerInput").val(buyerTypeArr);
+	//采购单位联系方式有无
+    $("#zbSeatchT [name='buyertel']").val($(".custom-input[name='buyertel']").attr('data-value'));
+    //中标单位联系方式有无
+    $("#zbSeatchT [name='winnertel']").val($(".custom-input[name='winnertel']").attr('data-value'));
+    //排除词
+	$("#zbSeatchT [name='notkey']").val($(".not-key-input-group input").val().slice(0, 10));
+		if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()&&n!="F"){
+			getNewBids(currentPage);
+		}else{
+			if(n!="F"){
+				if(submitflag){
+					if($.trim(searchname)==""){
+						getNewBiddings();
+						nbflag = false;
+					}else{
+						searchvalue = $.trim(searchname);
+						searchOnsubmit();
+						nbflag = true;
+					}
+					submitflag=false;
+				}
+				setTimeout(function(){
+					submitflag=true
+				},200);
+			}else{
+				if($.trim(searchname)!=""){
+					nbflag = true;
+				}
+			}
+		}
+		return true
+	},200)
+}
+var LimitClass = {
+	prevNoLimitFlag: false,
+	limitFlag: false,
+	list: null,
+	result: null,
+	paging: function(cp){
+		if(LimitClass.list != null){
+			var start = (cp-1)*pageSize;
+			var end = start+pageSize;
+			if(end > LimitClass.list.length){
+				end = LimitClass.list.length;
+			}
+			LimitClass.result.list = LimitClass.list.slice(start,end);
+		}
+		pcAjaxReqCallBack(LimitClass.result);
+	}
+};
+//搜索关键词信息
+function searchOnsubmit(clickpaging){
+	var this_selectType = $("#zbSeatchT [name='selectType']").val();
+	if(this_selectType != "all"){
+		LimitClass.limitFlag = false;
+		LimitClass.result = null;
+		LimitClass.list = null;
+	}else{
+		if(clickpaging&&LimitClass.limitFlag){
+			LimitClass.paging(currentPage);
+			return;
+		}
+	}
+	// $("#newsclass").show();
+	// $("#newsnow").hide();
+	if(currentPage==1){
+		$(".nbprev").addClass("disabled");
+	}
+	var param = {
+    pageNumber: currentPage,
+    pageSize: pageSize,
+    reqType: "bidSearch",
+    searchvalue: $("#zbSeatchT [name='keywords']").val(),
+    area: $("#zbSeatchT [name='area']").val(),
+    subtype: $("#zbSeatchT [name='subtype']").val(),
+    publishtime: $("#zbSeatchT [name='publishtime']").val(),
+    selectType : this_selectType || 'title,content',
+    minprice : $("#zbSeatchT [name='minprice']").val(),
+    maxprice : $("#zbSeatchT [name='maxprice']").val(),
+    industry : $("#zbSeatchT [name='industry']").val(),
+    tabularflag: "Y",
+    buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
+    buyertel: $("#zbSeatchT [name='buyertel']").val(),
+    winnertel: $("#zbSeatchT [name='winnertel']").val(),
+    notkey: $(".not-key-input-group input").val().slice(0, 10),
+    fileExists: $("#zbSeatchT [name='fileExists']").val(),
+    city: $("#zbSeatchT [name='city']").val(),
+    bid_field: $("#zbSeatchT [name='bid_field']").val()
+  };
+	$.post("/front/pcAjaxReq",param,function(r){
+		if(r.limitFlag){
+			LimitClass.limitFlag = true;
+			LimitClass.result = r;
+			LimitClass.list = r.list;
+			LimitClass.paging(currentPage);
+      LimitClass.prevNoLimitFlag = false;
+      // 重新分页
+      searchInnerVue.listState.total = r.totalPage
+      searchInnerVue.checkPageNumAdd1()
+		}else{
+			LimitClass.prevNoLimitFlag = true;
+      LimitClass.limitFlag = false;
+      pcAjaxReqCallBack(r);
+    }
+    // getBidIsColl()
+	});
+}
+function showSearchTipForTimeRange (type) {
+	var tempDom = $("#hasNoData_tiptext>font:eq(0)")
+	var tipMap = {
+    'fiveyear': '近5年',
+    'threeyear': '近3年',
+		'thisyear': '近1年',
+		'lately-7': '近7天',
+		'lately-30': '近30天'
+	}
+	var tempStr = ''
+	var defaultRange =  $("#zbSeatchT [name='publishtime']").val() || selectPublishtime
+	if (tipMap[defaultRange]) {
+		tempStr = tipMap[defaultRange]
+	} else {
+		var tempTimeList = defaultRange.split('_')
+		if (tempTimeList[0]) {
+			tempStr = new Date(tempTimeList[0] * 1000).pattern('yyyy/MM/dd')
+		}
+		if (tempTimeList[1]) {
+			if (tempStr.length) {
+				tempStr += '-'
+			}
+			tempStr += new Date(tempTimeList[1] * 1000).pattern('yyyy/MM/dd')
+		}
+	}
+	tempDom.find('span').text(tempStr)
+	if (type !== false) {
+		tempDom.show();
+	}
+}
+$(function () {
+	setTimeout(function(){
+		showSearchTipForTimeRange(false);
+	},500)
+})
+function pcAjaxReqCallBack(r){
+	afterAjaxReq(r);
+  var isAllSearch = $("#zbSeatchT [name='selectType']").val()=="all";
+	if(r.list == null || r.list.length == 0){
+		$("#hasNoData_tiptext>font").hide();
+		if(r.status==-1){
+			$("#hasNoData_tiptext>font:eq(1)").show();
+		}else if (r.status==-2){
+			$("#hasNoData_tiptext>font:eq(2)").show();
+		}else{
+			showSearchTipForTimeRange()
+		}
+		if(isAllSearch){
+			$("#allSearchModel").hide();
+		}else{
+			// $("#allSearchModel").show();
+		}
+		//分页过程中,突然切换控制状态
+		if(r.limitFlag && LimitClass.prevNoLimitFlag){
+			$("#hasNoData_tiptext>font").hide();
+			$("#hasNoData_tiptext>font:eq(1)").show();
+		}else{
+			if(currentPage>1){
+				$(".nbnext").addClass("disabled");
+				if(currentPage==2){
+					$(".nbprev").addClass("disabled");
+				}
+				currentPage = currentPage-1;
+				return false
+			}
+		}
+		$(".tabContainer").hide();
+		$(".pagination").hide();
+		$(".working").hide();
+    $(".hasNoData").show();
+    // 隐藏页码
+    searchInnerVue.showPage = false
+		submitflag=true;
+	}else{
+		//$(".tabContainer").show();
+		$(".hasNoData").hide();
+		appendDatas(r.list,true,false)
+	}
+}
+function afterAjaxReq(r){
+	secondFlag=r.secondFlag;
+	if(r.interceptWord != ""){
+      	$("#intercept .interceptWord").text(r.interceptWord);
+      	$("#intercept .interceptLimit").text(r.interceptLimit);
+		$("#intercept").removeClass("hidden");
+	}else{
+		$("#intercept").addClass("hidden");
+	}
+	if(r.keywords != null && typeof(r.keywords) != "undefined"){
+		$(".searchname").val(r.keywords);
+	}
+	$(".side-bar-bottom-font").text("“"+$.trim($(".searchname").val()).replace(/\s+/," ")+"”");
+	if(secondFlag==""&&typeof(r.searchvalue) != "undefined"){
+		searchvalue = r.searchvalue;
+	}
+	if(r.pcAjaxFlag=="T"){
+		searchvalue = r.searchvalue;
+		totalPage = r.totalPage;
+		list= r.list;
+    secondList= r.secondList;
+    // vue 重置总页数
+    searchInnerVue.listState.total = totalPage
+    searchInnerVue.checkPageNumAdd1()
+	}
+	if(secondFlag==""&&typeof(totalPage) != "undefined" && currentPage == 1){
+		if (r.totalPage==1){
+			totalPage = parseInt(r.count/pageSize)+1;
+			if(totalPage>10){
+				totalPage=10;
+      }
+      // vue 重置总页数
+      searchInnerVue.listState.total = totalPage
+      searchInnerVue.checkPageNumAdd1()
+		}else{
+      totalPage = r.totalPage;
+      searchInnerVue.listState.total = totalPage
+      searchInnerVue.checkPageNumAdd1()
+		}
+	}
+}
+
+function getCheckList() {
+  var getSelectNum = 0 // 获取这一页有多少个选中
+  var $dom = $('.custom-checkbox:not(.check-all)[name="bid-list"]')
+  $.each($dom,function(i, value) {
+    if(selectDataIds.length == 0) return
+    selectDataIds.forEach(function(item,index) {
+      let dataid = $(value).attr('dataid')
+      if (item == dataid) {
+        getSelectNum++
+        $(this).attr('checked', true)
+      }
+    })
+  })
+  if(getSelectNum>=50) {
+    $('.custom-checkbox').prop("checked",true)
+  } else {
+    $('.custom-checkbox').prop("checked",false)
+    $dom.each(function(i, dNode) {
+      if(selectDataIds.length == 0) return
+      selectDataIds.forEach(function(item,index) {
+        let dataid = $(dNode).attr('dataid')
+        if (item == dataid) {
+          getSelectNum++
+          $(dNode).prop('checked', true)
+        }
+      })
+    })
+  }
+}
+
+/*
+  招标信息是否被收藏接口ajax
+  bids: String, // 招标信息id(多个用,号拼接) 必填
+*/
+function getBidIsColl () {
+  collectClick()
+  var bids = ""
+  var dataId = ""
+  // 区分标题搜索和全文搜索收藏
+  var allSearch = selectType.indexOf('content') > -1 && $("#zbSeatchT [name='keywords']").val() !==""
+  // console.log('当前是否显示的是全文',allSearch)
+  var $dom = allSearch ? $('.all-text-checkbox[name="bid-list"]') : $('.title-text-checkbox[name="bid-list"]')
+  $dom.each(function() {
+    if ($(this).attr('dataid')) {
+      dataId = $(this).attr("dataid");
+      if(bids != ""){
+        bids += ",";
+      }
+      bids += dataId;
+    }
+  })
+  $.ajax({
+    type:'post',
+    url:'/publicapply/bidcoll/isColl?t=' + Date.now(),
+    data: {
+      bids: bids
+    },
+    dataType:'json',
+    success: function(r){
+      if (r.data) {
+        var data = r.data
+        $('.icon-collect').removeClass('checked')
+        data.forEach(function(item,index){
+          if (selectType == 'title') {
+            $('.icon-collect[dataid="' + item + '"]').addClass('checked')
+          } else {
+            $('.icon-collect[dataid="' + item + '"]').addClass('checked')
+          }
+        })
+      }
+    }
+  })
+}
+
+// 收藏点击事件
+function collectClick() {
+  // console.log(vipState, '是否是超级订阅用户')
+  // 单个收藏点击事件
+  $('.icon-collect').unbind('click').on('click',function(e) {
+    // 登录判断
+    if (!loginflag) {
+      openLoginDig()
+      return
+    }
+    baiduEvent('列表页标讯收藏-星标') // 百度统计代码
+    e.stopPropagation()
+    var $that = $(this)
+    var checked = $(this).hasClass('checked')
+    var checkedId =  $(this).attr('dataid')
+    var binfo = [{
+      bid: checkedId
+    }]
+    if (checked) {
+      // 单个取消收藏行为
+      collBidAction('R', binfo, function(res) {
+        if (res.data) {
+          if (selectType == 'title') {
+            // 标题搜索下相关样式
+            // $that.removeClass('checked').parents().siblings('input[type="checkbox"]').prop("checked",false).removeAttr('disabled')
+            $that.removeClass('checked')
+          } else {
+            // 全文搜索下相关样式
+            // $that.removeClass('checked').parents('.luce-right').siblings().find('input[type="checkbox"]').prop("checked",false).removeAttr('disabled')
+            $that.removeClass('checked')
+          }
+          toastFn('已取消收藏', 800)
+        } else {
+          toastFn(res.error_msg, 1000)
+        }
+      })
+    } else {
+      // 单个收藏行为
+      vm.dialogTitle = '重要项目一键创建标签收藏!请完善个人信息,为您匹配精准服务'
+      // 查询是否需要用户留资料 不需要 则执行下一步回调(收藏标讯行为)
+      vm.isNeedSubmit('article_collection',function() {
+        sessionStorage.setItem('$save-tags-binfo', JSON.stringify(binfo)) // 将本次收藏的标讯id缓存起来 用于绑定标签时使用
+        collBidAction('C', binfo, function(res) {
+          if (res.data) {
+            toastFn('收藏成功', 1500)
+            if (selectType == 'title') {
+              $that.addClass('checked')
+            } else {
+              $that.addClass('checked')
+            }
+            var top = (parseInt($that.position().top) + 50 ) + 'px';
+            $('.tags-box').show(function(){
+              activeTags = []
+              $('.tag-labels').empty()
+              $('.clear-input').val('')
+              $('.tags-list').find('.tags-item').removeClass('tags-active')
+              $('.tag-placeholder').show()
+            }).css('top', top)
+            getUserTags()
+          } else {
+            // 是超级订阅用户或者其他付费用户
+            if (vipState || res.error_msg.indexOf('付费') > -1) {
+              toastFn('您的标讯收藏上限为5000条,请联系客服人员。', 1500)
+            } else {
+              updateVipDialog('标讯收藏满100条-去升级')
+            }
+          }
+        })
+      }, $(this))
+    }
+  })
+  // 批量收藏
+  $('#bid-collect').off('click').bind('click',function(e){
+    // 登录判断
+    if (!loginflag) {
+      openLoginDig()
+      return
+    }
+    baiduEvent('列表页标讯收藏-星标') // 百度统计代码
+    e.stopPropagation()
+    var top = (parseInt($(this).position().top) + 60 ) + 'px';
+    var len = $('.custom-checkbox:not(".check-all"):checked').length;
+    var checkedId = [] // 提交后端需要的标讯id数组
+    var leftArr = [] // checkbox选中的数据
+    var rightArr = [] // 当前已收藏过的数据
+    var notSameArr = [] // 选中的数据 与 收藏过的数据相比不同的数组
+    $('.custom-checkbox:not(".check-all"):checked').each(function(){
+      if ($(this).attr('dataid')) {
+        checkedId.push({
+          bid: $(this).attr('dataid')
+        })
+        leftArr.push($(this).attr('dataid'))
+      }
+    })
+    $('.icon-collect.checked').each(function() {
+      if ($(this).attr('dataid')) {
+        rightArr.push($(this).attr('dataid'))
+      }
+    })
+    var $that = $(this)
+    // 判断有无选中的标讯信息
+    if (len > 0 || selectDataIds.length > 0) {
+      selectDataIds.forEach(function(v) {
+        checkedId.push({
+          bid: v
+        })
+      })
+      checkedId = arrUnique(checkedId)
+      if(leftArr.length <= rightArr.length) {
+        for (key in leftArr) {
+          var stra = leftArr[key];
+          var count = 0;
+          for (var j = 0; j < rightArr.length; j++) {
+            var strb = rightArr[j];
+            if (stra == strb) {
+              count++;
+            }
+          }
+          if (count === 0) { //表示数组1的这个值没有重复的,放到notSameArr列表中
+            notSameArr.push(stra);
+          }
+        }
+        // 如果没有不同的值 即为选中的标讯都已收藏过 有不同的值即为有未收藏的标讯
+        // console.log(notSameArr, 'notSameArr')
+        if(notSameArr.length == 0) {
+          toastFn('已收藏', 800)
+          return
+        }
+      }
+      vm.dialogTitle = '重要项目一键创建标签收藏!请完善个人信息,为您匹配精准服务'
+      // 查询是否需要用户留资料 不需要 则执行下一步回调(批量收藏标讯行为)
+      vm.isNeedSubmit('article_collection', function() {
+        sessionStorage.setItem('$save-tags-binfo', JSON.stringify(checkedId)) // 将本次收藏的标讯id缓存起来 用于绑定标签时使用
+        collBidAction('C', checkedId, function(res) {
+          if (res.data) {
+            toastFn('收藏成功', 1500)
+            if (selectType == 'title') {
+              $('.custom-checkbox:not(".check-all"):checked').siblings().children('.icon-collect').addClass('checked')
+            } else {
+              $('.custom-checkbox:not(".check-all"):checked').parents('.liLuceneList').find('.icon-collect').addClass('checked')
+            }
+            // 收藏成功后再查一次收藏状态,为了区分达到收藏上限点时部分收藏成功,部分收藏失败
+            getBidIsColl()
+            // 弹出标签弹框时 清除上次选择的标签
+            $('.tags-box').show().css('top', top)
+            getUserTags()
+          } else {
+            // 是超级订阅用户或者其他付费用户
+            if (vipState || res.error_msg.indexOf('付费') > -1) {
+              toastFn('您的标讯收藏上限为5000条,请联系客服人员。', 1500)
+            } else {
+              updateVipDialog('标讯收藏满100条-去升级')
+            }
+          }
+        })
+      })
+    } else {
+      toastFn('尚未选择标讯,请选择', 1000)
+    }
+  })
+}
+
+/**
+ * @date 2022/12/15 山川环境嵌入搜索
+ * 山川应用嵌入环境 特殊处理
+ */
+
+var InBIInjectHooks = {
+  // 已添加的标讯信息
+  ids: [],
+  // 获取已添加的标讯信息
+  getInfoIds: function () {
+    $.ajax({
+      url: '/jyapi/biService/getInfoId',
+      type: 'POST',
+      success: function (res) {
+        if (Array.isArray(res.data)) {
+          this.ids = res.data
+          this.upDateView()
+        }
+      }.bind(this)
+    })
+  },
+  // 添加标讯信息
+  setInfoId (ids) {
+    $.ajax({
+      url: '/jyapi/biService/addProject',
+      type: 'POST',
+      contentType: 'application/json',
+      data: JSON.stringify({
+        info_id: ids.join(','),
+        source: 2
+      }),
+      success: function () {
+        this.getInfoIds()
+        if (ids.length > 1) {
+          selectDataIds = []
+          $('.custom-checkbox').prop("checked", false)
+        }
+      }.bind(this)
+    })
+  },
+  // 刷新视图
+  upDateView () {
+    var _this = this
+    $(".liLuceneList").each(function () {
+      var nowId = $(this).find('.custom-checkbox').attr('dataid')
+      var hasNowId = _this.ids.indexOf(nowId) !== -1
+
+      // 刷新 dom 状态
+      $(this).find('.bi-report-inject-button').text(hasNowId ? '已添加' : '添加')
+      $(this).find('.custom-checkbox').prop('disabled', hasNowId)
+    })
+  },
+  getCheckIds () {
+    return selectDataIds || []
+  },
+  checkInBI () {
+    var inInjectBI = getParam('report') === 'bi' || (location.href.indexOf('/jylab/bi/index') !== -1)
+    return inInjectBI
+  },
+  check () {
+    if (this.checkInBI()) {
+      // 获取数据
+      this.getInfoIds()
+    }
+  },
+  inject () {
+    if (this.checkInBI()) {
+      $("body").addClass('in-iframe in-bi')
+
+      // 仅展示信息-结果类型
+      $(".bi-mark.parent-node").trigger('click')
+
+      var _this = this
+      // 添加按钮点击事件
+      $("body").on('click', '.bi-report-inject-button', function () {
+        var nowStatus = $(this).text() === '已添加'
+        if (nowStatus) {
+          return
+        }
+        var nowId = $(this).attr('data-id')
+        var isAllButton = nowId === 'all'
+        // 批量添加
+        if (isAllButton) {
+          _this.setInfoId(_this.getCheckIds())
+        } else {
+          // 单个添加
+          _this.setInfoId([nowId])
+        }
+      })
+
+      // 获取数据
+      this.getInfoIds()
+    }
+  }
+}
+
+$(function () {
+  InBIInjectHooks.inject()
+})
+
+function arrUnique(arr){
+  let ojb = {};
+  arr = arr.reduce(function(prevArr, currentItem) {
+    //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
+      ojb[currentItem.bid] ? '' : ojb[currentItem.bid] = true && prevArr.push(currentItem);
+      return prevArr
+  }, [])
+  return arr;
+}
+
+function openBigMemberDialog (str, content) {
+  $('.auth-dialog').show()
+  $('.auth-dialog .dialog-title').text('您暂无使用权限')
+  $('.auth-dialog .dialog-content').html(content ||  '开通大会员,查看更多招标项目,畅享商机不受限!')
+  $('.auth-dialog .default-btn').click(function () {
+    $('.auth-dialog').hide(300)
+  })
+  $('.auth-dialog .confirm-btn').text('免费体验')
+  $('.auth-dialog .confirm-btn').off('click').bind('click',function () {
+    var advName = '招标搜索' + str + '-去开通'
+    baiduEvent(advName) // 点击去开通事件 百度统计
+    $('.auth-dialog').hide(300)
+    vm.dialogTitle = '免费用户查看超过500条招标搜索结果'
+    vm.isNeedSubmit('jylab_see500_plus', function () {
+      vm.showSuccess = true
+    })
+  })
+}
+
+// 开通提醒弹框
+function  openVipDialog(str, content) {
+  $('.auth-dialog').show()
+	$('.auth-dialog .dialog-title').text('开通超级订阅')
+  $('.auth-dialog .dialog-content').html(content ||  '立享更多搜索权限,寻找商机更精准')
+  $('.auth-dialog .default-btn').click(function () {
+    $('.auth-dialog').hide(300)
+  })
+	$('.auth-dialog .confirm-btn').text('去开通')
+  $('.auth-dialog .confirm-btn').off('click').bind('click',function () {
+    var advName = '招标搜索' + str + '-去开通'
+    baiduEvent(advName) // 点击去开通事件 百度统计
+    window.open('/swordfish/page_big_pc/free/svip/buy')
+  })
+}
+// 升级提醒弹框
+function  updateVipDialog(str) {
+  $('.update-dialog').show()
+  $('.update-dialog .default-btn').click(function () {
+    $('.update-dialog').hide(300)
+  })
+  $('.update-dialog .confirm-btn').off('click').bind('click',function () {
+    baiduEvent(str) // 点击去升级事件 百度统计
+    window.open('/front/subscribe.html')
+  })
+}
+// 列表页收藏点击事件 百度统计
+function baiduEvent(name) {
+  // console.log(name, 'name')
+  try {
+    _hmt.push(['_trackEvent', '超级订阅-pc', 'click', name]);
+  } catch (e) {
+    console.log('未初始化百度统计')
+  }
+}
+
+// toast上限提示
+function toastFn (text, duration) {
+  if (duration) {
+    duration = 1000
+  }
+  var _html = ""
+  _html+='<div class="custom-toast"><div class="mask" style="background-color: transparent;"></div><div class="toast-container">'
+  _html+='<span>' + text + '</span></div></div>'
+  $('body').append(_html)
+	setTimeout(function(){
+		$(".custom-toast").fadeOut().remove();
+	},duration)
+}
+function gologin (link) {
+    window.location.href=link
+
+}
+
+// 是否有权限
+// isPower()
+function isPower () {
+  $.ajax({
+    type:'post',
+    url:'/publicapply/bidcoll/power?t=' + Date.now(),
+    success: function(r){
+      if (r.data) {
+        var entniche = r.data.entniche
+        var member = r.data.member
+        var vip = r.data.vip
+        if (entniche || member || vip > 0) {
+          return 'true'
+        } else {
+          return 'false'
+        }
+      } else {
+        return 'false'
+      }
+    }
+  })
+}
+

+ 287 - 306
src/web/staticres/js/superSearch.js

@@ -3,6 +3,17 @@ var nbflag = false;//是否显示的是最新招标数据
 var currentPage = 1;//当前页
 var submitflag = true;
 var tabularflag = "Y";
+console.log(vipState, goTemplateData);
+var tParams = goTemplateData.params
+if (!(tParams.isEntniche || tParams.isVip || tParams.isMember)) {
+  localStorage.setItem('login-clear-bidsearch-list-model', 'S')
+}
+var listModel = localStorage.getItem('login-clear-bidsearch-list-model') || 'S' // 列表精简or详细 S:精简 D:详细
+// 采购单位画像中转页
+var buyerLink = '/swordfish/page_big_pc/free/loading/buyer/'
+// 企业画像中转页
+var winnerLink = '/swordfish/page_big_pc/free/loading/ent/'
+
 $(function() {
 	priceTime();
 	$(".Price-content").find("span:first-child").click(function(){
@@ -44,17 +55,7 @@ $(function() {
 		beforeSubmit()
 	})
 	//
-	$(".nbprev").click(function(){
-		$(window).scrollTop(0);
-		$('.custom-checkbox.check-all').prop('checked', false)
-		prev();
-	})
-	$(".nbnext").click(function(){
-    	$(window).scrollTop(0);
-    	$('.custom-checkbox.check-all').prop('checked', false)
-		next();
 
-	})
 	//筛选关闭和打开
 	//根据cookie值设置筛选是否显示 移除该需求操作
 	// var rsw = localStorage.getItem("hideorshow");
@@ -96,7 +97,7 @@ $(function() {
 	})
 	//全文检索和标题检索切换
 	$("#newsclass li:nth-child(2)").click(function(){
-    // searchInnerVue.listState.total = totalPage
+    // searchInnerVue.listState.totalPage = totalPage
     // 重置全选按钮
     $('.custom-checkbox.check-all').prop('checked', false)
 		$(".tabContainer-2 .lucene ul").html("");
@@ -144,100 +145,22 @@ $(function() {
 
   })
 })
-//
-function next(){
-	if($(".nbnext").hasClass("disabled")){
-		return false;
-	}
-	$(".hasNoData").hide();
-	$(".working").show();
-	$(".tabContainer").hide();
-	$("#allnews").hide();
-	$(".pagination").hide();
-	currentPage = parseInt($(".pagination-inner").find("span").text())+parseInt(1)
-	if(currentPage==10){
-		$(".nbnext").addClass("disabled");
-	}else if(currentPage==2){
-		$(".nbprev").removeClass("disabled");
-	}
-	if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
-		getNewBids(currentPage);
-	}else{
-		if(!$("#right-table").hasClass("active")){
-			if(secondFlag=="T"){
-				$(".tabContainer").show();
-				$(".hasNoData").hide();
-				$(".nbnext").addClass("disabled");
-				appendDatas(secondList,true,false);
-			}else if(!nbflag&&currentPage<11){
-				getNewBiddings();
-			}else{
-				searchOnsubmit(true);
-			}
-		}else{
-//表格点击下一页
-//			if(secondFlag=="T"){
-//				$(".tabContainer").show();
-//				$(".hasNoData").hide();
-//				$(".nbnext").addClass("disabled");
-//				appendDatas(secondList,true,false);
-//			}else{
-//				getVIPData(true);
-//			}
-		}
-	}
-}
-function prev(){
-	if($(".nbprev").hasClass("disabled")){
-		return false;
-	}
-	$(".hasNoData").hide();
-	$(".working").show();
-	$(".tabContainer").hide();
-	$("#allnews").hide();
-	$(".pagination").hide();
-	currentPage = parseInt($(".pagination-inner").find("span").text())-parseInt(1)
-	if(currentPage==1){
-		$(".nbprev").addClass("disabled");
-	}else if(currentPage<10){
-		$(".nbnext").removeClass("disabled");
-	}
-	if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()){
-		getNewBids(currentPage);
-	}else{
-		if(!$("#right-table").hasClass("active")){
-			if(secondFlag=="T"){
-				$(".tabContainer").show();
-				$(".hasNoData").hide();
-				//$(".nbnext").addClass("disabled");
-				appendDatas(list,true,false);
-			}else if(!nbflag&&currentPage>0){
-				getNewBiddings();
-			}else{
-				searchOnsubmit(true);
-			}
-		}else{
-//表格点击上一页
-//			getVIPData(true);
-		}
-	}
-}
 
 //取redis里的数据
 function getNewBids(pnum, size){
-	$.post("/jylab/supsearch/getNewBids",{pageNumber:pnum,pageSize: size? size : pageSize, pageType:"", fileExists: $("#zbSeatchT [name='fileExists']").val(),bid_field: $("#zbSeatchT [name='bid_field']").val()},function(r){
+	$.post("/jylab/supsearch/getNewBids",{
+    pageNumber:pnum,
+    pageSize: size? size : pageSize, 
+    pageType:"", 
+    fileExists: $("#zbSeatchT [name='fileExists']").val(),
+    bid_field: $("#zbSeatchT [name='bid_field']").val(),
+    searchGroup: $("#zbSeatchT [name='searchGroup']").val()
+  },function(r){
 		if(r&&r.list!=null&&r.list.length>0){
 			$(".tabContainer").show();
-			//$(".pagination").show();
 			$(".hasNoData").hide();
-			//$(".pagination-inner").find("span").text(currentPage);
-			if(r.list.length<pageSize||currentPage==10){
-				$(".nbnext").addClass("disabled");
-			}else{
-				$(".nbnext").removeClass("disabled");
-      }
-      searchInnerVue.listState.total = Math.ceil(r.count/pageSize)
-      searchInnerVue.checkPageNumAdd1()
+      searchInnerVue.listState.totalPage = Math.ceil(r.count/pageSize)
+      // searchInnerVue.checkPageNumAdd1()
       if (size) {
         appendDatas(r.list,false,true, true);
       } else {
@@ -252,17 +175,14 @@ function getNewBids(pnum, size){
       // 隐藏页码
       searchInnerVue.showPage = false
     }
+    allCount = r.total
+    searchInnerVue.listState.allCount = r.total
     // getBidIsColl()
 	})
 }
 
 ////最新招标信息
 function getNewBiddings(num, size){
-	// $("#newsclass").hide();
-	// $("#newsnow").show();
-	if(currentPage==1){
-		$(".nbprev").addClass("disabled");
-	}
 	var param = {
     pageNumber: num ? num : currentPage,
     pageSize: size ? size : pageSize,
@@ -279,27 +199,27 @@ function getNewBiddings(num, size){
     buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
     buyertel: $("#zbSeatchT [name='buyertel']").val(),
     winnertel: $("#zbSeatchT [name='winnertel']").val(),
-    notkey: $(".not-key-input-group input").val().slice(0, 10),
+    notkey: $("#zbSeatchT [name='notkey']").val(),
     fileExists: $("#zbSeatchT [name='fileExists']").val(),
     city: $("#zbSeatchT [name='city']").val(),
-    bid_field: $("#zbSeatchT [name='bid_field']").val()
+    bid_field: $("#zbSeatchT [name='bid_field']").val(),
+    searchGroup: $("#zbSeatchT [name='searchGroup']").val(),
+    searchMode: $("#zbSeatchT [name='searchMode']").val(),
+    wordsMode: $("#zbSeatchT [name='wordsMode']").val(),
+    additionalWords: $("#zbSeatchT [name='additionalWords']").val()
   };
 	$.post("/front/pcAjaxReq",param,function(r){
+    heightWords = r.heightWords
 		if(r&&r.list!=null&&r.list.length>0){
       // 计算总页码
       if (currentPage == 1) {
-        searchInnerVue.listState.total = Math.ceil(r.count/pageSize)
-        searchInnerVue.checkPageNumAdd1()
+        searchInnerVue.listState.totalPage = Math.ceil(r.count/pageSize)
+        allCount = r.total
+        searchInnerVue.listState.allCount = r.total
+        // searchInnerVue.checkPageNumAdd1()
       }
 			$(".tabContainer").show();
-			//$(".pagination").show();
 			$(".hasNoData").hide();
-			//$(".pagination-inner").find("span").text(currentPage);
-			if(r.list.length<pageSize||currentPage==10){
-				$(".nbnext").addClass("disabled");
-			}else{
-				$(".nbnext").removeClass("disabled");
-			}
       if (size && num === 1) {
 			  appendDatas(r.list,true,true, true);
       } else {
@@ -307,10 +227,6 @@ function getNewBiddings(num, size){
       }
 		}else{
 			if(currentPage>1){
-				$(".nbnext").addClass("disabled");
-				if(currentPage==2){
-					$(".nbprev").addClass("disabled");
-				}
 				currentPage = currentPage-1;
 				return false
 			}
@@ -321,7 +237,10 @@ function getNewBiddings(num, size){
       $(".hasNoData").show();
       // 隐藏页码
       searchInnerVue.showPage = false
+      allCount = 0
+      searchInnerVue.listState.allCount = 0
     }
+    autoModelFn(r)
 	})
 }
 //
@@ -335,20 +254,16 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
 	var tableHtml = '';
 	$(".working").hide();
   $(".pagination").show();
-  // 显示页码
-  searchInnerVue.showPage = true
-	var searchvalueArray = searchvalue.split("+");
+  // 列表模式下显示页码 表格模式下隐藏
+  if (searchInnerVue.dataTab == 'list') {
+    searchInnerVue.showPage = true
+  } else {
+    searchInnerVue.showPage = false
+  }
+	var searchvalueArray = heightWords.split(" ");
+  // console.log('需要高亮的关键词、附加词组:' + searchvalueArray)
 	$(".pagination-inner").find("span").text(currentPage);
-	if(datas.length<pageSize){
-		$(".nbnext").addClass("disabled");
-	}
-	if(!isNew && typeof(totalPage) != "undefined"){
-		if(currentPage == totalPage){
-			$(".nbnext").addClass("disabled");
-		}else{
-			$(".nbnext").removeClass("disabled");
-		}
-	}
+
 	//(数据够20条显示查看更多遮罩层)
 	if (currentPage==1){//第一页得时候需要判断 是否显示遮罩层
 		if(datas.length>=20){
@@ -368,14 +283,16 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
 				detail = detail.substring(0,200)+"..."
 			}
 		}
-		if(flag){
+		// if(flag){
 			title = keyWordHighlight(title,searchvalueArray,"<font class='com-highlight'>$1</font>");
 			title=title.replace(/\<br>/g,"")
-			detail = keyWordHighlight(detail,searchvalueArray,"<font class='com-highlight'>$1</font>");
-		}
-		if(title.length<40){
-				title=title+"<span style='color:#fff;display:none;'>"+Math.random().toString(36).substring(2)+"<span>";
-		}
+      if (detail) {
+			  detail = keyWordHighlight(detail,searchvalueArray,"<font class='com-highlight'>$1</font>");
+      }
+		// }
+		// if(title.length<40){
+		// 		title=title+"<span style='color:#fff;display:none;'>"+Math.random().toString(36).substring(2)+"<span>";
+		// }
 		var type = datas[i].subtype;
 		if(typeof(type) == "undefined" || type == null || type == ""){
 			type = datas[i].toptype;
@@ -395,133 +312,159 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
 
 		if (!onlyUpdateTable){ //是否仅更新table
 			listHtml += '<li>'
-			//if(datas.length==(i+1)){
-			//	listHtml +='<div class="liLuceneList">'
-			//}else{
-				listHtml +='<div class="liLuceneList" style="border-bottom: 1px solid #EBEBEB;">'
-      //}
-      // 标题搜索 选择框
-      if (!selectContext || !flag) {
-        listHtml += '<input class="custom-checkbox title-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
-        listHtml +='<div class="luce-left">'
-		if(datas[i].site == '剑鱼信息发布平台') {
-			listHtml += '<span class="userPublish">用户发布</span>'
-		}
-		listHtml += '<em class="visited-hd">'+index+'.</em>'
-						+'<div class="left-title" style="width:auto;max-width:700px">'
-						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
-        if(fileExists) {
-          listHtml+='<span class="haveFile">'+'有附件'+'</span>'
-        }
-        listHtml+='</div>'
-      }
-      // 全文搜索
-			if(flag && selectContext){
-				listHtml +='<div class="luce-left">'
-				if(datas[i].site == '剑鱼信息发布平台') {
-					listHtml += '<span class="userPublish">用户发布</span>'
-					listHtml += '<em class="visited-hd">'+index+'.</em>'
-						+'<div class="left-title" style="width:auto;max-width:1080px">'
-						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
-				} else {
-					listHtml +='<em class="visited-hd" style="padding-left:30px;">'+index+'.</em>'
-						+'<div class="left-title" style="width:auto;max-width:1080px">'
-						+'<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a>'
-				}
-				if(fileExists) {
-					listHtml+='<span class="haveFile">'+'有附件'+'</span>'
-				}
-				listHtml+='</div>'
-				// 全文搜索选择框
-				listHtml += '<div class="left-content" style="width:100%;padding:0;">'
-					+ '<input class="custom-checkbox all-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
-					+'<a style="float:left;width:calc(100% - 32px)" href="javascript:volid(0);">'+detail+'...</a>'
-					+'</div>'
-			}
-			listHtml += '</div><div class="luce-right">'
-			if($.trim(datas[i].area) != "" && datas[i].area != "A"){
-
-          listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/area/"+datas[i].areaadd+".html')"+'">'+datas[i].area+'</a>';
-			}else{
-				listHtml += '<a href="#" style="display:none;"></a>';
-			}
-			if(typeof(type) != "undefined" && type != null && type != ""){
-				// listHtml += '<a href="/list/stype/'+datas[i].stypeadd+'.html">'+type+'</a>';
-        listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/stype/"+datas[i].stypeadd+".html')"+'">'+type+'</a>';
-			}else{
-				listHtml += '<a href="#" style="display:none;"></a>';
-			}
-			//
-			if(typeof(datas[i].industry) != "undefined" && datas[i].industry != null && datas[i].industry != ""&&!is_field){
-				// listHtml += '<a href="/list/industry/'+datas[i].indadd+'.html">'+datas[i].industry+'</a>';
-        listHtml += '<a href="javascript:;"'+'onclick="gologin('+"'/list/industry/"+datas[i].indadd+".html')"+'">'+datas[i].industry+'</a>';
-			}else{
-				listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
-      }
-      // vipState付费用户显示采购单位类型 免费用户不显示
-      // if(typeof(datas[i].buyerclass) != "undefined" && datas[i].buyerclass != null && datas[i].buyerclass != "" && vipState){
-			// 	listHtml += '<a href="javascript:;">'+datas[i].buyerclass+'</a>';
-			// }else{
-			// 	listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
-			// }
-
-			var amount= getacount(datas[i].bidamount,datas[i].budget)
-			if(amount!=""){
-				listHtml += '<a>'+conversionMoeny(amount)+'</a>';
-			}else{
-				listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
-			}
-
-			//
-			if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
-				var diff = utils.dateFromNow(Number(datas[i].publishtime+"000"));
-				if(diff != null){
-					listHtml += '<span class="com-time">'+diff+'</span>';
-				}
-      }
-      // 是否收藏
-      listHtml += '<i class="icon-collect" dataid="'+datas[i]._id+'"></i>'
-      // 是否山川应用嵌入环境 添加操作按钮
-      var inInjectBI = getParam('report') === 'bi' || (location.href.indexOf('/jylab/bi/index') !== -1)
-      if (inInjectBI) {
-        listHtml += '<button class="bi-report-inject-button" data-id="'+datas[i]._id+'">添加</button>'
-      }
-      listHtml += '</div>'
-
-
-      //领域化展示 商品&采购单位&中标单位
-      if (is_field && !selectContext){
-        listHtml += '<div class="luce-field">'
-        if (typeof(datas[i].purchasing) != "undefined" && datas[i].purchasing != null && datas[i].purchasing != ""){
-          listHtml += '<div class="nowrap"><span>产品</span><span>'+datas[i].purchasing +'</span></div>'
-        }
-
-        let secondLine=''
-        if (typeof(datas[i].buyer) != "undefined" && datas[i].buyer != null && datas[i].buyer != ""){
-          secondLine += '<div class="nowrap"><span>采购单位</span><span>'+datas[i].buyer +'</span></div>'
-        }
-
-        if (typeof(datas[i].s_winner) != "undefined" && datas[i].s_winner != null && datas[i].s_winner != ""){
-          secondLine += '<div class="nowrap"><span>中标单位</span><span>'+datas[i].s_winner +'</span></div>'
-        }
-
-        if (secondLine!=='') {
-          listHtml += '<div class="secondLine">'+secondLine+'</div>'
-        }
-
-        listHtml += '</div>'
-      }
-
-      listHtml += '</div></li>';
-
-			if(i == 5) {
+        listHtml +='<div class="liLuceneList" style="border-bottom: 1px solid #EBEBEB;">'
+          listHtml += '<input class="custom-checkbox title-text-checkbox" name="bid-list" type="checkbox" dataid="'+datas[i]._id+'" />'
+          listHtml +='<div class="list-container">'
+            // 标题、推送时间
+            listHtml += '<div class="bid-list-title">'
+                     + '<div class="list-title-flex  ellipsis"><em class="visited-hd">'+index+'.</em>'
+                     + '<a class="visited-hd" onclick="noIn(this)" dataid="'+datas[i]._id+'" dataindustry="'+datas[i].industry+'" target="_blank"> '+title+ '</a></div>'
+                     if(typeof(datas[i].publishtime) != "undefined" && datas[i].publishtime != null && datas[i].publishtime != ""){
+                      var diff = utils.dateFromNow(Number(datas[i].publishtime+"000"));
+                      if(diff != null){
+                        listHtml += '<span class="com-time">'+diff+'</span>';
+                      }
+                    }
+            listHtml += '</div>'
+            // 正文
+            if(selectContext && detail) {
+              listHtml += '<div class="bid-list-content">' + detail + '</div>'
+            }
+            // 分类标签、收藏
+            listHtml += '<div class="bid-list-tags">'
+                +'<div>'
+                if (datas[i].site == '剑鱼信息发布平台') {
+                  listHtml += '<span class="tags-item tags-publish">用户发布</span>'
+                }
+                if ($.trim(datas[i].area) != "" && datas[i].area != "A") {
+                  listHtml += '<a class="tags-item" href="javascript:;"'+'onclick="gologin('+"'/list/area/"+datas[i].areaadd+".html')"+'">'+datas[i].area+'</a>';
+                } else {
+                  listHtml += '<a href="#" style="display:none;"></a>';
+                }
+                if (typeof(type) != "undefined" && type != null && type != "") {
+                  listHtml += '<a class="tags-item" href="javascript:;"'+'onclick="gologin('+"'/list/stype/"+datas[i].stypeadd+".html')"+'">'+type+'</a>';
+                } else {
+                  listHtml += '<a href="#" style="display:none;"></a>';
+                }
+                if (typeof(datas[i].industry) != "undefined" && datas[i].industry != null && datas[i].industry != ""&&!is_field) {
+                  listHtml += '<a class="tags-item tags-industry" href="javascript:;"'+'onclick="gologin('+"'/list/industry/"+datas[i].indadd+".html')"+'">'+datas[i].industry+'</a>';
+                } else {
+                  listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
+                }
+                var amount= getacount(datas[i].bidamount,datas[i].budget)
+                if (amount!="") {
+                  listHtml += '<a class="tags-item">'+conversionMoeny(amount)+'</a>';
+                } else {
+                  listHtml += '<a href="javascript:volid(0);" style="display:none;"></a>';
+                }
+                // 附件
+                if (fileExists) {
+                  listHtml+='<span class="tags-item tags-file">'+'有附件'+'</span>'
+                }
+                listHtml+='</div>'
+                // // 是否收藏
+                listHtml += '<i class="icon-collect" dataid="'+datas[i]._id+'"></i>'
+                // 是否山川应用嵌入环境 添加操作按钮
+                var inInjectBI = getParam('report') === 'bi' || (location.href.indexOf('/jylab/bi/index') !== -1)
+                if (inInjectBI) {
+                  listHtml += '<button class="bi-report-inject-button" data-id="'+datas[i]._id+'">添加</button>'
+                }
+            listHtml += '</div>'
+            // 详细列表内容
+            if (listModel === 'D') {
+              listHtml += '<div class="bid-detail-info" data-subtype='+ datas[i].subtype +'>'
+                if (datas[i].buyer || datas[i].buyertel || datas[i].budget) {
+                  listHtml += '<p class="d-i-item">'
+                    if (datas[i].buyer) {
+                      listHtml += '<span><i class="d-i-item-label">采购单位:</i>'
+                      // 可能是多个采购单位(测试环境出现过)
+                      if (datas[i].buyer.indexOf('、') > -1) {
+                        var buyerArr = datas[i].buyer.split('、')
+                        console.log(buyerArr);
+                        for(var j = 0; j< buyerArr.length;j++) {
+                          var dun = j != buyerArr.length - 1 ? '<i class="highlight-text">、</i>' : ''
+                          listHtml += '<a class="highlight-text" href="' + buyerLink + buyerArr[j] +'" target="_blank">'+ buyerArr[j]+ '</a>' + dun
+                        }
+                      } else {
+                        listHtml += '<a class="highlight-text" href="' + buyerLink + datas[i].buyer +'" target="_blank">'+ datas[i].buyer+ '</a>'
+                      }
+                      listHtml += '</span>'
+                    }
+                    if (datas[i].buyertel) {
+                      datas[i].buyerperson = datas[i].buyerperson  ? datas[i].buyerperson +',' : ''
+                      listHtml += '<span><i class="d-i-item-label">采购单位联系方式:</i>'+ datas[i].buyerperson + datas[i].buyertel + '<a class="highlight-text" href="' + buyerLink + datas[i].buyer + '?position=contact" target="_blank"> 获取更多</a></span>'
+                    }
+                    if (datas[i].budget) {
+                      listHtml += '<span><i class="d-i-item-label">预算金额:</i>' + conversionMoeny(datas[i].budget) + '</span>'
+                    }
+                  listHtml +='</p>'
+                }
+                if (datas[i].agency || datas[i].agencytel) {
+                  listHtml += '<p class="d-i-item">'
+                    if (datas[i].agency) {
+                      listHtml += '<span><i class="d-i-item-label">代理机构:</i>' + datas[i].agency + '</span>'
+                    }
+                    if (datas[i].agencytel) {
+                      datas[i].agencyperson = datas[i].agencyperson  ? datas[i].agencyperson +',' : ''
+                      listHtml += '<span><i class="d-i-item-label">代理机构联系方式:</i>' + datas[i].agencyperson + datas[i].agencytel + '</span>'
+                    }
+                  listHtml +='</p>'
+                }
+                if (datas[i].winnerInfo || datas[i].winnertel || datas[i].bidamount) {
+                  listHtml += '<p class="d-i-item">'
+                    if (datas[i].winnerInfo) {
+                      listHtml += '<span><i class="d-i-item-label">中标单位:</i>'
+                      for(var j=0;j<datas[i].winnerInfo.length;j++) {
+                        var dun = j != datas[i].winnerInfo.length - 1 ? '<i class="highlight-text">、</i>' : ''
+                        listHtml +='<a class="highlight-text" href="' + winnerLink + datas[i].winnerInfo[j].winnerId +'" target="_blank">'+ datas[i].winnerInfo[j].winner+ '</a>'+ dun
+                      }
+                      listHtml +='</span>'
+                    }
+                    if (datas[i].winnertel && datas[i].winnerInfo) {
+                      // 如果有两个中标单位则不显示‘获取更多’,只有一个中标单位显示‘获取更多’并跳到画像通讯录锚点位置
+                      var moreWinnerTel = datas[i].winnerInfo && datas[i].winnerInfo.length > 1 ? '' :'<a class="highlight-text" href="' + winnerLink + datas[i].winnerInfo[0].winnerId + '?position=contact" target="_blank"> 获取更多</a></span>'
+                      datas[i].winnerperson = datas[i].winnerperson  ? datas[i].winnerperson +',' : ''
+                      listHtml += '<span><i class="d-i-item-label">中标单位联系方式:</i>' + datas[i].winnerperson + datas[i].winnertel + moreWinnerTel +'</span>'
+                    }
+                    if (datas[i].bidamount) {
+                      listHtml += '<span><i class="d-i-item-label">中标金额:</i>'+ conversionMoeny(datas[i].bidamount) +'</span>'
+                    }
+                  listHtml +='</p>'
+                }
+                if (datas[i].signendtime || datas[i].bidendtime || datas[i].bidopentime) {
+                  listHtml += '<p class="d-i-item">'
+                    if (datas[i].signendtime) {
+                      listHtml += '<span><i class="d-i-item-label">报名截止日期:</i>' + utils.dateFromNow(Number(datas[i].signendtime+"000")) +'</span>'
+                    }
+                    if (datas[i].bidendtime) {
+                      listHtml += '<span><i class="d-i-item-label">投标截止日期:</i>' + utils.dateFromNow(Number(datas[i].bidendtime+"000")) + '</span>'
+                    }
+                    if (datas[i].bidopentime) {
+                      listHtml += '<span><i class="d-i-item-label">开标日期:</i>' + utils.dateFromNow(Number(datas[i].bidopentime+"000")) + '</span>'
+                    }
+                  listHtml +='</p>'
+                }
+                //领域化展示 商品&采购单位&中标单位
+                if (is_field){
+                  listHtml += '<p class="d-i-item">'
+                    if (datas[i].purchasing) {
+                      listHtml += '<span><i class="d-i-item-label">产品:</i>' + datas[i].purchasing +'</span>'
+                    }
+                  listHtml +='</p>'
+                }
+              listHtml += '</div>'
+            }
+          listHtml += '</div>'
+        listHtml +='</div>'
+      listHtml += '</li>'
+      if(i == 5) {
 				listHtml += '<div data-list-ad class="_t3di2018y5"></div>'
 			}
 			if(i == 26) {
 				listHtml += '<div data-list-ad class="_6omliqck79a"></div>'
 			}
 		}
-
+ 
 		//表格仅显示前20条信息
 		if (i >= 20||currentPage!=1){
 			continue
@@ -636,6 +579,12 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
    * 更新是否已添加状态
    */
   InBIInjectHooks.check()
+  // 信息类型是“采购意向”和“拟建项目”,无采购意向和拟建项目权限的超级订阅用户(老超级订阅用户),即使选择详细列表,也按照精简列表展示
+  // 大会员、商机管理、超级订阅(配置时间之前的老用户)有超前项目权限
+  if (!goTemplateData.params.vipBefore202209 && !goTemplateData.params.isMember && !goTemplateData.params.isEntniche) {
+    $('.bid-detail-info[data-subtype="拟建"]').hide()
+    $('.bid-detail-info[data-subtype="采购意向"]').hide()
+  }
 }
 
 function getacount(bidamount,budget){
@@ -775,9 +724,6 @@ function getVIPData(clickpaging){
 		// $("#newsnow").show();
 		tlflag = false;
 	}
-	if(currentPage==1){
-		$(".nbprev").addClass("disabled");
-	}
 	var reqType="bidSearch";
 	if($("#zbSeatchT [name='keywords']").val()==""){
 		reqType="lastNews";
@@ -798,10 +744,14 @@ function getVIPData(clickpaging){
         buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
         buyertel: $("#zbSeatchT [name='buyertel']").val(),
         winnertel: $("#zbSeatchT [name='winnertel']").val(),
-		    notkey: $(".not-key-input-group input").val().slice(0, 10),
+		    notkey: $("#zbSeatchT [name='notkey']").val(),
         fileExists: $("#zbSeatchT [name='fileExists']").val(),
         city: $("#zbSeatchT [name='city']").val(),
-        bid_field: $("#zbSeatchT [name='bid_field']").val()
+        bid_field: $("#zbSeatchT [name='bid_field']").val(),
+        searchGroup: $("#zbSeatchT [name='searchGroup']").val(),
+        searchMode: $("#zbSeatchT [name='searchMode']").val(),
+        wordsMode: $("#zbSeatchT [name='wordsMode']").val(),
+        additionalWords: $("#zbSeatchT [name='additionalWords']").val()
       };
 	$.ajax({
        type:'post',
@@ -813,11 +763,6 @@ function getVIPData(clickpaging){
 			afterAjaxReq(r);
 			if(r&&r.list!=null&&r.list.length>0){
 				$(".hasNoData").hide();
-				if(r.list.length<pageSize||currentPage==10){
-					$(".nbnext").addClass("disabled");
-				}else{
-					$(".nbnext").removeClass("disabled");
-				}
 				// appendDatas(r.list,tlflag,true,true);
 				appendDatas(r.list,tlflag,true,false);
 			}else{
@@ -827,6 +772,7 @@ function getVIPData(clickpaging){
         searchInnerVue.showPage = false
 			}
       tabflag = true;
+      autoModelFn(r)
 		}
 	})
 	return tabflag
@@ -851,21 +797,20 @@ function beforeSubmit(n){
 	$(".tabContainer .lucene ul").html("");
 	//$(".tabContainer .lucene-table table tbody").html("");
 	$(".tabContainer").css("min-height","600px");
-	$("#right-list").addClass("active").siblings().removeClass("active");
+	// $("#right-list").addClass("active").siblings().removeClass("active");
 	$(".tabContainer-2 .lucene").show().siblings().hide();
-	$("#right-list").addClass("active").siblings().removeClass("active");
+	// $("#right-list").addClass("active").siblings().removeClass("active");
 	$("#allnews .lucene").show().siblings().hide();
 	$(".tabContainer-2").hide();
 	$("#allnews").hide();
 	$(".pagination").hide();
+  searchInnerVue.dataTab = 'list'
+  searchInnerVue.listModel = localStorage.getItem('login-clear-bidsearch-list-model')
 	setTimeout(function(){
     currentPage=1;
     // 重置element ui页码为1
     searchInnerVue.listState.num = 1
 		//时间
-		if(currentPage==1){
-			$(".nbprev").addClass("disabled");
-		}
 		var publishtime = null;
 		var timeslot = getInputTime().join("_");
 		if($(".timerInput").hasClass("active")){
@@ -993,8 +938,8 @@ function beforeSubmit(n){
     //中标单位联系方式有无
     $("#zbSeatchT [name='winnertel']").val($(".custom-input[name='winnertel']").attr('data-value'));
     //排除词
-	$("#zbSeatchT [name='notkey']").val($(".not-key-input-group input").val().slice(0, 10));
-		if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()&&n!="F"){
+	$("#zbSeatchT [name='notkey']").val($("#zbSeatchT [name='notkey']").val());
+		if(!$("#zbSeatchT [name='keywords']").val()&&!$("#zbSeatchT [name='industry']").val()&&n!="F" && !$("#zbSeatchT [name='additionalWords']").val()){
 			getNewBids(currentPage);
 		}else{
 			if(n!="F"){
@@ -1051,11 +996,7 @@ function searchOnsubmit(clickpaging){
 			return;
 		}
 	}
-	// $("#newsclass").show();
-	// $("#newsnow").hide();
-	if(currentPage==1){
-		$(".nbprev").addClass("disabled");
-	}
+	
 	var param = {
     pageNumber: currentPage,
     pageSize: pageSize,
@@ -1072,12 +1013,17 @@ function searchOnsubmit(clickpaging){
     buyerclass: $("#zbSeatchT [name='buyerclass']").val(),
     buyertel: $("#zbSeatchT [name='buyertel']").val(),
     winnertel: $("#zbSeatchT [name='winnertel']").val(),
-    notkey: $(".not-key-input-group input").val().slice(0, 10),
+    notkey: $("#zbSeatchT [name='notkey']").val(),
     fileExists: $("#zbSeatchT [name='fileExists']").val(),
     city: $("#zbSeatchT [name='city']").val(),
-    bid_field: $("#zbSeatchT [name='bid_field']").val()
+    bid_field: $("#zbSeatchT [name='bid_field']").val(),
+    searchGroup: $("#zbSeatchT [name='searchGroup']").val(),
+    searchMode: $("#zbSeatchT [name='searchMode']").val(),
+    wordsMode: $("#zbSeatchT [name='wordsMode']").val(),
+    additionalWords: $("#zbSeatchT [name='additionalWords']").val()
   };
 	$.post("/front/pcAjaxReq",param,function(r){
+    heightWords = r.heightWords
 		if(r.limitFlag){
 			LimitClass.limitFlag = true;
 			LimitClass.result = r;
@@ -1085,13 +1031,16 @@ function searchOnsubmit(clickpaging){
 			LimitClass.paging(currentPage);
       LimitClass.prevNoLimitFlag = false;
       // 重新分页
-      searchInnerVue.listState.total = r.totalPage
-      searchInnerVue.checkPageNumAdd1()
+      searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize)
+      allCount = r.total
+      searchInnerVue.listState.allCount = r.total
+      // searchInnerVue.checkPageNumAdd1()
 		}else{
 			LimitClass.prevNoLimitFlag = true;
       LimitClass.limitFlag = false;
       pcAjaxReqCallBack(r);
     }
+    autoModelFn(r)
     // getBidIsColl()
 	});
 }
@@ -1130,6 +1079,33 @@ $(function () {
 		showSearchTipForTimeRange(false);
 	},500)
 })
+
+function autoModelFn (r) {
+  var keywordFlag = $("#zbSeatchT [name='keywords']").val()
+  var addkeyFlag = $("#zbSeatchT [name='additionalWords']").val()
+  var sModel = $("#zbSeatchT [name='searchMode']").val()
+  // console.log(autoSwitchModel, sModel, (keywordFlag || addkeyFlag), r.list);
+  var jzFlag = !autoSwitchModel && sModel == 0 && (keywordFlag || addkeyFlag) && r.list == null
+  var mhFlag = autoSwitchModel && sModel == 1 && (keywordFlag || addkeyFlag)
+  if (jzFlag) {
+    console.log(jzFlag, '精准flag');
+    $("#zbSeatchT [name='searchMode']").val(1)
+    searchInnerVue.keywordSearchType = 1
+    beforeSubmit()
+    autoSwitchModel = true
+  }
+  if (mhFlag) {
+    console.log(mhFlag, '模糊flag');
+    if (r.list && r.list.length > 0) {
+      toastFn('精准搜索无结果,已为您自动切换到模糊搜索', 5000)
+      autoSwitchModel = false
+    } else {
+      $("#zbSeatchT [name='searchMode']").val(0)
+      searchInnerVue.keywordSearchType = 0
+    }
+  }
+}
+
 function pcAjaxReqCallBack(r){
 	afterAjaxReq(r);
   var isAllSearch = $("#zbSeatchT [name='selectType']").val()=="all";
@@ -1153,10 +1129,6 @@ function pcAjaxReqCallBack(r){
 			$("#hasNoData_tiptext>font:eq(1)").show();
 		}else{
 			if(currentPage>1){
-				$(".nbnext").addClass("disabled");
-				if(currentPage==2){
-					$(".nbprev").addClass("disabled");
-				}
 				currentPage = currentPage-1;
 				return false
 			}
@@ -1171,13 +1143,17 @@ function pcAjaxReqCallBack(r){
 	}else{
 		//$(".tabContainer").show();
 		$(".hasNoData").hide();
+    searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize);
 		appendDatas(r.list,true,false)
+    
 	}
+  allCount = r.total
+  searchInnerVue.listState.allCount = r.total
 }
 function afterAjaxReq(r){
 	secondFlag=r.secondFlag;
-	if(r.interceptWord != ""){
-      	$("#intercept .interceptWord").text(r.interceptWord);
+	if(r.interceptOtherWord){
+      	$("#intercept .interceptWord").text(r.interceptOtherWord);
       	$("#intercept .interceptLimit").text(r.interceptLimit);
 		$("#intercept").removeClass("hidden");
 	}else{
@@ -1187,17 +1163,20 @@ function afterAjaxReq(r){
 		$(".searchname").val(r.keywords);
 	}
 	$(".side-bar-bottom-font").text("“"+$.trim($(".searchname").val()).replace(/\s+/," ")+"”");
-	if(secondFlag==""&&typeof(r.searchvalue) != "undefined"){
-		searchvalue = r.searchvalue;
-	}
+	// if(secondFlag==""&&typeof(r.heightWords) != "undefined"){
+	// 	heightWords = r.heightWords;
+	// }
+  heightWords = r.heightWords;
 	if(r.pcAjaxFlag=="T"){
-		searchvalue = r.searchvalue;
-		totalPage = r.totalPage;
+		// heightWords = r.heightWords;
+    totalPage = Math.ceil(r.count / pageSize)
 		list= r.list;
     secondList= r.secondList;
     // vue 重置总页数
-    searchInnerVue.listState.total = totalPage
-    searchInnerVue.checkPageNumAdd1()
+    searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize);
+    allCount = r.total
+    searchInnerVue.listState.allCount = r.total
+    // searchInnerVue.checkPageNumAdd1()
 	}
 	if(secondFlag==""&&typeof(totalPage) != "undefined" && currentPage == 1){
 		if (r.totalPage==1){
@@ -1206,13 +1185,15 @@ function afterAjaxReq(r){
 				totalPage=10;
       }
       // vue 重置总页数
-      searchInnerVue.listState.total = totalPage
-      searchInnerVue.checkPageNumAdd1()
+      searchInnerVue.listState.totalPage = totalPage
+      // searchInnerVue.checkPageNumAdd1()
 		}else{
-      totalPage = r.totalPage;
-      searchInnerVue.listState.total = totalPage
-      searchInnerVue.checkPageNumAdd1()
+      totalPage = Math.ceil(r.count / pageSize);
+      searchInnerVue.listState.totalPage = Math.ceil(r.count / pageSize)
+      // searchInnerVue.checkPageNumAdd1()
 		}
+    allCount = r.total
+    searchInnerVue.listState.allCount = r.total
 	}
 }
 
@@ -1619,7 +1600,7 @@ function baiduEvent(name) {
 
 // toast上限提示
 function toastFn (text, duration) {
-  if (duration) {
+  if (!duration) {
     duration = 1000
   }
   var _html = ""
@@ -1631,8 +1612,8 @@ function toastFn (text, duration) {
 	},duration)
 }
 function gologin (link) {
-    window.location.href=link
-
+    // window.location.href=link
+    window.open(link)
 }
 
 // 是否有权限

+ 42 - 9
src/web/staticres/pccss/ent-search-index-pc.css

@@ -23,7 +23,7 @@
     min-height: 400px;
 }
 .search-header {
-    padding: 29px 0 15px;
+    /* padding: 29px 0 15px; */
     background-color: #f5f5fb;
 }
 .search-content {
@@ -32,7 +32,8 @@
 }
 
 .search-header-content {
-    padding-left: 125px;
+    /* padding-left: 125px; */
+    padding: 24px 24px 24px 32px;
 }
 .search-header-top {
     display: flex;
@@ -45,7 +46,7 @@
     display: flex;
     align-items: center;
     padding: 0 20px;
-    height: 36px;
+    /* height: 36px; */
     cursor: pointer;
 }
 .input-container {
@@ -56,14 +57,17 @@
     align-items: center;
 }
 
-.el-input__prefix {
+.input-container .el-input__prefix {
     display: flex;
     align-items: center;
     justify-content: center;
-    left: 18px;
+    left: 16px;
 }
-.el-input--prefix .el-input__inner {
-    padding-left: 50px;
+.input-container .el-input--prefix .el-input__inner {
+    padding-left: 44px;
+    height: 36px;
+    line-height: 36px;
+    border-radius: 8px 0 0 8px;
 }
 .input-prefix-icon {
     display: flex;
@@ -74,7 +78,7 @@
     display: block;
 }
 .input-container .el-input-group {
-    width: 640px;
+    width: 528px;
 }
 .input-container .el-input__inner,
 .input-container .el-input-group__append {
@@ -83,9 +87,10 @@
 }
 .input-container .el-input-group__append {
     padding: 0;
-    font-size: 18px;
+    font-size: 16px;
     color: #fff;
     background-color: #2cb7ca;
+    border-radius: 0 8px 8px 0;
 }
 .pre-search-list {
     padding: 20px 0;
@@ -376,3 +381,31 @@
     color: #1d1d1d;
     line-height: 22px;
 }
+.search-header-tab{
+  padding: 0 16px;
+  height: 48px;
+  line-height: 48px;
+  border-bottom: 1px solid #ececec;
+}
+.tab-item{
+  display: inline-block;
+  padding: 0 16px;
+  height: 100%;
+  font-size: 16px;
+  cursor: pointer;
+}
+.tab-item.tab-active{
+  position: relative;
+  color: #2cb7ca;
+}
+.tab-item.tab-active::before{
+  position: absolute;
+  content: '';
+  left: 50%;
+  bottom: 0;
+  width: 64px;
+  height: 2px;
+  background: #2cb7ca;
+  transform: translateX(-50%);
+  z-index: 9;
+}

+ 40 - 7
src/web/staticres/pccss/pur-search-index-pc.css

@@ -23,7 +23,7 @@
     min-height: 400px;
 }
 .search-header {
-    padding: 29px 0 15px;
+    /* padding: 29px 0 15px; */
     background-color: #f5f5fb;
 }
 .search-content {
@@ -31,7 +31,8 @@
 }
 
 .search-header-content {
-    padding-left: 125px;
+    /* padding-left: 125px; */
+    padding: 24px 24px 24px 32px;
 }
 .search-header-top {
     display: flex;
@@ -44,7 +45,7 @@
     display: flex;
     align-items: center;
     padding: 0 20px;
-    height: 36px;
+    /* height: 36px; */
     cursor: pointer;
 }
 .input-container {
@@ -62,10 +63,13 @@
     display: flex;
     align-items: center;
     justify-content: center;
-    left: 18px;
+    left: 16px;
 }
 .el-input--prefix .el-input__inner {
-    padding-left: 50px;
+    padding-left: 44px;
+    height: 36px;
+    line-height: 36px;
+    border-radius: 8px 0 0 8px;
 }
 .input-prefix-icon {
     display: flex;
@@ -76,7 +80,7 @@
     display: block;
 }
 .input-container .el-input-group {
-    width: 640px;
+    width: 528px;
 }
 .input-container .el-input__inner,
 .input-container .el-input-group__append {
@@ -85,9 +89,10 @@
 }
 .input-container .el-input-group__append {
     padding: 0;
-    font-size: 18px;
+    font-size: 16px;
     color: #fff;
     background-color: #2cb7ca;
+    border-radius: 0 8px 8px 0;
 }
 .pre-search-list {
     padding: 20px 0;
@@ -985,3 +990,31 @@
     color: #fff;
     background: #2CB7CA;
 }
+.search-header-tab{
+  padding: 0 16px;
+  height: 48px;
+  line-height: 48px;
+  border-bottom: 1px solid #ececec;
+}
+.tab-item{
+  display: inline-block;
+  padding: 0 16px;
+  height: 100%;
+  font-size: 16px;
+  cursor: pointer;
+}
+.tab-item.tab-active{
+  position: relative;
+  color: #2cb7ca;
+}
+.tab-item.tab-active::before{
+  position: absolute;
+  content: '';
+  left: 50%;
+  bottom: 0;
+  width: 64px;
+  height: 2px;
+  background: #2cb7ca;
+  transform: translateX(-50%);
+  z-index: 9;
+}

+ 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 {

+ 7 - 6
src/web/staticres/serviceSystem/css/serviceSystem.css

@@ -143,7 +143,7 @@
     height: 56px;
     display: block;
     margin-top: -12px;
-    
+
 }
 
 .auto-w-1200 {
@@ -1248,6 +1248,7 @@
 .table_content_r_item {
     display: flex;
     /* box-sizing: border-box; */
+    border: 1px solid transparent;
     border-top: 1px solid #ECECEC;
 }
 
@@ -1385,7 +1386,7 @@
     padding-left: 350px;
 }
 .all_border_warn{
-        border-top: 1px solid #ECECEC;      
+        border-top: 1px solid #ECECEC;
 }
 .table_header_112 {
     height: 112px !important;
@@ -1534,8 +1535,8 @@ i.free::before {
     left: 0;
     position:absolute;
     top: 14px
-    
-    
+
+
 }
 .text_box .lh_30_img{
     width: 8px;
@@ -1637,7 +1638,7 @@ i.free::before {
     margin-top: 42px !important;
 }
 .position{
-    
+
 }
 
 clearfix:after {
@@ -2391,4 +2392,4 @@ clearfix:after {
 .CfadeInUp {
     opacity: 0;
     animation: 1s ease forwards alternate;
-}
+}

+ 61 - 61
src/web/templates/frontRouter/pc/serviceSystem/free/index.html

@@ -56,7 +56,7 @@
                     </div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            商务服务  
+                            商务服务
                         </p>
                         <p class="service_text">供应商招募</p>
                         <p class="service_text">供应商资格预审</p>
@@ -67,7 +67,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/xin.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            推荐服务  
+                            推荐服务
                         </p>
                         <p class="service_text">优秀供应商推荐</p>
                         <p class="service_text">供应商名录</p>
@@ -79,7 +79,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/bing.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            数据分析  
+                            数据分析
                         </p>
                         <p class="service_text">通讯录</p>
                         <p class="service_text">各类招标方式占比</p>
@@ -91,7 +91,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/dingwei.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            信息发布  
+                            信息发布
                         </p>
                         <p class="service_text">招标信息发布</p>
                         <p class="service_text">采购信息发布</p>
@@ -128,7 +128,7 @@
                         <div class="line"></div>
                         <div class="blue_btn_long" @click="consultation('1')">立即咨询</div>
                     </div>
-                    
+
                     <div class="item bg_bule mr-40">
                         <p class="tit">高级会员</p>
                         <p class="price">¥<span class="fz-24">19,999</span>/年</p>
@@ -437,7 +437,7 @@
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
-                                </div>              
+                                </div>
                             </div>
                         </div>
                         <div class="table_headline">
@@ -500,7 +500,7 @@
                                     </div>
                                     <div class="table_content_textcell"><span class="tit">即将上线,敬请期待</span></div>
                                 </div>
-                                
+
                             </div>
                         </div>
                         <div class="table_headline">
@@ -523,11 +523,11 @@
                                         <p class="text">
                                             搜索范围支持项目名称/标的物、采购单位、中标企业、招标代理机构,项目地区支持地市级,发布时间支持自定义,支持采购单位类型、有无联系方式、排除词等高级筛选。支持查看拟建项目、采购意向标讯详情,提前获取商机。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
-                                   
+
                                 </div>
                                 <div class="table_content_r_item ">
                                     <div class="table_content_longcell">
@@ -568,7 +568,7 @@
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                 </div>
-                                
+
                             </div>
                          </div>
                          <div class="table_headline">
@@ -591,7 +591,7 @@
                                         <p class="text">
                                             可将业务范围、产品名称、甲方单位名称、业务需求等设置为订阅关键词,及时获取精准项目信息。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -601,9 +601,9 @@
                          <div class="warn_text clearfix">
                             <p>注:以上仅为部分服务项目,请联系客户经理查看全部内容!</p>
                             <div class="btn_" @click="consultation('1')">立即咨询</div>
-                         </div>       
+                         </div>
                 </div>
-            </div>    
+            </div>
         </div>
         <!-- 招标代理机构服务 -->
         <div class="content" v-if="tabs==2">
@@ -627,7 +627,7 @@
                     </div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            商务服务  
+                            商务服务
                         </p>
                         <p class="service_text">供应商招募</p>
                         <p class="service_text">供应商资格预审</p>
@@ -638,7 +638,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/xin.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            推荐服务  
+                            推荐服务
                         </p>
                         <p class="service_text">采购单位推荐</p>
                         <p class="service_text">优秀供应商推荐</p>
@@ -649,7 +649,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/bing.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            数据分析  
+                            数据分析
                         </p>
                         <p class="service_text">招标方式占比</p>
                         <p class="service_text">代理项目规模分布</p>
@@ -661,7 +661,7 @@
                     <div class="fl ml-29"><img src="/serviceSystem/img/dingwei.png" alt=""></div>
                     <div class="fl ml-20">
                         <p class="service_title">
-                            信息发布  
+                            信息发布
                         </p>
                         <p class="service_text">招标信息发布</p>
                         <p class="service_text">采购信息发布</p>
@@ -699,7 +699,7 @@
                         <div class="line"></div>
                         <div class="blue_btn_long" @click="consultation('2')">立即咨询</div>
                     </div>
-                    
+
                     <div class="item bg_bule mr-40">
                         <p class="tit">高级会员</p>
                         <p class="price">¥<span class="fz-24">19,999</span>/年</p>
@@ -882,7 +882,7 @@
                                     </div>
                                     <div class="table_content_textcell"><span>即将上线,敬请期待</span></div>
                                 </div>
-                                
+
                             </div>
                          </div>
                          <div class="table_headline">
@@ -1048,7 +1048,7 @@
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
-                                </div>              
+                                </div>
                             </div>
                         </div>
                         <div class="table_headline">
@@ -1111,7 +1111,7 @@
                                     </div>
                                     <div class="table_content_textcell"><span class="tit">即将上线,敬请期待</span></div>
                                 </div>
-                                
+
                             </div>
                         </div>
                         <div class="table_headline">
@@ -1134,11 +1134,11 @@
                                         <p class="text">
                                             搜索范围支持项目名称/标的物、采购单位、中标企业、招标代理机构,项目地区支持地市级,发布时间支持自定义,支持采购单位类型、有无联系方式、排除词等高级筛选。支持查看拟建项目、采购意向标讯详情,提前获取商机。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
-                                   
+
                                 </div>
                                 <div class="table_content_r_item ">
                                     <div class="table_content_longcell">
@@ -1179,7 +1179,7 @@
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                 </div>
-                                
+
                             </div>
                          </div>
                          <div class="table_headline">
@@ -1202,7 +1202,7 @@
                                         <p class="text">
                                             可将业务范围、产品名称、甲方单位名称、业务需求等设置为订阅关键词,及时获取精准项目信息。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><span class="tit">部分可用</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -1212,9 +1212,9 @@
                          <div class="warn_text clearfix">
                             <p>注:以上仅为部分服务项目,请联系客户经理查看全部内容!</p>
                             <div class="btn_" @click="consultation('2')">立即咨询</div>
-                         </div>       
+                         </div>
                 </div>
-            </div>    
+            </div>
         </div>
         <!-- 供应商开始 -->
         <div class="content" v-if="tabs==0">
@@ -1256,7 +1256,7 @@
                               <p class="text"><img src="/serviceSystem/img/ic_v.png" alt="">客户线索实时记录、动态跟踪</p>
                               <p class="text"><img src="/serviceSystem/img/ic_v.png" alt="">招投标项目进度可视化报表展示</p>
                         </div>
-                        
+
                     </div>
                     <div class="item lr">
                       <img src="/serviceSystem/img/gysMine2@2x.png" alt="" class="item_img w-475">
@@ -1351,7 +1351,7 @@
                             <div class="sort_cell_block serve_bg_blue he-110">
                                 <span class="table_serve_head_text">超级订阅</span>
                                 <div class="cell_blue_btn" v-if="loginFlag&&isbuy_vip" @click="goplay('vip')">立即使用</div>
-                                <div class="cell_blue_btn" v-else @click="gobuy('vip')">立即购买</div>  
+                                <div class="cell_blue_btn" v-else @click="gobuy('vip')">立即购买</div>
                             </div>
                             <div class="sort_cell_block_nob  serve_bg_yellow he-110">
                                 <span class="table_serve_head_text2">大会员</span>
@@ -1381,7 +1381,7 @@
                             <div class="sort_cell_block serve_bg_blue he-110">
                                 <span class="table_serve_head_text">超级订阅</span>
                                 <div class="cell_blue_btn" v-if="loginFlag&&isbuy_vip" @click="goplay('vip')">立即使用</div>
-                                <div class="cell_blue_btn" v-else @click="gobuy('vip')">立即购买</div>  
+                                <div class="cell_blue_btn" v-else @click="gobuy('vip')">立即购买</div>
                             </div>
                             <div class="sort_cell_block_nob  serve_bg_yellow he-110">
                                 <span class="table_serve_head_text2">大会员</span>
@@ -1620,11 +1620,11 @@
                                             监控招标大数据,一旦关注企业中标,及时推送企业的中标项目、时间等公告信息。
                                         </p>
                                     </div>
-                                    <div class="table_content_sortcell"><span class="tit">10个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">10个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">100个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">500个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">500个项目</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">10个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">10个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">100个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">500个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">500个企业</span></div>
                                 </div>
                                 <div class="table_content_r_item cell_wite">
                                     <div class="table_content_longcell">
@@ -1637,9 +1637,9 @@
                                     </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
-                                    <div class="table_content_sortcell"><span class="tit">100个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">500个项目</span></div>
-                                    <div class="table_content_sortcell"><span class="tit">500个项目</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">100个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">500个企业</span></div>
+                                    <div class="table_content_sortcell"><span class="tit">500个企业</span></div>
                                 </div>
                             </div>
                         </div>
@@ -1759,7 +1759,7 @@
                                         <p class="text">
                                             大数据预测企业中标概率、企业排名,帮助分析潜在投标企业、辅助投标决策。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -1780,7 +1780,7 @@
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><span class="tit">200次</span></div>
                                     <div class="table_content_sortcell"><span class="tit">200次</span></div>
-                                </div> 
+                                </div>
                             </div>
                          </div>
                          <div class="table_content">
@@ -1798,7 +1798,7 @@
                                         <p class="text">
                                             通过大数据分析统计,提供类似项目评标专家的频次排名、类似项目的热点中标企业、项目区域分布、采购单位类型分布、项目标书编制周期、类型项目折扣率分析等,帮助投标人员编制标书,判断是否参与投标。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -1822,12 +1822,12 @@
                                         <p class="text">
                                             提供汇总后的采购单位历史招标项目负责人及其联系方式。
                                         </p>
-                                    </div> 
-                                    <div class="table_content_sortcell"><i class="free"></i></div>
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
+                                    <div class="table_content_sortcell"><i class="right"></i></div>
                                 </div>
                                 <div class="table_content_r_item cell_wite">
                                     <div class="table_content_longcell">
@@ -1837,7 +1837,7 @@
                                         <p class="text">
                                             提供采购单位的采购项目动态、近5年招标采购项目数量及项目金额统计、采购预算区间、招标方式占比、采购领域平均节支率、重点合作的企业分析、重点合作代理机构明细等多维度分析。洞察采购单位采购需求,用于开发新客户、客户维护。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><span class="tit">每购买1个省份,每月可查看5个采购单位画像,上限80个</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -1861,7 +1861,7 @@
                                         <p class="text">
                                             提供汇总后的企业历史中标项目负责人及其联系方式。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -1876,7 +1876,7 @@
                                         <p class="text">
                                             掌控企业董监高、股东及投资比例、注册资本、企业地址、经营范围、公司注销/吊销、新公司设立变动信息。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -1891,7 +1891,7 @@
                                         <p class="text">
                                             提供企业年度历史中标项目清单、项目数量及项目金额统计、市场区域分布情况统计图、各业务线折扣率、合作客户类型分布图、各行业的重点合作客户等多维度数据。帮助快速了解企业竞争力。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><span class="tit">每购买1个省份,每月可查看50个企业画像,上限800个</span></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
@@ -1920,7 +1920,7 @@
                                         <p class="text">
                                             月新增招标和开标的项目数量、项目预算、项目规模统计,以及关注企业中标项目明细,开标项目提醒、规模TOP10采购行业;中标企业区域、资本分布统计;采购单位、中标企业排行等。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -1935,7 +1935,7 @@
                                         <p class="text">
                                             自定义分析范围(分析内容、区域、行业、采购单位类型、时间),对市场规模、采购单位、中标单位进行分析,包含细分业务市场的项目数量、金额分布情况、以及各细分业务市场的重点中标单位中标数量明细等。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -1959,7 +1959,7 @@
                                         <p class="text">
                                             本周/字段明细:省份、城市、公告标题、公告类别、公告内容、发布时间、公告地址、剑鱼标讯地址、项目名称、项目范围、预算金额、中标金额、开标日期、采购单位、采购单位信息(采购单位联系人、采购单位联系电话、招标代理机构)、中标单位信息(中标单位、中标单位联系人、中标单位联系电话)(来源:招标公告网站)、中标单位信息(中标单位联系人、中标单位联系电话、电子邮箱)(来源:国家企业公示网站)。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><span class="tit">每日导出量
@@ -1985,14 +1985,14 @@
                                         <p class="text">
                                             采购单位/招标代理机构会将部分项目通过剑鱼标讯进行公开或邀请招标,剑鱼标讯为客户提供项目的采购单位/招标代理机构联系方式,方便客户联系。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                 </div>
-                          
+
                                 <div class="table_content_r_item ">
                                     <div class="table_content_longcell">
                                         <p class="tit">
@@ -2001,7 +2001,7 @@
                                         <p class="text">
                                             剑鱼标讯与众多采购单位/招标代理机构都有良好的合作关系,部分优质项目在剑鱼标讯进行公开或邀请招标,可以根据客户的企业资质、综合实力、成功案例等,直接推荐给采购单位。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -2016,7 +2016,7 @@
                                         <p class="text">
                                             剑鱼标讯与众多采购单位/招标代理机构拥有良好的合作关系,部分优质项目在剑鱼标讯进行公开或邀请招标。剑鱼标讯将根据客户企业资质、综合实力、成功案例,向采购单位方推荐。客户在使用唯一推荐权益后,剑鱼标讯将不再向采购单位方推荐其他供应商。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
@@ -2040,21 +2040,21 @@
                                         <p class="text">
                                             提供专业的售后客服服务,定期电话回访,及时解决服务中的任何问题,例如:帮助客户优化订阅关键词、培训系统操作等。
                                         </p>
-                                    </div> 
+                                    </div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="free"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
                                     <div class="table_content_sortcell"><i class="right"></i></div>
-                                    <div class="table_content_sortcell"><i class="right"></i></div> 
+                                    <div class="table_content_sortcell"><i class="right"></i></div>
                                 </div>
                             </div>
                          </div>
                          <div class="all_border_warn warn_text clearfix">
                             <p>注:以上仅为部分服务项目,请联系客户经理查看全部内容!</p>
                             <div class="btn_" @click="consultation('0')">立即咨询</div>
-                         </div>       
+                         </div>
                 </div>
-            </div>  
+            </div>
         </div>
         <div class="model_" v-show="isshow"  @click.self="close('isshow')">
             <div class="pop-up">
@@ -2064,7 +2064,7 @@
                     <img :src="url" alt="">
                 </div>
                 <p class="text">{text}</p>
-            </div> 
+            </div>
         </div>
         <div class="model_" v-show="vipshow"  @click.self="close('vipshow')">
             <div class="modal-dialog modal-dialog-subvip modal-sm" role="document">
@@ -2094,10 +2094,10 @@
     </script>
     <script src='{{Msg "seo" "cdn"}}/serviceSystem/js/serviceSystem.js?v={{Msg "seo" "version"}}'></script>
     <!--S-百度统计-->
-    
+
     {{include "/common/pcbottom.html"}}
     {{include "/common/baiducc.html"}}
     <!--E-百度统计-->
 </body>
 
-</html>
+</html>

+ 9 - 3
src/web/templates/pc/entsearchindex.html

@@ -131,6 +131,9 @@
             .tab-cgdw {
                 display: none;
             }
+            .in-iframe[data-page-name=entSearch] .search-header .search-header-content {
+              padding-right: 24px;
+            }
         </style>
 	</head>
 
@@ -139,6 +142,9 @@
 	<section class="search-container">
         <div class="vue-search-container" v-cloak>
             <div class="search-header">
+                <div class="search-header-tab">
+                  <span class="tab-item tab-active">企业搜索</span>
+                </div>
                 <div class="search-header-content w">
                     <div class="search-header-top">
                         <div class="input-container flex">
@@ -152,7 +158,7 @@
                                 @keyup.enter.native="doSearch">
                                 <template slot="prefix">
                                     <div class="input-prefix-icon">
-                                        <img src="/images/biddingSearch/search-icon1.png">
+                                        <img src="/images/biddingSearch/bidding-search.png">
                                     </div>
                                 </template>
                                 <template slot="append">
@@ -183,14 +189,14 @@
                             </div>
                         </div>
                     </div>
-                    <div class="search-header-bottom">
+                    <!-- <div class="search-header-bottom">
                         <el-tabs v-model="tabActive">
                             <el-tab-pane label="招标采购搜索" name="zb"></el-tab-pane>
                             <el-tab-pane label="企业搜索" name="qy"></el-tab-pane>
                             <el-tab-pane label="采购单位搜索" name="cgdw"></el-tab-pane>
                             <el-tab-pane label="供应搜索" name="gy"></el-tab-pane>
                         </el-tabs>
-                    </div>
+                    </div> -->
                 </div>
             </div>
             <div class="search-content w">

+ 12 - 8
src/web/templates/pc/index.html

@@ -47,8 +47,15 @@
         <!-- 搜索框区域 -->
         <div class="jy-index-search">
           <div class="search">
+            <div class="tips">
+              <span class="active spa1" data-id="zb">招标采购搜索</span>
+              <span class="spa1" data-id="qy">企业搜索</span>
+              <span id="buyUnits" class="spa1 cai-gou" data-id="cg">采购单位搜索</span>
+              <span class="spa1" data-id="gy">供应搜索</span>
+              <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">
@@ -59,13 +66,6 @@
               <ul>
               </ul>
             </div>
-            <div class="tips">
-              <span class="active spa1" data-id="zb">招标采购搜索</span>
-              <span class="spa1" data-id="qy">企业搜索</span>
-              <span id="buyUnits" class="spa1 cai-gou" data-id="cg">采购单位搜索</span>
-              <span class="spa1" data-id="gy">供应搜索</span>
-              <i></i>
-            </div>
             <div class="pre-search-list" style="display: none;"></div>
           </div>
         </div>
@@ -511,12 +511,16 @@
                 if (theme === 'light') {
                   setTimeout(function(){
                     $('.public-nav').addClass('light-bg-dark-color').removeClass('light-bg-light-color')
+                    $('.swiper-pagination').addClass('light-swiper-bg-dark-color').removeClass('light-swiper-bg-light-color')
                     $('.loginBtn').css('color', '#1d1d1d')
                   }, 100)
                 } else {
                   setTimeout(function(){
                     $('.public-nav').addClass('light-bg-light-color').removeClass('light-bg-dark-color')
                     $('.loginBtn').css('color', '#fff')
+                    var a = $('.jy-index .jy-index-banner .custom-dot .swiper-pagination-bullet-active')
+                    // $('.jy-index .jy-index-banner .custom-dot .swiper-pagination-bullet').css('background', 'rgba(255, 255, 255, 0.32)')
+                    $('.swiper-pagination').addClass('light-swiper-bg-light-color').removeClass('light-swiper-bg-dark-color')
                   }, 100)
                 }
               }

+ 11 - 5
src/web/templates/pc/pursearchindex.html

@@ -33,8 +33,8 @@
             }
 
             .in-iframe .search-header-content {
-              padding-left: 86px;
-              padding-right: 86px;
+              /* padding-left: 86px;
+              padding-right: 86px; */
             }
             .in-iframe .search-header,
             .in-iframe .search-pur-container,
@@ -46,6 +46,9 @@
               border: none;
               border-bottom: 1px solid #EBEBEB;
             }
+            .in-iframe[data-page-name=entSearch] .search-header .search-header-content {
+              padding-right: 24px;
+            }
         </style>
 	</head>
 
@@ -54,6 +57,9 @@
 	<section class="search-container">
         <div class="vue-search-container" id="pur-search-container" v-cloak>
             <div class="search-header">
+                <div class="search-header-tab">
+                  <span class="tab-item tab-active">采购单位搜索</span>
+                </div>
                 <div class="search-header-content w">
                     <div class="search-header-top">
                         <div class="input-container flex">
@@ -67,7 +73,7 @@
                                 @keyup.enter.native="doSearch">
                                 <template slot="prefix">
                                     <div class="input-prefix-icon">
-                                        <img src="/images/biddingSearch/search-icon1.png">
+                                        <img src="/images/biddingSearch/bidding-search.png">
                                     </div>
                                 </template>
                                 <template slot="append">
@@ -98,14 +104,14 @@
                             </div>
                         </div>
                     </div>
-                    <div class="search-header-bottom">
+                    <!-- <div class="search-header-bottom">
                         <el-tabs v-model="tabActive">
                             <el-tab-pane label="招标采购搜索" name="zb"></el-tab-pane>
                             <el-tab-pane label="企业搜索" name="qy"></el-tab-pane>
                             <el-tab-pane label="采购单位搜索" name="cgdw"></el-tab-pane>
                             <el-tab-pane label="供应搜索" name="gy"></el-tab-pane>
                         </el-tabs>
-                    </div>
+                    </div> -->
                 </div>
             </div>
             <div class="search-content w">

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 457 - 174
src/web/templates/pc/supsearch.html


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно