소스 검색

填充图片地址

xiexiaoyuan 3 년 전
부모
커밋
794ca9c24b

+ 1 - 1
models/response/classify.go

@@ -58,5 +58,5 @@ type ClassifyFirstListItem struct {
 	ClassifyNameFirst  string `description:"一级分类名称" json:"classify_name_first"`
 	ClassifyNameSecond     	string  `json:"classify_name_second"`
 	IconImgUrl         string	`json:"icon_img_url"`
-	RedirectPage        string     `json:"redirect_page"`
+	RedirectType        int     `description:"跳转页面类型:1,专栏列表,2报告列表,3专栏详情" json:"redirect_type"`
 }

+ 1 - 1
routers/report.go

@@ -16,7 +16,7 @@ func InitReport(r *gin.Engine)  {
 	rGroup.GET("/search", report.Search)
 
 	rGroup2 := r.Group("api/classify").Use(middleware.Token())
-	rGroup2.GET("/", report.ClassifyFirstList)
+	rGroup2.GET("/ficc", report.ClassifyFirstList)
 	rGroup2.GET("/list", report.ClassifyList)
 	rGroup2.GET("/simple/list", report.ClassifySimpleList)
 	rGroup2.GET("/detail", report.ClassifyDetail)

+ 3 - 4
services/activity/activity.go

@@ -228,8 +228,8 @@ func GetLatestActivity(permissionIds []int, userId uint64) (purchaseItem *purcha
 		purchaseItem.Content = fmt.Sprintf("主讲:%s", activityItem.Speaker)
 		purchaseItem.Time = activityItem.ModifyTime
 		purchaseItem.Unread = unRead
-		// TODO 添加活动icon
-		purchaseItem.ImgUrl = ""
+		// 添加活动icon
+		purchaseItem.ImgUrl = utils.ALIYUN_YBIMG_HOST + "purchase_icon_xj_two_week.png"
 	}
 
 	return
@@ -283,8 +283,7 @@ func GetPurchaseDetail(permissionIds []int, userId uint64,  pageIndex, pageSize
 		temp.Content = fmt.Sprintf("活动时间:%s", timeStr)
 		temp.Time = item.ModifyTime
 		temp.TopName = item.ActivityName
-		// TODO 电话会背景图
-		temp.ImgUrl = ""
+		temp.ImgUrl = utils.ALIYUN_YBIMG_HOST + "purchase_bg_activity"
 		list = append(list, temp)
 	}
 	ret.List = list

+ 18 - 1
services/company/permission.go

@@ -14,6 +14,7 @@ import (
 	"hongze/hongze_yb/services/user"
 	"hongze/hongze_yb/utils"
 	"sort"
+	"strings"
 	"time"
 )
 
@@ -650,12 +651,22 @@ func GetHomeFiccPermissions(user user.UserInfo) (list response.PermissionFiccLis
 		temp := new(response.PermissionFiccItem)
 		temp.Sort = v.Sort
 		temp.ClassifyName = k
-		if temp.ClassifyName == "化工产业" {
+		if strings.Contains(temp.ClassifyName, "宏观") {
+			temp.ClassifyName = "宏观经济"
+			temp.SelectIconUrl = utils.ALIYUN_YBIMG_HOST+"ficc_icon_idx_hongguan_select.png"
+			temp.IconUrl = utils.ALIYUN_YBIMG_HOST+"ficc_icon_idx_hongguan.png"
+		}else if temp.ClassifyName == "化工产业" {
 			temp.ClassifyName = "化工"
+			temp.SelectIconUrl = utils.ALIYUN_YBIMG_HOST+"ficc_icon_idx_huagong_select.png"
+			temp.IconUrl = utils.ALIYUN_YBIMG_HOST+"ficc_icon_idx_huagong.png"
 		}else if temp.ClassifyName == "黑色产业" {
 			temp.ClassifyName = "黑色"
+			temp.SelectIconUrl = utils.ALIYUN_YBIMG_HOST+"ficc_icon_idx_black_select.png"
+			temp.IconUrl = utils.ALIYUN_YBIMG_HOST+"ficc_icon_idx_black.png"
 		}else if temp.ClassifyName == "有色产业" {
 			temp.ClassifyName = "有色"
+			temp.SelectIconUrl = utils.ALIYUN_YBIMG_HOST+"ficc_icon_idx_youse_select.png"
+			temp.IconUrl = utils.ALIYUN_YBIMG_HOST+"ficc_icon_idx_youse.png"
 		}
 		if len(v.List) > 0 {
 			temp.List = v.List
@@ -667,5 +678,11 @@ func GetHomeFiccPermissions(user user.UserInfo) (list response.PermissionFiccLis
 	if len(list) > 0 {
 		sort.Sort(list)
 	}
+	temp := new(response.PermissionFiccItem)
+	temp.SelectIconUrl = utils.ALIYUN_YBIMG_HOST+"ficc_icon_idx_more_select.png"
+	temp.IconUrl = utils.ALIYUN_YBIMG_HOST+"ficc_icon_idx_more.png"
+	temp.ClassifyName = "更多报告"
+	temp.Sort = 100000
+	list = append(list, temp)
 	return
 }

+ 4 - 4
services/report/classify.go

@@ -65,7 +65,6 @@ func GetClassListByClassifyId(user user.UserInfo, classifyIdFirst int) (list []*
 		temp.ParentId = item.ParentId
 		temp.AuthorDescript = item.AuthorDescript
 		temp.ReportAuthor = item.ReportAuthor
-		// TODO ficc菜单图标
 		temp.HomeImgUrl = item.HomeImgUrl
 		temp.ClassifyNameSecond = item.ClassifyName
 		if _, ok := reportMap[item.Id]; ok {
@@ -298,6 +297,7 @@ func GetClassifyFirstList(user user.UserInfo) (list []*response.ClassifyFirstLis
 		temp := new(response.ClassifyFirstListItem)
 		temp.ClassifyIdFirst = item.Id
 		temp.ClassifyNameFirst = item.ClassifyName
+		// TODO ficc菜单图标
 		temp.IconImgUrl = ""
 		if _, ok := classifyMap[item.ClassifyName]; ok {
 			if item.ClassifyName == "需求报告" || item.ClassifyName == "宏观报告" {
@@ -305,13 +305,13 @@ func GetClassifyFirstList(user user.UserInfo) (list []*response.ClassifyFirstLis
 				if tErr == nil && classifySecond.Id > 0 {
 					temp.ClassifyIdSecond = classifySecond.Id
 					temp.ClassifyNameSecond = classifySecond.ClassifyName
-					temp.RedirectPage = "/api/classify/detail"
+					temp.RedirectType = 3
 				}
 			}else{
-				temp.RedirectPage = "/api/classify/list"
+				temp.RedirectType = 1
 			}
 		}else{
-			temp.RedirectPage = "/api/report/list"
+			temp.RedirectType = 2
 		}
 
 		list = append(list, temp)

+ 14 - 6
services/report/report.go

@@ -258,6 +258,7 @@ func GetPurchaseDetail(permissionIds []int, userId uint64, classifyIdFirst int,
 			temp.ClassifyIdSecond = v.ClassifyIdSecond
 			temp.ClassifyNameSecond = v.ClassifyNameSecond
 			temp.Stage = v.Stage
+			// TODO 背景图
 			temp.ImgUrl = classifyInfo.YbBgUrl
 			if temp.ClassifyNameFirst == "晨报" || temp.ClassifyNameFirst == "周报" {  //晨报或者周报,查询最新的章节信息
 				temp.Content = fmt.Sprintf("【第%d期|FICC】%s", temp.Stage, temp.Title)
@@ -333,13 +334,20 @@ func GetReportDetail(userinfo user.UserInfo, reportId int) (reportDetail respons
 	reportItem.VideoName = reportInfo.VideoName
 	reportItem.VideoPlaySeconds = reportInfo.VideoPlaySeconds
 	reportItem.Author = reportInfo.Author
-   // TODO 报告详情(晨报和周报的banner图)
-   reportItem.BannerUrl = ""
 	var reportTypeList []*response.ReportChapterListItem
-	if (reportInfo.ClassifyNameFirst == "晨报" || reportInfo.ClassifyNameFirst == "周报") && authOk {
-		reportTypeList, err = GetChapterListByReport(reportInfo.ClassifyNameFirst, reportInfo.Id, userinfo.CompanyID)
-		if err != nil {
-			return
+
+	if (reportInfo.ClassifyNameFirst == "晨报" || reportInfo.ClassifyNameFirst == "周报") {
+		//(晨报和周报的banner图)
+		if reportInfo.ClassifyNameFirst == "晨报"  {
+			reportItem.BannerUrl = utils.ALIYUN_YBIMG_HOST + "report_banner_day.jpg"
+		} else {
+			reportItem.BannerUrl = utils.ALIYUN_YBIMG_HOST + "report_banner_week.jpg"
+		}
+		if authOk {
+			reportTypeList, err = GetChapterListByReport(reportInfo.ClassifyNameFirst, reportInfo.Id, userinfo.CompanyID)
+			if err != nil {
+				return
+			}
 		}
 	}
 	//如果有权限则展示content

+ 0 - 2
services/report/report_chapter.go

@@ -128,7 +128,6 @@ func GetChapterListByReport(classifyNameFirst string, reportId int, companyId in
 			temp.Sort = item.Sort
 			temp.PublishTime = item.PublishTime
 			temp.ReportChapterTypeKey = typeItem.ReportChapterTypeKey
-			// TODO 章节名称和icon
 			temp.ReportChapterTypeName = typeItem.ReportChapterTypeName
 			temp.ReportChapterTypeThumb = typeItem.YbIconUrl
 			reportTypeList = append(reportTypeList, temp)
@@ -288,7 +287,6 @@ func GetMenuChapter(reportId int, typeIds []int, classifyNameFirst string) (repo
 				temp := new(response.ReportChapterMenu)
 				temp.ReportChapterId = item.ReportChapterId
 				temp.ReportId = item.ReportId
-				// TODO 章节名称和新的icon地址
 				temp.ReportChapterTypeName = typeItem.ReportChapterTypeName
 				temp.ReportChapterTypeThumb = typeItem.YbIconUrl
 				reportTypeList = append(reportTypeList, temp)

+ 3 - 1
utils/constants.go

@@ -110,4 +110,6 @@ const (
 
 const (
 	ES_INDEX_RDDP_REPORT = "research_report_v1"                //报告
-)
+)
+
+const ALIYUN_YBIMG_HOST = "https://hzstatic.hzinsights.com/static/yb_wx/"