|
@@ -1,6 +1,7 @@
|
|
|
package controllers
|
|
|
|
|
|
import (
|
|
|
+ "encoding/json"
|
|
|
"hongze/hongze_mfyx/models"
|
|
|
)
|
|
|
|
|
@@ -27,15 +28,40 @@ func (this *BannerController) ListHome() {
|
|
|
return
|
|
|
}
|
|
|
resp := new(models.BannerUrHomeListResp)
|
|
|
- var list []*models.BannerUrlYxResp
|
|
|
+ //var list []*models.BannerUrlYxResp
|
|
|
+ list := new(models.BannerUrHomeListResp)
|
|
|
+ //list = []*models.BannerUrlYxResp{
|
|
|
+ // &models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/1.png", Path: "pages-purchaser/leaflet/leaflet?leafletImage=https%3A%2F%2Fhzstatic.hzinsights.com%2Fcygx%2Fconfig%2Fresearch_11_0.png"},
|
|
|
+ // &models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/2.png", Path: "pages-purchaser/survey/surveySubmit"},
|
|
|
+ // &models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/4.png", Path: "pages-purchaser/specialColumn/specialColumn"},
|
|
|
+ // &models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/3_long.png", Path: "pages-purchaser/researchList/researchList"},
|
|
|
+ //}
|
|
|
|
|
|
- list = []*models.BannerUrlYxResp{
|
|
|
- &models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/1.png", Path: "pages-purchaser/leaflet/leaflet?leafletImage=https%3A%2F%2Fhzstatic.hzinsights.com%2Fcygx%2Fconfig%2Fresearch_11_0.png"},
|
|
|
- &models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/2.png", Path: "pages-purchaser/survey/surveySubmit"},
|
|
|
- &models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/4.png", Path: "pages-purchaser/specialColumn/specialColumn"},
|
|
|
- &models.BannerUrlYxResp{IndexImg: "https://hzstatic.hzinsights.com/banner/yx/3_long.png", Path: "pages-purchaser/researchList/researchList"},
|
|
|
+ key := "mfyx_banner_list"
|
|
|
+ conf, e := models.GetConfigByCode(key)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取首页头部导航失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if conf.ConfigValue == "" {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "首页头部导航配置值有误"
|
|
|
+ return
|
|
|
}
|
|
|
- resp.List = list
|
|
|
+
|
|
|
+ //list := new(*models.BannerUrlYxResp)
|
|
|
+ if e = json.Unmarshal([]byte(conf.ConfigValue), &list); e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "首页头部导航配置值解析失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //resp.List := list
|
|
|
+ //if searchPage == 1 {
|
|
|
+ // resp = list.SearchPage
|
|
|
+ //}
|
|
|
+
|
|
|
+ resp.List = list.List
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|