Browse Source

Merge branch 'dev/v4.8.83_rjj' of qmx/jy into feature/v4.8.83

renjiaojiao 1 year ago
parent
commit
600ccba3e0

+ 17 - 1
src/jfw/front/classificationTag.go

@@ -55,6 +55,22 @@ func RegionAndInformationAndTender() map[string]interface{} {
 	return data
 }
 
+func GetHotIndustry() []map[string][]map[string]interface{} {
+	if bytes, err := redis.GetBytes(RedisNameNew, "pcIndexHotIndustry"); err == nil && bytes != nil {
+		rData := []map[string][]map[string]interface{}{}
+		if err := json.Unmarshal(*bytes, &rData); err != nil {
+			log.Printf("[MANAGER-ERR]pcIndexHotIndustry  GetData Error %v \n", err)
+			return nil
+		}
+		return rData
+	}
+	keysMap := getkeysMap() //热门行业
+	if bytes, err := json.Marshal(keysMap); err == nil && bytes != nil {
+		_ = redis.PutBytes(RedisNameNew, "pcIndexHotIndustry", &bytes, 2*60*60)
+	}
+	return keysMap
+}
+
 // 最新更新的200中标企业
 func GetWinnerInfo() (data []*BuyerList) {
 	// 取缓存
@@ -461,7 +477,7 @@ func NewIndexbids(session *httpsession.Session, r *http.Request) []map[string]in
 		data.Count = total
 	*/
 	// p397 收回查看拟建权限
-	_, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", "招标预告,招标公告,招标结果,招标信用信息", "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 10, "")
+	_, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", "招标预告,招标公告,招标结果,招标信用信息", "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 8, "")
 	if lists != nil {
 		for _, v1 := range *lists {
 			v1["_id"] = encrypt.CommonEncodeArticle("content", v1["_id"].(string))

+ 129 - 0
src/jfw/front/index.go

@@ -2,11 +2,19 @@ package front
 
 import (
 	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
+	"app.yhyue.com/moapp/jypkg/public"
 	"context"
 	"fmt"
 	"github.com/gogf/gf/v2/frame/g"
 	"jy/src/jfw/config"
+	"jy/src/jfw/jyutil"
+	"jy/src/jfw/site/jySchool"
+	"math/rand"
+	"time"
 )
 
 type NewIndex struct {
@@ -45,6 +53,33 @@ func init() {
 
 // NewIndex 新版首页改版
 func (nIndex *NewIndex) NewIndex() error {
+	//招标公告
+	nIndex.T["newbids"] = map[string]interface{}{
+		"biddingList": NewIndexbids(nIndex.Session(), nIndex.Request),
+		"more":        fmt.Sprintf("%s%s", config.Sysconfig["webdomain"].(string), "/list/stype/ZBGG.html"),
+	}
+	//推荐标讯专区
+	rangeInfoType := []int{1, 2, 3, 4}
+	//recommendBid
+	for _, v := range rangeInfoType { //1招标预告 2 中标成交 3采购意向 4 拟建项目
+		nIndex.T[fmt.Sprintf("recommendBid_%d", v)] = GetRecommendBidZone(v, 8)
+	}
+	//项目分包
+
+	//项目专区
+
+	//热门行业
+	nIndex.T["hotIndustry"] = GetHotIndustry()
+	//热门中标企业
+	nIndex.T["hotWinner"] = NewHotEnt(true)
+	//热门采购单位
+	nIndex.T["hotBuyers"] = NewHotEnt(false)
+	//供应商
+	nIndex.T["supplyEnt"] = GetBidInfoPublishEnt()
+	//招投标攻略
+	nIndex.T["strategyList"] = GetStrategyList()
+	//剑鱼课堂
+	nIndex.T["jySchool"] = jyutil.Course(6, 3)
 	//顶部菜单
 	nIndex.T["topMenu"] = g.Cfg("index").MustGet(context.Background(), "topMenu").Maps()
 	return nIndex.Render("/pc/newIndex.html", &nIndex.T)
@@ -92,3 +127,97 @@ func (nIndex *NewIndex) EntServerTransfer(code string) {
 	}()
 	_ = nIndex.Redirect(toUrl)
 }
+
+// 推荐标讯专区
+func GetRecommendBidZone(typ int, pageSize int) (list []map[string]interface{}) {
+	if typ == 0 {
+		typ = 1
+	}
+	rediskey := fmt.Sprintf("pcindex_RecommendBidZone_%d", typ)
+	subtype := ""
+	switch typ {
+	case 1:
+		//招标预告
+		subtype = "预告"
+	case 2:
+		//招标中标成交
+		subtype = "中标,成交"
+	case 3:
+		//采购意向
+		subtype = "采购意向"
+	case 4:
+		//项目分包
+		subtype = "拟建"
+	}
+	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]
+			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"])
+				}
+			}
+
+			list = *lists
+			redis.Put("other", rediskey, list, 2*60*60)
+		}
+	}
+	return list
+}
+
+// GetStrategyList 招投标攻略
+func GetStrategyList() (strategyList []map[string]interface{}) {
+	if l, ok := redis.Get("newother", "pcIndexStrategyList").([]interface{}); ok && l != nil && len(l) > 0 {
+		strategyList = common.ObjArrToMapArr(l)
+	} else {
+		for _, item := range jySchool.GuidelineColumn().SeedData {
+			if res := jySchool.Guideline(item.Code, 15); res != nil && len(*res) > 0 {
+				strategyList = append(strategyList, map[string]interface{}{
+					"name": item.Name,
+					"code": item.Code,
+					"list": res,
+				})
+			}
+		}
+	}
+	return strategyList
+}
+
+func GetIndexProjectList(typ int) []map[string]interface{} {
+
+	/*res, err := g.DB().GetOne(ctx, fmt.Sprintf(`SELECT col.bid_id FROM jyseo.%s col   WHERE col.seo_id = '%s'`, consts.TableName, seoId))
+	  if err != nil || res.IsEmpty() {
+	  	return nil
+	  }*/
+	return nil
+}
+
+// 优秀供应商
+func GetBidInfoPublishEnt() (res []map[string]interface{}) {
+	if l, ok := redis.Get("newother", "pcIndexBidInfoPublishEnt").([]interface{}); ok && l != nil && len(l) > 0 {
+		res = common.ObjArrToMapArr(l)
+	} else {
+		data := public.Mysql.Find("entniche_info", map[string]interface{}{"auth_status": 1}, "id,name", "auth_time DESC", -1, -1)
+		if data != nil && len(*data) > 0 {
+			if len(*data) > 60 {
+				r := rand.Intn(len(*data) - 60)
+				res = (*data)[r : r+60]
+			} else {
+				res = *data
+			}
+			redis.Put("newother", "pcIndexBidInfoPublishEnt", res, 3600*24*7)
+		}
+	}
+	return res
+}

+ 1 - 0
src/jfw/front/nzjProject.go

@@ -459,6 +459,7 @@ func NewHotEnt(isWinner bool) (data []map[string]interface{}) {
 					v["city"] = vs["city"]
 					v["buyerclass"] = vs["buyerclass"]
 				}
+				fmt.Println("buyer", common.InterfaceToStr(v["ent_Id"]))
 				v["count"] = buyerCountMap[common.InterfaceToStr(v["ent_Id"])]
 			}
 		}

+ 336 - 79
src/web/templates/pc/newIndex.html

@@ -3,67 +3,100 @@
 <head>
   <meta charset="UTF-8">
   <title>新版剑鱼首页</title>
+  <link rel="stylesheet" href='{{Msg "seo" "cdn"}}/css/swiper.min.css?v={{Msg "seo" "version"}}'>
   <style>
-  .border{
-    margin: 2px;
-    border: 1px solid #eee;
-  }
-  .line-1{
-    display: flex;
-    flex-direction: row;
-  }
-  .line-1>div{
-    margin: 3px;
-  }
-  .line-1 .title{
-    text-align: center;
-    background: #52BED1;
-    color: #fff;
-  }
-  .line-1 .detail a{
-    text-decoration: none;
-    color: #000;
-    cursor: pointer;
-    white-space: nowrap
-  }
-
-  .line-2{
-    height: 100px;
-    width: 100%;
-    text-align: center;
-    line-height: 100px;
-    background: #159BD5;
-  }
-  .line-3{
-    height: 60px;
-    width: 100%;
-    line-height: 60px;
-    text-align: center;
-  }
-  .group{
-    display: flex;
-    flex-direction: row;
-  }
-  .group .main{
-    flex: 3;
-  }
-  .group .right{
-    flex: 1;
-  }
-  .line-4{
-    display: flex;
-    flex-direction: row;
-    height: 260px;
-  }
-  .biddingDiv{
-    flex: 2;
-  }
-  .adScroll{
-    flex: 3;
-  }
-  .line-5{
-    height: 460px;
-  }
+    .border {
+      margin: 2px;
+      border: 1px solid #eee;
+    }
+
+    .line-1 {
+      display: flex;
+      flex-direction: row;
+    }
+
+    .line-1 > div {
+      margin: 3px;
+    }
+
+    .line-1 .title {
+      text-align: center;
+      background: #52BED1;
+      color: #fff;
+    }
+
+    .line-1 .detail a {
+      text-decoration: none;
+      color: #000;
+      cursor: pointer;
+      white-space: nowrap
+    }
+
+    .line-2 {
+      height: 100px;
+      width: 100%;
+      text-align: center;
+      line-height: 100px;
+      background: #159BD5;
+    }
+
+    .line-3 {
+      height: 60px;
+      width: 100%;
+      line-height: 60px;
+      text-align: center;
+    }
+
+    .group {
+      display: flex;
+      flex-direction: row;
+    }
+
+    .group .main {
+      flex: 3;
+    }
+
+    .group .right {
+      flex: 1;
+    }
+
+    .line-4 {
+      display: flex;
+      flex-direction: row;
+      height: 260px;
+    }
+
+    .biddingDiv {
+      flex: 2;
+    }
+
+    .adScroll {
+      flex: 3;
+    }
+
+    .line-5 {
+      height: 460px;
+    }
+
+    .ellipsis {
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      text-align: justify
+    }
+
+    .line-6 {
+      height: 100px;
+      width: 99.5%;
+      text-align: center;
+      line-height: 100px;
+      background: #159BD5;
+    }
+
+    .line-7 {
+      height: 530px;
+    }
+
   </style>
 </head>
 <body>
