Forráskód Böngészése

Merge branch 'cygx_11.0' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 1 éve
szülő
commit
ab631c0d64
2 módosított fájl, 124 hozzáadás és 1 törlés
  1. 2 1
      controllers/activity.go
  2. 122 0
      services/activity.go

+ 2 - 1
controllers/activity.go

@@ -2067,8 +2067,9 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 			list[k].AudioLink = true
 			list[k].VideoDetail = mapActivityVideo[v.ActivityId]
 		}
-		resp.List = append(resp.List, services.ActivityButtonShow(v))
+		//resp.List = append(resp.List, services.ActivityButtonShow(v))
 	}
+	resp.List = services.ActivityArrButtonShow(resp.List)
 
 	// 查研观向7.4-判断标签是否为产业, 为产业时是否跳转资源包
 	if label != "" {

+ 122 - 0
services/activity.go

@@ -2399,6 +2399,128 @@ func ActivityButtonShow(item *models.ActivityDetail) (activityDetail *models.Act
 	return
 }
 
+func ActivityArrButtonShow(items []*models.ActivityDetail) (activityDetails []*models.ActivityDetail) {
+	activityPointsByUserAllMap := GetActivityPointsByUserAllMap() // 获取对用户进行研选扣点的活动
+	for _, activityDetail := range items {
+		if activityDetail.ChartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
+			activityDetail.IsResearch = true
+		}
+
+		//IsShowAppointment       bool                       `description:"是否展示预约纪要"`
+		//IsShowOutboundCall      bool                       `description:"是否展示预约外呼"`
+		//IsShowMeetingReminder   bool                       `description:"是否展示会议提醒"`
+		//IsShowHelpSsk           bool                       `description:"是否展示帮我带问"`
+		//IsShowSignup            bool                       `description:"是否展示我要报名"`
+
+		activityDetail.IsResearchPoints = activityPointsByUserAllMap[activityDetail.ActivityId]
+		if activityDetail.SiginupDeadline == utils.FormatDateTimeInit { //报名截止时间处理
+			activityDetail.SiginupDeadline = ""
+		}
+		//如果报名截止时间不规范,或者是非研选扣点活动就把截止时间设置为空
+		if activityDetail.CancelDeadline == utils.FormatDateTimeInit || !activityDetail.IsResearchPoints {
+			activityDetail.CancelDeadline = ""
+		}
+		activityTimeText := activityDetail.ActivityTimeText
+		activityTimeText = strings.Replace(activityTimeText, "(", "(", -1)
+		activityTimeText = strings.Replace(activityTimeText, ")", ")", -1)
+		activityDetail.ActivityTimeText = activityTimeText
+		if activityDetail.SourceType != 2 {
+			activityDetail.SourceType = 1
+		}
+		activityDetail.IsShowAppointment = false
+		//易董的操作按钮都隐藏
+		if activityDetail.YidongActivityId != "" {
+			activityDetail.SourceType = 1
+			activityDetail.IsShowSignup = false
+			activityDetail.IsShowDetails = true
+			return
+		}
+
+		//专家电话会 1
+		if activityDetail.ActivityTypeId == 1 && activityDetail.IsLimitPeople == 0 && (activityDetail.ActiveState == "1" || activityDetail.ActiveState == "2") {
+			activityDetail.IsShowHelpSsk = true
+		}
+		//新的是否展示规则
+		if activityDetail.IsCanAppointmentMinutes == 1 {
+			activityDetail.IsShowAppointment = true
+		} else {
+			activityDetail.IsShowAppointment = false
+		}
+		if activityDetail.ActiveState == "1" {
+			//专家电话会 1
+			//专家电话会限制人数的展示我要报名,不限制的展示预约外外呼
+			if activityDetail.ActivityTypeId == 1 {
+				//articleDetail.IsShowOutboundCall = true
+				if activityDetail.LimitPeopleNum == 0 {
+					activityDetail.IsShowOutboundCall = true
+					//articleDetail.IsShowHelpSsk = true
+				} else {
+					activityDetail.IsShowSignup = true
+				}
+				activityDetail.IsShowMeetingReminder = true
+				activityDetail.IsShowHelpSsk = true
+			}
+
+			//分析师电话会 2
+			if activityDetail.ActivityTypeId == 2 {
+				if activityDetail.LimitPeopleNum == 0 {
+					activityDetail.IsShowOutboundCall = true
+					//articleDetail.IsShowHelpSsk = true
+				} else {
+					activityDetail.IsShowSignup = true
+				}
+				activityDetail.IsShowMeetingReminder = true
+			}
+
+			//公司调研电话会 3
+			if activityDetail.ActivityTypeId == 3 {
+				if activityDetail.IsResearchPoints || activityDetail.LimitPeopleNum > 0 {
+					activityDetail.IsShowSignup = true
+				} else {
+					activityDetail.IsShowMeetingReminder = true
+					activityDetail.IsShowOutboundCall = true
+				}
+			}
+
+			//公司线下调研 4
+			if activityDetail.ActivityTypeId == 4 {
+				activityDetail.IsShowSignup = true
+			}
+
+			//专家线下沙龙 5
+			if activityDetail.ActivityTypeId == 5 {
+				activityDetail.IsShowSignup = true
+			}
+
+			//分析师线下沙龙 6
+			if activityDetail.ActivityTypeId == 6 {
+				activityDetail.IsShowSignup = true
+			}
+
+			//分析师电话会(C类) 7
+			if activityDetail.ActivityTypeId == 7 {
+				activityDetail.IsShowSignup = true
+				activityDetail.IsShowMeetingReminder = true
+				activityDetail.ActivityTypeName = "分析师电话会"
+			}
+
+			//买方线下交流 8 // 查研观向 11.0
+			if activityDetail.ActivityTypeId == 8 {
+				activityDetail.IsShowSignup = true
+			}
+		}
+
+		//如果是易董创建的活动,展示我要报名,不展示预约外呼
+		if activityDetail.IsYidongConduct {
+			activityDetail.IsShowSignup = true
+			activityDetail.IsShowOutboundCall = false
+		}
+		activityDetails = append(activityDetails, activityDetail)
+	}
+
+	return
+}
+
 // GetActivityNewLabelMap 获取活动【新】标签Map
 func GetActivityNewLabelMap(activityIds []int) (labelMap map[int]bool, industryNewMap map[int]bool, err error) {
 	labelMap = make(map[int]bool, 0)