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
f827f4c9
Commit
f827f4c9
authored
Jun 11, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
0c9ee628
40d5b68b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
12 deletions
+43
-12
ConvertHelper.cs
Mall.Common/Plugin/ConvertHelper.cs
+34
-2
Mall.Module.MarketingCenter.csproj
...Module.MarketingCenter/Mall.Module.MarketingCenter.csproj
+1
-0
MiniprogramTemplateModule.cs
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
+1
-1
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+7
-7
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+0
-2
No files found.
Mall.Common/Plugin/ConvertHelper.cs
View file @
f827f4c9
...
...
@@ -13,6 +13,38 @@ namespace Mall.Common
public
class
ConvertHelper
{
/// <summary>
/// json字符串将属性值中的英文双引号变成中文双引号
/// </summary>
/// <param name="strJson">json字符串</param>
/// <returns></returns>
public
static
string
JsonReplaceSign
(
string
strJson
)
{
char
[]
temp
=
strJson
.
ToCharArray
();
int
n
=
temp
.
Length
;
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
if
(
temp
[
i
]
==
':'
&&
temp
[
i
+
1
]
==
'"'
)
{
for
(
int
j
=
i
+
2
;
j
<
n
;
j
++)
{
if
(
temp
[
j
]
==
'"'
)
{
if
(
temp
[
j
+
1
]
!=
','
&&
temp
[
j
+
1
]
!=
'}'
)
{
temp
[
j
]
=
'”'
;
}
else
if
(
temp
[
j
+
1
]
==
','
||
temp
[
j
+
1
]
==
'}'
)
{
break
;
}
}
}
}
}
return
new
String
(
temp
);
}
/// <summary>
/// 转换字符流成字符串
/// </summary>
...
...
@@ -45,7 +77,7 @@ namespace Mall.Common
return
data
;
}
/// <summary>
/// 类型转换
/// </summary>
...
...
@@ -103,7 +135,7 @@ namespace Mall.Common
/// <param name="obj"></param>
/// <param name="defaultValue">默认值</param>
/// <returns></returns>
public
static
int
ToInt
(
object
obj
,
int
defaultValue
=
0
)
public
static
int
ToInt
(
object
obj
,
int
defaultValue
=
0
)
{
int
result
=
defaultValue
;
if
(
obj
!=
null
)
...
...
Mall.Module.MarketingCenter/Mall.Module.MarketingCenter.csproj
View file @
f827f4c9
...
...
@@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Mall.Common\Mall.Common.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
</ItemGroup>
...
...
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
View file @
f827f4c9
...
...
@@ -55,7 +55,7 @@ namespace Mall.Module.MarketingCenter
{
if
(
item
.
TemplateData
!=
null
&&
!
string
.
IsNullOrEmpty
(
item
.
TemplateData
))
{
item
.
ComponentDataList
=
JsonHelper
.
DeserializeObject
<
List
<
ComponentItem
>>(
item
.
TemplateData
);
item
.
ComponentDataList
=
JsonHelper
.
DeserializeObject
<
List
<
ComponentItem
>>(
Mall
.
Common
.
ConvertHelper
.
JsonReplaceSign
(
item
.
TemplateData
)
);
if
(
item
.
ComponentDataList
!=
null
&&
item
.
ComponentDataList
.
Count
>
0
)
{
foreach
(
var
subItem
in
item
.
ComponentDataList
)
...
...
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
f827f4c9
...
...
@@ -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
...
...
Mall.WebApi/Controllers/User/TenantController.cs
View file @
f827f4c9
...
...
@@ -872,9 +872,7 @@ namespace Mall.WebApi.Controllers.User
superList
.
Add
(
firstItem
);
}
}
}
}
if
(
item
.
MenuLevel
==
2
)
{
...
...
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