Browse Source

Merge branch 'feature/v4.7.11' of http://192.168.3.207:8080/qmx/jy into feature/v4.7.11

zhangxinlei1996 3 years ago
parent
commit
ea2117eb9f

+ 89 - 1
src/jfw/front/shorturl.go

@@ -37,6 +37,7 @@ var mobileReg = regexp.MustCompile("(?i)(Android|Mobile|Phone)")
 var DateFullLayout = "2006-01-02 15:04:05"
 var Map_stype = map[string]bool{
 	"content":      true,
+	"entservice":   true,
 	"bdprivate":    true,
 	"mailprivate":  true,
 	"bdcontent":    true,
@@ -126,6 +127,94 @@ func (s *Short) Article(stype, id string) error {
 		if stype == "bdcontent" {
 			stype = "content"
 		}
+	} else if stype == "entservice" { //大客户数据快照展示
+		//SE := util.SimpleEncrypt{"entservice"}
+		sid := util.SE3.DecodeString(id)
+		if len(sid) == 0 || (len(sid) > 0 && sid == "") {
+			s.Redirect("/notin/page", 302)
+			return nil
+		}
+		catchKey := fmt.Sprintf("jypcdetail_%s_%s_%s", userId, stype, sid)
+		if res := redis.Get("other", catchKey); res == nil || res == "" {
+			industry := s.GetString("industry")
+			var shareid = s.GetString("id")
+			if len(shareid) == 0 {
+				shareid = "10"
+			}
+			s.T["logid"] = config.Seoconfig["jysskzy"].(string)
+			s.T["shareid"] = se.EncodeString(shareid)
+			s.T["keywords"] = s.GetString("kds")
+			ssOpenid := s.Session().Get("s_m_openid")
+
+			po, bo, wo, obj := pcVRT(sid, industry, true)
+			if obj != nil && len(obj) > 0 {
+
+				if len(po) > 0 {
+					s.T["projectOther"] = po
+				}
+				if len(bo) > 0 {
+					s.T["buyerOther"] = bo
+				}
+				if len(wo) > 0 {
+					s.T["winnerOther"] = wo
+				}
+				obj["urlpath"] = s.Uri()
+				obj["industry"] = industry
+				if ssOpenid != nil {
+					obj["ucbsId"] = util.EncodeArticleId2ByCheck("ucbs#" + ssOpenid.(string) + "#" + id)
+				}
+				if isbid(obj["subtype"]) {
+					obj["winner_enttel"] = getwinnertel(obj["winner"])
+				}
+				//判断时间 //如果是seo页面超过时间访问的进入首页
+				comeinTime := time.Unix(util.Int64All(obj["comeintime"]), 0)
+				if stype == "indexcontent" {
+					if count := public.MQFW.Count("seobidding", map[string]interface{}{"bid": sid}); count <= 0 && comeinTime.Before(time.Now().Add(time.Duration(-util.IntAll(config.Sysconfig["seoBeforeTimeHour"]))*time.Hour)) {
+						return s.Redirect("/")
+					}
+				}
+				FieldProcessing(obj, ssOpenid, industry, id, from_userid, userId, stype, true, false)
+
+				if obj["projectname"] != nil {
+					s.SetSession("projectname", obj["projectname"])
+				}
+				if obj["entidlist"] != nil { //大会员中标企业跳转至画像
+					if winner := util.ObjToString(obj["winner"]); winner != "" {
+						s_winner := util.ObjToString(obj["s_winner"])
+						idObjs, _ := obj["entidlist"].([]interface{})
+						winnerId := ""
+						if names := strings.Split(s_winner, ","); len(names) > 1 {
+							index := 0
+							for i := 0; i < len(names); i++ {
+								if names[i] == winner {
+									index = i
+									break
+								}
+							}
+							if len(idObjs) > index {
+								winnerId = util.ObjToString(idObjs[index])
+							}
+						} else { //中标企业仅一个
+							if len(idObjs) > 0 {
+								winnerId = util.ObjToString(idObjs[0])
+							}
+						}
+						if winnerId != "" && winnerId != "-" {
+							obj["entId"] = util.EncodeArticleId2ByCheck(winnerId)
+						}
+					}
+				}
+				s.T["url"] = s.Uri()
+				s.T["obj"] = obj
+
+				content, _ := s.Render4Cache("/pc/biddetail_rec.html", &s.T)
+				timeout := 60 * 20
+				redis.Put("other", catchKey, string(content), timeout)
+				return s.SetBody(content)
+			}
+		} else {
+			return s.SetBody([]byte(res.(string)))
+		}
 	}
 	ssOpenid := s.Session().Get("s_m_openid")
 	var res *map[string]interface{}
@@ -276,7 +365,6 @@ func (s *Short) Article(stype, id string) error {
 		} else {
 			nodeStr = "false"
 		}
-		fmt.Println(s.T["canRead"])
 		if userId != "" && stype == "indexcontent" { //已登录用户直接跳转至正常三级页
 			return s.Redirect(fmt.Sprintf("/article/content/%s.html", util.CommonEncodeArticle("content", sid)))
 		}

+ 3 - 0
src/web/staticres/public-pc/js/article-content.js

@@ -1217,6 +1217,9 @@ $(function(){
   // $(".com-original").attr("dataHref",originalhref);
   // 点击阅读原文 用户留资
   $(".com-original").on('click',function() {
+    if (entService) {
+      return window.open(originalhref)
+    }
     if (!loginflag) {
       openLoginDig()
       return

+ 1 - 1
src/web/staticres/public-pc/js/header-nav.js

@@ -80,7 +80,7 @@ function trySelectNav (name) {
     }
 
     // 导航栏是否固定
-    var noFixedArr = ['/article/indexcontent','/article/content', '/article/mailprivate']
+    var noFixedArr = ['/article/indexcontent','/article/content', '/article/mailprivate', '/article/entservice']
     var hasPage = noFixedArr.some(function (v) {
       return $href.indexOf(v) !== -1
     })

+ 11 - 1
src/web/templates/pc/biddetail_rec.html

@@ -1450,7 +1450,9 @@ var ucbs_source="pc_rec",ucbsId="{{.T.obj.ucbsId}}";
 		};
 	</script>
 	<script type="text/javascript">
-		var canRead = location.href.indexOf('mailprivate') > -1 || {{.T.canRead}}
+    var pathname = location.pathname
+    var entService = pathname.indexOf('entservice') !== -1
+		var canRead = location.href.indexOf('mailprivate') > -1 || {{.T.canRead}} || entService
     // 免费用户每日查看三次
     if(!(goTemplateData.params.obj.subtype == '采购意向' || goTemplateData.params.obj.subtype == '拟建') && !canRead) {
       $('#tip-title').text('免费查看更多公告')
@@ -1464,6 +1466,14 @@ var ucbs_source="pc_rec",ucbsId="{{.T.obj.ucbsId}}";
 
 		//是否显示遮罩层
 		function checkShowDialog (res) {
+      // 企业级用户不显示广告
+      if (entService) {
+        $('.lead-btn-nj').show()
+        $('.tabfat').show()
+        $(".recoveryfat").show()
+        $('.free-download').hide()
+        return 
+      }
 			var bidmember = false
 			var entniche = false
 			var vip = 0