|
@@ -169,6 +169,7 @@ func GetindustryVideoDetailById(user *models.WxUserItem, videoId int) (industryV
|
|
|
videoSimple.ResourceUrl = ""
|
|
|
}
|
|
|
}
|
|
|
+ videoSimple.Type = 3
|
|
|
industryVideo = videoSimple
|
|
|
AuthInfo = au
|
|
|
return
|
|
@@ -682,3 +683,70 @@ func MicroRoadshowVideoUserRmind(user *models.WxUserItem, videoId int) (err erro
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GetindustryVideoDetailById 通过视频ID获取视频详情
|
|
|
+func GetAskserieVideoDetailById(user *models.WxUserItem, askserieVideoId int) (industryVideo *models.MicroVideoSimpleInfo, AuthInfo *models.UserPermissionAuthInfo, err error) {
|
|
|
+ total, e := models.GetCygxAskserieVideoCountByVideoId(askserieVideoId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("获取产业关联的视频失败,GetCygxAskserieVideoCountByVideoId " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if total == 0 {
|
|
|
+ err = errors.New("视频不存在,或已取消发布")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 用户权限
|
|
|
+ authInfo, permissionArr, e := GetUserRaiPermissionInfo(user.UserId, user.CompanyId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("获取用户权限失败,GetUserRaiPermissionInfo " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ videoSimple := new(models.MicroVideoSimpleInfo)
|
|
|
+ // 权限
|
|
|
+ var au *models.UserPermissionAuthInfo
|
|
|
+ video, e := models.GetCygxAskserieVideoDetail(askserieVideoId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("获取产业关联的视频失败,GetMicroRoadshowVideoByIndustryId " + e.Error())
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ videoSimple.Id = video.AskserieVideoId
|
|
|
+ videoSimple.Title = video.VideoName
|
|
|
+ videoSimple.BackgroundImg = video.BackgroundImg
|
|
|
+ videoSimple.DetailImgUrl = video.ShareImg
|
|
|
+ if videoSimple.BackgroundImg == "" {
|
|
|
+ // 获取默认图配置
|
|
|
+ _, videoMap, _, _, e := GetMicroRoadShowDefaultImgConfig()
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("获取视频默认配置图失败,GetMicroRoadshowVideoByIndustryId " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ videoSimple.BackgroundImg = videoMap[video.ChartPermissionId]
|
|
|
+ }
|
|
|
+ videoSimple.PlaySeconds = video.VideoDuration
|
|
|
+ videoSimple.ResourceUrl = video.VideoUrl
|
|
|
+ au = new(models.UserPermissionAuthInfo)
|
|
|
+ au.SellerName = authInfo.SellerName
|
|
|
+ au.SellerMobile = authInfo.SellerMobile
|
|
|
+ au.HasPermission = authInfo.HasPermission
|
|
|
+ au.OperationMode = authInfo.OperationMode
|
|
|
+ if au.HasPermission == 1 {
|
|
|
+ // 非宏观权限进一步判断是否有权限
|
|
|
+ if video.ChartPermissionId != utils.HONG_GUAN_ID && !utils.InArrayByStr(permissionArr, video.ChartPermissionName) {
|
|
|
+ au.HasPermission = 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 无权限的弹框提示
|
|
|
+ if au.HasPermission != 1 {
|
|
|
+ if au.OperationMode == UserPermissionOperationModeCall {
|
|
|
+ au.PopupMsg = UserPermissionPopupMsgCallMicroVideo
|
|
|
+ } else {
|
|
|
+ au.PopupMsg = UserPermissionPopupMsgApplyMicroVideo
|
|
|
+ }
|
|
|
+ videoSimple.ResourceUrl = ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ videoSimple.Type = 4
|
|
|
+ industryVideo = videoSimple
|
|
|
+ AuthInfo = au
|
|
|
+ return
|
|
|
+}
|