Browse Source

wip:领域化搜索路由修改

wangkaiyue 2 years ago
parent
commit
e376da896e
2 changed files with 18 additions and 6 deletions
  1. 15 4
      src/jfw/front/supsearch.go
  2. 3 2
      src/web/templates/pc/supsearch.html

+ 15 - 4
src/jfw/front/supsearch.go

@@ -23,8 +23,7 @@ import (
 
 type Pcsearch struct {
 	*xweb.Action
-
-	pcSearchIndex   xweb.Mapper `xweb:"/jylab/supsearch/index.html"`           //搜索首页
+	pcSearchIndex   xweb.Mapper `xweb:"/jylab/(supsearch|medical)/index.html"` //搜索首页
 	getNewBids      xweb.Mapper `xweb:"/jylab/supsearch/getNewBids"`           //最新招标信息
 	getstatus       xweb.Mapper `xweb:"/jylab/supsearch/getstatus"`            //实验室开启状态
 	proposedProject xweb.Mapper `xweb:"/jylab/supsearch/proposedProject.html"` //拟建项目
@@ -270,10 +269,21 @@ func (p *Pcsearch) GetNewBids() error {
 	return nil
 }
 
-func (p *Pcsearch) PcSearchIndex() error {
+func (p *Pcsearch) PcSearchIndex(module string) error {
 	defer util.Catch()
 	p.T["logid"] = config.Seoconfig["jysslby"].(string)
-	bidField := p.GetString("bid_field") // 领域类型  医疗-0101
+
+	// 领域化标识
+	bidField := p.GetString("bid_field")
+	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")                            //地区
@@ -415,6 +425,7 @@ func (p *Pcsearch) PcSearchIndex() error {
 	p.T["sortArray"] = sortArray
 	p.T["showVipScreen"] = isPayedUser
 	p.T["bidField"] = bidField
+	p.T["module"] = module
 	//
 	if userId != "" {
 		//企业画像 权限

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

@@ -680,7 +680,7 @@ var IframeOnClick = {
 		<div class="w searchHeader-container">
 			<!--搜索-->
 			<div class="searchInput clearfix">
-				<form action="/jylab/supsearch/index.html" method="post" id="zbSeatchT" class="clearfix" onsubmit="return beforeSubmit('F')">
+				<form action="/jylab/{{.T.module}}/index.html" method="post" id="zbSeatchT" class="clearfix" onsubmit="return beforeSubmit('F')">
 					<input class="searchname" autocomplete="off" type="search" id="searchinput" value="{{.T.keywords}}" name="keywords" placeholder="请输入您想要查询的招标信息,多个关键词用空格隔开" />
 					<img src='{{Msg "seo" "cdn"}}/images/pc_20.png' id="t-clear" class="j-clearicon" style="display: none;">
 					<input type="button" value="搜索" onclick="zbSeatch('zbSeatchT')"/>
@@ -713,7 +713,6 @@ var IframeOnClick = {
         <el-badge value="限免" type="danger" class="publish-button">
           <el-button type="primary" round @click="goToPublish">信息发布</el-button>
         </el-badge>
-        {{end}}
 				<!--二维码-->
 				<div class="search-right-wx">
 					<img src='{{Msg "seo" "cdn"}}/images/biddingSearch/sea-right-wx.png' />
@@ -729,6 +728,8 @@ var IframeOnClick = {
 						</div>
 					</div>
 				</div>
+        {{end}}
+
 			</div>
       <!--领域化页面不展示-->
       {{if not .T.bidField}}