Commit 40d5b68b authored by 黄奎's avatar 黄奎

页面修改

parent b4193488
......@@ -20,26 +20,18 @@ namespace Mall.Common
/// <returns></returns>
public static string JsonReplaceSign(string strJson)
{
//获取每个字符
char[] temp = strJson.ToCharArray();
//获取字符数组长度
int n = temp.Length;
//循环整个字符数组
for (int i = 0; i < n; i++)
{
//查找json属性值(:+" )
if (temp[i] == ':' && temp[i + 1] == '"')
{
//循环属性值内的字符(:+2 推算到value值)
for (int j = i + 2; j < n; j++)
{
//判断是否是英文双引号
if (temp[j] == '"')
{
//排除json属性的双引号
if (temp[j + 1] != ',' && temp[j + 1] != '}')
{
//替换成中文双引号
temp[j] = '”';
}
else if (temp[j + 1] == ',' || temp[j + 1] == '}')
......@@ -47,14 +39,6 @@ namespace Mall.Common
break;
}
}
else if (temp[j] == '-')
{
temp[j] = ' ';
}
else if (true)
{
// 要过虑其他字符,继续添加判断就可以
}
}
}
}
......
......@@ -216,18 +216,18 @@ namespace Mall.WebApi.Controllers.MallBase
QIds = templateIds
}, IsAnalyzePlus: true);
//解析模板
foreach (var item in templateList)
foreach (var item in selfHomePage.DetailsList)
{
var detailsModel = selfHomePage?.DetailsList?.Where(qitem => qitem.TemplateId == item.Id)?.FirstOrDefault();
var templateData = new
{
id = detailsModel?.Id ?? 0,
name = detailsModel?.NavName ?? "",
id = item?.Id ?? 0,
name = item?.NavName ?? "",
data = new List<object>()
};
if (item.ComponentDataList != null && item.ComponentDataList.Count() > 0)
var templateModel = templateList?.Where(qitem => qitem.Id == item.TemplateId)?.FirstOrDefault();
if (templateModel!=null && templateModel.ComponentDataList != null && templateModel.ComponentDataList.Count() > 0)
{
foreach (var subItem in item.ComponentDataList)
foreach (var subItem in templateModel.ComponentDataList)
{
templateData.data.Add(PlusDataToObject(subItem, (miniProgram?.TenantId ?? 0), miniProgram.MallBaseId));
}
......@@ -235,7 +235,7 @@ namespace Mall.WebApi.Controllers.MallBase
var tempObj = new
{
id = item.Id,
name = item.TemplateName,
name = item.NavName,
page_id = 0,
template_id = item.Id,
template = templateData
......
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