From efad979b6fae76fb37a4de7e94e6bac0a85cb72c Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 30 十一月 2021 13:14:28 +0800
Subject: [PATCH] 2021-11-30 1.修复乐橙Android,没调用拒接接口问题。
---
HDL-ON_iOS/Other/JLCountrycode.cs | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 57 insertions(+), 0 deletions(-)
diff --git a/HDL-ON_iOS/Other/JLCountrycode.cs b/HDL-ON_iOS/Other/JLCountrycode.cs
index f6a2451..176a7df 100644
--- a/HDL-ON_iOS/Other/JLCountrycode.cs
+++ b/HDL-ON_iOS/Other/JLCountrycode.cs
@@ -1,5 +1,7 @@
锘縰sing System;
using Shared.IOS.JLCountryCode;
+using Foundation;
+using System.Collections.Generic;
namespace JLCountrycode
{
@@ -40,5 +42,60 @@
Shared.Application.currentVC.NavigationController.PushViewController(mJLCountryCodeController, true);
}
+
+
+ /// <summary>
+ /// 閫夋嫨
+ /// </summary>
+ /// <param name="titleStr"></param>
+ /// <param name="dic"></param>
+ /// <param name="action"></param>
+ public void ShowSortSelection(string titleStr, Dictionary<string, List<string>> dic, Action<string> action)
+ {
+ try
+ {
+ JLSortSelectionViewController vc = new JLSortSelectionViewController();
+ vc.TitleStr = titleStr;
+ vc.SortedNameDict = ConvertToNativeDictionary(dic);
+ vc.SortSelectionBlock += (countryName) =>
+ {
+ action?.Invoke(countryName);
+ };
+
+ Shared.Application.currentVC.NavigationController.PushViewController(vc, true);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex.ToString());
+ }
+
+ }
+
+ /// <summary>
+ /// Dictionary 杞� iOS鍘熺敓 NSMutableDictionary
+ /// </summary>
+ /// <param name="dict"></param>
+ /// <returns></returns>
+ NSMutableDictionary ConvertToNativeDictionary(Dictionary<string, List<string>> dict)
+ {
+ NSMutableDictionary newDictionary = new NSMutableDictionary();
+ try
+ {
+ //var dictDataList = new NSMutableArray();
+ foreach (string key in dict.Keys)
+ {
+ var value = dict[key];
+ newDictionary.Add(new NSString(key), NSArray.FromObjects(value.ToArray()));
+ }
+ }
+ catch (Exception Ex)
+ {
+ Console.WriteLine(Ex.ToString());
+ }
+ return newDictionary;
+ }
+
+
+
}
}
\ No newline at end of file
--
Gitblit v1.8.0