Sfoglia il codice sorgente

fix 小程序端跳转类型

ziwen 2 anni fa
parent
commit
10b7b4752c
1 ha cambiato i file con 14 aggiunte e 15 eliminazioni
  1. 14 15
      services/report/classify.go

+ 14 - 15
services/report/classify.go

@@ -50,7 +50,7 @@ func GetClassListByClassifyId(user user.UserInfo, classifyIdFirst int) (list []*
 	}
 	var secondIds []int
 	for _, v := range classifyList {
-		secondIds = append(secondIds,v.Id)
+		secondIds = append(secondIds, v.Id)
 	}
 
 	//查询二级分类中最新的报告ID
@@ -72,7 +72,7 @@ func GetClassListByClassifyId(user user.UserInfo, classifyIdFirst int) (list []*
 		temp.AuthorDescript = item.AuthorDescript
 		temp.Abstract = item.Abstract
 		temp.ReportAuthor = item.ReportAuthor
-		temp.HomeImgUrl = item.AvatarImgUrl	// 此处图片用二级分类的"头像"
+		temp.HomeImgUrl = item.AvatarImgUrl // 此处图片用二级分类的"头像"
 		temp.ClassifyNameSecond = item.ClassifyName
 		temp.VipTitle = item.VipTitle
 		if classifyInfo.ClassifyName == "权益研报" {
@@ -89,7 +89,7 @@ func GetClassListByClassifyId(user user.UserInfo, classifyIdFirst int) (list []*
 	return
 }
 
-func GetClassifyDetail(user user.UserInfo, classifyIdSecond int) (detail *response.ClassifyDetail, err error)  {
+func GetClassifyDetail(user user.UserInfo, classifyIdSecond int) (detail *response.ClassifyDetail, err error) {
 	var errMsg string
 	defer func() {
 		if err != nil {
@@ -142,7 +142,7 @@ func GetClassifyDetail(user user.UserInfo, classifyIdSecond int) (detail *respon
 }
 
 // GetClassifyReportList 查询二级分类下的报告列表
-func GetClassifyReportList(user user.UserInfo, classifyIdSecond int, pageIndex, pageSize int) (list *response.ClassReportList, err error)  {
+func GetClassifyReportList(user user.UserInfo, classifyIdSecond int, pageIndex, pageSize int) (list *response.ClassReportList, err error) {
 	var errMsg string
 	defer func() {
 		if err != nil {
@@ -230,13 +230,13 @@ func GetClassifyReportList(user user.UserInfo, classifyIdSecond int, pageIndex,
 			reportItem.Stage = reportInfo.Stage
 			reportItem.Abstract = reportInfo.Abstract
 			if reportInfo.Abstract != "" {
-				reportItem.Abstract = "<div style=\"overflow: hidden;white-space: nowrap;text-overflow: ellipsis;\">" +reportInfo.Abstract+"</div>"
+				reportItem.Abstract = "<div style=\"overflow: hidden;white-space: nowrap;text-overflow: ellipsis;\">" + reportInfo.Abstract + "</div>"
 			}
 			reportItem.Author = classifyInfo.ReportAuthor
-			reportItem.ReportImgUrl = classifyInfo.AvatarImgUrl	// 此处图片用二级分类的"头像"
+			reportItem.ReportImgUrl = classifyInfo.AvatarImgUrl // 此处图片用二级分类的"头像"
 			reportItem.VideoName = reportInfo.VideoName
 			reportItem.VideoPlaySeconds = reportInfo.VideoPlaySeconds
-			if  reportInfo.VideoUrl != "" && reportInfo.VideoName == "" {
+			if reportInfo.VideoUrl != "" && reportInfo.VideoName == "" {
 				reportItem.VideoName = reportInfo.Title
 			}
 			if authOk {
@@ -289,11 +289,11 @@ func GetClassifySecondSimpleList(user user.UserInfo, classifyIdFirst int) (list
 			temp := new(response.ClassifySimpleListItem)
 			temp.ClassifyIdSecond = item.Id
 			temp.ClassifyNameSecond = item.ClassifyName
-			if index := strings.Index(item.ClassifyName, "双周报"); index > 0{
-				temp.ClassifySecondNameSimple = item.ClassifyName[0 : index]
-			} else if item.ClassifyName == "纺织服装与商品价格"{
+			if index := strings.Index(item.ClassifyName, "双周报"); index > 0 {
+				temp.ClassifySecondNameSimple = item.ClassifyName[0:index]
+			} else if item.ClassifyName == "纺织服装与商品价格" {
 				temp.ClassifySecondNameSimple = "纺织服装"
-			}else{
+			} else {
 				temp.ClassifySecondNameSimple = item.ClassifyName
 			}
 
@@ -304,7 +304,6 @@ func GetClassifySecondSimpleList(user user.UserInfo, classifyIdFirst int) (list
 	return
 }
 
-
 // GetClassifyFirstList 获取一级分类列表
 func GetClassifyFirstList(user user.UserInfo) (list response.ClassifyFirstList, err error) {
 	var errMsg string
@@ -339,7 +338,7 @@ func GetClassifyFirstList(user user.UserInfo) (list response.ClassifyFirstList,
 		if temp.Sort == 0 {
 			continue
 		}
-		// ShowType展示类型:1-列表 2-专栏; RedirectType跳转类型:1-专栏列表 2-报告列表 3-专栏详情
+		// ShowType展示类型:1-列表 2-专栏; RedirectType跳转类型:1-专栏列表 2-报告列表 3-专栏详情 4-品种类型列表
 		temp.RedirectType = 2
 		if item.ShowType == 2 {
 			temp.RedirectType = 1
@@ -350,6 +349,8 @@ func GetClassifyFirstList(user user.UserInfo) (list response.ClassifyFirstList,
 				temp.ClassifyNameSecond = classifyChild[0].ClassifyName
 				temp.RedirectType = 3
 			}
+		} else if item.ShowType == 3 {
+			temp.RedirectType = 4
 		}
 		list = append(list, temp)
 	}
@@ -388,5 +389,3 @@ func GetClassifyFirstList(user user.UserInfo) (list response.ClassifyFirstList,
 
 	return
 }
-
-