Преглед изворни кода

调试会员充值,目前问题付款码不正确

张洋 пре 4 година
родитељ
комит
d912f3ade6

+ 123 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_chongzhi_wnd.xml

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window size="800,634" caption="0,0,0,44" roundcorner="4,4" >
+	<Font id="0" name="微软雅黑" size="24" />
+	<Font id="1" name="微软雅黑" size="40" />
+	<Font id="2" name="微软雅黑" size="18" />
+	<Font id="3" name="微软雅黑" size="32" />
+	<Font id="4" name="微软雅黑" size="14" />
+	<VerticalLayout bkimage="shoukuan_bkg.png" >
+		<HorizontalLayout name="shoukuan_title_bkg" height="44" bkcolor="0xFF3CB371">
+			<Label name="shoukuan_version" text="会员充值" height="44" align="center" valign="center" padding="0,0,0,0" textcolor="#FFFFFFFF" font="2"/>
+			<Button name="closebtn" keyboard="false" padding="0,13,15,0" width="16" height="16" tooltip="关闭" normalimage="file='close_normal.png'" hotimage="file='close_hover.png'" pushedimage="file='close_normal.png'"/>
+		</HorizontalLayout>
+		
+		<HorizontalLayout visible="true" name="shoukuan_before_pay_layout">
+			<VerticalLayout height="520" padding="0,20,0,0">			
+				<HorizontalLayout height="50" padding="0,0,0,0">
+					<Label name="huiyuan_chongzhi_curbalance" text="当前余额:" font="2" float="true" pos="30,12,250,40"/>
+				</HorizontalLayout>
+				
+				<HorizontalLayout height="50" padding="0,20,0,0">
+					<Label text="充值:" font="2" float="true" pos="30,12,180,40"/>
+					<Edit name="chongzhi_edit" float="true" pos="98,12,355,48" normalimage="file='Chat_InputBox_BG.png' corner='4,4,4,4'" hotimage="file='Chat_InputBox_BG_Hover.png' corner='4,4,4,4'" />
+					<Label text="元" font="2" float="true" pos="362,15,470,40"/>
+				</HorizontalLayout>
+				
+				<HorizontalLayout height="50" padding="0,35,0,0">
+					<Label text="快选:" font="2" float="true" pos="30,12,180,40"/>
+					<Button name="xianjin_kuaijie_50" font="4" text="50元" heiht="36" width="55" padding="100,10,0,0" textcolor="#FFFFFFFF" normalimage="" hotimage="" pushedimage="" bordersize="0" bordercolor="#FFC1C1C1" bkcolor="#FF3CB371"></Button>
+					<Button name="xianjin_kuaijie_100" font="4" text="100元" heiht="36" width="55" padding="14,10,0,0" textcolor="#FFFFFFFF" normalimage="" hotimage="" pushedimage="" bordersize="0" bordercolor="#FFC1C1C1" bkcolor="#FF3CB371"></Button>
+					<Button name="xianjin_kuaijie_200" font="4" text="200元" heiht="36" width="55" padding="14,10,0,0" textcolor="#FFFFFFFF" normalimage="" hotimage="" pushedimage="" bordersize="0" bordercolor="#FFC1C1C1" bkcolor="#FF3CB371"></Button>
+					<Button name="xianjin_kuaijie_500" font="4" text="500元" heiht="36" width="55" padding="14,10,0,0" textcolor="#FFFFFFFF" normalimage="" hotimage="" pushedimage="" bordersize="0" bordercolor="#FFC1C1C1" bkcolor="#FF3CB371"></Button>
+					<Button name="xianjin_kuaijie_1000" font="4" text="1000元" heiht="36" width="55" padding="14,10,0,0" textcolor="#FFFFFFFF" normalimage="" hotimage="" pushedimage="" bordersize="0" bordercolor="#FFC1C1C1" bkcolor="#FF3CB371"></Button>
+				</HorizontalLayout>
+				
+				<HorizontalLayout height="50" padding="0,35,0,0">
+					<Label text="赠送:" font="2" float="true" pos="30,12,180,40"/>
+					<Edit name="zengsong_edit" float="true" pos="98,12,355,48" normalimage="file='Chat_InputBox_BG.png' corner='4,4,4,4'" hotimage="file='Chat_InputBox_BG_Hover.png' corner='4,4,4,4'" />
+					<Label text="元" font="2" float="true" pos="362,15,470,40"/>
+				</HorizontalLayout>
+
+				<HorizontalLayout height="50" padding="0,20,0,0">
+					<Control></Control>
+					<Label name="shoukuanresult" font="2" width="400" height="50" multiline="true" text="" visible="false" textcolor="#FF0000" align="center" />
+					<Control></Control>
+				</HorizontalLayout>
+				
+				<Label text="支付方式" font="2" padding="30,40,0,15"/>
+
+				<HorizontalLayout height="90" padding="15,0,0,0">
+					<Button name="shoukuanBtn" text="" heiht="75" width="110" padding="15,0,0,15" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#FFFF4242"></Button>
+					<Control bkimage="weixinzhifu_icon.png" width="24" height="22" float="true" pos="60,10,84,32" mouse="false"></Control>
+					<Label text="微信支付/支付宝" width="110" height="35" font="4" float="true" pos="16,35,126,70" textcolor="#FFFFFFFF" mouse="false"></Label>
+				</HorizontalLayout>
+			</VerticalLayout>
+			
+			<HorizontalLayout width="340" height="406" bkcolor="#FFF3F3F3">
+				<Button name="jianpan_1" text="1" font="0" heiht="60" width="60" float="true" pos="10,0,110,90" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				<Button name="jianpan_2" text="2" font="0" heiht="60" width="60" float="true" pos="120,0,220,90" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				<Button name="jianpan_3" text="3" font="0" heiht="60" width="60" float="true" pos="230,0,330,90" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				
+				<Button name="jianpan_4" text="4" font="0" heiht="60" width="60" float="true" pos="10,100,110,190" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				<Button name="jianpan_5" text="5" font="0" heiht="60" width="60" float="true" pos="120,100,220,190" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				<Button name="jianpan_6" text="6" font="0" heiht="60" width="60" float="true" pos="230,100,330,190" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				
+				<Button name="jianpan_7" text="7" font="0" heiht="60" width="60" float="true" pos="10,200,110,290" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				<Button name="jianpan_8" text="8" font="0" heiht="60" width="60" float="true" pos="120,200,220,290" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				<Button name="jianpan_9" text="9" font="0" heiht="60" width="60" float="true" pos="230,200,330,290" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				
+				<Button name="jianpan_dian" text="." font="0" heiht="60" width="60" float="true" pos="10,300,110,390" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				<Button name="jianpan_0" text="0" font="0" heiht="60" width="60" float="true" pos="120,300,220,390" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				<Button name="jianpan_x" text="X" font="0" heiht="60" width="60" float="true" pos="230,300,330,390" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+			</HorizontalLayout>
+		</HorizontalLayout>
+		
+		<VerticalLayout name="shoukuan_tishi_layout" visible="false">
+			<HorizontalLayout padding="0,100,0,0" height="129">
+				<Control></Control>
+				<Control bkimage="qrcode_attention.png" width="129" height="127"></Control>
+				<Control></Control>
+			</HorizontalLayout>
+			
+			<Label text="请扫描顾客付款二维码" align="center" padding="0,30,0,0" height="40" font="0"></Label>
+		</VerticalLayout>
+		
+		<VerticalLayout name="shoukuan_paying_layout" visible="false">
+			<HorizontalLayout name="shoukuan_paying_loading" height="24" padding="0, 20, 0, 20">
+				<Control></Control>
+				<VerticalLayout width="24">
+					<Control></Control>
+					<HorizontalLayout height="24">
+						<GifAnim bkimage="loading.gif" autosize="true"></GifAnim>
+					</HorizontalLayout>
+					<Control></Control>
+				</VerticalLayout>
+				<Control></Control>
+			</HorizontalLayout>
+			
+			<Label height="40" padding="0,10,0,10" name="shoukuan_paying_money" text="收款金额:" font="3" textcolor="0xFF3CB371" align="center"></Label>
+			
+			<Label height="32" padding="0,10,0,10" name="shoukuan_paying_status" text="请求支付中..." font="2" textcolor="0xFF3CB371" align="center"></Label>
+			
+			<Label height="60" padding="20,30,20,0" name="shouyin_paying_attention" text="如果用户没有支付成功,则请确认客户不再进行支付时再关闭此窗口,按【Esc】取消本次支付" font="2" textcolor="0xFF808080" multiline="true" align="center" />
+		</VerticalLayout>
+		
+		<VerticalLayout name="shoukuan_pay_success_layout" visible="false">			
+			<Label height="40" padding="0,100,0,20" name="shoukuan_pay_success_money" text="成功收款:" font="3" textcolor="0xFF3CB371" align="center"></Label>
+			
+			<Label height="60" padding="20,30,20,0" name="shouyin_pay_success_attention" text="按任意键关闭窗口" font="2" textcolor="0xFF808080" multiline="true" align="center" />
+		</VerticalLayout>
+		
+		<VerticalLayout name="shoukuan_pay_fail_layout" visible="false">
+			<HorizontalLayout height="100" padding="0,20,0,0">
+				<Control></Control>
+				<Control bkimage="pay_fail.png" width="100" height="100" align="center"></Control>
+				<Control></Control>
+			</HorizontalLayout>
+			
+			<Label height="40" padding="0,20,0,20" name="shoukuan_pay_fail_money" text="订单支付失败" font="3" textcolor="0xFFD33E3A" align="center"></Label>
+			
+			<Label height="60" padding="20,30,20,0" name="shouyin_pay_fail_attention" text="" font="2" textcolor="0xFF808080" multiline="true" align="center" />
+		</VerticalLayout>
+    </VerticalLayout>
+</Window>

BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_no.png


Разлика између датотеке није приказан због своје велике величине
+ 61 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_page.xml


+ 5 - 0
zhipuzi_pos_windows/control/ControlEx.h

@@ -8,6 +8,7 @@
 #include "../page/CDianneiOrderListPageUI.h"
 #include "../page/CDianneiOrderInfoPageUI.h"
 #include "../page/CSettingPageUI.h"
+#include "../page/CHuiyuanPageUI.h"
 
 #include "CWaimaiOrderItemUI.h"
 #include "CDianneiOrderItemUI.h"
@@ -45,6 +46,10 @@ public:
 		{
 			return new CSettingPageUI;
 		}
+		else if (_tcscmp(pstrClass, _T("HuiyuanPage")) == 0)
+		{
+			return new CHuiyuanPageUI;
+		}
 
 		//控件相关的
 		else if (_tcscmp(pstrClass, _T("WaimaiOrderItem")) == 0)

+ 0 - 53
zhipuzi_pos_windows/page/CHuiyuanPage.cpp

@@ -1,53 +0,0 @@
-#include "../pch/pch.h"
-#include "CHuiyuanPageUI.h"
-
-CHuiyuanPageUI::CHuiyuanPageUI()
-{
-
-}
-
-CHuiyuanPageUI::~CHuiyuanPageUI()
-{
-
-}
-
-//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
-void CHuiyuanPageUI::InitShow()
-{
-	
-}
-
-//处理按钮点击类事件
-void CHuiyuanPageUI::HandleClickMsg(TNotifyUI& msg)
-{
-	CDuiString name = msg.pSender->GetName();
-
-	if (name == _T(""))
-	{
-		
-	}
-}
-
-//处理option切换事件
-void CHuiyuanPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
-{
-
-}
-
-//处理下拉框、radio的切换事件
-void CHuiyuanPageUI::HandleItemSelectMsg(TNotifyUI& msg)
-{
-
-}
-
-//处理编辑框输入内容改变事件
-void CHuiyuanPageUI::HandleTextChangedMsg(TNotifyUI& msg)
-{
-
-}
-
-//处理扫码枪捕捉到的扫码信息
-void CHuiyuanPageUI::HandleTextCapture(std::string content)
-{
-
-}

