From 8da70e1a39328e1769b02bb1e05303916bb30eb5 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 01 二月 2021 13:55:31 +0800
Subject: [PATCH] 水阀功能

---
 HDL_ON/Common/ImageUtlis.cs |   39 ++++++++++++++++++++++++++-------------
 1 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/HDL_ON/Common/ImageUtlis.cs b/HDL_ON/Common/ImageUtlis.cs
index 6eb1c54..918483d 100644
--- a/HDL_ON/Common/ImageUtlis.cs
+++ b/HDL_ON/Common/ImageUtlis.cs
@@ -2,6 +2,7 @@
 using Shared;
 using HDL_ON.DAL.Server;
 using System.IO;
+using HDL_ON.Common;
 
 namespace HDL_ON
 {
@@ -361,25 +362,37 @@
         /// <param name="imageKey">鍥剧墖璺緞銆佷簯绔笅杞藉浘鐗囩殑鏍囪瘑key</param>
         /// <param name="imageView">闇�瑕佹樉绀哄浘鐗囩殑ImageView</param>
         /// <param name="ignoreCache">鏄惁闇�瑕佸拷鐣ョ紦瀛�</param>
-        public void Load3tyBrandIconImages(string imageKey, ImageView imageView)
+        public void Load3tyBrandIconImages(string brandName, string imageKey, ImageView imageView)
         {
             try
             {
                 System.Threading.Tasks.Task.Run(() =>
                 {
-                    byte[] imageBytes = GetImageDownloadUrl(imageKey);
-                    if (imageBytes != null)
-                    {
-                        WriteFileByBytes(imageKey, imageBytes);
-                        //2.3 涓嬭浇鎴愬姛锛屾樉绀哄苟缂撳瓨鏈湴
-                        Application.RunOnMainThread(() => {
-                            if (imageView != null)
-                            {
-                                imageView.ImageBytes = imageBytes;
-                                //Utlis.WriteLine("imageKey 鍔犺浇浜戠涓嬭浇鍥剧墖鎴愬姛");
-                            }
+                    //byte[] imageBytes = GetImageDownloadUrl(imageKey);
+                    //if (imageBytes != null)
+                    //{
+                    //    WriteFileByBytes(imageKey, imageBytes);
+                    //    //2.3 涓嬭浇鎴愬姛锛屾樉绀哄苟缂撳瓨鏈湴
+                    //    Application.RunOnMainThread(() => {
+                    //        if (imageView != null)
+                    //        {
+                    //            imageView.ImageBytes = imageBytes;
+                    //            //Utlis.WriteLine("imageKey 鍔犺浇浜戠涓嬭浇鍥剧墖鎴愬姛");
+                    //        }
+                    //    });
+                    //}
+
+                    //var ddd = new Common.DownLoadImageAsync(imageKey,"1","1");
+                    //ddd.StartDownloadImageAsync();
+
+                    Action action = () => {
+                        Application.RunOnMainThread(() =>
+                        {
+                            imageView.ImagePath = $"{brandName}.png";
                         });
-                    }
+                    };
+                    FileUtlis.Files.DownLoadImage($"{brandName}.png", imageKey, action);
+
                 });
             }
             catch (Exception ex)

--
Gitblit v1.8.0