Commit e5278dc2 authored by liudong1993's avatar liudong1993

Merge branch 'sdzq' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents 1b5b3509 4cc78c3c
...@@ -3175,18 +3175,6 @@ namespace Mall.Model.Extend.MarketingCenter ...@@ -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> /// <summary>
/// 列表样式[-1-列表模式,0-左右滑动,1-一行一个] /// 列表样式[-1-列表模式,0-左右滑动,1-一行一个]
/// </summary> /// </summary>
...@@ -3231,8 +3219,44 @@ namespace Mall.Model.Extend.MarketingCenter ...@@ -3231,8 +3219,44 @@ namespace Mall.Model.Extend.MarketingCenter
/// <summary> /// <summary>
/// 自定义列表 /// 自定义列表
/// </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 #endregion
} }
\ No newline at end of file
...@@ -11,5 +11,10 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -11,5 +11,10 @@ namespace Mall.Model.Extend.TradePavilion
public class RB_Commerce_ActivityType_Extend : RB_Commerce_ActivityType public class RB_Commerce_ActivityType_Extend : RB_Commerce_ActivityType
{ {
public List<string> LableNameList { get; set; } 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 ...@@ -649,6 +649,31 @@ namespace Mall.Module.MarketingCenter
} }
item.data = miaiUserItem; item.data = miaiUserItem;
break; 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; case "nav-page": item.data = JsonHelper.DeserializeObject<navPageItem>(item.data.ToString()); break;
......
...@@ -90,6 +90,10 @@ WHERE 1=1 ...@@ -90,6 +90,10 @@ WHERE 1=1
builder.AppendFormat(" AND {0} LIKE @Name ", nameof(RB_Commerce_ActivityType_Extend.TypeName)); builder.AppendFormat(" AND {0} LIKE @Name ", nameof(RB_Commerce_ActivityType_Extend.TypeName));
parameters.Add("Name", "%" + query.TypeName.Trim() + "%"); 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(); return Get<RB_Commerce_ActivityType_Extend>(builder.ToString(), parameters).ToList();
} }
......
...@@ -97,6 +97,9 @@ namespace Mall.WebApi.Controllers ...@@ -97,6 +97,9 @@ namespace Mall.WebApi.Controllers
/// </summary> /// </summary>
private static Module.Miai.MiaiModule miaiModule = new Module.Miai.MiaiModule(); private static Module.Miai.MiaiModule miaiModule = new Module.Miai.MiaiModule();
private static Module.TradePavilion.CommerceActivityModule commerceActivityModule = new Module.TradePavilion.CommerceActivityModule();
/// <summary> /// <summary>
/// 解析插件数据为对象 /// 解析插件数据为对象
/// </summary> /// </summary>
...@@ -1417,6 +1420,51 @@ namespace Mall.WebApi.Controllers ...@@ -1417,6 +1420,51 @@ namespace Mall.WebApi.Controllers
data = miAiUserItem data = miAiUserItem
}; };
break; 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; 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