Commit 76ab0f3b authored by 黄奎's avatar 黄奎

页面修改

parent d8216f93
...@@ -58,8 +58,16 @@ namespace Test.Helper ...@@ -58,8 +58,16 @@ namespace Test.Helper
if (dataObj != null && !string.IsNullOrEmpty(dataObj["list"].ToString())) if (dataObj != null && !string.IsNullOrEmpty(dataObj["list"].ToString()))
{ {
var tempList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<cateGoryListItem>>(dataObj["list"].ToString()); var tempList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<cateGoryListItem>>(dataObj["list"].ToString());
if (tempList != null && tempList.Count > 0) if (tempList != null && tempList.Count > 0)
{ {
foreach (var item in tempList)
{
if (!string.IsNullOrEmpty(item.logo))
{
MallHelper.CreateImage(item.logo);
}
}
list.AddRange(tempList); list.AddRange(tempList);
} }
} }
...@@ -89,6 +97,10 @@ namespace Test.Helper ...@@ -89,6 +97,10 @@ namespace Test.Helper
{ {
foreach (var item in list) foreach (var item in list)
{ {
if (!string.IsNullOrEmpty(item.logo))
{
MallHelper.CreateImage(item.logo);
}
GetBrandInfo(item); GetBrandInfo(item);
} }
} }
...@@ -135,6 +147,11 @@ namespace Test.Helper ...@@ -135,6 +147,11 @@ namespace Test.Helper
JObject imgObj = JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(jItem)); JObject imgObj = JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(jItem));
string sort = imgObj["sort"].ToString(); string sort = imgObj["sort"].ToString();
Int32.TryParse(sort, out int newSort); Int32.TryParse(sort, out int newSort);
string fullImage = imgObj["full_image"].ToString();
if (!string.IsNullOrEmpty(fullImage))
{
MallHelper.CreateImage(fullImage);
}
imgList.Add(new imgList.Add(new
{ {
Name = imgObj["name"].ToString(), Name = imgObj["name"].ToString(),
......
...@@ -387,7 +387,7 @@ namespace Test.Helper ...@@ -387,7 +387,7 @@ namespace Test.Helper
catch (Exception) catch (Exception)
{ {
} }
} }
...@@ -396,10 +396,10 @@ namespace Test.Helper ...@@ -396,10 +396,10 @@ namespace Test.Helper
/// 生成图片 /// 生成图片
/// </summary> /// </summary>
/// <param name="url"></param> /// <param name="url"></param>
static void CreateImage(string url) public static void CreateImage(string url)
{ {
string tempPath = GetFileUrl(url); string tempPath = GetFileUrl(url);
string path = Environment.CurrentDirectory + tempPath;//下载到的地址+文件名 // 设置参数 string path = Environment.CurrentDirectory +"/NewImage/"+ tempPath;//下载到的地址+文件名 // 设置参数
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
//发送请求并获取相应回应数据 //发送请求并获取相应回应数据
HttpWebResponse response = request.GetResponse() as HttpWebResponse; HttpWebResponse response = request.GetResponse() as HttpWebResponse;
...@@ -430,7 +430,7 @@ namespace Test.Helper ...@@ -430,7 +430,7 @@ namespace Test.Helper
/// <returns></returns> /// <returns></returns>
public static string GetFileUrl(string path) 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> /// <summary>
......
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