aa
This commit is contained in:
@@ -1966,7 +1966,7 @@ func GetUnionActList(ctx *jxcontext.Context, vendorID, actType int) (actList []*
|
||||
return actList, err
|
||||
}
|
||||
|
||||
func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType, resourceType int) (link string, err error) {
|
||||
func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType, resourceType int, goodsID string) (link string, err error) {
|
||||
var (
|
||||
job = &model.Job{}
|
||||
db = dao.GetDB()
|
||||
@@ -2009,7 +2009,7 @@ func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType, resource
|
||||
}
|
||||
//2、分享链接
|
||||
if handler != nil {
|
||||
if link, err = handler.ShareUnionLink(ctx, linkType, job.UnionActID, sid, userID, resourceType); err == nil {
|
||||
if link, err = handler.ShareUnionLink(ctx, linkType, job.UnionActID, sid, userID, resourceType, goodsID); err == nil {
|
||||
if vendorID == model.VendorIDMTWM || vendorID == model.VendorIDTB {
|
||||
if linkType == partner.LinkTypeWeiXinMini {
|
||||
if resBinary, _, err := jxutils.DownloadFileByURL(link); err == nil {
|
||||
|
||||
@@ -17,7 +17,7 @@ func init() {
|
||||
partner.UnionHandlerMap[model.VendorIDJDShop] = unionHandler
|
||||
}
|
||||
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int) (link string, err error) {
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int, goodsID string) (link string, err error) {
|
||||
|
||||
return "jds", err
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int) (link string, err error) {
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int, goodsID string) (link string, err error) {
|
||||
if linkType == partner.LinkTypeWeiXinMini {
|
||||
if qrCode, err := api.MtUnionAPI.MiniCode(unionActID, sID); err == nil {
|
||||
if qrCode != "" {
|
||||
|
||||
@@ -79,7 +79,7 @@ func init() {
|
||||
}
|
||||
|
||||
type UnionInterface interface {
|
||||
ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int) (link string, err error)
|
||||
ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int, goodsID string) (link string, err error)
|
||||
GetUnionActList(ctx *jxcontext.Context, actType int) (result []*ActivityList, err error)
|
||||
CreateUnionPosition(ctx *jxcontext.Context, userID string) (sID string, err error)
|
||||
GetUnionMatterList(ctx *jxcontext.Context, vendorCatID, keyword string, page, pageSize, sortType int, listID string) (result *MatterList, err error)
|
||||
|
||||
@@ -23,19 +23,38 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int) (link string, err error) {
|
||||
if result, err := api.PddAPI.ResourceURLGen(sID, resourceType); err == nil {
|
||||
switch linkType {
|
||||
case partner.LinkTypeWeiXinMini:
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int, goodsID string) (link string, err error) {
|
||||
//传了goodsID表示是商品分享
|
||||
if goodsID != "" {
|
||||
authBindFlag, err := api.PddAPI.MemberAuthorityQuery(sID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
case partner.LinTypeH5:
|
||||
return result.SingleURLList.URL, err
|
||||
case partner.LinTypeWx:
|
||||
return result.WeAppInfo.PagePath, err
|
||||
default:
|
||||
return link, fmt.Errorf("暂不支持此链接类型!")
|
||||
}
|
||||
if result, err := api.PddAPI.GoodsPromotionURLGen(sID, goodsID, !authBindFlag); err == nil {
|
||||
switch linkType {
|
||||
case partner.LinTypeH5:
|
||||
return result.MobileURL, err
|
||||
case partner.LinTypeWx:
|
||||
return result.WeAppInfo.PagePath, err
|
||||
default:
|
||||
return link, fmt.Errorf("暂不支持此链接类型!")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if result, err := api.PddAPI.ResourceURLGen(sID, resourceType); err == nil {
|
||||
switch linkType {
|
||||
case partner.LinkTypeWeiXinMini:
|
||||
return "", err
|
||||
case partner.LinTypeH5:
|
||||
return result.SingleURLList.URL, err
|
||||
case partner.LinTypeWx:
|
||||
return result.WeAppInfo.PagePath, err
|
||||
default:
|
||||
return link, fmt.Errorf("暂不支持此链接类型!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return link, err
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int) (link string, err error) {
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int, goodsID string) (link string, err error) {
|
||||
if result, err2 := api.TbUnionAPI.ActivityInfoGet(userID, utils.Int2Str(unionActID), utils.Str2Int64(sID)); err2 == nil {
|
||||
switch linkType {
|
||||
case partner.LinkTypeWeiXinMini:
|
||||
|
||||
Reference in New Issue
Block a user