Commit c7f74e5a authored by 黄奎's avatar 黄奎

新增选择菜单

parent 4ff0a867
......@@ -107,5 +107,10 @@ namespace Mall.Model.Entity.MarketingCenter
/// 是否为校园版首页
/// </summary>
public int IsSchoolHomePage { get; set; }
/// <summary>
/// 是否显示底部导航
/// </summary>
public int IsShowBottomTabBar { get; set; }
}
}
......@@ -114,6 +114,7 @@ namespace Mall.Module.MarketingCenter
fileds.Add(nameof(RB_Miniprogram_Page_Templ_Extend.IsUse), extModel.IsUse);
fileds.Add(nameof(RB_Miniprogram_Page_Templ_Extend.IsShowNav), extModel.IsShowNav);
fileds.Add(nameof(RB_Miniprogram_Page_Templ_Extend.IsHome), extModel.IsHome);
fileds.Add(nameof(RB_Miniprogram_Page_Templ_Extend.IsShowBottomTabBar), extModel.IsShowBottomTabBar);
flag = pageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_Page_Templ_Extend.Id), extModel.Id));
}
else
......
......@@ -11,6 +11,9 @@ using Mall.Common;
using Mall.Common.Enum;
using VT.FW.DB.Dapper;
using RabbitMQ.Client.Framing.Impl;
using Mall.Model.Extend.Product;
using RabbitMQ.Client;
using Mall.Common.Enum.TradePavilion;
namespace Mall.Module.TradePavilion
{
......@@ -1062,6 +1065,57 @@ namespace Mall.Module.TradePavilion
return brandClassRepository.GetBrandClassListRepository(query);
}
/// <summary>
/// 获取商载通链接
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<object> GetBrandClassListLinkModule(RB_BrandClass_Extend query)
{
List<object> resultList = new List<object>();
var rootList = Common.Plugin.EnumHelper.EnumToList(typeof(BrandCategoryEnum));
List<RB_BrandClass_Extend> categoryList = GetBrandClassListModule(new RB_BrandClass_Extend() { TenantId = query.TenantId, MallBaseId = query.MallBaseId });
if (rootList != null && rootList.Count > 0)
{
foreach (var firstItem in rootList)
{
var subList = categoryList.Where(qitem => qitem.BrandCategory.ToInt() == firstItem.Id).ToList();
List<object> secondResultList = new List<object>();
foreach (var secondItem in subList)
{
string secondUrl = "/pages/kotra/CarrierBuildingIndex?cat_id&="+ firstItem .Id+ "&CategoryIds=" + secondItem.ID;
secondResultList.Add(new
{
PageId = secondItem.ID + 300000,
PageName = secondItem.ClassName,
PageUrl = secondUrl,
PageType = Common.Enum.MallBase.PageTypeEnum.DiyPage,
IsParameter = 0,
TipText = "",
SelfPageName = secondItem.ClassName,
ParameterValue = "",
SubMenuList = new List<int>(),
});
}
string rootUrl = @"/pages/kotra/CarrierBuildingIndex?cat_id=" + firstItem.Id;
resultList.Add(new
{
PageId = firstItem.Id + 200000,
PageName = firstItem.Name,
PageUrl = rootUrl,
PageType = Common.Enum.MallBase.PageTypeEnum.DiyPage,
IsParameter = 0,
TipText = "",
SelfPageName = firstItem.Name,
ParameterValue = "",
SubMenuList = secondResultList,
});
}
}
return resultList;
}
/// <summary>
/// 新增/修改品牌分类
......
......@@ -39,6 +39,7 @@ namespace Mall.Repository.MarketingCenter
builder.Append($" AND {nameof(RB_Miniprogram_Page_Templ_Extend.PageName)} like '%{query.PageName.Trim()}%'");
}
}
builder.AppendFormat(" ORDER BY Id DESC ");
return GetPage<RB_Miniprogram_Page_Templ_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
......
......@@ -39,6 +39,7 @@ namespace Mall.Repository.MarketingCenter
builder.Append($" AND {nameof(RB_Miniprogram_Template_Extend.TemplateName)} like '%{query.TemplateName.Trim()}%'");
}
}
builder.AppendFormat(" ORDER BY Id DESC ");
return GetPage<RB_Miniprogram_Template_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
......
......@@ -199,6 +199,7 @@ namespace Mall.WebApi.Controllers.MallBase
title = miniProgram.MallName,
show_navs = targetPage.IsShowNav,
is_home_page = targetPage.IsHome,
is_show_bottom_nav=targetPage.IsShowBottomTabBar,
navs = list
};
}
......@@ -273,6 +274,7 @@ namespace Mall.WebApi.Controllers.MallBase
title = miniProgram.MallName,
show_navs = selfHomePage.IsShowNav,
is_home_page = selfHomePage.IsHome,
is_show_bottom_nav = selfHomePage.IsShowBottomTabBar,
navs = list
};
}
......@@ -302,6 +304,7 @@ namespace Mall.WebApi.Controllers.MallBase
title = miniProgram.MallName,
show_navs = 1,
is_home_page = 1,
is_show_bottom_nav = 1,
navs = list
};
}
......
......@@ -172,7 +172,37 @@ namespace Mall.WebApi.Controllers.MarketingCenter
/// <returns></returns>
public ApiResult SetMiniprogramPageTempl()
{
var extModel = JsonConvert.DeserializeObject<RB_Miniprogram_Page_Templ_Extend>(RequestParm.msg.ToString());
JObject parms = JObject.Parse(RequestParm.msg.ToString());
RB_Miniprogram_Page_Templ_Extend extModel = new RB_Miniprogram_Page_Templ_Extend()
{
Id = parms.GetInt("Id"),
PageName = parms.GetStringValue("PageName"),
IsHome = parms.GetInt("IsHome"),
IsUse = parms.GetInt("IsUse"),
IsShowNav = parms.GetInt("IsShowNav"),
IsShowBottomTabBar = parms.GetInt("IsShowBottomTabBar"),
DetailsList = new List<RB_Miniprogram_Page_Templ_Details_Extend>(),
};
string detailsListStr = parms.GetStringValue("DetailsList");
if (!string.IsNullOrEmpty(detailsListStr))
{
JArray jarray = JArray.Parse(detailsListStr);
if (jarray != null && jarray.Count > 0)
{
foreach (var jItem in jarray)
{
JObject jobj = JObject.Parse(Common.Plugin.JsonHelper.Serialize(jItem));
extModel.DetailsList.Add(new RB_Miniprogram_Page_Templ_Details_Extend()
{
Id= jobj.GetInt("Id"),
PageTemplID=jobj.GetInt("PageTemplID"),
NavName=jobj.GetStringValue("NavName"),
TemplateId=jobj.GetInt("TemplateId"),
TemplateShowName=jobj.GetStringValue("TemplateShowName"),
});
}
}
}
extModel.TenantId = RequestParm.TenantId;
extModel.MallBaseId = RequestParm.MallBaseId;
......
......@@ -81,6 +81,8 @@ namespace Mall.WebApi.Controllers.User
private readonly Module.Property.AuthorizeModule authorizeModule = new Module.Property.AuthorizeModule();
private readonly Module.TradePavilion.CarrierModule carrierModule = new Module.TradePavilion.CarrierModule();
#region 商户信息
[AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
......@@ -1664,6 +1666,18 @@ namespace Mall.WebApi.Controllers.User
SubMenuList = categoryList
});
}
if (RequestParm.TenantId == 30)
{
var brandList = carrierModule.GetBrandClassListLinkModule(new Model.Extend.TradePavilion.RB_BrandClass_Extend() { TenantId = RequestParm.TenantId, MallBaseId = RequestParm.MallBaseId });
//新增商品选项卡
resultList.Add(new
{
PageTypeName = "宜宾商载通",
PageTypeId = 8,
SubMenuList = brandList
});
}
return ApiResult.Success(data: resultList);
}
......
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