Browse Source

小键盘弄完一个了

zhangyang 4 years ago
parent
commit
c521240dda

+ 32 - 8
bin/Win32/Debug/zhipuzi_pos_windows/skin/member_login_dlg.xml

@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<Window size="700,450" caption="0,0,0,44" roundcorner="4,4" >
+<Window size="700,434" caption="0,0,0,44" roundcorner="4,4" >
 	<Font id="0" name="微软雅黑" size="26" />
 	<Font id="1" name="微软雅黑" size="32" />
+	<Font id="2" name="微软雅黑" size="22" />
 	
 	<VerticalLayout bkimage="shoukuan_bkg.png" >
 		<HorizontalLayout name="shoukuan_title_bkg" height="44" bkcolor="0xFF3CB371">
@@ -9,14 +10,37 @@
 			<Button name="closebtn" keyboard="false" padding="0,13,15,0" width="16" height="16" normalimage="file='close_normal.png'" hotimage="file='close_hover.png'" pushedimage="file='close_normal.png'"/>
 		</HorizontalLayout>
 		
-		<Label name="name" text="请输入会员手机号"  height="30" width="150" padding="30,50,0,0" align="left"/>
+		<HorizontalLayout>
+			<VerticalLayout width="370">
+				<Label name="name" text="请输入会员手机号" font="0" height="30" width="250" padding="30,50,0,0" align="left"/>
 	
-		<Edit name="content" width="300" height="50" tipvalue="1111" padding="30,30,0,0" textcolor="0xFF3CB371" bkcolor="#FFF2F2F2" nativebkcolor="#FFF2F2F2" font="1"/>
-		
-		<Label name="errinfo" text=""  height="60" width="250" float="true" pos="30,200,280,290" align="left" textcolor="#FFFF0000" visible="false"/>
-		
-		<HorizontalLayout height="56" valign="center" padding="30,80,0,20">
-			<Button name="save" align="center" text="确认" font="2" textcolor="#FFFFFFFF" height="50" width="300" padding="0,0,0,0" normalimage="file='Btn_Green.png' corner='5,5,5,5'" hotimage="file='Btn_Green_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" />
+				<Edit name="content" width="250" height="50" tipvalue="1111" padding="30,30,0,0" textcolor="0xFF3CB371" bkcolor="#FFF2F2F2" nativebkcolor="#FFF2F2F2" font="1"/>
+				
+				<Label name="errinfo" text=""  height="60" width="250" float="true" pos="30,150,280,290" align="left" textcolor="#FFFF0000" visible="false"/>
+				
+				<HorizontalLayout height="56" valign="center" padding="30,100,0,20">
+					<Button name="save" align="center" text="确认" textcolor="#FFFFFFFF" height="50" width="250" padding="0,0,0,0" normalimage="file='Btn_Green.png' corner='5,5,5,5'" hotimage="file='Btn_Green_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" />
+				</HorizontalLayout>
+			</VerticalLayout>
+			
+			<HorizontalLayout width="330" height="406" bkcolor="#FFF3F3F3">
+				<Button name="jianpan_1" text="1" font="0" heiht="60" width="60" float="true" pos="10,0,110,90" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				<Button name="jianpan_2" text="2" font="0" heiht="60" width="60" float="true" pos="120,0,220,90" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				<Button name="jianpan_3" text="3" font="0" heiht="60" width="60" float="true" pos="230,0,330,90" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				
+				<Button name="jianpan_4" text="4" font="0" heiht="60" width="60" float="true" pos="10,100,110,190" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				<Button name="jianpan_5" text="5" font="0" heiht="60" width="60" float="true" pos="120,100,220,190" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				<Button name="jianpan_6" text="6" font="0" heiht="60" width="60" float="true" pos="230,100,330,190" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				
+				<Button name="jianpan_7" text="7" font="0" heiht="60" width="60" float="true" pos="10,200,110,290" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				<Button name="jianpan_8" text="8" font="0" heiht="60" width="60" float="true" pos="120,200,220,290" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				<Button name="jianpan_9" text="9" font="0" heiht="60" width="60" float="true" pos="230,200,330,290" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				
+				<Button name="jianpan_qingkong" text="清空" font="0" heiht="60" width="60" float="true" pos="10,300,110,390" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				<Button name="jianpan_0" text="0" font="0" heiht="60" width="60" float="true" pos="120,300,220,390" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+				<Button name="jianpan_x" text="X" font="0" heiht="60" width="60" float="true" pos="230,300,330,390" normalimage="" hotimage="" pushedimage="" borderround="6,6" bkcolor="#FFFFFFFF"></Button>
+			</HorizontalLayout>
 		</HorizontalLayout>
+		
 	</VerticalLayout>
 </Window>

+ 141 - 6
zhipuzi_pos_windows/wnd/CMemberLoginWnd.cpp

@@ -88,6 +88,8 @@ LRESULT CMemberLoginWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam,
 	{
 		if (wParam == VK_RETURN)
 		{
+			StartYanzheng();
+
 			return true;
 		}
 		else if (wParam == VK_ESCAPE)
@@ -162,18 +164,127 @@ void CMemberLoginWnd::Notify(TNotifyUI& msg)
 		}
 		else if (senderName == _T("save"))
 		{
+			StartYanzheng();
+		}
+		else if (senderName == L"jianpan_1")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			wsReason += L"1";
+
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_2")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			wsReason += L"2";
+
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_3")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			wsReason += L"3";
+
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_4")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			wsReason += L"4";
+
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_5")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			wsReason += L"5";
+
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_6")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			wsReason += L"6";
+
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_7")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			wsReason += L"7";
+
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_8")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			wsReason += L"8";
+
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_9")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			wsReason += L"9";
+
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_0")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			wsReason += L"0";
+
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_x")
+		{
 			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
 			wstring wsReason = pContent->GetText();
 
-			m_content = CLewaimaiString::UnicodeToUTF8(wsReason);
+			wsReason = wsReason.substr(0, wsReason.length() - 1);
 
-			pContent->SetEnabled(false);
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
+		}
+		else if (senderName == L"jianpan_qingkong")
+		{
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
 
-			CButtonUI* pSave = static_cast<CButtonUI*>(m_pm.FindControl(_T("save")));
-			pSave->SetEnabled(false);
+			wsReason.clear();
 
-			//开始处理
-			std::thread(&CMemberLoginWnd::ConfirmMember, this).detach();
+			pContent->SetText(wsReason.c_str());
+			pContent->SetFocus();
 		}
 	}
 	else if (msg.sType == _T("textchanged"))
@@ -238,6 +349,30 @@ void CMemberLoginWnd::SetTitle(std::wstring title)
 	pLabel->SetText(title.c_str());
 }
 
+void CMemberLoginWnd::StartYanzheng()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+	wstring wsReason = pContent->GetText();
+
+	if (wsReason.length() == 0)
+	{
+		m_errorInfo = _T("手机号不能为空");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+
+	m_content = CLewaimaiString::UnicodeToUTF8(wsReason);
+
+	pContent->SetEnabled(false);
+
+	CButtonUI* pSave = static_cast<CButtonUI*>(m_pm.FindControl(_T("save")));
+	pSave->SetEnabled(false);
+
+	//开始处理
+	std::thread(&CMemberLoginWnd::ConfirmMember, this).detach();
+}
+
 void CMemberLoginWnd::ConfirmMember()
 {
 	std::string phone = m_content;

+ 2 - 0
zhipuzi_pos_windows/wnd/CMemberLoginWnd.h

@@ -62,6 +62,8 @@ public:
 
 	LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
 
+	void StartYanzheng();
+
 	void ConfirmMember();
 
 	//´¦Àí¼üÅ̲¶×½½á¹û