Przeglądaj źródła

Merge remote-tracking branch 'origin/feature/v4.8.47' into dev/v4.8.47_fuwencai

# Conflicts:
#	src/jfw/modules/app/src/app/front/tags.go
#	src/jfw/modules/app/src/web/staticres/jyapp/tags/js/index.js
fuwencai 2 lat temu
rodzic
commit
c3d1e55795

+ 1 - 1
src/jfw/modules/app/src/app/filter/loginfilter.go

@@ -31,7 +31,7 @@ var urls = []*regexp.Regexp{
 	regexp.MustCompile("^/jyapp/big/page/free_high_set"),
 	regexp.MustCompile("^/jyapp/big/page/ent_portrait$"),
 	regexp.MustCompile("^/jyapp/big/page/ent_portrait_change$"),
-	regexp.MustCompile("^/jyapp/tags/.*"),
+	regexp.MustCompile("^/jyapp/s/.*"),
 }
 
 type loginFilter struct {

+ 1 - 1
src/jfw/modules/app/src/app/front/search.go

@@ -54,7 +54,7 @@ func (s *Search) Site() error {
 
 func (s *Search) MainSearch() error {
 	if userId, _ := s.GetSession("userId").(string); userId == "" {
-		return s.Redirect("/jyapp/tags/home/home.html")
+		return s.Redirect("/jyapp/s/tags/home/home.html")
 	}
 	return s.Redirect("/jy_mobile/tabbar/home")
 	// 	if len(industrylist) > 0 {

+ 52 - 28
src/jfw/modules/app/src/app/front/tags.go

@@ -20,11 +20,22 @@ var (
 		"上海": true,
 		"重庆": true,
 	}
+	firstList = map[string]bool{
+		"list": true,
+		"tags": true,
+	}
+	infoTypeToCode = map[string]string{
+		"ZBYG":   "2_1",
+		"ZBGG":   "3_1",
+		"ZBJG":   "4_1",
+		"ZBXYXX": "5_1",
+		"NJXM":   "1_1",
+	}
 )
 
 type Tags struct {
 	*xweb.Action
-	tagsIndex xweb.Mapper `xweb:"/jyapp/tags/(\\w+)/(\\w+).html"`
+	tagsIndex xweb.Mapper `xweb:"/jyapp/s/(\\w+)/(\\w+)/(\\w+).html"`
 }
 
 func init() {
@@ -65,11 +76,13 @@ func init() {
 	}
 }
 
-func (tg *Tags) TagsIndex(types, name string) error {
+func (tg *Tags) TagsIndex(first, types, name string) error {
 	defer qu.Catch()
+	if !firstList[first] {
+		return tg.Redirect("/jyapp/free/swordfish/about?from=tags")
+	}
 	if userId, _ := tg.GetSession("userId").(string); userId != "" {
 		return tg.Redirect("/jyapp/jylab/mainSearch?isLogin=1")
-		//return tg.Redirect("/jy_mobile/tabbar/home")
 	}
 onceAgain:
 	tagsMobileKey := fmt.Sprintf("tags_mobile_key_%s_%s", types, name)
@@ -95,7 +108,6 @@ onceAgain:
 				IsSearch: true,                                    //是否进行bidding数据查询
 			}
 			isInfoList bool // 是否是在列表页面
-
 		)
 		areaList, areaToCode, cityToCode, areaToCity = jyutil.GetAllArea()
 		infoTypeList, topMap = jyutil.GetInfoType()
@@ -132,6 +144,9 @@ onceAgain:
 				}
 			}
 		case jyutil.Label["infoType"]: //信息类型
