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/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs | 316 ++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 269 insertions(+), 47 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs index bb2af77..b59e237 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Matching.cs @@ -148,6 +148,7 @@ }; fLayout.AddChidren(succeedBtn); #endregion + #region 鐐瑰嚮浜嬩欢 //琛ㄧず搴撳垪琛ㄧ储寮曞��(鐩墠鍙�20涓簱) int index = 1; @@ -176,18 +177,22 @@ code = 1; GetBtnText(testBtn, code, spk); }; - //娴嬭瘯Text testBtn.MouseUpEventHandler += (sender, e) => { - var library = libraryList[index-1]; + // testBtn.BackgroundColor = CSS.CSS_Color.viewMiddle; + var library = libraryList[index - 1]; var control = GetControl(spk, testBtn.TextID, library); //鍙戦�佹祴璇曠爜鍛戒护 - CodeTest(control); + PirMethod.ThreadSend(control, (responsePackNew) => { }, "搴撶爜娴嬭瘯", "frame", this, null); if (code == 3) { //鏍囪鏈�鍚庨偅涓爜 if_bool = true; } + }; + testBtn.MouseDownEventHandler += (sender, e) => + { + //testBtn.BackgroundColor = CSS.CSS_Color.textConfirmColor; }; //鎺у埗澶辫触 failedBtn.MouseUpEventHandler += (sender, e) => @@ -216,14 +221,27 @@ { var library = libraryList[index-1]; var control = GetControl(spk, testBtn.TextID, library); - Method method = new Method(); + if (spk == SPK.TvIr) + { + //澶囨敞锛氫紵鍗楄姹傚皬绫崇數瑙嗘崲鎺塻pk=ir.tvxm锛堝惉璇存槸涓存椂瑙e喅鏂规锛� + var brand = brandList.Find((c) => c.id == library.brandId); + if (brand != null) + { + if (brand.brandName.Contains("灏忕背") || brand.brandName.Contains("Xiaomi")) + { + //鏇存崲spk + control.spk = "ir.tvxm"; + } + } + } + PirMethod method = new PirMethod(); //鍙戦�佸簱娣诲姞閬ユ帶鍣ㄥ懡浠� - method.ThreadAddControl(control, this, (cont) => + method.ThreadAddControl(control, this, (device) => { MainPage.BasePageView.RemoveViewByTag("PirView"); AddControlComplete addControlComplete = new AddControlComplete(); MainPage.BasePageView.AddChidren(addControlComplete); - addControlComplete.Show(cont, true); + addControlComplete.Show(device, true); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }); @@ -295,6 +313,136 @@ } } break; + case SPK.FanIr: + { + switch (textInt) + { + case StringId.dianyuan: + { + key = "on_off"; + value = "on"; + } + break; + case StringId.fengsuqiehuan: + { + key = "speed"; + value = ""; + } + break; + case StringId.yaotou: + { + key = "swing"; + value = ""; + } + break; + } + } + break; + case SPK.PjtIr: + { + switch (textInt) + { + case StringId.dianyuan: + { + key = "on_off"; + value = "on"; + } + break; + case StringId.yinliangjia: + { + key = "volume+"; + value = ""; + } + break; + case StringId.yinliangjian: + { + key = "volume-"; + value = ""; + } + break; + } + } + break; + case SPK.StbIr: + { + switch (textInt) + { + case StringId.dianyuan: + { + key = "on_off"; + value = "on"; + } + break; + case StringId.yinliangjia: + { + key = "volume+"; + value = ""; + } + break; + case StringId.yinliangjian: + { + key = "volume-"; + value = ""; + } + break; + } + } + break; + case SPK.DvDIr: + { + + } + break; + case SPK.PurifierIr: + { + switch (textInt) + { + case StringId.dianyuan: + { + key = "on_off"; + value = "on"; + } + break; + case StringId.zidong: + { + key = "auto"; + value = ""; + } + break; + case StringId.jingyin: + { + key = "mute"; + value = "0"; + } + break; + } + } + break; + case SPK.HeaterIr: + { + switch (textInt) + { + case StringId.dianyuan: + { + key = "on_off"; + value = "on"; + } + break; + case StringId.wendujia: + { + key = "temp+"; + value = ""; + } + break; + case StringId.wendujian: + { + key = "temp-"; + value = ""; + } + break; + } + } + break; } AttributesStatus buttonObj = new AttributesStatus(); buttonObj.key = key; @@ -316,47 +464,6 @@ } return control; - } - - /// <summary> - /// 鍙戦�佸簱鐮佹祴璇曞懡浠� - /// </summary> - /// <param name="control"></param> - private void CodeTest(Control control) - { - - //鍔犺浇log - Loading loading = new Loading(); - this.AddChidren(loading); - HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; - loading.Start(); - new System.Threading.Thread(() => - { - try - { - responsePackNew = PirSend.CodeTest(control); - } - catch { } - finally - { - Application.RunOnMainThread(() => - { - loading.Hide(); - if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") - { - - } - else - { - //Method method = new Method(); - //method.ErrorShow(responsePackNew); - } - - }); - } - - }) - { IsBackground = true }.Start(); } /// <summary> @@ -414,6 +521,121 @@ } } break; + case SPK.FanIr: + { + switch (code) + { + case 1: + { + textValue = StringId.dianyuan; + } + break; + case 2: + { + textValue = StringId.fengsuqiehuan; + } + break; + case 3: + { + textValue = StringId.yaotou; + } + break; + } + } + break; + case SPK.PjtIr: + { + switch (code) + { + case 1: + { + textValue = StringId.dianyuan; + } + break; + case 2: + { + textValue = StringId.yinliangjia; + } + break; + case 3: + { + textValue = StringId.yinliangjian; + } + break; + } + } + break; + case SPK.StbIr: + { + switch (code) + { + case 1: + { + textValue = StringId.dianyuan; + } + break; + case 2: + { + textValue = StringId.yinliangjia; + } + break; + case 3: + { + textValue = StringId.yinliangjian; + } + break; + } + } + break; + case SPK.DvDIr: + { + + } + break; + case SPK.PurifierIr: + { + switch (code) + { + case 1: + { + textValue = StringId.dianyuan; + } + break; + case 2: + { + textValue = StringId.zidong; + } + break; + case 3: + { + textValue = StringId.jingyin; + } + break; + } + } + break; + case SPK.HeaterIr: + { + switch (code) + { + case 1: + { + textValue = StringId.dianyuan; + } + break; + case 2: + { + textValue = StringId.wendujia; + } + break; + case 3: + { + textValue = StringId.wendujian; + } + break; + } + } + break; } testBtn.TextID = textValue; } -- Gitblit v1.8.0