|
@@ -133,7 +133,7 @@ func (d *Detail) ShareInfo() {
|
|
if ub.Nickname == "" {
|
|
if ub.Nickname == "" {
|
|
ub.Nickname = string(ub.Phone[0:3]) + "****" + string(ub.Phone[len(ub.Phone)-4:])
|
|
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{}{
|
|
shareInfo := map[string]interface{}{
|
|
"nickname": ub.Nickname,
|
|
"nickname": ub.Nickname,
|
|
"userId": encrypt.SE.Encode2Hex(ub.UserId), //加密用户userid
|
|
"userId": encrypt.SE.Encode2Hex(ub.UserId), //加密用户userid
|
|
@@ -194,7 +194,14 @@ func (d *Detail) MinBaseInfo() {
|
|
|
|
|
|
// CheckSubscribe 判断用户是否关注微信公众号
|
|
// CheckSubscribe 判断用户是否关注微信公众号
|
|
func (d *Detail) 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 {
|
|
if d.Session() == nil {
|
|
d.ServeJson(result)
|
|
d.ServeJson(result)
|
|
return
|
|
return
|
|
@@ -204,7 +211,7 @@ func (d *Detail) CheckSubscribe() {
|
|
d.ServeJson(result)
|
|
d.ServeJson(result)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- result.Data = dao.IsSubscribe(ub.MgoUserId)
|
|
|
|
|
|
+ (*data)["is_subscribe"] = dao.IsSubscribe(ub.MgoUserId)
|
|
d.ServeJson(result)
|
|
d.ServeJson(result)
|
|
return
|
|
return
|
|
}
|
|
}
|