renjiaojiao 1 жил өмнө
parent
commit
89e9362874

+ 2 - 2
src/jfw/front/classificationTag.go

@@ -462,7 +462,7 @@ func GetIncludedInfo() map[string]interface{} {
 }
 
 func NewIndexbids(session *httpsession.Session, r *http.Request) []map[string]interface{} {
-	if bytes, err := redis.GetBytes(RedisNameNew, "jyNewIndexbids"); err == nil && bytes != nil {
+	if bytes, err := redis.GetBytes(RedisNameNew, "pcIndexNewBids"); err == nil && bytes != nil {
 		rData := []map[string]interface{}{}
 		if err := json.Unmarshal(*bytes, &rData); err != nil {
 			log.Printf("[MANAGER-ERR]jyNewIndexbids  GetData Error %v \n", err)
@@ -494,7 +494,7 @@ func NewIndexbids(session *httpsession.Session, r *http.Request) []map[string]in
 			}
 		}
 		if bytes, err := json.Marshal(*lists); err == nil && bytes != nil {
-			_ = redis.PutBytes(RedisNameNew, "jyNewIndexbids", &bytes, 5*60)
+			_ = redis.PutBytes(RedisNameNew, "pcIndexNewBids", &bytes, 5*60)
 		}
 		return *lists
 	}

+ 65 - 21
src/jfw/front/index.go

@@ -25,6 +25,16 @@ type NewIndex struct {
 }
 
 var entServerTransferMap map[string]map[bool]string
+var BiddingTypeUrl = map[int]string{
+	1:  "/list/stype/ZBYG.html",
+	2:  "/list/stype/ZBJG.html",
+	3:  "/list/stype/CGYX.html",
+	6:  "/list/stype/XMFB.html",
+	13: "/list/rmxm/",
+	14: "/list/xxxm/",
+	15: "/list/gjxm/",
+	16: "/list/sjxm/",
+}
 
 func init() {
 	xweb.AddAction(&NewIndex{})
@@ -62,18 +72,37 @@ func (nIndex *NewIndex) NewIndex() error {
 		"more":        fmt.Sprintf("%s%s", config.Sysconfig["webdomain"].(string), "/list/stype/ZBGG.html"),
 	}
 	//推荐标讯专区
-	rangeInfoType := []int{1, 2, 3, 4}
-	//recommendBid
+	rangeInfoType := []int{1, 2, 3}
+	//招标动态
+	bidTrends := []map[string]interface{}{}
 	for _, v := range rangeInfoType { //1招标预告 2 中标成交 3采购意向 4 拟建项目
-		nIndex.T[fmt.Sprintf("recommendBid_%d", v)] = GetRecommendBidZone(v, 8)
+		listData, types := GetRecommendBidZone(v, 5)
+		bidTrends = append(bidTrends, map[string]interface{}{
+			"listData": listData,
+			"types":    types,
+			"url":      fmt.Sprintf("%s%s", common.ObjToString(config.Sysconfig["webdomain"]), BiddingTypeUrl[v]),
+		})
 	}
 	//项目分包
-	nIndex.T["projectPackage"] = GetIndexProjectList(6, 8)
+	projectPage, typesName := GetIndexProjectList(6, 5)
+	bidTrends = append(bidTrends, map[string]interface{}{
+		"listData": projectPage,
+		"types":    typesName,
+		"url":      fmt.Sprintf("%s%s", common.ObjToString(config.Sysconfig["webdomain"]), BiddingTypeUrl[6]),
+	})
+	nIndex.T["bidTrends"] = bidTrends
 	//项目专区
 	projectZoneType := []int{13, 14, 15, 16}
+	projectZone := []map[string]interface{}{}
 	for _, val := range projectZoneType {
-		nIndex.T[fmt.Sprintf("projectZone_%d", val)] = GetIndexProjectList(val, 8)
+		listData, types := GetIndexProjectList(val, 5)
+		projectZone = append(projectZone, map[string]interface{}{
+			"listData": listData,
+			"types":    types,
+			"url":      fmt.Sprintf("%s%s", common.ObjToString(config.Sysconfig["webdomain"]), BiddingTypeUrl[val]),
+		})
 	}
+	nIndex.T["projectZone"] = projectZone
 	//中标喜报
 	nIndex.T["winnerGlad"] = WinnerGladTidings()
 	//热门行业  ////重点招标
@@ -163,51 +192,54 @@ func GetAreaNav() []map[string]interface{} {
 }
 
 // 推荐标讯专区
-func GetRecommendBidZone(typ int, pageSize int) (list []map[string]interface{}) {
+func GetRecommendBidZone(typ int, pageSize int) (list []map[string]interface{}, typs string) {
 	if typ == 0 {
 		typ = 1
 	}
-	rediskey := fmt.Sprintf("pcindex_RecommendBidZone_%d", typ)
+	rediskey := fmt.Sprintf("pcIndexRecommendBidZone_%d", typ)
 	subtype := ""
 	switch typ {
 	case 1:
 		//招标预告
 		subtype = "预告"
+		typs = "招标预告"
 	case 2:
 		//招标中标成交
 		subtype = "中标,成交"
+		typs = "中标成交"
 	case 3:
 		//采购意向
 		subtype = "采购意向"
+		typs = "采购意向"
 	case 4:
-		//项目分包
+		//拟建
 		subtype = "拟建"
+		typs = "拟建项目"
 	}
 	if l, ok := redis.Get("newother", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
 		list = common.ObjArrToMapArr(l)
 	} else {
 		_, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", subtype, "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", pageSize, "")
-		if lists != nil && len(*lists) > 5 {
-			*lists = (*lists)[0:8]
+		if lists != nil && len(*lists) >= 5 {
+			*lists = (*lists)[0:5]
 			for _, v := range *lists {
-				// v["_id"] = EncodeArticleId2ByCheck(v["_id"].(string))
 				v["_id"] = encrypt.CommonEncodeArticle("indexcontent", v["_id"].(string))
 				delete(v, "toptype")
 				delete(v, "s_subscopeclass")
 				tmpdate := v["publishtime"]
-				v["publishtime"] = time.Unix(common.Int64All(tmpdate.(float64)), 0).Format("2006-01-02")
-				if v["budget"] != nil {
-					v["budget"] = ConversionMoeny(v["budget"])
-				} else if v["bidamount"] != nil {
-					v["budget"] = ConversionMoeny(v["bidamount"])
-				}
+				v["publish_time"] = time.Unix(common.Int64All(tmpdate.(float64)), 0).Format("2006-01-02")
+				/*if v["budget"] != nil {
+				  	v["budget"] = ConversionMoeny(v["budget"])
+				  } else if v["bidamount"] != nil {
+				  	v["budget"] = ConversionMoeny(v["bidamount"])
+				  }*/
 			}
 
 			list = *lists
 			redis.Put("other", rediskey, list, 2*60*60)
 		}
 	}
-	return list
+	return list, typs
 }
 
 // GetStrategyList 招投标攻略
@@ -228,7 +260,19 @@ func GetStrategyList() (strategyList []map[string]interface{}) {
 	return strategyList
 }
 
-func GetIndexProjectList(typ, pageSize int) (data []map[string]interface{}) {
+func GetIndexProjectList(typ, pageSize int) (data []map[string]interface{}, types string) {
+	switch typ {
+	case 6:
+		types = "项目分包"
+	case 13:
+		types = "热门项目"
+	case 14:
+		types = "新兴项目"
+	case 15:
+		types = "国家级项目"
+	case 16:
+		types = "省级项目"
+	}
 	redidKey := fmt.Sprintf("pcIndexProjectZone_%d", typ)
 	redisArr, _ := redis.Get("newother", redidKey).([]interface{})
 	if len(redisArr) > 0 {
@@ -237,14 +281,14 @@ func GetIndexProjectList(typ, pageSize int) (data []map[string]interface{}) {
 	}
 	res, err := g.DB().Query(gctx.New(), fmt.Sprintf(`SELECT nbl.bid_id as bid_id,nbl.title as title,nbl.publish_time as publish_time FROM jyseo_test.new_bid_sign nbs  LEFT JOIN jyseo_test.new_bidList nbl ON nbs.bid_id = nbl.bid_id  WHERE bitmapContains(sign, %d) ORDER BY publish_time DESC LIMIT %d `, typ, pageSize))
 	if err != nil || res.IsEmpty() {
-		return nil
+		return nil, types
 	}
 	for _, v := range res.List() {
 		v["bid_id"] = encrypt.EncodeArticleId2ByCheck(common.InterfaceToStr(v["bid_id"]))
 		v["publish_time"] = time.Unix(common.Int64All(v["publish_time"]), 0).Format("2006-01-02")
 		data = append(data, v)
 	}
-	return data
+	return data, types
 }
 
 // 优秀供应商

+ 3 - 3
src/jfw/front/nzjProject.go

@@ -464,9 +464,9 @@ func NewHotEnt(isWinner bool) (data []map[string]interface{}) {
 			}
 		}
 		redis.Put("newother", redidsKey, *portraitRecord, 3600*24*7)
-		if len(*portraitRecord) > 10 {
-			randomNumber := rand.Intn(len(*portraitRecord) - 10)
-			data = (*portraitRecord)[randomNumber : randomNumber+10]
+		if len(*portraitRecord) > 5 {
+			randomNumber := rand.Intn(len(*portraitRecord) - 5)
+			data = (*portraitRecord)[randomNumber : randomNumber+5]
 		} else {
 			data = *portraitRecord
 		}

+ 2 - 2
src/web/templates/pc/newIndex.html

@@ -61,7 +61,7 @@
             </section>
             <!-- 项目专区 -->
             <section class="aside-main-module mb20">
-              {{include "/pc/template/index/module-card-list-container.html"}}
+              {{include "/pc/template/index/project-card-list-container.html"}}
             </section>
             <!-- 项目专区下广告位 -->
             <section class="aside-main-module mb20 swiper-module-21">
@@ -92,7 +92,7 @@
             </section>
             <!-- 中标喜报 -->
             <section class="aside-right-module mb20">
-              {{include "/pc/template/index/notice-card.html"}}
+              {{include "/pc/template/index/bidding-good-news-card.html"}}
             </section>
             <!-- 热门行业 -->
             <section class="aside-right-module mb20">

+ 1 - 1
src/web/templates/pc/template/index/bidding-desc-module.html

@@ -16,5 +16,5 @@
       <li class="bidding-desc-content-card-list" data-name="中标技巧"></li>
       <li class="bidding-desc-content-card-list" data-name="回答百科"></li>
     </ul>
-  </main> 
+  </main>
 </section>

+ 20 - 0
src/web/templates/pc/template/index/bidding-good-news-card.html

@@ -0,0 +1,20 @@
+<section class="notice-card">
+  <header class="notice-card-header">
+    <h3 class="notice-card-title notice-header-bg">剑鱼会员中标喜报</h3>
+  </header>
+  <main class="notice-card-content">
+    <ul class="notice-card-list clearfix">
+      {{range $v := .T.winnerGlad}}
+      {{range $kk,$vv := $v}}
+      <li class="notice-card-list-item">
+        <i class="notice-item-prefix-icon j-icon base-icon icon-img-sahua"></i>
+        <p class="notice-card-list-item-content ellipsis">{{$kk}}</p>
+      </li>
+      {{end}}
+      {{end}}
+    </ul>
+  </main>
+  <!-- <main class="notice-card-content notice-card-list empty">
+    {{include "/pc/template/common/empty.html" .}}
+  </main> -->
+</section>

+ 19 - 2
src/web/templates/pc/template/index/ent-list-module.html

@@ -5,10 +5,27 @@
   </header>
   <main class="module-card-content ent-list-module-content">
     <div class="ent-list-module-content-left">
-      {{include "/pc/template/index/cms-card-deep.html"}}
+      <section class="cms-card header-deep-theme zb-aside-card">
+        <header class="cms-card-header">
+          <h3 class="cms-card-title">热门中标企业</h3>
+        </header>
+        <main class="cms-card-content border-ec">
+          <ul class="cms-card-list clearfix">
+            {{range $v := .T.hotWinner}}
+            <li class="cms-card-list-item">
+              <a class="cms-card-list-item-left cms-link ellipsis" target="_blank" title="" href="" target="_blank">{{$v.ent_name}}</a>
+              <!-- <span class="cms-card-list-item-right">asdfsafsdafsadf</span> -->
+            </li>
+            {{end}}
+          </ul>
+        </main>
+        <!-- <main class="cms-card-content cms-card-list empty">
+          {{include "/pc/template/common/empty.html" .}}
+        </main> -->
+      </section>
     </div>
     <div class="ent-list-module-content-right">
       {{include "/pc/template/index/hot-buyer-card.html"}}
     </div>
-  </main> 
+  </main>
 </section>

+ 7 - 32
src/web/templates/pc/template/index/hot-buyer-card.html

@@ -4,60 +4,35 @@
   </header>
   <main class="hot-buyer-card-content">
     <ul class="hot-buyer-list">
+      {{range $v := .T.hotBuyers}}
       <li class="hot-buyer-list-item buyer-list-cell">
         <div class="buyer-list-cell-hd">
-          <div class="list-info-item-head head-blue">北京剑鱼信息技术</div>
+          <div class="list-info-item-head head-blue">{{$v.ent_Id}}</div>
         </div>
         <div class="buyer-list-cell-bd">
           <div class="buyer-list-cell-title">
-            <a class="cms-link" title="" href="" target="_blank">北京剑鱼信息技术</a>
+            <a class="cms-link" title="" href="" target="_blank">{{$v.ent_Id}}</a>
           </div>
           <div class="buyer-list-cell-info">
             <p class="buyer-list-cell-info-item">
               <span class="buyer-list-cell-info-item-label">所在地:</span>
-              <span class="buyer-list-cell-info-item-value">河南,郑州</span>
+              <span class="buyer-list-cell-info-item-value">{{$v.city}}</span>
             </p>
             <p class="buyer-list-cell-info-item">
               <span class="buyer-list-cell-info-item-label">采购单位类型:</span>
-              <span class="buyer-list-cell-info-item-value">市政</span>
+              <span class="buyer-list-cell-info-item-value">{{$v.buyerclass}}</span>
             </p>
           </div>
         </div>
         <div class="buyer-list-cell-ft">
           <p class="buyer-list-cell-num-container">
             <span class="buyer-list-cell-num-container">
-              采购标讯:<i class="highlight-text">3552</i> 条
-            </span>
-          </p>
-        </div>
-      </li>
-      <li class="hot-buyer-list-item buyer-list-cell">
-        <div class="buyer-list-cell-hd">
-          <div class="list-info-item-head head-blue">北京剑鱼信息技术</div>
-        </div>
-        <div class="buyer-list-cell-bd">
-          <div class="buyer-list-cell-title">
-            <a class="cms-link" title="" href="" target="_blank">北京剑鱼信息技术</a>
-          </div>
-          <div class="buyer-list-cell-info">
-            <p class="buyer-list-cell-info-item">
-              <span class="buyer-list-cell-info-item-label">所在地:</span>
-              <span class="buyer-list-cell-info-item-value">河南,郑州</span>
-            </p>
-            <p class="buyer-list-cell-info-item">
-              <span class="buyer-list-cell-info-item-label">采购单位类型:</span>
-              <span class="buyer-list-cell-info-item-value">市政</span>
-            </p>
-          </div>
-        </div>
-        <div class="buyer-list-cell-ft">
-          <p class="buyer-list-cell-num-container">
-            <span class="buyer-list-cell-num-container">
-              采购标讯:<i class="highlight-text">3552</i> 条
+              采购标讯:<i class="highlight-text">{{$v.count}}</i> 条
             </span>
           </p>
         </div>
       </li>
+      {{end}}
     </ul>
   </main>
 </section>

+ 8 - 27
src/web/templates/pc/template/index/hot-industry-card.html

@@ -3,43 +3,24 @@
     <h3 class="cms-card-title">热门行业</h3>
   </header>
   <main class="cms-card-content border-ec industry-aside-list">
+    {{range $v := .T.hotIndustry}}
+    {{range $ke,$va := $v}}
     <div class="industry-aside-item">
       <div class="industry-aside-item-name">
-        <a class="cms-link" title="" href="" target="_blank">fasfsafsadf</a>
+        <a class="cms-link" title="" href="" target="_blank">{{$ke}}</a>
       </div>
       <ul class="industry-aside-item-content">
+        {{range $kk,$vv := $va}}
         <li>
-          <a class="cms-link" title="" href="" target="_blank">fassdds</a>
-        </li>
-        <li>
-          <a class="cms-link" title="" href="" target="_blank">fassdds</a>
-        </li>
-        <li>
-          <a class="cms-link" title="" href="" target="_blank">fassdds</a>
-        </li>
-        <li>
-          <a class="cms-link highlight-text" title="" href="" target="_blank">更多 ></a>
-        </li>
-      </ul>
-    </div>
-    <div class="industry-aside-item">
-      <div class="industry-aside-item-name">
-        <a class="cms-link" title="" href="" target="_blank">fasfsafsadf</a>
-      </div>
-      <ul class="industry-aside-item-content">
-        <li>
-          <a class="cms-link" title="" href="" target="_blank">fassdds</a>
-        </li>
-        <li>
-          <a class="cms-link" title="" href="" target="_blank">fassdds</a>
-        </li>
-        <li>
-          <a class="cms-link" title="" href="" target="_blank">fassdds</a>
+          <a class="cms-link" title="" href="{{$vv.url}}" target="_blank">{{$vv.key}}</a>
         </li>
+        {{end}}
         <li>
           <a class="cms-link highlight-text" title="" href="" target="_blank">更多 ></a>
         </li>
       </ul>
     </div>
+    {{end}}
+    {{end}}
   </main>
 </section>

+ 27 - 6
src/web/templates/pc/template/index/module-card-list-container.html

@@ -1,12 +1,33 @@
 <!-- 招标动态/项目专区卡片 -->
+
 <section class="module-card-container">
   <header class="module-card-header">
-    <h3 class="module-card-title">招标预告</h3>
+    <h3 class="module-card-title">招标动态</h3>
   </header>
   <main class="module-card-content">
-    {{include "/pc/template/index/cms-card.html"}}
-    {{include "/pc/template/index/cms-card.html"}}
-    {{include "/pc/template/index/cms-card.html"}}
-    {{include "/pc/template/index/cms-card.html"}}
-  </main> 
+    {{range $v := .T.bidTrends}}
+    <section class="cms-card">
+      <header class="cms-card-header">
+        <h3 class="cms-card-title">{{$v.types}}</h3>
+        <div class="cms-card-header-right">
+          <a class="highlight-text pointer cms-link" href="{{$v.url}}" target="_blank">查看更多 ></a>
+        </div>
+      </header>
+      <main class="cms-card-content">
+        <ul class="cms-card-list clearfix">
+          {{range $vv := $v.listData}}
+          <li class="cms-card-list-item">
+            <a class="cms-card-list-item-left cms-link ellipsis" target="_blank" title="" href="" target="_blank">{{$vv.title}}</a>
+            <span class="cms-card-list-item-right">{{$vv.publish_time}}</span>
+          </li>
+          {{end}}
+        </ul>
+      </main>
+      <!-- <main class="cms-card-content cms-card-list empty">
+        {{include "/pc/template/common/empty.html" .}}
+      </main> -->
+    </section>
+    {{end}}
+  </main>
 </section>
+

+ 4 - 10
src/web/templates/pc/template/index/notice-card.html

@@ -1,21 +1,15 @@
 <section class="notice-card">
   <header class="notice-card-header">
-    <h3 class="notice-card-title notice-header-bg">剑鱼会员中标喜报</h3>
+    <h3 class="notice-card-title notice-header-bg">优秀供应商</h3>
   </header>
   <main class="notice-card-content">
     <ul class="notice-card-list clearfix">
+      {{range $k,$v := .T.supplyEnt}}
       <li class="notice-card-list-item">
         <i class="notice-item-prefix-icon j-icon base-icon icon-img-sahua"></i>
-        <p class="notice-card-list-item-content ellipsis">fasfasdfasdfsadfasf</p>
-      </li>
-      <li class="notice-card-list-item">
-        <i class="notice-item-prefix-icon j-icon base-icon icon-img-sahua"></i>
-        <p class="notice-card-list-item-content ellipsis">fasfasdfasdfsadfasf</p>
-      </li>
-      <li class="notice-card-list-item">
-        <i class="notice-item-prefix-icon j-icon base-icon icon-img-sahua"></i>
-        <p class="notice-card-list-item-content ellipsis">fasfasdfasdfsadfasf</p>
+        <p class="notice-card-list-item-content ellipsis">{{$v.name}}</p>
       </li>
+      {{end}}
     </ul>
   </main>
   <!-- <main class="notice-card-content notice-card-list empty">

+ 32 - 0
src/web/templates/pc/template/index/project-card-list-container.html

@@ -0,0 +1,32 @@
+<!-- 招标动态/项目专区卡片 -->
+<section class="module-card-container">
+  <header class="module-card-header">
+    <h3 class="module-card-title">项目专区</h3>
+  </header>
+  <main class="module-card-content">
+    {{range $v := .T.projectZone}}
+    <section class="cms-card">
+      <header class="cms-card-header">
+        <h3 class="cms-card-title">{{$v.types}}</h3>
+        <div class="cms-card-header-right">
+          <a class="highlight-text pointer cms-link" href="{{$v.url}}" target="_blank">查看更多 ></a>
+        </div>
+      </header>
+      <main class="cms-card-content">
+        <ul class="cms-card-list clearfix">
+          {{range $vv := $v.listData}}
+          <li class="cms-card-list-item">
+            <a class="cms-card-list-item-left cms-link ellipsis" target="_blank" title="" href="" target="_blank">{{$vv.title}}</a>
+            <span class="cms-card-list-item-right">{{$vv.publish_time}}</span>
+          </li>
+          {{end}}
+        </ul>
+      </main>
+      <!-- <main class="cms-card-content cms-card-list empty">
+        {{include "/pc/template/common/empty.html" .}}
+      </main> -->
+    </section>
+    {{end}}
+  </main>
+</section>
+

+ 6 - 12
src/web/templates/pc/template/index/zb-aside-card.html

@@ -1,24 +1,18 @@
 <section class="cms-card header-deep-theme zb-aside-card">
   <header class="cms-card-header">
-    <h3 class="cms-card-title">标公告</h3>
+    <h3 class="cms-card-title">标公告</h3>
     <div class="cms-card-header-right">
-      <a class="pointer cms-link" href="" target="_blank">查看更多 ></a>
+      <a class="pointer cms-link" href="{{.T.newbids.more}}" target="_blank">查看更多 ></a>
     </div>
   </header>
   <main class="cms-card-content border-ec">
     <ul class="cms-card-list clearfix">
+      {{range $k,$v := .T.newbids.biddingList}}
       <li class="cms-card-list-item">
-        <a class="cms-card-list-item-left cms-link ellipsis" target="_blank" title="" href="" target="_blank">fasfasdfasdfsadfasf</a>
-        <span class="cms-card-list-item-right">asdfsafsdafsadf</span>
-      </li>
-      <li class="cms-card-list-item">
-        <a class="cms-card-list-item-left cms-link ellipsis" target="_blank" title="" href="" target="_blank">fasfasdfasdfsadfasf</a>
-        <span class="cms-card-list-item-right">asdfsafsdafsadf</span>
-      </li>
-      <li class="cms-card-list-item">
-        <a class="cms-card-list-item-left cms-link ellipsis" target="_blank" title="" href="" target="_blank">fasfasdfasdfsadfasf</a>
-        <span class="cms-card-list-item-right">asdfsafsdafsadf</span>
+        <a class="cms-card-list-item-left cms-link ellipsis" target="_blank" title="" href="" target="_blank">{{$v.title}}</a>
+        <span class="cms-card-list-item-right">{{$v.publishtime}}</span>
       </li>
+      {{end}}
     </ul>
   </main>
   <!-- <main class="cms-card-content cms-card-list empty">