@@ -71,52 +104,276 @@
   {{$global:=.T}}
   <div class="line-1 ">
     {{range $v:= $global.topMenu}}
-      <div>
-        <div class="title">{{$v.title}}</div>
-        <div class="detail">
-          {{range $item:= $v.child}}
-            <a href="{{$item.href}}">{{$item.name}}</a>
-          {{end}}
-        </div>
+    <div>
+      <div class="title">{{$v.title}}</div>
+      <div class="detail">
+        {{range $item:= $v.child}}
+        <a href="{{$item.href}}">{{$item.name}}</a>
+        {{end}}
       </div>
+    </div>
     {{end}}
   </div>
   <div class="line-2 border">
-    12广告位
+    <!--    12广告位-->
+    {{range $k,$v:=Ad "new-pc-index-top-ad" -1 .Host}}
+    <div class="school-in-header">
+      <img src="{{$v.S_pic}}" alt="" style="width: 1115px;height: 100px;">
+    </div>
+    {{end}}
   </div>
   <div class="line-3 border">
-    13消息
+    <!-- 消息展示 -->
+    <div class="list-msg">
+      <div class="no-read" style="width: 100px;float:left;">99+条未读</div>
+      <url style="list-style: none;float:left;">
+        <li style="display: inline;">消息111</li>
+        <li style="display: inline;">消息2</li>
+      </url>
+    </div>
   </div>
   <div class="group">
     <div class="main">
-        <div class="line-4">
-          <div class="biddingDiv border">招标公告</div>
-          <div class="adScroll border">轮播图</div>
+      <div class="line-4">
+        <div class="biddingDiv border" style="font-size: 12px;">
+          招标公告
+          <a href="{{.T.newbids.more}}" style="float: right">更多</a>
+          <ul>
+            {{range $k,$v := .T.newbids.biddingList}}
+            <li>
+              <span>{{$v.title}}</span>
+              <span>{{$v.publishtime}}</span>
+            </li>
+            {{end}}
+          </ul>
         </div>
