瀏覽代碼

收款可以支持键盘输入了,正餐的问题也修复好了

张洋 2 年之前
父節點
當前提交
00954bb05a

+ 271 - 108
zhipuzi_pos_windows/page/CShoukuanPageUI.cpp

@@ -50,147 +50,51 @@ void CShoukuanPageUI::HandleClickMsg(TNotifyUI& msg)
 
 	if (senderName == L"jianpan_1")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"1");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_1();
 	}
 	else if (senderName == L"jianpan_2")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"2");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_2();
 	}
 	else if (senderName == L"jianpan_3")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"3");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_3();
 	}
 	else if (senderName == L"jianpan_4")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"4");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_4();
 	}
 	else if (senderName == L"jianpan_5")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"5");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_5();
 	}
 	else if (senderName == L"jianpan_6")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"6");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_6();
 	}
 	else if (senderName == L"jianpan_7")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"7");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_7();
 	}
 	else if (senderName == L"jianpan_8")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"8");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_8();
 	}
 	else if (senderName == L"jianpan_9")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"9");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_9();
 	}
 	else if (senderName == L"jianpan_0")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"0");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_0();
 	}
 	else if (senderName == L"jianpan_dian")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L".");
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_dian();
 	}
 	else if (senderName == L"jianpan_qingkong")
 	{
-		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
-		wstring wsReason = pContent->GetText();
-
-		wsReason = L"0";
-
-		pContent->SetText(wsReason.c_str());
-		pContent->SetFocus();
-
-		UpdateJiesuanInfo();
+		this->Click_qingkong();		
 	}
 	else if (senderName == L"diandan_jiesuan_zhifufangshi_weixinzhifu_btn")
 	{
@@ -303,6 +207,87 @@ void CShoukuanPageUI::HandleTextCapture(std::string content)
 	this->StartWeixinzhifuShoukuan(content);
 }
 
+bool CShoukuanPageUI::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+	if (uMsg == WM_KEYDOWN)
+	{
+		if (wParam == '1' || wParam == VK_NUMPAD1)
+		{
+			this->Click_1();
+
+			return true;
+		}
+		else if (wParam == '2' || wParam == VK_NUMPAD2)
+		{
+			this->Click_2();
+
+			return true;
+		}
+		else if (wParam == '3' || wParam == VK_NUMPAD3)
+		{
+			this->Click_3();
+
+			return true;
+		}
+		else if (wParam == '4' || wParam == VK_NUMPAD4)
+		{
+			this->Click_4();
+
+			return true;
+		}
+		else if (wParam == '5' || wParam == VK_NUMPAD5)
+		{
+			this->Click_5();
+
+			return true;
+		}
+		else if (wParam == '6' || wParam == VK_NUMPAD6)
+		{
+			this->Click_6();
+
+			return true;
+		}
+		else if (wParam == '7' || wParam == VK_NUMPAD7)
+		{
+			this->Click_7();
+
+			return true;
+		}
+		else if (wParam == '8' || wParam == VK_NUMPAD8)
+		{
+			this->Click_8();
+
+			return true;
+		}
+		else if (wParam == '9' || wParam == VK_NUMPAD9)
+		{
+			this->Click_9();
+
+			return true;
+		}
+		else if (wParam == '0' || wParam == VK_NUMPAD0)
+		{
+			this->Click_0();
+
+			return true;
+		}
+		else if (wParam == VK_DECIMAL)
+		{
+			this->Click_dian();
+
+			return true;
+		}
+		else if (wParam == VK_BACK)
+		{
+			this->Click_del();
+
+			return true;
+		}
+	}
+
+	return false;
+}
+
 void CShoukuanPageUI::ShowError(std::wstring err)
 {
 	CLabelUI* m_pLabel = static_cast<CLabelUI*>(this->FindSubControl(_T("errorinfo")));
@@ -1023,4 +1008,182 @@ void CShoukuanPageUI::ClickMemberLogout()
 	m_is_member = false;
 
 	this->UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_1()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"1");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_2()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"2");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_3()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"3");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_4()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"4");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_5()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"5");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_6()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"6");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_7()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"7");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_8()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"8");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_9()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"9");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_0()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"0");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_dian()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L".");
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_qingkong()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = L"0";
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
+}
+
+void CShoukuanPageUI::Click_del()
+{
+	CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring wsReason = pContent->GetText();
+
+	wsReason = wsReason.substr(0, wsReason.size() - 1);
+
+	if (wsReason == L"")
+	{
+		wsReason = L"0";
+	}
+	else
+	{
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"");
+	}
+
+	pContent->SetText(wsReason.c_str());
+	pContent->SetFocus();
+
+	UpdateJiesuanInfo();
 }

+ 27 - 4
zhipuzi_pos_windows/page/CShoukuanPageUI.h

@@ -33,10 +33,7 @@ public:
 	void HandleTextCapture(std::string content);
 
 	//处理自定义消息,各个页面处理各个页面自己的(是自己处理的消息返回true,不是自己处理的消息返回false)
-	bool HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
-	{
-		return false;
-	}
+	bool HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
 
 	void SetPos(RECT rc, bool bNeedInvalidate = true);
 
@@ -46,6 +43,32 @@ public:
 	//处理会员退出登陆
 	void ClickMemberLogout();
 
+	void Click_1();
+
+	void Click_2();
+
+	void Click_3();
+
+	void Click_4();
+
+	void Click_5();
+
+	void Click_6();
+
+	void Click_7();
+
+	void Click_8();
+
+	void Click_9();
+
+	void Click_0();
+
+	void Click_dian();
+
+	void Click_qingkong();
+
+	void Click_del();
+
 private:
 	void ShowError(std::wstring err);
 

+ 12 - 0
zhipuzi_pos_windows/page/CZhengcanPageUI.cpp

@@ -108,6 +108,18 @@ void CZhengcanPageUI::HandleTextCapture(std::string content)
 
 }
 
+bool CZhengcanPageUI::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+	if (uMsg == WM_ZHENGCAN_SAOMADIANCAI_XIADAN)
+	{
+		this->RefreshTableShow();
+
+		return true;
+	}
+
+	return false;
+}
+
 void CZhengcanPageUI::SetPos(RECT rc, bool bNeedInvalidate)
 {
 	m_nPageWidth = rc.right - rc.left;

+ 1 - 4
zhipuzi_pos_windows/page/CZhengcanPageUI.h

@@ -36,10 +36,7 @@ public:
 	void HandleTextCapture(std::string content);
 
 	//处理自定义消息,各个页面处理各个页面自己的(是自己处理的消息返回true,不是自己处理的消息返回false)
-	bool HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
-	{
-		return false;
-	}
+	bool HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
 
 	void SetPos(RECT rc, bool bNeedInvalidate = true);
 

+ 0 - 11
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -400,17 +400,6 @@ bool CMainWnd::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 
 		return true;
 	}
-	else if (uMsg == WM_ZHENGCAN_SAOMADIANCAI_XIADAN)
-	{
-		//正餐扫码下单加菜
-		if (m_curPageName == ZHENGCAN)
-		{
-			CZhengcanPageUI* zhengcanPage = static_cast<CZhengcanPageUI*>(this->GetPage(ZHENGCAN));
-			zhengcanPage->RefreshTableShow();
-		}
-
-		return true;
-	}
 	else
 	{
 		//走到这里,说明消息还没有被处理,那就不是MainWnd自己要处理的消息,应该是自定义的消息,交给各个子页面自己处理去

+ 3 - 0
zhipuzi_pos_windows/wnd/CZhengcanSaomadiancanWnd.cpp

@@ -423,6 +423,9 @@ void CZhengcanSaomadiancanWnd::DoQuerenOrder()
 	CPosPrinter printer;
 	printer.PrintZhengcanOrderXiadan(m_order_id, m_jiacai_no);
 
+	//Ë¢ÐÂ×Àλ
+	m_pageUI->RefreshTableShow();
+
 	DoRefreshOrder();
 }