|
@@ -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缓存
|