Commit 26736e77 authored by 黄奎's avatar 黄奎

页面修改

parent e5295f14
...@@ -3997,14 +3997,25 @@ namespace Mall.Model.Extend.MarketingCenter ...@@ -3997,14 +3997,25 @@ namespace Mall.Model.Extend.MarketingCenter
/// </summary> /// </summary>
public class TradeActivityItem public class TradeActivityItem
{ {
/// <summary> /// <summary>
/// 活动编号 /// 分组名称
/// </summary> /// </summary>
public string ActivityIds { get; set; } public string GroupName { get; set; }
/// <summary> /// <summary>
/// 默认活动编号 /// 时间
/// </summary> /// </summary>
public string DefaultActivityId { get; set; } public string DateStr { get; set; }
/// <summary>
/// 是否默认活动(1-是)
/// </summary>
public int IsDefaultActivity { get; set; }
/// <summary>
/// 新活动编号
/// </summary>
public string NewActivitys { get; set; }
} }
} }
\ No newline at end of file
...@@ -966,20 +966,30 @@ namespace Mall.Module.MarketingCenter ...@@ -966,20 +966,30 @@ namespace Mall.Module.MarketingCenter
break; break;
//首店活动 //首店活动
case "tradeActivity": case "tradeActivity":
TradeActivityItem tradeActivityItem = new TradeActivityItem(); List<TradeActivityItem> tradeActivityItemList = new List<TradeActivityItem>();
try try
{ {
var tradeActivity = JsonHelper.DeserializeObject<TradeActivityItem>(item.data.ToString()); var tradeActivityList = JsonHelper.DeserializeObject<List<TradeActivityItem>>(item.data.ToString());
if (tradeActivity != null) if (tradeActivityList != null&& tradeActivityList.Count>0)
{ {
tradeActivityItem.ActivityIds = tradeActivity?.ActivityIds ?? ""; foreach (var tItem in tradeActivityList)
tradeActivityItem.DefaultActivityId = tradeActivity?.DefaultActivityId ?? ""; {
var tradeActivityModel = new TradeActivityItem()
{
GroupName = tItem?.GroupName ?? "",
DateStr= tItem?.DateStr ?? "",
IsDefaultActivity = tItem?.IsDefaultActivity ?? 0,
NewActivitys = tItem?.NewActivitys ?? ""
};
tradeActivityItemList.Add(tradeActivityModel);
}
} }
} }
catch catch
{ {
} }
item.data = tradeActivityItem; item.data = tradeActivityItemList;
break; break;
} }
} }
......
...@@ -1999,33 +1999,69 @@ namespace Mall.WebApi.Controllers ...@@ -1999,33 +1999,69 @@ namespace Mall.WebApi.Controllers
break; break;
//首店活动组件 //首店活动组件
case "tradeActivity": case "tradeActivity":
var tradeActivityData = subItem.data as TradeActivityItem; var tradeActivityData = Common.Plugin.JsonHelper.DeserializeObject<List< TradeActivityItem >>(Common.Plugin.JsonHelper.Serialize(subItem.data));
var activityList = commerceActivityModule.GetCommerceActivityListModule(new RB_Commerce_Activity_Extend()
{
TenantId = TenantId,
ActivityIds = tradeActivityData.ActivityIds
},isGetSignUp:true);
List<object> activityDataList = new List<object>(); List<object> activityDataList = new List<object>();
if (activityList != null && activityList.Count > 0) if (tradeActivityData != null && tradeActivityData.Count > 0)
{ {
foreach (var aItem in activityList) string ActivityIds = string.Join(",", tradeActivityData.Where(qitem=>!string.IsNullOrEmpty(qitem.NewActivitys)).Select(qitem => qitem.NewActivitys.Replace(",",",")));
var activityList = commerceActivityModule.GetCommerceActivityListModule(new RB_Commerce_Activity_Extend()
{
TenantId = TenantId,
ActivityIds = ActivityIds
}, isGetSignUp: true);
if (activityList != null && activityList.Count > 0)
{ {
var aObj = new foreach (var tItem in tradeActivityData.Where(qitem => qitem.IsDefaultActivity == 1))
{ {
aItem.Id, var aItem = activityList?.Where(qitem => qitem.Id.ToString() == tItem.NewActivitys)?.FirstOrDefault();
aItem.ActivityName, var defatltData = new
StartTime= Common.ConvertHelper.FormatTime( aItem.StartTime), {
EndTime = Common.ConvertHelper.FormatTime(aItem.EndTime), aItem.Id,
aItem.CoverImg, aItem.ActivityName,
aItem.ActivityType, StartTime = Common.ConvertHelper.FormatTime(aItem.StartTime),
aItem.ActivityTypeName, EndTime = Common.ConvertHelper.FormatTime(aItem.EndTime),
SignStartTime = Common.ConvertHelper.FormatTime(aItem.SignStartTime), aItem.CoverImg,
SignEndTime = Common.ConvertHelper.FormatTime(aItem.SignEndTime), aItem.ActivityType,
IsDefault = aItem.Id.ToString().Equals(tradeActivityData.DefaultActivityId), aItem.ActivityTypeName,
IsCheck = aItem.Id.ToString().Equals(tradeActivityData.DefaultActivityId), SignStartTime = Common.ConvertHelper.FormatTime(aItem.SignStartTime),
IsSign = aItem.CommerceConsultList != null && aItem.CommerceConsultList.Count > 0, SignEndTime = Common.ConvertHelper.FormatTime(aItem.SignEndTime),
}; IsDefault = aItem.Id.ToString().Equals(tItem.NewActivitys),
activityDataList.Add(aObj); IsCheck = aItem.Id.ToString().Equals(tItem.NewActivitys),
IsSign = aItem.CommerceConsultList != null && aItem.CommerceConsultList.Count > 0,
};
var aObj = new
{
GroupName = tItem.GroupName,
tItem.DateStr,
DataList = new List<object>() { defatltData }
};
activityDataList.Add(aObj);
}
foreach (var tItem in tradeActivityData.Where(qitem => qitem.IsDefaultActivity != 1))
{
var aList = activityList?.Where(qitem => tItem.NewActivitys.Contains(qitem.Id.ToString()))?.ToList();
var aObj = new
{
GroupName = tItem.GroupName,
tItem.DateStr,
DataList = aList?.Select(aItem => new {
aItem.Id,
aItem.ActivityName,
StartTime = Common.ConvertHelper.FormatTime(aItem.StartTime),
EndTime = Common.ConvertHelper.FormatTime(aItem.EndTime),
aItem.CoverImg,
aItem.ActivityType,
aItem.ActivityTypeName,
SignStartTime = Common.ConvertHelper.FormatTime(aItem.SignStartTime),
SignEndTime = Common.ConvertHelper.FormatTime(aItem.SignEndTime),
IsDefault = false,
IsCheck = false,
IsSign = aItem.CommerceConsultList != null && aItem.CommerceConsultList.Count > 0,
})
};
activityDataList.Add(aObj);
}
} }
} }
obj = new obj = new
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment