Commit 4d725687 authored by 黄奎's avatar 黄奎

自定义首页模板修改

parent c38ee42c
...@@ -95,7 +95,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -95,7 +95,7 @@ namespace Mall.WebApi.Controllers.MallBase
}, isGetHome: true); }, isGetHome: true);
List<object> list = new List<object>(); List<object> list = new List<object>();
//测试使用 //测试使用
selfHomePage.Id = 0; //selfHomePage.Id = 0;
//自定义首页 //自定义首页
if (selfHomePage != null && selfHomePage.Id > 0) if (selfHomePage != null && selfHomePage.Id > 0)
{ {
...@@ -378,7 +378,15 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -378,7 +378,15 @@ namespace Mall.WebApi.Controllers.MallBase
break; break;
//商品分类 //商品分类
case "cat": case "cat":
var tempGoodsList = new List<GoodsDetailsItem2>(); var cats = new catItem()
{
goodsNum = 6,
id = subitem.relation_id,
menuName = subitem.name,
name = subitem.name,
staticGoods = false,
goodsList=new List<GoodsDetailsItem2> ()
};
if (subitem.relation_id == 0) if (subitem.relation_id == 0)
{ {
var goodsList = productModule.GetProductGoodsPageList(1, 6, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend() var goodsList = productModule.GetProductGoodsPageList(1, 6, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend()
...@@ -388,9 +396,10 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -388,9 +396,10 @@ namespace Mall.WebApi.Controllers.MallBase
}); });
if (goodsList != null && goodsList.Count > 0) if (goodsList != null && goodsList.Count > 0)
{ {
foreach (var gItem in goodsList) foreach (var gItem in goodsList)
{ {
tempGoodsList.Add(new GoodsDetailsItem2() cats.goodsList.Add(new GoodsDetailsItem2()
{ {
id = gItem.Id, id = gItem.Id,
price = gItem?.SellingPrice ?? 0, price = gItem?.SellingPrice ?? 0,
...@@ -412,7 +421,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -412,7 +421,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
foreach (var gItem in goodsList) foreach (var gItem in goodsList)
{ {
tempGoodsList.Add(new GoodsDetailsItem2() cats.goodsList.Add(new GoodsDetailsItem2()
{ {
id = gItem.Id, id = gItem.Id,
price = gItem?.SellingPrice ?? 0, price = gItem?.SellingPrice ?? 0,
...@@ -427,7 +436,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -427,7 +436,7 @@ namespace Mall.WebApi.Controllers.MallBase
id = "goods", id = "goods",
data = new goodsItem() data = new goodsItem()
{ {
showCat = false, showCat = true,
catPosition = "top", catPosition = "top",
catStyle = 0, catStyle = 0,
addGoodsType = 0, addGoodsType = 0,
...@@ -454,7 +463,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -454,7 +463,8 @@ namespace Mall.WebApi.Controllers.MallBase
mode = 1, mode = 1,
backgroundHeight = 100, backgroundHeight = 100,
backgroundWidth = 100, backgroundWidth = 100,
list = tempGoodsList list = new List<GoodsDetailsItem2> (),
catList= new List<catItem>() { cats }
} }
}); });
templateData.data.Add(new templateData.data.Add(new
...@@ -472,7 +482,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -472,7 +482,8 @@ namespace Mall.WebApi.Controllers.MallBase
var blockSource = programModule.GetMallMagicListModule(new Model.Entity.User.RB_Mall_Magic_Extend() var blockSource = programModule.GetMallMagicListModule(new Model.Entity.User.RB_Mall_Magic_Extend()
{ {
MallBaseId = miniProgram.MallBaseId, MallBaseId = miniProgram.MallBaseId,
TenantId = Convert.ToInt32(miniProgram.TenantId) TenantId = Convert.ToInt32(miniProgram.TenantId),
Id=subitem.relation_id
}).FirstOrDefault(); }).FirstOrDefault();
if (blockSource!=null && blockSource.Id>0) if (blockSource!=null && blockSource.Id>0)
{ {
...@@ -1052,7 +1063,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1052,7 +1063,7 @@ namespace Mall.WebApi.Controllers.MallBase
}, },
width = "calc(50%)", width = "calc(50%)",
height = "calc(50%)", height = "calc(50%)",
left = "calc(05%)", left = "calc(50%)",
top = "calc(50%)", top = "calc(50%)",
pic_url = Common.Config.GetFileUrl(blockSource.MagicDataList[3].ImgUrl), pic_url = Common.Config.GetFileUrl(blockSource.MagicDataList[3].ImgUrl),
backgroundImage = "", backgroundImage = "",
......
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