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
76ab0f3b
Commit
76ab0f3b
authored
Jul 25, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
d8216f93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
HuiMaiHelper.cs
Test/Helper/HuiMaiHelper.cs
+17
-0
MallHelper.cs
Test/Helper/MallHelper.cs
+4
-4
No files found.
Test/Helper/HuiMaiHelper.cs
View file @
76ab0f3b
...
...
@@ -58,8 +58,16 @@ namespace Test.Helper
if
(
dataObj
!=
null
&&
!
string
.
IsNullOrEmpty
(
dataObj
[
"list"
].
ToString
()))
{
var
tempList
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
List
<
cateGoryListItem
>>(
dataObj
[
"list"
].
ToString
());
if
(
tempList
!=
null
&&
tempList
.
Count
>
0
)
{
foreach
(
var
item
in
tempList
)
{
if
(!
string
.
IsNullOrEmpty
(
item
.
logo
))
{
MallHelper
.
CreateImage
(
item
.
logo
);
}
}
list
.
AddRange
(
tempList
);
}
}
...
...
@@ -89,6 +97,10 @@ namespace Test.Helper
{
foreach
(
var
item
in
list
)
{
if
(!
string
.
IsNullOrEmpty
(
item
.
logo
))
{
MallHelper
.
CreateImage
(
item
.
logo
);
}
GetBrandInfo
(
item
);
}
}
...
...
@@ -135,6 +147,11 @@ namespace Test.Helper
JObject
imgObj
=
JObject
.
Parse
(
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
jItem
));
string
sort
=
imgObj
[
"sort"
].
ToString
();
Int32
.
TryParse
(
sort
,
out
int
newSort
);
string
fullImage
=
imgObj
[
"full_image"
].
ToString
();
if
(!
string
.
IsNullOrEmpty
(
fullImage
))
{
MallHelper
.
CreateImage
(
fullImage
);
}
imgList
.
Add
(
new
{
Name
=
imgObj
[
"name"
].
ToString
(),
...
...
Test/Helper/MallHelper.cs
View file @
76ab0f3b
...
...
@@ -387,7 +387,7 @@ namespace Test.Helper
catch
(
Exception
)
{
}
}
...
...
@@ -396,10 +396,10 @@ namespace Test.Helper
/// 生成图片
/// </summary>
/// <param name="url"></param>
static
void
CreateImage
(
string
url
)
public
static
void
CreateImage
(
string
url
)
{
string
tempPath
=
GetFileUrl
(
url
);
string
path
=
Environment
.
CurrentDirectory
+
tempPath
;
//下载到的地址+文件名 // 设置参数
string
path
=
Environment
.
CurrentDirectory
+
"/NewImage/"
+
tempPath
;
//下载到的地址+文件名 // 设置参数
HttpWebRequest
request
=
WebRequest
.
Create
(
url
)
as
HttpWebRequest
;
//发送请求并获取相应回应数据
HttpWebResponse
response
=
request
.
GetResponse
()
as
HttpWebResponse
;
...
...
@@ -430,7 +430,7 @@ namespace Test.Helper
/// <returns></returns>
public
static
string
GetFileUrl
(
string
path
)
{
return
path
.
Replace
(
"https://
cdnimg.iotweixin.com"
,
""
).
Replace
(
"http://kydwx.oss-cn-hangzhou.aliyuncs
.com"
,
""
);
return
path
.
Replace
(
"https://
qiniu.huimaihuishou.com"
,
""
).
Replace
(
"https://oc.huimaihuishou
.com"
,
""
);
}
/// <summary>
...
...
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