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

页面修改

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