+ 236 - 0
zhipuzi_pos_windows/page/CHuiyuanPageUI.cpp

@@ -0,0 +1,236 @@
+#include "../pch/pch.h"
+#include "CHuiyuanPageUI.h"
+
+#include "../wnd/CHuiyuanChongzhiWnd.h"
+
+CHuiyuanPageUI::CHuiyuanPageUI()
+{
+
+}
+
+CHuiyuanPageUI::~CHuiyuanPageUI()
+{
+
+}
+
+//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
+void CHuiyuanPageUI::InitShow()
+{
+	CEditUI* pFukuanEdit = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+	pFukuanEdit->SetFocus();
+}
+
+//处理按钮点击类事件
+void CHuiyuanPageUI::HandleClickMsg(TNotifyUI& msg)
+{
+	CDuiString name = msg.pSender->GetName();
+
+	if (name == _T("huiiyuan_page_sousuo_btn"))
+	{
+		StartHuiyuanSousuo();
+	}
+	else if (name == L"huiiyuan_page_chongzhi_btn")
+	{
+		StartHuiyuanChongzhi();
+	}
+}
+
+//处理option切换事件
+void CHuiyuanPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
+{
+
+}
+
+//处理下拉框、radio的切换事件
+void CHuiyuanPageUI::HandleItemSelectMsg(TNotifyUI& msg)
+{
+
+}
+
+//处理编辑框输入内容改变事件
+void CHuiyuanPageUI::HandleTextChangedMsg(TNotifyUI& msg)
+{
+	DuiLib::CDuiString senderName = msg.pSender->GetName();
+
+	if (senderName == L"huiyuan_page_shoujihao_edit")
+	{
+		//只能输入数字,其他的全部删除
+		CEditUI* m_pEdit = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+		if (!m_pEdit->GetText().IsEmpty())
+		{
+			wstring ws_Value = m_pEdit->GetText();
+			string strValue = CLewaimaiString::UnicodeToUTF8(ws_Value);
+
+			for (size_t nIndex = 0; nIndex < strValue.length(); nIndex++)
+			{
+				unsigned char tmp = strValue.at(nIndex);
+				if (tmp > 57 || tmp < 48)
+				{
+					//ASCII码不是数字的都过滤掉
+					strValue = strValue.substr(0, nIndex);
+
+					m_pEdit->SetText(CLewaimaiString::UTF8ToUnicode(strValue).c_str());
+					m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
+
+					break;
+				}
+			}
+		}
+	}
+}
+
+//处理扫码枪捕捉到的扫码信息
+void CHuiyuanPageUI::HandleTextCapture(std::string content)
+{
+	if (m_is_show_modal_wnd == true)
+	{
+		m_curModalWnd->HandleTextCapture(content);
+	}
+}
+
+void CHuiyuanPageUI::StartHuiyuanSousuo()
+{
+	if (m_is_handle == true)
+	{
+		return;
+	}
+
+	CEditUI* m_pEdit = static_cast<CEditUI*>(this->FindSubControl(_T("huiyuan_page_shoujihao_edit")));
+	std::wstring ws_phone = m_pEdit->GetText();
+
+	if (ws_phone.length() != 11)
+	{
+		//手机号格式错误
+		ShowError(L"手机号格式不对!");
+	}
+
+	//手机号格式正确,开始处理
+	m_is_handle = true;
+
+	m_phone = CLewaimaiString::UnicodeToUTF8(ws_phone);
+
+	std::map<string, string> params;
+	params["phone"] = m_phone;
+
+	std::string response;
+	bool ret = CZhipuziHttpClient::Request("/member/membercheckbyphone", params, response);
+	if (!ret)
+	{
+		ShowError(L"网络请求出错");
+		m_is_handle = false;
+
+		return;
+	}
+
+	rapidjson::Document document;
+	document.Parse(response.c_str());
+
+	if (document.HasParseError())
+	{
+		ShowError(L"服务器返回数据格式错误");
+		m_is_handle = false;
+
+		return;
+	}
+	else
+	{
+		if (!document.HasMember("errcode") || !document.HasMember("errmsg"))
+		{
+			ShowError(L"服务器返回数据格式错误");
+			m_is_handle = false;
+
+			return;
+		}
+
+		rapidjson::Value& v_errcode = document["errcode"];
+		int errcode = v_errcode.GetInt();
+		if (errcode != 0)
+		{
+			std::string errmsg = CLewaimaiString::UnicodeToUTF8(L"搜索结果:") + string(document["errmsg"].GetString());
+			std::wstring m_errorInfo = CLewaimaiString::UTF8ToUnicode(errmsg);
+			ShowError(m_errorInfo);
+			m_is_handle = false;
+
+			return;
+		}
+
+		rapidjson::Value& data = document["data"];
+		rapidjson::Value& rows = data["rows"];
+
+		if (rows.Size() < 1)
+		{
+			ShowError(L"会员信息为空");
+			m_is_handle = false;
+
+			return;
+		}
+
+		rapidjson::Value& rowinfo = rows[0];
+
+		std::string member_name = rowinfo["name"].GetString();
+		std::string phone = rowinfo["phone"].GetString();
+		std::string sex = rowinfo["sex"].GetString();
+		std::string birthday = rowinfo["birthday"].GetString();
+		std::string balance = rowinfo["balance"].GetString();
+		std::string member_level_name = rowinfo["member_level_name"].GetString();
+
+		m_member_id = rowinfo["id"].GetString();
+		m_balance = balance;
+		m_member_card_no = rowinfo["card_no"].GetString();
+
+		this->FindSubControl(L"huiyuan_name")->SetText((L"会员姓名:" + CLewaimaiString::UTF8ToUnicode(member_name)).c_str());
+		this->FindSubControl(L"huiyuan_phone")->SetText((L"电话:" + CLewaimaiString::UTF8ToUnicode(phone)).c_str());
+		this->FindSubControl(L"huiyuan_sex")->SetText((L"性别:" + CLewaimaiString::UTF8ToUnicode(sex)).c_str());
+		this->FindSubControl(L"huiyuan_birthday")->SetText((L"生日:" + CLewaimaiString::UTF8ToUnicode(birthday)).c_str());
+		this->FindSubControl(L"huiyuan_levelname")->SetText((L"会员级别:" + CLewaimaiString::UTF8ToUnicode(member_level_name)).c_str());
+		this->FindSubControl(L"huiyuan_yue")->SetText((L"当前余额:" + CLewaimaiString::UTF8ToUnicode(balance)).c_str());
+
+		this->FindSubControl(L"huiyuan_info_layout")->SetVisible(true);
+		this->FindSubControl(L"huiyuan_page_no_layout")->SetVisible(false);
+
+		m_is_handle = false;
+	}
+}
+
+void CHuiyuanPageUI::ShowError(std::wstring err)
+{
+	CLabelUI* m_pLabel= static_cast<CLabelUI*>(this->FindSubControl(_T("errorinfo")));
+	m_pLabel->SetText(err.c_str());
+
+	m_pLabel->SetVisible(true);
+
+	this->FindSubControl(L"huiyuan_info_layout")->SetVisible(false);
+	this->FindSubControl(L"huiyuan_page_no_layout")->SetVisible(true);
+}
+
+void CHuiyuanPageUI::StartHuiyuanChongzhi()
+{
+	if (m_is_show_modal_wnd == true)
+	{
+		return;
+	}
+
+	CHuiyuanChongzhiWnd* pShoukuanWnd = new CHuiyuanChongzhiWnd();
+	if (pShoukuanWnd != NULL)
+	{
+		m_is_show_modal_wnd = true;
+		m_curModalWnd = pShoukuanWnd;
+
+		pShoukuanWnd->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
+		pShoukuanWnd->SetIcon(IDI_ICON_DUILIB);
+		pShoukuanWnd->CenterWindow();
+
+		pShoukuanWnd->SetCurBalance(m_balance);
+		pShoukuanWnd->m_member_id = m_member_id;
+		pShoukuanWnd->m_member_card_no = m_member_card_no;
+
+		UINT ret = pShoukuanWnd->ShowModal();
+		if (ret == IDOK)
+		{
+			
+		}
+
+		m_is_show_modal_wnd = false;
+		delete pShoukuanWnd;
+	}
+}

+ 20 - 1
zhipuzi_pos_windows/page/CHuiyuanPage.h

@@ -3,6 +3,8 @@
 #include "../pch/pch.h"
 #include "CBasePageUI.h"
 
+#include "../wnd/CModalWnd.h"
+
 class CHuiyuanPageUI : public CBasePageUI
 {
 public:
@@ -34,6 +36,23 @@ public:
 		return false;
 	}
 
-public:
+private:	
+	void StartHuiyuanSousuo();
+
+	void StartHuiyuanChongzhi();
+
+	void ShowError(std::wstring err);
+
+private:
+	bool m_is_handle = false;
+
+	//当前搜索出来的会员信息
+	std::string m_phone;
+	std::string m_member_id;
+	std::string m_balance;
+	std::string m_member_card_no;
 
+	//模态对话框有关的
+	bool m_is_show_modal_wnd = false;
+	CModalWnd* m_curModalWnd;
 };

Разлика између датотеке није приказан због своје велике величине
+ 1270 - 0
zhipuzi_pos_windows/wnd/CHuiyuanChongzhiWnd.cpp


+ 119 - 0
zhipuzi_pos_windows/wnd/CHuiyuanChongzhiWnd.h

@@ -0,0 +1,119 @@
+#pragma once
+
+#include "../pch/pch.h"
+#include "CModalWnd.h"
+
+class CHuiyuanChongzhiWnd : public CModalWnd
+{
+public:
+	CHuiyuanChongzhiWnd()
+	{
+
+	}
+
+	LPCTSTR GetWindowClassName() const
+	{
+		return _T("UIShoukuanFrame");
+	};
+
+	UINT GetClassStyle() const
+	{
+		return UI_CLASSSTYLE_DIALOG;
+	};
+
+	void OnFinalMessage(HWND /*hWnd*/)
+	{
+		m_pm.RemovePreMessageFilter(this);
+	};
+
+	void Init();
+
+	void Notify(TNotifyUI& msg);
+
+	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnShoukuanNeedPassword(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnShoukuanSuccess(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnShoukuanFail(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+	LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
+
+	//点击确认,开始执行收款
+	void StartShoukuan();
+
+	//处理收款
+	void HandleShoukuan();
+
+	//处理收款的密码查询
+	void HandleShoukuanPassword();
+
+	//取消查询密码
+	void CancelShoukuanPassword();
+
+	//处理取消收款
+	void HandleCancelShoukuan();
+
+	void StartClose();
+
+	void ReadShoukuanValue();
+
+	//处理键盘捕捉结果
+	void HandleTextCapture(std::string content);
+
+	void SetCurBalance(std::string balance);
+
+public:
+	CPaintManagerUI m_pm;
+
+	//当前充值会员的余额
+	std::string m_cur_balance;
+
+	//当前充值会员的id
+	std::string m_member_id;
+
+	//当前会员的会员卡号
+	std::string m_member_card_no;
+
+	std::string m_chongzhi;
+	std::string m_zengsong;
+
+	//收款状态 0:未开始 1:请求发给服务器了,但是暂时还没得到反馈 2:查询密码中 3:成功 4:失败 5:正在取消支付
+	int m_shoukuan_status = 0;
+
+	std::wstring m_fail_message;
+
+	//窗口关闭的定时器时间
+	int m_timer_now = 2;
+	
+	int m_inputType = 1; //当前输入框 1:输入充值金额 2:输入赠送金额
+
+	int m_shoukuan_type = 1; //1 微信支付
+
+	//微信支付时候的付款码
+	std::string m_fukuanma;
+
+	//支付成功返回的字段
+	std::string m_trade_no;
+};

+ 5 - 1
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -156,6 +156,10 @@ void CMainWnd::SwitchPage(MainPageName name)
 	{
 		pChildContainer = static_cast<CBasePageUI*>(builder.Create(_T("setting_page.xml"), (UINT)0, &cb, &m_pm));
 	}
+	else if (name == HUIYUAN)
+	{
+		pChildContainer = static_cast<CBasePageUI*>(builder.Create(_T("huiyuan_page.xml"), (UINT)0, &cb, &m_pm));
+	}
 	else if (name == WAIMAIINFO)
 	{
 		pChildContainer = static_cast<CBasePageUI*>(builder.Create(_T("waimaiorder_info_page.xml"), (UINT)0, &cb, &m_pm));
@@ -309,7 +313,7 @@ void CMainWnd::HandleSelectChangeMsg(TNotifyUI& msg)
     }
 	else if (name == L"main_huiyuan")
 	{
-
+		this->SwitchPage(HUIYUAN);
 	}
 	else if (name == L"main_baobiao")
 	{

+ 4 - 2
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -227,7 +227,8 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClInclude Include="page\CHuiyuanPage.h" />
+    <ClInclude Include="wnd\CHuiyuanChongzhiWnd.h" />
+    <ClInclude Include="page\CHuiyuanPageUI.h" />
     <ClInclude Include="control\CDianneiOrderItemUI.h" />
     <ClInclude Include="page\CDianneiOrderInfoPageUI.h" />
     <ClInclude Include="page\CDianneiOrderListPageUI.h" />
@@ -303,7 +304,8 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="helper\CSystem.h" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="page\CHuiyuanPage.cpp" />
+    <ClCompile Include="wnd\CHuiyuanChongzhiWnd.cpp" />
+    <ClCompile Include="page\CHuiyuanPageUI.cpp" />
     <ClCompile Include="control\CDianneiOrderItemUI.cpp" />
     <ClCompile Include="page\CDianneiOrderInfoPageUI.cpp" />
     <ClCompile Include="page\CDianneiOrderListPageUI.cpp" />

+ 8 - 2
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -234,7 +234,10 @@
     <ClInclude Include="control\CDianneiOrderItemUI.h">
       <Filter>头文件</Filter>
     </ClInclude>
-    <ClInclude Include="page\CHuiyuanPage.h">
+    <ClInclude Include="page\CHuiyuanPageUI.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="wnd\CHuiyuanChongzhiWnd.h">
       <Filter>头文件</Filter>
     </ClInclude>
   </ItemGroup>
@@ -434,7 +437,10 @@
     <ClCompile Include="control\CDianneiOrderItemUI.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
-    <ClCompile Include="page\CHuiyuanPage.cpp">
+    <ClCompile Include="page\CHuiyuanPageUI.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="wnd\CHuiyuanChongzhiWnd.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
   </ItemGroup>