Commit 4cc78c3c authored by 吴春's avatar 吴春

提交代码

parent ac2d991d
......@@ -3175,18 +3175,6 @@ namespace Mall.Model.Extend.MarketingCenter
{
/// <summary>
/// 商品数量
/// </summary>
public int goodsLength { get; set; }
/// <summary>
/// 商品添加方式【0-自定义,1-最新】
/// </summary>
public int addGoodsType { get; set; }
/// <summary>
/// 列表样式[-1-列表模式,0-左右滑动,1-一行一个]
/// </summary>
......@@ -3231,8 +3219,44 @@ namespace Mall.Model.Extend.MarketingCenter
/// <summary>
/// 自定义列表
/// </summary>
public List<CustomDetailsItem2> list { get; set; }
public List<MiAiActivityTypeModel> list { get; set; }
}
/// <summary>
/// 商品详情项
/// </summary>
public class MiAiActivityTypeModel
{
/// <summary>
/// 商品编号
/// </summary>
public int id { get; set; }
/// <summary>
/// 标题
/// </summary>
public string name { get; set; }
/// <summary>
/// 副标题
/// </summary>
public string lableName { get; set; }
/// <summary>
/// 副标题
/// </summary>
public List<string> lableNameList { get; set; }
/// <summary>
/// 商品图片
/// </summary>
public string picUrl { get; set; }
}
#endregion
}
\ No newline at end of file
......@@ -11,5 +11,10 @@ namespace Mall.Model.Extend.TradePavilion
public class RB_Commerce_ActivityType_Extend : RB_Commerce_ActivityType
{
public List<string> LableNameList { get; set; }
/// <summary>
/// ids
/// </summary>
public string Ids { get; set; }
}
}
\ No newline at end of file
......@@ -649,6 +649,31 @@ namespace Mall.Module.MarketingCenter
}
item.data = miaiUserItem;
break;
case "miaiactivitytype":
MiAiActivityTypeItem miAiActivityTypeItem = new MiAiActivityTypeItem();
try
{
var driveData = JsonHelper.DeserializeObject<MiAiActivityTypeItem>(item.data.ToString());
if (driveData != null)
{
miAiActivityTypeItem.listStyle = driveData?.listStyle ?? 1;
miAiActivityTypeItem.backgroundColor = driveData?.backgroundColor ?? "";
miAiActivityTypeItem.PaddingTop = driveData?.PaddingTop ?? "0";
miAiActivityTypeItem.PaddingBottom = driveData?.PaddingBottom ?? "0";
miAiActivityTypeItem.PaddingLeft = driveData?.PaddingLeft ?? "0";
miAiActivityTypeItem.PaddingRight = driveData?.PaddingRight ?? "0";
miAiActivityTypeItem.SearchFilletPX = driveData?.SearchFilletPX ?? 0;
miAiActivityTypeItem.list = new List<MiAiActivityTypeModel>();
miAiActivityTypeItem.list = driveData.list;
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "miaiuser");
}
item.data = miAiActivityTypeItem;
break;
//导航-页面
case "nav-page": item.data = JsonHelper.DeserializeObject<navPageItem>(item.data.ToString()); break;
......
......@@ -90,6 +90,10 @@ WHERE 1=1
builder.AppendFormat(" AND {0} LIKE @Name ", nameof(RB_Commerce_ActivityType_Extend.TypeName));
parameters.Add("Name", "%" + query.TypeName.Trim() + "%");
}
if (string.IsNullOrWhiteSpace(query.Ids))
{
builder.AppendFormat($@" AND { nameof(RB_Commerce_ActivityType_Extend.Id)} in ({query.Ids}) ");
}
}
return Get<RB_Commerce_ActivityType_Extend>(builder.ToString(), parameters).ToList();
}
......
......@@ -97,6 +97,9 @@ namespace Mall.WebApi.Controllers
/// </summary>
private static Module.Miai.MiaiModule miaiModule = new Module.Miai.MiaiModule();
private static Module.TradePavilion.CommerceActivityModule commerceActivityModule = new Module.TradePavilion.CommerceActivityModule();
/// <summary>
/// 解析插件数据为对象
/// </summary>
......@@ -1417,6 +1420,51 @@ namespace Mall.WebApi.Controllers
data = miAiUserItem
};
break;
case "miaiactivitytype":
var miAiActivityTypeItemInfo = subItem.data as MiAiActivityTypeItem;
if (miAiActivityTypeItemInfo != null)
{
//自定义商品
if (miAiActivityTypeItemInfo.list != null && miAiActivityTypeItemInfo.list.Count > 0)
{
var Ids = "0," + string.Join(",", miAiActivityTypeItemInfo.list.Select(qitem => qitem.id));
var tempGoodsList = commerceActivityModule.GetCommerceActivityTypeListModule(new Mall.Model.Extend.TradePavilion.RB_Commerce_ActivityType_Extend()
{
TenantId = TenantId,
MallBaseId = MallBaseId,
Ids = Ids
});
List<MiAiActivityTypeModel> newTeacherList = new List<MiAiActivityTypeModel>();
foreach (var goodItem in miAiActivityTypeItemInfo.list)
{
var lastItem = new MiAiActivityTypeModel();
var tempGood = tempGoodsList?.Where(qitem => qitem.Id == goodItem.id)?.FirstOrDefault();
if (tempGood != null && tempGood.Id > 0)
{
lastItem.id = tempGood.Id;
lastItem.name = tempGood.TypeName;
lastItem.lableName = tempGood.LableName;
lastItem.picUrl = tempGood.CoverImage;
if (!string.IsNullOrWhiteSpace(lastItem.lableName))
{
lastItem.lableNameList = JsonConvert.DeserializeObject<List<string>>(lastItem.lableName);
}
newTeacherList.Add(lastItem);
}
}
miAiActivityTypeItemInfo.list = newTeacherList;
}
}
obj = new
{
id = subItem.Id,
data = miAiActivityTypeItemInfo
};
break;
}
return obj;
}
......
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