-        <div class="line-5 border">
-          17标讯专区
+        <div class="adScroll border">轮播图
+          <!--轮播图  有数据,不会样式 -->
+          <div class="swiper-wrapper">
+            <!--{{range $k,$v:=Ad "new-pc-index-carousel" -1 .Host}}
+            <a class="swiper-slide"
+               {{if $v.S_link }}href="{{$v.S_link}}"{{end}}
+               {{if eq $v.O_extend.Linktype "abroad" }} target="_blank" {{else}} target="_self" {{end}}
+            >
+            <img class="img-banner" data-theme="{{$v.O_extend.Theme}}" src='{{$v.S_pic}}' alt="{{$v.S_remark}}">
+            </a>
+            {{end}}-->
+          </div>
         </div>
-        <div class="line-5 border">
-          18项目专区
+      </div>
+      <div class="line-5 border" style="font-size: 14px;">
+        <p>17标讯专区</p>
+        <div class="bidAdvance" style="width: 400px;float: left;">
+          招标预告
+          <a href="" style="float: right">更多</a>
+          <ul>
+            {{range $k,$v := .T.recommendBid_1}}
+            <li class="ellipsis">
+              <span>{{$v.title}}</span>
+              <span>{{$v.publishtime}}</span>
+            </li>
+            {{end}}
+          </ul>
         </div>
+
+        <div class="bidAdvance" style="width: 400px;float: right;">
+          中标成交
+          <a href="" style="float: right">更多</a>
+          <ul>
+            {{range $k,$v := .T.recommendBid_2}}
+            <li class="ellipsis">
+              <span>{{$v.title}}</span>
+              <span>{{$v.publishtime}}</span>
+            </li>
+            {{end}}
+          </ul>
+        </div>
+
+        <div class="bidAdvance" style="width: 400px;float: left">
+          采购意向
+          <a href="" style="float: right">更多</a>
+          <ul>
+            {{range $k,$v := .T.recommendBid_3}}
+            <li class="ellipsis">
+              <span>{{$v.title}}</span>
+              <span>{{$v.publishtime}}</span>
+            </li>
+            {{end}}
+          </ul>
+        </div>
+
+        <div class="bidAdvance" style="width: 400px;float: right">
+          项目分包
+          <a href="" style="float: right">更多</a>
+          <ul>
+            {{range $k,$v := .T.recommendBid_4}}
+            <li class="ellipsis">
+              <span>{{$v.title}}</span>
+              <span>{{$v.publishtime}}</span>
+            </li>
+            {{end}}
+          </ul>
+        </div>
+      </div>
+      <div class="line-5 border">
+        18项目专区
+      </div>
+      <div class="line-6 border">
+        21广告位
+        <!--{{range $k,$v:=Ad "new-pc-index-middle-carousel" -1 .Host}}
+        <div class="school-in-header">
+          <img src="{{$v.S_pic}}" alt=""  style="width: 830px;height: 100px;">
+        </div>
+        {{end}}-->
+      </div>
+      <div class="line-7 border">
+        <p>22机构专区</p>
+        <div style="display: flex;">
+          <div class="winner-ent" style="width: 250px;font-size: 14px;">
+            热门中标企业
+            <ul>
+              {{range $k,$v := .T.hotWinner}}
+              <li class="">{{$v.ent_name}}</li>
+              {{end}}
+            </ul>
+          </div>
+          <div class="buyer" style="font-size: 10px;">
+            热门采购单位
+            <ul>
+              {{range $k,$v := .T.hotBuyers}}
+              <li class="">
+                <p>{{$v.ent_Id}} <span>采购标讯{{$v.count}}条</span></p>
+                <apan>所在地:{{$v.city}}</apan>&nbsp;&nbsp;&nbsp;&nbsp;<span>采购单位类型:{{$v.buyerclass}}</span>
+              </li>
+              {{end}}
+            </ul>
+          </div>
+        </div>
+      </div>
+      <div style="height: 100px;background: #0CA1F5;display: flex;">
+        <!--        23号广告位-->
+        {{range $k,$v:=Ad "new-pc-index-twenty-three" -1 .Host}}
+        <div class="school-in-header">
+          <img src="{{$v.S_pic}}" alt="" style="width: 420px;height: 100px;">
+        </div>
+        {{end}}
+      </div>
+      <div style="height: 300px;background: #00D7B0;display: flex;">
+        <div style="width: 220px;margin-left: 20px;">
+          24企业服务专区
+          <h4>营销</h4>
+          <p>实现用户在平台上完成咨询,销售线索、销售机会,客服的权限跟踪处理。</p>
+          <button>专属资讯</button>
+          <br>
+          <button>机构管理</button>
+          <br>
+          <button>任务管理</button>
+        </div>
+        <div>
+          {{range $k,$v:=Ad "new-pc-index-ent-service" -1 .Host}}
+          <div class="school-in-header">
+            <img src="{{$v.S_pic}}" alt="" style="width: 600px;height: 300px;">
+          </div>
+          {{end}}
+        </div>
+
+      </div>
     </div>
-    <div  class="right">
+    <div class="right">
       <div class="border" style="height: 200px">
         16登录注册
       </div>
       <div class="border" style="height: 200px">
         19会员中标喜报
       </div>
-      <div class="border" style="height: 400px">
+      <div class="border" style="height: 500px">
         20热门行业
+        {{range $k,$v := .T.hotIndustry}}
+        {{range $ke,$va := $v}}
+        <div style="font-size: 12px;display: flex;">
+          <p>{{$ke}}</p>
+          <ul style="font-size: 10px;flex: 1;margin: 15px 0 0 0;padding: 0;">
+            {{range $kk,$vv := $va}}
+            {{if le $kk 4}}
+            <li style="list-style-type: none;float: left;display: inline-block;margin-right: 5px;">
+              <a href="{{$vv.url}}">{{$vv.key}}</a>
+            </li>
+            {{end}}
+            {{end}}
+          </ul>
+        </div>
+        {{end}}
+        {{end}}
       </div>
-      <div class="border" style="height: 200px">
+      <div class="border" style="height: 300px;font-size: 13px;">
         25优秀供应商
+        <ul>
+          {{range $k,$v := .T.supplyEnt}}
+          {{if le $k 14}}
+          <li style="list-style: none;">{{$v.name}}</li>
+          {{end}}
+          {{end}}
+        </ul>
       </div>
     </div>
   </div>
+  <div class="line-10 border" style="height: 300px;background: #0A9AEA;">
+    26数据服务专区
+  </div>
+  <div style="height: 400px;display: flex;flex-wrap:wrap;">
+    {{range $k,$v:=Ad "new-pc-index-twenty-seven" -1 .Host}}
+    <div class="school-in-header" style="width: 33.3%">
+      <img src="{{$v.S_pic}}" alt="" style="height: 200px;">
+    </div>
+    {{end}}
+  </div>
+  <div class="strategy-school border" style="height: 400px;display: flex;">
+    <div class="strategy" style="width: 75%">
+      {{$thisCode := "zbcg"}}
+      {{range $k,$v := .T.strategyList}}
+      {{if eq $k 1 }}
+      <div class="school_classify jyxt">
+        <a {{if eq $v.code $thisCode}} class="classify_tabs is-active" {{else}} class="classify_tabs" {{end}}
+           href="/jySchool/{{$v.code}}/index.html">
+          {{$v.name}}
+        </a>
+        <ul>
+          {{range $kk,$vv := $v.list}}
+          <li><span>{{$vv.s_title}}</span> <span>{{$vv.l_createdate}}</span></li>
+          {{end}}
+        </ul>
+      </div>
+      {{end}}
+      {{end}}
+    </div>
+    <div class="school" style="width: 25%">
+      <p>剑鱼学堂</p>
+      <ul>
+        {{range $k,$v := .T.jySchool}}
+        <li>{{$v.s_name}}</li>
+        {{end}}
+      </ul>
+    </div>
+  </div>
+  <div class="line-11 border" style="height: 100px;display: flex;flex-wrap:wrap;">
+    {{range $k,$v:=Ad "new-pc-index-bottom-ad" -1 .Host}}
+    <div class="" style="">
+      <img src="{{$v.S_pic}}" alt="" style="height: 100px;width: 184px;">
+    </div>
+    {{end}}
+  </div>
+
 
 
 </content>
 </body>
+<script src='{{Msg "seo" "cdn"}}/js/pc-message-new.js?v={{Msg "seo" "version"}}'></script>
+<script>
+  // tab点击切换
+  $('.school_classify .classify_tabs').click(function () {
+    $(this).addClass('is-active')
+    $(this).siblings().removeClass('is-active')
+  })
+
+</script>
 </html>