Prechádzať zdrojové kódy

wip:三级页修改

wangkaiyue 1 rok pred
rodič
commit
a601ed6c7c

+ 4 - 4
internal/consts/consts.go

@@ -28,10 +28,10 @@ var (
 
 	PinyinKeywords map[string]map[string]string
 	TopTypeMap     = map[string]string{
-		"招标预告":   "预告",
-		"招标公告":   "招标",
-		"招标结果":   "结果",
-		"招标信用信息": "其它",
+		"预告": "招标预告",
+		"招标": "招标公告",
+		"结果": "招标结果",
+		"其它": "招标信用",
 	}
 )
 

+ 11 - 2
internal/controller/detail.go

@@ -3,12 +3,13 @@ package controller
 import (
 	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/net/ghttp"
+	"github.com/gogf/gf/v2/util/gconv"
 	"jybxseo/internal/service"
 	"jybxseo/utility"
 )
 
 func BiddingDetail(r *ghttp.Request) {
-	//classNode := service.JyBxSeoClassRoot.GetNodeByCode(code)
+	nameCode := getSubdomain(r.Request.Host)
 	isLogin := utility.JySessionLoginEd(r)
 	seoId := r.Get("seoId").String()
 	if seoId == "" {
@@ -16,9 +17,17 @@ func BiddingDetail(r *ghttp.Request) {
 		return
 	}
 	detail := service.JyBxSeoDetailRoot.GetDetail(r.Context(), seoId, isLogin)
+
+	areaNode := service.JyBxSeoAreaRoot.GetNodeByCode(nameCode)
+	if areaNode == nil {
+		if areaName := gconv.String(detail["area"]); areaName != "" {
+			areaNode = service.JyBxSeoAreaRoot.GetNodeByName(areaName)
+		}
+	}
 	utility.HtmlRender.Render(r, utility.GetCommonRenderPatch(r.Request.UserAgent(), "detail.html"),
 		g.Map{
-			"detail": detail,
+			"areaNode": areaNode,
+			"detail":   detail,
 			//"tdk":      service.JySeoTdk.GetAreaIndexTdk(r.Context(), node.Name),
 		})
 }

+ 1 - 1
internal/service/detailStruct.go

@@ -40,7 +40,7 @@ func (dRoot *DetailRoot) GetDetail(ctx context.Context, seoId string, isLogin bo
 			obj = Filter(obj)
 		}
 		obj["abstract"] = GetAbstractInfo(obj)
-		obj["time"] = time.Unix(gconv.Int64(obj["publishtime"]), 0).Format(time.DateTime)
+		obj["time"] = time.Unix(gconv.Int64(obj["publishtime"]), 0).Format("2006-01-02 15:04:05")
 		obj["bottomAbstract"] = fmt.Sprintf(g.Cfg("global").MustGet(context.Background(), "bottomDescribe").String(), "子站名称")
 		return obj
 	}

+ 1 - 1
internal/service/queryStruct.go

@@ -86,7 +86,7 @@ func (query *SeoBiddingQuery) dataFormat(data []map[string]interface{}) (bList [
 		titleReduction := map[string]bool{}
 		for _, v := range data {
 			bl := &InfoList{
-				Title:   gconv.String(v["title"]),
+				Title:   gconv.String(fmt.Sprintf("【%s】%s", consts.TopTypeMap[gconv.String(v["toptype"])], v["title"])),
 				Url:     fmt.Sprintf("/jybx/%s_%s.html", gtime.NewFromTimeStamp(gconv.Int64(v["publish_time"])).Format("20060102"), gconv.String(v["seo_id"])),
 				Area:    gconv.String(v["area"]),
 				City:    gconv.String(v["city"]),

+ 4 - 4
manifest/config/config.yaml

@@ -35,14 +35,14 @@ mongodb:
 
 redis:
   default: # 配置seo的redis
-    #address: 127.0.0.1:6379
-    address: 192.168.3.149:1712
+    address: 127.0.0.1:6379
+    #address: 192.168.3.149:1712
   other: # 广告位
     address: 192.168.3.149:1712
     #address: 127.0.0.1:6379
   session: # session
-    address: 192.168.3.149:1712
-    #address: 127.0.0.1:6379
+    #address: 192.168.3.149:1712
+    address: 127.0.0.1:6379
 
 listPageSetting:
   pageSize: 20 #每页20条

+ 0 - 1
resource/template/pc/detail.html

@@ -33,7 +33,6 @@
       <section class="w page-main-container">
         <section class="page-main-content">
           <h2 class="detail-title">{{$global.detail.title}}</h2>
-          {{dump $global}}
           <div class="detail-tags">
             <span>所属地区:{{$global.detail.area}}{{$global.detail.city}}</span>
             <span>发布日期:{{$global.detail.time}} </span>