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

页面修改

parent e5295f14
......@@ -3997,14 +3997,25 @@ namespace Mall.Model.Extend.MarketingCenter
/// </summary>
public class TradeActivityItem
{
/// <summary>
/// 活动编号
/// 分组名称
/// </summary>
public string ActivityIds { get; set; }
public string GroupName { get; set; }
/// <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
break;
//首店活动
case "tradeActivity":
TradeActivityItem tradeActivityItem = new TradeActivityItem();
List<TradeActivityItem> tradeActivityItemList = new List<TradeActivityItem>();
try
{
var tradeActivity = JsonHelper.DeserializeObject<TradeActivityItem>(item.data.ToString());
if (tradeActivity != null)
var tradeActivityList = JsonHelper.DeserializeObject<List<TradeActivityItem>>(item.data.ToString());
if (tradeActivityList != null&& tradeActivityList.Count>0)
{
tradeActivityItem.ActivityIds = tradeActivity?.ActivityIds ?? "";
tradeActivityItem.DefaultActivityId = tradeActivity?.DefaultActivityId ?? "";
foreach (var tItem in tradeActivityList)
{
var tradeActivityModel = new TradeActivityItem()
{
GroupName = tItem?.GroupName ?? "",
DateStr= tItem?.DateStr ?? "",
IsDefaultActivity = tItem?.IsDefaultActivity ?? 0,
NewActivitys = tItem?.NewActivitys ?? ""
};
tradeActivityItemList.Add(tradeActivityModel);
}
}
}
catch
{
}
item.data = tradeActivityItem;
item.data = tradeActivityItemList;
break;
}
}
......
......@@ -1999,33 +1999,69 @@ namespace Mall.WebApi.Controllers
break;
//首店活动组件
case "tradeActivity":
var tradeActivityData = subItem.data as TradeActivityItem;
var activityList = commerceActivityModule.GetCommerceActivityListModule(new RB_Commerce_Activity_Extend()
{
TenantId = TenantId,
ActivityIds = tradeActivityData.ActivityIds
},isGetSignUp:true);
var tradeActivityData = Common.Plugin.JsonHelper.DeserializeObject<List< TradeActivityItem >>(Common.Plugin.JsonHelper.Serialize(subItem.data));
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,
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 = aItem.Id.ToString().Equals(tradeActivityData.DefaultActivityId),
IsCheck = aItem.Id.ToString().Equals(tradeActivityData.DefaultActivityId),
IsSign = aItem.CommerceConsultList != null && aItem.CommerceConsultList.Count > 0,
};
activityDataList.Add(aObj);
var aItem = activityList?.Where(qitem => qitem.Id.ToString() == tItem.NewActivitys)?.FirstOrDefault();
var defatltData = 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 = aItem.Id.ToString().Equals(tItem.NewActivitys),
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
......
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