Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
40d5b68b
Commit
40d5b68b
authored
Jun 11, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
b4193488
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
23 deletions
+7
-23
ConvertHelper.cs
Mall.Common/Plugin/ConvertHelper.cs
+0
-16
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+7
-7
No files found.
Mall.Common/Plugin/ConvertHelper.cs
View file @
40d5b68b
...
...
@@ -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
)
{
// 要过虑其他字符,继续添加判断就可以
}
}
}
}
...
...
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
40d5b68b
...
...
@@ -216,18 +216,18 @@ namespace Mall.WebApi.Controllers.MallBase
QIds
=
templateIds
},
IsAnalyzePlus
:
true
);
//解析模板
foreach
(
var
item
in
template
List
)
foreach
(
var
item
in
selfHomePage
.
Details
List
)
{
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
.
Template
Name
,
name
=
item
.
Nav
Name
,
page_id
=
0
,
template_id
=
item
.
Id
,
template
=
templateData
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment