From 2ae36ddb40d28c62b64a2fdd4c3033e7d65d5cfb Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 04 三月 2021 15:20:29 +0800
Subject: [PATCH] 2021-0304-1
---
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs | 73 ++++++++++++++++++++++++++++--------
1 files changed, 57 insertions(+), 16 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs
index 4835344..97af281 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs
@@ -9,9 +9,9 @@
{
public AddControl()
{
- Tag = "AddControl";
+ Tag = "Pir";
}
- public void Show()
+ public void Show(Control control)
{
#region 鐣岄潰甯冨眬
@@ -24,8 +24,7 @@
this.AddChidren(topView.FLayoutView());
topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
{
- //杩斿洖娓呯┖鍒楄〃
- Pir.BuottonList.Clear();
+
this.RemoveFromParent();
};
@@ -135,19 +134,27 @@
{
AddButton addButton = new AddButton();
MainPage.BasePageView.AddChidren(addButton);
- addButton.Show();
+ addButton.Show(control);
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
//淇濆瓨鐐瑰嚮浜嬩欢
saveBtn.MouseUpEventHandler += (sender, e) =>
{
- //淇濆瓨閬ユ帶鍣ㄦ竻闄や箣鍓嶆寜閽垪琛ㄧ殑鏁版嵁
- Pir.BuottonList.Clear();
+ //绉婚櫎褰撳墠鐣岄潰
+ this.RemoveFromParent();
//鍙兘涔嬪墠宸茬粡瀛樺湪璇ョ晫闈�
- MainPage.BasePageView.RemoveViewByTag("Pir");
+ for (int i = MainPage.BasePageView.ChildrenCount - 1; 0 <= i; i--)
+ {
+ var view = MainPage.BasePageView.GetChildren(i);
+ if (view.GetType() == typeof(AddControlComplete))
+ {
+ view.RemoveFromParent();
+ }
+ }
+ //MainPage.BasePageView.RemoveViewByTag("Pir");
AddControlComplete addControlComplete = new AddControlComplete();
MainPage.BasePageView.AddChidren(addControlComplete);
- addControlComplete.Show();
+ addControlComplete.Show(control);
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
#endregion
@@ -207,7 +214,7 @@
X = Application.GetRealWidth((16 + 92) + (104 + 16) * j),
Width = Application.GetRealWidth(16),
Height = Application.GetRealWidth(16),
- Tag = nameObj.value,
+ Tag = nameObj,
};
if (if_bool)
{
@@ -216,13 +223,47 @@
//鍒犻櫎鍥炬爣鐨勭偣鍑讳簨浠�
delIconBtn.MouseUpEventHandler += (sender, e) =>
{
- var name = delIconBtn.Tag.ToString();
- var buttonObj = Pir.BuottonList.Find((c) => c.value == name);
- if (buttonObj != null)
+ var obj = delIconBtn.Tag as ButtonObj;
+ //鍔犺浇log
+ Loading loading = new Loading();
+ this.AddChidren(loading);
+ HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null;
+ loading.Start();
+ new System.Threading.Thread(() =>
{
- Pir.BuottonList.Remove(buttonObj);
- }
- RefreshView(vv, true);
+ try
+ {
+ //鍙戦�佹寜閿垹闄わ紱
+ responsePackNew = PirSend.CodeRemove(obj);
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ loading.Hide();
+ if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
+ {
+ ///杩欓噷锛氱洃鍚琈TTP鎺ㄩ�佷笅鏉ヤ富棰橈紝鎵嶇煡閬撴槸鍚︽坊鍔犳垚鍔�
+ var buttonObj = Pir.BuottonList.Find((c) => c.value == obj.value);
+ if (buttonObj != null)
+ {
+ Pir.BuottonList.Remove(buttonObj);
+ }
+ RefreshView(vv, true);
+ }
+ else {
+ Method method = new Method();
+ method.ErrorShow(responsePackNew);
+ }
+
+ });
+ }
+
+ })
+ { IsBackground = true }.Start();
+
+
};
if (i % 3 == 0)
{
--
Gitblit v1.8.0