Commit abd38c0d authored by liudong1993's avatar liudong1993

菜单栏调整

parent 956cf337
......@@ -434,7 +434,34 @@ namespace Mall.Model.Entity.User
}
public class MenuNavMoreModel {
public class MenuNavMoreModel {
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 菜单栏标题
/// </summary>
public string MenuNavTitle
{
get;
set;
}
/// <summary>
/// 标题样式 1标准
/// </summary>
public int TitleStyle { get; set; }
/// <summary>
/// 菜单栏样式(0-列表,1-九宫格)
/// </summary>
public int? MenuNavStyle
{
get;
set;
}
/// <summary>
/// 菜单列表
/// </summary>
public List<RB_MiniProgram_UserCenterMenu> MeunList { get; set; }
}
}
......@@ -100,8 +100,10 @@ namespace Mall.Model.Extend.User
/// 小程序用户中心【自定义】菜单列表
/// </summary>
public List<RB_MiniProgram_UserCenterMenu_Extend> SelfMenuList { get; set; }
/// <summary>
/// 菜单栏 多组
/// </summary>
public List<Entity.User.MenuNavMoreModel> NavMoreList { get; set; }
/// <summary>
/// 获取可跳转小程序
/// </summary>
......
......@@ -478,6 +478,22 @@ namespace Mall.Module.User
extModel.AccountMenuList = menuList?.Where(qitem => qitem.MenuType == 2)?.ToList();
extModel.SelfMenuList = menuList?.Where(qitem => qitem.MenuType == 4).OrderBy(qitem => qitem.PageSort)?.ToList();
}
if (!string.IsNullOrEmpty(extModel.MenuNavJson) && extModel.MenuNavJson != "[]")
{
extModel.NavMoreList = JsonConvert.DeserializeObject<List<MenuNavMoreModel>>(extModel.MenuNavJson);
}
else {
extModel.NavMoreList = new List<MenuNavMoreModel>() {
new MenuNavMoreModel(){
Sort=1,
MenuNavTitle="",
MenuNavStyle=0,
TitleStyle=1,
MeunList=new List<RB_MiniProgram_UserCenterMenu>()
}
};
}
}
if (isGetHomeData)
{
......@@ -722,6 +738,28 @@ namespace Mall.Module.User
bool flag = false;
if (extModel.MallBaseId > 0)
{
#region 组装菜单栏
if (extModel.NavMoreList != null && extModel.NavMoreList.Any())
{
extModel.MenuNavJson = JsonConvert.SerializeObject(extModel.NavMoreList.Select(x => new
{
x.Sort,
x.MenuNavTitle,
x.TitleStyle,
x.MenuNavStyle,
MeunList = x.MeunList.Select(z => new
{
z.PageSort,
z.MenuName,
z.MenuIcon,
z.MenuUrl
})
}));
}
else {
extModel.MenuNavJson = "[]";
}
#endregion
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.DefaultBgImg),extModel.DefaultBgImg},
......@@ -736,6 +774,7 @@ namespace Mall.Module.User
{ nameof(RB_MiniProgram_Extend.IsShowMenuNav),extModel.IsShowMenuNav},
{ nameof(RB_MiniProgram_Extend.MenuNavTitle),extModel.MenuNavTitle},
{ nameof(RB_MiniProgram_Extend.MenuNavStyle),extModel.MenuNavStyle},
{ nameof(RB_MiniProgram_Extend.MenuNavJson),extModel.MenuNavJson},
};
if (extModel.FavoriteFootMenuList != null && extModel.FavoriteFootMenuList.Count > 0)
{
......
......@@ -535,6 +535,19 @@ namespace Mall.WebApi.Controllers.MallBase
@params = "",
}),
nar_menus = miniProgram?.NavMoreList?.Select(x => new {
x.Sort,
x.MenuNavTitle,
x.TitleStyle,
x.MenuNavStyle,
MeunList = x.MeunList.OrderBy(qitem => qitem.PageSort).Select(qitem => new {
icon_url = qitem.MenuIcon,
name = qitem.MenuName,
link_url = qitem.MenuUrl.Trim(),
open_type = "navigate",
@params = "",
})
}),
//订单菜单列表
order_bar = miniProgram?.OrderMenuList?.Select(qitem => 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