| | |
| | | var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Ir_CodeRemove); |
| | | return responsePackNew; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取逻辑 |
| | | /// 查询红外设备类型列表/品牌列表/品牌红外码库列表 |
| | | /// </summary> |
| | | /// <param name="listIdList">逻辑ID列表</param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew GetLogic(List<string> listIdList) |
| | | /// <param name="frameLayout">加载log的父控件</param> |
| | | /// <param name="action">回调函数</param> |
| | | public static void GetDeviceTypesList(FrameLayout frameLayout, Action<ResponsePackNew> action, string id, string if_str) |
| | | { |
| | | var jArray = new JArray { }; |
| | | for (int i = 0; i < listIdList.Count; i++) |
| | | |
| | | DAL.Server.ResponsePackNew responsePackNew = null; |
| | | Loading loading = new Loading(); |
| | | frameLayout.AddChidren(loading); |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | jArray.Add(listIdList[i]); |
| | | } |
| | | var jObject = new JObject { { "userLogicIds", jArray } }; |
| | | var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Info); |
| | | //如果是token过期则刷新token |
| | | if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) |
| | | { |
| | | RefreshToken(); |
| | | GetLogic(listIdList); |
| | | } |
| | | return responsePackNew; |
| | | try |
| | | { |
| | | string url = ""; |
| | | var jObject = new JObject { }; |
| | | if (if_str == "设备类型列表") |
| | | { |
| | | url = "/smart-footstone/app/ir/device-type/list"; |
| | | } |
| | | else if (if_str == "品牌列表") |
| | | { |
| | | url = "/smart-footstone/app/ir/brand/list"; |
| | | jObject.Add("deviceTypeId", id); |
| | | } |
| | | else if (if_str == "品牌红外码库列表") |
| | | { |
| | | url = "/smart-footstone/app/ir/code/list"; |
| | | jObject.Add("brandId", id); |
| | | } |
| | | responsePackNew = RequestServerhomeId(jObject, url); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | action(responsePackNew); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | ///请求服务器(与住宅有关:例如;homeId) |