Commit 65e184a9 authored by liudong1993's avatar liudong1993

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

parents 5a0e5d3f a3ff3c25
......@@ -230,6 +230,119 @@ namespace Mall.Model.Extend.MarketingCenter
public int backgroundWidth { get; set; }
}
/// <summary>
/// 导航页面组件
/// </summary>
public class navPageItem
{
/// <summary>
/// 颜色
/// </summary>
public string color { get; set; }
/// <summary>
/// 每页行数
/// </summary>
public int rows { get; set; }
/// <summary>
/// 每行个数
/// </summary>
public int columns { get; set; }
/// <summary>
/// 左右滑动
/// </summary>
public bool scroll { get; set; }
/// <summary>
/// 导航图标
/// </summary>
public List<navPageIconItem> navs { get; set; }
/// <summary>
/// 背景图片
/// </summary>
public bool showImg { get; set; }
/// <summary>
/// 背景颜色
/// </summary>
public string backgroundColor { get; set; }
/// <summary>
/// 背景链接
/// </summary>
public string backgroundPicUrl { get; set; }
/// <summary>
/// 图片位置
/// </summary>
public int position { get; set; }
/// <summary>
/// 填充方式
/// </summary>
public int mode { get; set; }
/// <summary>
/// 背景图宽
/// </summary>
public int backgroundHeight { get; set; }
/// <summary>
/// 背景图高
/// </summary>
public int backgroundWidth { get; set; }
}
/// <summary>
/// 导航图标页面明细
/// </summary>
public class navPageIconItem
{
/// <summary>
/// 导航图标
/// </summary>
public string icon { get; set; }
/// <summary>
/// 导航名称
/// </summary>
public string name { get; set; }
/// <summary>
/// 组件方式(0-组件,1-模板)
/// </summary>
public int ShowType { get; set; }
/// <summary>
/// 组件URL
/// </summary>
public string url { get; set; }
/// <summary>
/// 组件名称
/// </summary>
public string ComponentName { get; set; }
/// <summary>
/// 模板编号
/// </summary>
public int TemplateId { get; set; }
/// <summary>
/// 显示名称
/// </summary>
public string TemplateShowName { get; set; }
/// <summary>
/// 模板数据
/// </summary>
public object TemplateData { get; set; }
}
/// <summary>
/// 导航图标明细
/// </summary>
......
......@@ -622,7 +622,7 @@ namespace Mall.Module.MarketingCenter
item.data = storeModel;
break;
//导航-页面
case "nav-page": item.data = JsonHelper.DeserializeObject<navItem>(item.data.ToString()); break;
case "nav-page": item.data = JsonHelper.DeserializeObject<navPageItem>(item.data.ToString()); break;
}
}
......
......@@ -30,7 +30,7 @@ namespace Mall.Repository.MarketingCenter
{
builder.Append($" AND {nameof(RB_Miniprogram_Template_Extend.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
if (query.MallBaseId > 0)
{
builder.Append($" AND {nameof(RB_Miniprogram_Template_Extend.MallBaseId)}={query.MallBaseId}");
}
......
......@@ -88,6 +88,11 @@ namespace Mall.WebApi.Controllers
/// </summary>
private static ReserveModule reserveModule = new ReserveModule();
/// <summary>
/// 模板处理类
/// </summary>
private static MiniprogramTemplateModule miniprogramTemplateModule = new MiniprogramTemplateModule();
/// <summary>
/// 解析插件数据为对象
......@@ -131,7 +136,31 @@ namespace Mall.WebApi.Controllers
};
break;
case "nav-page":
var navPageData = subItem.data as navItem;
var navPageData = subItem.data as navPageItem;
if (navPageData != null && navPageData.navs != null && navPageData.navs.Count > 0)
{
var subList = navPageData.navs.Where(qitem => qitem.ShowType == 1)?.ToList()??new List<navPageIconItem> ();
if (subList != null && subList.Count > 0)
{
string tempIds = string.Join(",", subList.Select(qitem => qitem.TemplateId));
List<RB_Miniprogram_Template_Extend> tempList = new List<RB_Miniprogram_Template_Extend>();
if (!string.IsNullOrEmpty(tempIds))
{
tempList= miniprogramTemplateModule.GetMiniprogramTemplateListModule(new RB_Miniprogram_Template_Extend() { QIds = tempIds },IsAnalyzePlus:true);
}
foreach (var item in navPageData.navs)
{
if (item.ShowType == 1)
{
var tempModel = tempList?.Where(qitem => qitem.Id == item.TemplateId)?.FirstOrDefault();
if (tempModel != null && tempModel.Id > 0)
{
item.TemplateData = tempModel.ComponentDataList;
}
}
}
}
}
obj = new
{
id = subItem.Id,
......
......@@ -48,6 +48,11 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
private readonly CommerceConsultModule consultModule = new CommerceConsultModule();
/// <summary>
/// 新闻处理类对象
/// </summary>
private readonly CommerceNewsModule commerceNewsModule = new CommerceNewsModule();
/// <summary>
/// 新增修改公司信息
/// </summary>
......@@ -182,7 +187,25 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// <returns></returns>
public ApiResult GetNewsTop()
{
return null;
var userInfo = AppletUserInfo;
var query = new RB_Commerce_News_Extend();
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = userInfo?.TenantId ?? 0;
var list = commerceNewsModule.GetCommerceNewsTopListModule(5, query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取新闻信息详情
/// </summary>
/// <returns></returns>
public ApiResult GetCommerceNews()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var Id = parms.GetInt("Id", 0);
var extModel = commerceNewsModule.GetCommerceNewsModule(Id);
return ApiResult.Success(data: extModel);
}
}
}
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