+			if infoTypeToCode[name] != "" {
+				codes = strings.Split(infoTypeToCode[name], "_")
+			}
 			if len(codes) == 2 {
 				if topMap != nil && topMap[codes[0]] != nil {
 					biddingInfo.IsEffective = true
@@ -144,12 +159,20 @@ onceAgain:
 					biddingInfo.PageFormat(codes[1])
 					prevPage = fmt.Sprintf("%s_%d", codes[0], biddingInfo.PageNum-1)
 					nextPage = fmt.Sprintf("%s_%d", codes[0], biddingInfo.PageNum+1)
+					if biddingInfo.PageNum == 2 {
+						code, _ := strconv.ParseInt(codes[0], 10, 64)
+						prevPage = jyutil.CodeToInfoType[code]
+					}
 					isInfoList = true
 				}
 			}
 		case jyutil.Label["industry"]: //行业
-			if len(codes) == 3 {
-				indu2, class1, class2 := jyutil.GetIndustryKeywords(codes[1]) // 获取标的物的名称
+			if len(codes) == 4 || len(codes) == 5 {
+				if len(codes) == 4 {
+					//默认第一页
+					codes = append(codes, "1")
+				}
+				indu2, class1, class2 := jyutil.GetIndustryKeywords(codes[3]) // 获取标的物的名称
 				if class1 != "" && class2 != "" && indu2 != "" {
 					biddingInfo.IsEffective = true
 					// 位置导航
@@ -160,16 +183,18 @@ onceAgain:
 					biddingInfo.Keys = indu2                                                    //关键词
 					biddingInfo.Total = qu.IntAll(config.Seoconfig["seoUnderlyingAssetsTotal"]) //标的物查询数据量100
 					title = fmt.Sprintf("%s招标采购%s", indu2, suffix)
-					biddingInfo.PageFormat(codes[2])
-					prevPage = fmt.Sprintf("%s_%s_%d", codes[0], codes[1], biddingInfo.PageNum-1)
-					nextPage = fmt.Sprintf("%s_%s_%d", codes[0], codes[1], biddingInfo.PageNum+1)
+					biddingInfo.PageFormat(codes[4])
+					prevPage = fmt.Sprintf("%s_all_all_%s_%d", codes[0], codes[3], biddingInfo.PageNum-1)
+					nextPage = fmt.Sprintf("%s_all_all_%s_%d", codes[0], codes[3], biddingInfo.PageNum+1)
+					if biddingInfo.PageNum == 2 {
+						prevPage = fmt.Sprintf("%s_all_all_%s", codes[0], codes[3])
+					}
 				}
 				isInfoList = true
-			} else if name == "home" {
+			} else if name == "all" {
 				biddingInfo.IsEffective = true
 				biddingInfo.IsSearch = false
-				industryData := jyutil.GetIndustry("/jyapp/tags/indu/%d_%d_1.html")
-				tg.T["industryData"] = industryData // 行业标的物全部
+				tg.T["industryData"] = jyutil.GetIndustry("/jyapp/s/tags/industry/%d_all_all_%d.html") // 行业标的物全部
 				title = fmt.Sprintf("%s%s", "招标导航", suffix)
 			}
 		case jyutil.Label["buyer"]: //采购单位
@@ -223,7 +248,7 @@ onceAgain:
 		tg.T["areaList"] = areaList
 		tg.T["currentLocation"] = currentLocation
 		//行业首页 不用广告位
-		if !(types == "indu" && name == "home") {
+		if !(types == "industry" && name == "home") {
 			tg.T["adList"] = jyutil.GetAdInfo(tg.Request.Host)
 		}
 		if biddingInfo.IsSearch {
@@ -235,32 +260,31 @@ onceAgain:
 		if biddingInfo.PageNum == (biddingInfo.Total-1)/biddingInfo.PageSize+1 {
 			nextPage = ""
 		}
-		tg.T["prevPage"] = qu.If(prevPage != "", fmt.Sprintf("/jyapp/tags/%s/%s.html", types, prevPage), "").(string)
-		tg.T["nextPage"] = qu.If(nextPage != "", fmt.Sprintf("/jyapp/tags/%s/%s.html", types, nextPage), "").(string)
+		tg.T["prevPage"] = qu.If(prevPage != "", fmt.Sprintf("/jyapp/s/tags/%s/%s.html", types, prevPage), "").(string)
+		tg.T["nextPage"] = qu.If(nextPage != "", fmt.Sprintf("/jyapp/s/tags/%s/%s.html", types, nextPage), "").(string)
 		tg.T["totalPage"] = (biddingInfo.Total-1)/biddingInfo.PageSize + 1
 		tg.T["pageNum"] = biddingInfo.PageNum
 		tg.T["hotArea"] = jyutil.GetHotArea()
 		if biddingInfo.IsBuyer && !biddingInfo.IsWinner {
-			tg.T["buyerList"] = &jyutil.InfoRes{
-				Name: "采购单位",
-				Url:  "/jyapp/tags/buyer/1.html",
-				List: biddingInfo.GetEntInfoList(qu.IntAll(config.Seoconfig["buyerListLimit"]), 0),
-			}
+			//tg.T["buyerList"] = &jyutil.InfoRes{
+			//	Name: "采购单位",
+			//	Url:  "/jyapp/tags/buyer/1.html",
+			//	List: biddingInfo.GetEntInfoList(qu.IntAll(config.Seoconfig["buyerListLimit"]), 0),
+			//}
 		}
 		if !biddingInfo.IsBuyer && biddingInfo.IsWinner {
-			tg.T["winnerList"] = &jyutil.InfoRes{
-				Name: "中标企业",
-				Url:  "/jyapp/tags/winner/1.html",
-				List: biddingInfo.GetEntInfoList(qu.IntAll(config.Seoconfig["winnerListLimit"]), 1),
-			}
+			//tg.T["winnerList"] = &jyutil.InfoRes{
+			//	Name: "中标企业",
+			//	Url:  "/jyapp/tags/winner/1.html",
+			//	List: biddingInfo.GetEntInfoList(qu.IntAll(config.Seoconfig["winnerListLimit"]), 1),
+			//}
 		}
 		if hasIndustryNav {
-			industryData := jyutil.GetIndustry("/jyapp/tags/indu/%d_%d_1.html")
-			tg.T["industryNav"] = jyutil.GetIndustryNav(industryData) // 标的物小于等于5个字的
+			tg.T["industryNav"] = jyutil.GetIndustryNav(jyutil.GetIndustry("/jyapp/s/tags/industry/%d_all_all_%d.html")) // 标的物小于等于5个字的
 		}
 		tg.T["areaTopTip"] = areaTopTip
 		tg.T["title"] = title
-		tg.T["HomeOrigin"] = "/jyapp/tags/home/home.html"
+		tg.T["HomeOrigin"] = "/jyapp/s/tags/home/home.html"
 		tg.T["Home"] = "/jyapp/jylab/mainSearch"
 		tg.T["isInfoList"] = isInfoList
 		//模板redis缓存

+ 25 - 18
src/jfw/modules/app/src/app/jyutil/tags.go

@@ -22,7 +22,7 @@ import (
 )
 
 var (
-	mobileHref          = "/jyapp/tags/%s/%s.html"
+	mobileHref          = "/jyapp/s/tags/%s/%s.html"
 	infoTypeRedisKey    = "mobile_seo_infoType_home"
 	areaRedisKey        = "mobile_seo_area_home"
 	hotAreaRedisKey     = "mobile_seo_hot_area"
@@ -36,18 +36,25 @@ var (
 	randCount           = 600
 	Label               = map[string]string{
 		"area":     "area",
-		"infoType": "it",
-		"industry": "indu",
+		"infoType": "stype",
+		"industry": "industry",
 		"buyer":    "buyer",
 		"winner":   "winner",
 		"home":     "home",
 	}
-	areaLock     = &sync.Mutex{}
-	infoTypeLock = &sync.Mutex{}
-	infoListLock = &sync.Mutex{}
-	AreaInfo     []map[string][]*SeoInfo
-	ReqLimitInit *ReqLimit
-	RandNum      *rand.Rand
+	areaLock       = &sync.Mutex{}
+	infoTypeLock   = &sync.Mutex{}
+	infoListLock   = &sync.Mutex{}
+	AreaInfo       []map[string][]*SeoInfo
+	ReqLimitInit   *ReqLimit
+	RandNum        *rand.Rand
+	CodeToInfoType = map[int64]string{
+		2: "ZBYG",
+		3: "ZBGG",
+		4: "ZBJG",
+		5: "ZBXYXX",
+		1: "NJXM",
+	}
 )
 
 type ReqLimit struct {
@@ -95,14 +102,14 @@ func GetInfoType() (list []map[string]interface{}, topMap map[string]*SeoInfo) {
 		for _, v := range data {
 			topMap[fmt.Sprintf("%d", qu.Int64All(v["id"]))] = &SeoInfo{
 				Name: qu.ObjToString(v["name"]),
-				Url:  fmt.Sprintf(mobileHref, Label["infoType"], combine(2, qu.Int64All(v["id"]), 1, 0)),
+				Url:  fmt.Sprintf(mobileHref, Label["infoType"], CodeToInfoType[qu.Int64All(v["id"])]),
 			}
 			if qu.ObjToString(v["name"]) == "拟建项目" {
 				continue
 			}
 			list = append(list, map[string]interface{}{
 				"name": qu.ObjToString(v["name"]),
-				"url":  fmt.Sprintf(mobileHref, Label["infoType"], combine(2, qu.Int64All(v["id"]), 1, 0)),
+				"url":  fmt.Sprintf(mobileHref, Label["infoType"], CodeToInfoType[qu.Int64All(v["id"])]),
 			})
 		}
 	}
@@ -220,7 +227,7 @@ type IndustryStruct struct {
 func GetIndustry(industryHref string) *IndustryStruct {
 	saveData := IndustryStruct{
 		Name: "招标导航",
-		Url:  "/jyapp/tags/indu/home.html",
+		Url:  "/jyapp/s/tags/industry/all.html",
 	}
 	redisKey := fmt.Sprintf(industryRedisKey)
 	if l, err := GetIndustryCache(redisKey); l != nil && (l.List != nil) && len(l.List) > 0 && err == nil {
@@ -301,24 +308,24 @@ var (
 	biddingType = []*SeoInfo{
 		{
 			Name: "招标预告",
-			Url:  fmt.Sprintf(mobileHref, Label["infoType"], combine(2, 2, 1, 0)),
+			Url:  fmt.Sprintf(mobileHref, Label["infoType"], CodeToInfoType[2]),
 		},
 		{
 			Name: "招标公告",
-			Url:  fmt.Sprintf(mobileHref, Label["infoType"], combine(2, 3, 1, 0)),
+			Url:  fmt.Sprintf(mobileHref, Label["infoType"], CodeToInfoType[3]),
 		},
 		{
 			Name: "招标结果",
-			Url:  fmt.Sprintf(mobileHref, Label["infoType"], combine(2, 4, 1, 0)),
+			Url:  fmt.Sprintf(mobileHref, Label["infoType"], CodeToInfoType[4]),
 		},
 		{
 			Name: "招标信用信息",
-			Url:  fmt.Sprintf(mobileHref, Label["infoType"], combine(2, 5, 1, 0)),
+			Url:  fmt.Sprintf(mobileHref, Label["infoType"], CodeToInfoType[5]),
 		},
 		{
 			Name:     "拟建项目",
+			Url:      fmt.Sprintf(mobileHref, Label["infoType"], CodeToInfoType[1]),
 			Nickname: "拟建",
-			Url:      fmt.Sprintf(mobileHref, Label["infoType"], combine(2, 1, 1, 0)),
 		},
 	}
 )
@@ -492,7 +499,7 @@ func (b *BiddingInfo) GetBiddingInfo(types, name string, currentLocation []*SeoI
 						}
 						bir = []*InfoRes{
 							{
-								Name: fmt.Sprintf("%s%s", currentLocation[0].Name, qu.If(types == "indu" && name != "home", "信息列表", "").(string)),
+								Name: fmt.Sprintf("%s%s", currentLocation[0].Name, qu.If(types == "industry" && name != "home", "信息列表", "").(string)),
 								Url:  "", //currentLocation[0].url
 								List: formatData[start:end],
 							},

+ 1 - 1
src/jfw/modules/app/src/seo.json

@@ -102,7 +102,7 @@
 	"distance":"0",
 	"wxDomain":"http://web1-jydev-zxl.jianyu360.cn",
   "jyadd": "https://web2-qmxtest.jydev.jianyu360.com/",
-  "hotArea": "北京,山东,陕西,河南,广东",
+  "hotArea": "北京,山东,陕西,江苏,广东",
   "areaInfo":[
     {"华北": [{"Name":"北京"},{"Name":"天津"},{"Name":"河北"},{"Name":"山西"},{"Name":"内蒙古"}]},
     {"华中": [{"Name":"河南"},{"Name":"湖北"},{"Name":"湖南"}]},

+ 5 - 1
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/unit_portrayal.js

@@ -394,6 +394,8 @@ var vNode = {
             if( _this.userInfo.isLogin) {
               _this.getNewMsg(); // 中标动态
               _this.getChartData(); // 企业画像
+            } else {
+              _this.chartLoading = false
             }
             _this.getUsage(); // 超级订阅用户剩余次数
             // _this.getNewMsg(); // 中标动态
@@ -748,8 +750,10 @@ var vNode = {
           }
           that.getUsage(); // 超级订阅用户剩余次数
         },
-        error: function (err) {
+        complete: function () {
           that.chartLoading = false;
+        },
+        error: function (err) {
           console.log(err)
           // setTimeout(function() {
           //   that.getChartData()

+ 4 - 0
src/jfw/modules/app/src/web/staticres/jyapp/tags/js/index.js

@@ -9,10 +9,14 @@ var page = {
     textTagListShowMore.init()
     this.changeTopNavTheme(!!templateData.areaTopTitle)
     this.initEvents()
+    this.clearSessionStorages()
   },
   initEvents: function () {
     this.initFooterPhoneCall()
   },
+  clearSessionStorages: function () {
+    localStorage.removeItem('JY-MOBILE-home-top-search')
+  },
   initFooterPhoneCall: function () {
     if (utils.$envs.inApp) {
       $('.tel-link,.phone-concat-customer').on('click', function (e) {

+ 1 - 1
src/jfw/modules/app/src/web/templates/tags/index.html

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="zh-CN">
+<html lang="zh-CN" style="font-size: 50px;">
 <head>
   {{include "/tags/template/tag-meta.html"}}
   <title>{{.T.title}}</title>

+ 1 - 1
src/jfw/modules/app/src/web/templates/tags/template/tag-footer.html

@@ -18,7 +18,7 @@
       <span class="j-icon base-icon icon-phone-white-solid"></span>
       <p>电话咨询</p>
     </a>
-    <a class="seo-button theme-main radius" href="/jyapp/free/login?url=/jy_mobile/tabbar/home">
+    <a class="seo-button theme-main radius" href="/jyapp/free/login?url=/jyapp/jylab/mainSearch">
       <span class="j-icon base-icon icon-person-white-solid"></span>
       <p>登录/注册</p>
     </a>

+ 1 - 1
src/jfw/modules/app/src/web/templates/tags/template/tag-register-login-group.html

@@ -5,5 +5,5 @@
   {{if .T.areaTopTip}}
     <h1 class="header-title">{{.T.areaTopTip}}</h1>
   {{end}}
-  <a class="seo-button theme-main" href="/jyapp/free/login?url=/jy_mobile/tabbar/home">登录/注册</a>
+  <a class="seo-button theme-main" href="/jyapp/free/login?url=/jyapp/jylab/mainSearch">登录/注册</a>
 </section>