fuwencai 6 сар өмнө
parent
commit
cafd8d3202

+ 3 - 0
src/jfw/modules/publicapply/src/detail/image.yaml

@@ -0,0 +1,3 @@
+homeShareImg: https://www.jianyu360.cn/shareFile/file/2025/01/07/202501071122130010920lqD8.png  #首页分享卡片-品宣图
+subImg: https://www.jianyu360.cn/shareFile/file/2025/01/07/2025010717454300161625TmQ.png # 首页-关注按钮图片地址
+stepImg: https://www.jianyu360.cn/shareFile/file/2025/01/07/20250107174708001683W993G.png1 # 首页-关注微信公众号步骤图地址

+ 10 - 3
src/jfw/modules/publicapply/src/detail/service/service.go

@@ -133,7 +133,7 @@ func (d *Detail) ShareInfo() {
 		if ub.Nickname == "" {
 			ub.Nickname = string(ub.Phone[0:3]) + "****" + string(ub.Phone[len(ub.Phone)-4:])
 		}
-		shareImg := g.Cfg("./detail/share.yaml").MustGet(gctx.New(), "homeShareImg") // todo 要不要存缓存?
+		shareImg := g.Cfg("./detail/image.yaml").MustGet(gctx.New(), "homeShareImg") // todo 要不要存缓存?
 		shareInfo := map[string]interface{}{
 			"nickname": ub.Nickname,
 			"userId":   encrypt.SE.Encode2Hex(ub.UserId), //加密用户userid
@@ -194,7 +194,14 @@ func (d *Detail) MinBaseInfo() {
 
 // CheckSubscribe 判断用户是否关注微信公众号
 func (d *Detail) CheckSubscribe() {
-	result := Result{Data: false}
+	imgCfg := g.Cfg("./detail/image.yaml")
+
+	data := &map[string]interface{}{
+		"sub_img":      imgCfg.MustGet(gctx.New(), "subImg"),
+		"step_img":     imgCfg.MustGet(gctx.New(), "stepImg"),
+		"is_subscribe": false,
+	}
+	result := Result{Data: data}
 	if d.Session() == nil {
 		d.ServeJson(result)
 		return
@@ -204,7 +211,7 @@ func (d *Detail) CheckSubscribe() {
 		d.ServeJson(result)
 		return
 	}
-	result.Data = dao.IsSubscribe(ub.MgoUserId)
+	(*data)["is_subscribe"] = dao.IsSubscribe(ub.MgoUserId)
 	d.ServeJson(result)
 	return
 }

+ 0 - 1
src/jfw/modules/publicapply/src/detail/share.yaml

@@ -1 +0,0 @@
-homeShareImg: https://www.jianyu360.cn/shareFile/file/2025/01/07/202501071122130010920lqD8.png  #首页分享卡片-品宣图