Browse Source

会员的UI改完了。

张洋 1 month ago
parent
commit
0076d052c3

+ 1 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_page.xml

@@ -13,6 +13,7 @@
 				<HorizontalLayout height="46" bkcolor="#FFF5F7FA" borderround="16,16" inset="14,0,14,0" childpadding="10" childvalign="vcenter">
 					<Control bkimage="search_icon.png" width="25" height="26" maxheight="26" />
 					<Edit name="huiyuan_page_shoujihao_edit" tipvalue="请输入会员手机号搜索" tipvaluecolor="#FFA8ADB3" font="15" textcolor="#FF1F2329" bkcolor="#FFF5F7FA" nativebkcolor="#FFF5F7FA" />
+					<Button name="huiyuan_page_shoujihao_clear" visible="false" width="23" height="23" maxheight="23" normalimage="search_clear.png" hotimage="search_clear.png" pushedimage="search_clear.png"/>
 				</HorizontalLayout>
 
 				<Control height="12" />

+ 45 - 0
zhipuzi_pos_windows/page/CHuiyuanPageUI.cpp

@@ -47,6 +47,11 @@ void CHuiyuanPageUI::HandleClickMsg(TNotifyUI& msg)
 
 		StartHuiyuanSousuo();
 	}
+	else if (senderName == L"huiyuan_page_shoujihao_clear")
+	{
+		//点击搜索框右侧的 X:清空输入,并回到搜索前的默认提示状态
+		QingkongHuiyuanSousuo();
+	}
 	else if (senderName == L"huiiyuan_page_chongzhi_btn")
 	{
 		StartHuiyuanChongzhi();
@@ -126,6 +131,9 @@ void CHuiyuanPageUI::HandleTextChangedMsg(TNotifyUI& msg)
 				}
 			}
 		}
+
+		//输入框有内容时显示右侧清空按钮,无内容时隐藏
+		this->FindSubControl(_T("huiyuan_page_shoujihao_clear"))->SetVisible(!m_pEdit->GetText().IsEmpty());
 	}
 }
 
@@ -138,6 +146,43 @@ void CHuiyuanPageUI::HandleTextCapture(std::string content)
 	}
 }
 
+//点击搜索框右侧的 X:清空输入框,并清空会员信息状态、回到搜索前的默认提示
+void CHuiyuanPageUI::QingkongHuiyuanSousuo()
+{
+	//1. 清空输入框
+	CEditUI* m_pEdit = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+	m_pEdit->SetText(L"");
+
+	m_sousuo_phone = "";
+
+	//2. 隐藏右侧清空按钮
+	this->FindSubControl(_T("huiyuan_page_shoujihao_clear"))->SetVisible(false);
+
+	//3. 清空当前会员信息状态
+	m_phone = "";
+	m_member_id = "";
+	m_balance = "";
+	m_member_card_no = "";
+	m_sex = "";
+	m_birthday = "";
+	m_address = "";
+	m_is_open_pay_password = "";
+	m_name = "";
+	m_card_identify = "";
+	m_md5_password = "";
+	m_freeze = "";
+
+	//4. 右侧回到搜索前的默认提示状态
+	this->FindSubControl(L"huiyuan_info_layout")->SetVisible(false);
+	this->FindSubControl(L"huiyuan_page_no_layout")->SetVisible(true);
+
+	CLabelUI* pNoTip = static_cast<CLabelUI*>(this->FindSubControl(_T("huiyuan_page_no_tip")));
+	pNoTip->SetText(L"请在左侧输入手机号搜索会员,再进行充值、挂失等操作");
+	pNoTip->SetTextColor(0xFF8A9099);
+
+	m_pManager->NeedUpdate();
+}
+
 void CHuiyuanPageUI::StartHuiyuanSousuo()
 {
 	if (m_is_handle == true)

+ 3 - 0
zhipuzi_pos_windows/page/CHuiyuanPageUI.h

@@ -40,6 +40,9 @@ public:
 private:	
 	void StartHuiyuanSousuo();
 
+	//点击搜索框右侧清空按钮:清空输入并回到搜索前的默认提示状态
+	void QingkongHuiyuanSousuo();
+
 	void StartAddHuiyuan();
 
 	void StartHuiyuanChongzhi();

BIN
zhipuzi_pos_windows/resource/skin.zip