Commit 7be5b724 authored by 黄奎's avatar 黄奎

页面修改

parent 4d725687
......@@ -67,5 +67,10 @@ namespace Mall.Common.API
/// 小程序Id
/// </summary>
public string MiniAppId { get; set; }
/// <summary>
/// 用户OpenId
/// </summary>
public string OpenId { get; set; }
}
}
......@@ -82,8 +82,11 @@ namespace Mall.WebApi.Controllers.MallBase
JObject parms = JObject.Parse(RequestParm.msg.ToString());
//小程序Id
var MiniAppId = parms.GetStringValue("MiniAppId");
MiniAppId = RequestParm.MiniAppId;
var homePage = new object();
if (MiniAppId != null && !string.IsNullOrEmpty(MiniAppId))
{
//获取小程序信息
var miniProgram = programModule.GetMiniProgramModule(new Model.Extend.User.RB_MiniProgram_Extend() { MiniAppId = MiniAppId }, isGetHomeData: true);
if (miniProgram != null && miniProgram.MallBaseId > 0)
......@@ -94,8 +97,6 @@ namespace Mall.WebApi.Controllers.MallBase
TenantId = miniProgram.TenantId,
}, isGetHome: true);
List<object> list = new List<object>();
//测试使用
//selfHomePage.Id = 0;
//自定义首页
if (selfHomePage != null && selfHomePage.Id > 0)
{
......@@ -121,7 +122,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
foreach (var subItem in item.ComponentDataList)
{
templateData.data.Add(PlusDataToObject(subItem, (miniProgram?.TenantId??0),miniProgram.MallBaseId));
templateData.data.Add(PlusDataToObject(subItem, (miniProgram?.TenantId ?? 0), miniProgram.MallBaseId));
}
}
var tempObj = new
......@@ -327,7 +328,7 @@ namespace Mall.WebApi.Controllers.MallBase
break;
//专题
case "topic":
var topicSourceList= contentModule.GetTopicListModule(new Model.Entity.User.RB_Topic_Extend()
var topicSourceList = contentModule.GetTopicListModule(new Model.Entity.User.RB_Topic_Extend()
{
MallBaseId = miniProgram.MallBaseId,
TenantId = miniProgram.TenantId,
......@@ -339,7 +340,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
topic_list.Add(new topicDetailsItem()
{
cover_pic = Common.Config.GetFileUrl(tItem.CoverImg) ,
cover_pic = Common.Config.GetFileUrl(tItem.CoverImg),
read_count = 0,
title = tItem.Title,
id = tItem.Id,
......@@ -356,7 +357,7 @@ namespace Mall.WebApi.Controllers.MallBase
count = subitem.topic_num,
logo_1 = Common.Config.GetFileUrl(subitem.topic_url),
logo_2 = Common.Config.GetFileUrl(subitem.topic_url_2),
icon = Common.Config.GetFileUrl(subitem.label_url) ,
icon = Common.Config.GetFileUrl(subitem.label_url),
cat_show = false,
list = new List<topicTypeItem>(),
topic_list = topic_list
......@@ -385,7 +386,7 @@ namespace Mall.WebApi.Controllers.MallBase
menuName = subitem.name,
name = subitem.name,
staticGoods = false,
goodsList=new List<GoodsDetailsItem2> ()
goodsList = new List<GoodsDetailsItem2>()
};
if (subitem.relation_id == 0)
{
......@@ -463,8 +464,8 @@ namespace Mall.WebApi.Controllers.MallBase
mode = 1,
backgroundHeight = 100,
backgroundWidth = 100,
list = new List<GoodsDetailsItem2> (),
catList= new List<catItem>() { cats }
list = new List<GoodsDetailsItem2>(),
catList = new List<catItem>() { cats }
}
});
templateData.data.Add(new
......@@ -483,14 +484,14 @@ namespace Mall.WebApi.Controllers.MallBase
{
MallBaseId = miniProgram.MallBaseId,
TenantId = Convert.ToInt32(miniProgram.TenantId),
Id=subitem.relation_id
Id = subitem.relation_id
}).FirstOrDefault();
if (blockSource!=null && blockSource.Id>0)
if (blockSource != null && blockSource.Id > 0)
{
var rubikData = new rubikItem()
{
style = Convert.ToInt32(blockSource.Style),
space=0,
space = 0,
list = new List<rubikDetailItem>(),
};
switch (rubikData.style)
......@@ -498,29 +499,30 @@ namespace Mall.WebApi.Controllers.MallBase
//1张图
case 0:
rubikData.height = "360";
rubikData.w ="1";
rubikData.w = "1";
rubikData.h = 1;
rubikData.list.Add(new rubikDetailItem()
{
backgroundColor="",
numberX=0,
numberY=0,
backgroundColor = "",
numberX = 0,
numberY = 0,
w = 1,
h = 1,
x = 0,
y = 0,
link=new rubikLinkItem() {
new_link_url= blockSource.MagicDataList[0].Link
link = new rubikLinkItem()
{
new_link_url = blockSource.MagicDataList[0].Link
},
width= "calc(100%)",
height= "calc(100%)",
left= "0%",
top= "0%",
pic_url=Common.Config.GetFileUrl(blockSource.MagicDataList[0].ImgUrl),
backgroundImage="",
backgroundRepeat= "no-repeat",
backgroundSize= "cover",
backgroundPosition= "center"
width = "calc(100%)",
height = "calc(100%)",
left = "0%",
top = "0%",
pic_url = Common.Config.GetFileUrl(blockSource.MagicDataList[0].ImgUrl),
backgroundImage = "",
backgroundRepeat = "no-repeat",
backgroundSize = "cover",
backgroundPosition = "center"
});
break;
//两张图
......@@ -1114,7 +1116,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
homePage = new
{
id = -1,
id = miniProgram.MallBaseId,
title = miniProgram.MallName,
show_navs = 1,
is_home_page = 1,
......@@ -1123,6 +1125,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
}
}
var objResult = new
{
home_pages = homePage
......
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