Prechádzať zdrojové kódy

点单和正餐的会员支付修改完了

张洋 3 rokov pred
rodič
commit
c1c7423336

+ 9 - 71
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_shoukuan_wnd.xml

@@ -16,81 +16,19 @@
 				<Label name="shoukuan_money_show_money" font="1" textcolor="0xFF3CB371" float="true" pos="345,12,620,48"/>
 			</HorizontalLayout>
 			
-			<HorizontalLayout height="40" padding="0,0,0,0">
-				<VerticalLayout>
-					<Button name="shoukuan_btn_saomazhifu" text="扫码支付" textcolor="#FF43A947" font="2" heiht="38" width="200" padding="50,0,10,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
-					<Control name="shoukuan_btn_saomazhifu_line" width="180" height="3" bkcolor="#FF43A947" padding="60,0,10,0"></Control>
-				</VerticalLayout>
-				
-				<VerticalLayout>
-					<Button name="shoukuan_btn_shoujihao" text="手机号+密码支付" font="2" heiht="38" width="200" padding="50,0,10,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
-					<Control name="shoukuan_btn_shoujihao_line" visible="false" width="180" height="3" bkcolor="#FF43A947" padding="60,0,10,0"></Control>
-				</VerticalLayout>
-				
-				<VerticalLayout>
-					<Button name="shoukuan_btn_shitika" text="实体卡支付" font="2" heiht="38" width="200" padding="50,0,10,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
-					<Control name="shoukuan_btn_shitika_line" visible="false" width="180" height="3" bkcolor="#FF43A947" padding="60,0,10,0"></Control>
-				</VerticalLayout>
-			</HorizontalLayout>
+			<Label name="huiyuan_num" text="会员卡号:" heiht="30" padding="250,50,10,10"></Label>
+			<Label name="huiyuan_yue" text="当前余额:" heiht="30" padding="250,10,10,10"></Label>
+			<Label name="huiyuan_name" text="会员姓名:" heiht="30" padding="250,10,10,10"></Label>
+			<Label name="huiyuan_levelname" text="会员级别:" heiht="30" padding="250,10,10,10"></Label>
 			
-			<VerticalLayout name="fukuan_input_fukuanma_layout" height="220" padding="0,80,0,100">
-				<HorizontalLayout padding="0,20,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>
+			<Label height="60" padding="20,50,20,0" name="shouyin_paying_attention" text="确认使用当前登录会员进行支付吗?" font="2" textcolor="0xFF808080" multiline="true" align="center" />
 			
-			<HorizontalLayout visible="false" name="fukuan_input_shoujihao_layout" padding="0,20,0,0">
-				<VerticalLayout height="230" padding="0,30,0,0">
-					<HorizontalLayout height="60">
-						<Label text="手机号:" font="2" float="true" pos="50,15,200,40"/>
-						<Edit name="shoujihao_edit" float="true" pos="153,12,370,48" normalimage="file='Chat_InputBox_BG.png' corner='4,4,4,4'" hotimage="file='Chat_InputBox_BG_Hover.png' corner='4,4,4,4'" />
-					</HorizontalLayout>
-				
-					<HorizontalLayout height="60">
-						<Label text="密码:" font="2" float="true" pos="50,15,200,40"/>
-						<Edit name="password_edit" password="true" float="true" pos="153,12,370,48" normalimage="file='Chat_InputBox_BG.png' corner='4,4,4,4'" hotimage="file='Chat_InputBox_BG_Hover.png' corner='4,4,4,4'" />
-					</HorizontalLayout>
-					
-					<HorizontalLayout height="80" padding="0,30,0,0">
-						<Control></Control>
-						<Button name="shoukuanBtn" text="确认" font="2" textcolor="#FFFFFFFF" height="50" width="350" padding="0,0,0,0" tooltip="点击这里确认收款" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
-						<Control></Control>
-					</HorizontalLayout>	
-				</VerticalLayout>
-			
-				<HorizontalLayout width="340" height="416" bkcolor="#FFF3F3F3" padding="0,0,20,0">
-					<Button name="jianpan_1" text="1" font="0" heiht="60" width="60" float="true" pos="10,10,110,100" 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,10,220,100" 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,10,330,100" 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,110,110,200" 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,110,220,200" 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,110,330,200" 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,210,110,300" 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,210,220,300" 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,210,330,300" 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_qingkong" text="清空" font="0" heiht="60" width="60" float="true" pos="10,310,110,400" 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,310,220,400" 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,310,330,400" 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 height="80" padding="0,30,0,0">
+				<Control></Control>
+				<Button name="shoukuanBtn" text="确认" font="2" textcolor="#FFFFFFFF" height="50" width="350" padding="0,0,0,0" tooltip="点击这里确认收款" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
+				<Control></Control>
 			</HorizontalLayout>	
 
-			<VerticalLayout visible="false" name="fukuan_input_shitika_layout" height="220" padding="0,80,0,100">
-				<HorizontalLayout padding="0,20,0,0" height="129">
-					<Control></Control>
-					<Control bkimage="huiyuan_no.png" width="206" height="141"></Control>
-					<Control></Control>
-				</HorizontalLayout>
-				
-				<Label text="请刷会员实体卡进行付款" align="center" padding="0,30,0,0" height="40" font="0"></Label>
-			</VerticalLayout>			
-
 			<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" />

+ 13 - 3
bin/Win32/Debug/zhipuzi_pos_windows/skin/zhengcan_diandan_page.xml

@@ -17,10 +17,20 @@
 						<VerticalLayout width="380" padding="0,0,0,0">					
 							<HorizontalLayout height="60">
 								<Control bkimage="member_login.png" width="32" height="32" padding="10,14,0,0"></Control>
-								<Button name="btn_diandan_member_login" align="left" text="会员登录" height="38" width="100" padding="10,10,10,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
-								<Label name="diandan_page_member_info" text="" width="130" height="30" padding="10,10,10,10" visible="false"></Label>
+								
+								<Button name="btn_diandan_member_login" align="left" text="会员登录" height="38" width="135" padding="10,12,10,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
+							
+								<VerticalLayout name="diandan_page_member_info" width="135" padding="10,5,10,5" visible="false">
+									<Label name="diandan_page_member_name" height="20" padding="0,0,0,0"></Label>
+									<HorizontalLayout padding="0,5,0,0">
+										<Button name="diandan_page_member_info_btn" text="信息" font="14" height="20" width="40" padding="0,0,10,0" textcolor="#FF41A846" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FF41A846" bkcolor="#FFFFFFFF"></Button>
+										
+										<Button name="diandan_page_member_out_btn" text="退出" textcolor="#FFFF4500" font="14" height="20" width="40" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFFF4500" bkcolor="#FFFFFFFF"></Button>
+									</HorizontalLayout>
+								</VerticalLayout>
+								
 								<Control></Control>
-								<Button name="btn_diandan_canpaihao" text="输入餐牌号" height="38" width="100" padding="0,10,0,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
+								<Button name="btn_diandan_canpaihao" text="人数" height="38" width="100" padding="0,10,0,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
 								<Control width="1" bkcolor="#FFEBE8E8" padding="5,15,15,15"></Control>
 								<Control bkimage="order_delete.png" width="20" height="20" padding="0,20,0,0"></Control>
 								<Button name="btn_diandan_qingkong" text="清空" height="38" width="40" padding="0,10,10,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>

+ 4 - 7
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -338,13 +338,7 @@ void CDiandanPageUI::InitFoodShow()
 void CDiandanPageUI::InitJiesuanShow()
 {
 	//先清空会员登录状态
-	m_is_member = false;
-
-	CButtonUI* pMemberLoginBtn = static_cast<CButtonUI*>(this->FindSubControl(_T("btn_diandan_member_login")));
-	pMemberLoginBtn->SetVisible(true);
-
-	CLabelUI* pMemberInfo = static_cast<CLabelUI*>(this->FindSubControl(_T("diandan_page_member_info")));
-	pMemberInfo->SetVisible(false);
+	this->ClickMemberLogout();
 
 	m_is_member_zhekou = false;
 	m_member_zhekou_value = 10;
@@ -3041,6 +3035,9 @@ void CDiandanPageUI::StartHuiyuanShoukuan()
 		std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
 		pShoukuanWnd->InitMoney(watchValue);
 
+		//把会员登录的信息传递进去
+		pShoukuanWnd->SetMemberInfo(m_member_id, m_card_no, m_balance, m_member_name, m_member_level_name);
+
 		//这里要对提交订单的参数进行组装,然后方便请求
 		pShoukuanWnd->SetCommonParams(GetSendorderParams());
 

+ 93 - 9
zhipuzi_pos_windows/page/CZhengcanDiandanPageUI.cpp

@@ -23,6 +23,7 @@
 #include "../wnd/CGuadanWnd.h"
 #include "../wnd/CZhengcanRenshuWnd.h"
 #include "../wnd/CNumInputWnd.h"
+#include "../wnd/CHuiyuanInfoShowWnd.h"
 
 #include "../print/CPosPrinter.h"
 
@@ -1058,6 +1059,14 @@ void CZhengcanDiandanPageUI::HandleClickMsg(TNotifyUI& msg)
 	{
 		this->XianshiYouhui();
 	}
+	else if (name == L"diandan_page_member_out_btn")
+	{
+		this->ClickMemberLogout();
+	}
+	else if (name == L"diandan_page_member_info_btn")
+	{
+		this->ClickMemberInfoShow();
+	}
 }
 
 //处理option切换事件
@@ -2852,25 +2861,39 @@ void CZhengcanDiandanPageUI::ClickMemberLogin()
 		pMemberLoginDlg->SetIcon(IDI_ICON_DUILIB);
 		pMemberLoginDlg->CenterWindow();
 
-		//pMemberLoginDlg->SetTitle(L"会员登录");
-
 		UINT ret = pMemberLoginDlg->ShowModal();
 
 		if (ret == IDOK)
 		{
 			//这说明会员登录成功了
 			m_is_member = true;
-			//m_member_name = pMemberLoginDlg->m_member_name;
-			//m_member_level = pMemberLoginDlg->m_member_level;
-			//m_member_level_name = pMemberLoginDlg->m_member_level_name;
+
+			m_member_name = pMemberLoginDlg->m_name;
+			m_member_level = pMemberLoginDlg->m_member_level;
+			m_member_level_name = pMemberLoginDlg->m_member_level_name;
+
+			m_member_id = pMemberLoginDlg->m_member_id;
+			m_card_no = pMemberLoginDlg->m_card_no;
+			m_balance = pMemberLoginDlg->m_balance;
+			m_phone = pMemberLoginDlg->m_phone;
+			m_birthday = pMemberLoginDlg->m_birthday;
+			m_sex = pMemberLoginDlg->m_sex;
+			m_address = pMemberLoginDlg->m_address;
+			m_is_card = pMemberLoginDlg->m_is_card;
+			m_point = pMemberLoginDlg->m_point;
+			m_open_no_card_payment = pMemberLoginDlg->m_open_no_card_payment;
+			m_pay_password = pMemberLoginDlg->m_pay_password;
+			m_freeze = pMemberLoginDlg->m_freeze;
+			m_card_identify = pMemberLoginDlg->m_card_identify;
+
+			CLabelUI* pMemberInfo = static_cast<CLabelUI*>(this->FindSubControl(_T("diandan_page_member_name")));
+			std::wstring memberInfo = L"会员:" + CLewaimaiString::UTF8ToUnicode(m_member_name);
+			pMemberInfo->SetText(memberInfo.c_str());
 
 			CButtonUI* pMemberLoginBtn = static_cast<CButtonUI*>(this->FindSubControl(_T("btn_diandan_member_login")));
 			pMemberLoginBtn->SetVisible(false);
 
-			//CLabelUI* pMemberInfo = static_cast<CLabelUI*>(this->FindSubControl(_T("diandan_page_member_info")));
-			//std::wstring memberInfo = CLewaimaiString::UTF8ToUnicode(m_member_name) + L"【" + CLewaimaiString::UTF8ToUnicode(m_member_level_name) + L"】";
-			//pMemberInfo->SetText(memberInfo.c_str());
-			//pMemberInfo->SetVisible(true);
+			this->FindSubControl(_T("diandan_page_member_info"))->SetVisible(true);
 
 			this->UpdateJiesuanInfo();
 
@@ -2887,6 +2910,57 @@ void CZhengcanDiandanPageUI::ClickMemberLogin()
 	}
 }
 
+//处理会员退出登陆
+void CZhengcanDiandanPageUI::ClickMemberLogout()
+{
+	m_is_member = false;
+
+	CButtonUI* pMemberLoginBtn = static_cast<CButtonUI*>(this->FindSubControl(_T("btn_diandan_member_login")));
+	pMemberLoginBtn->SetVisible(true);
+
+	this->FindSubControl(_T("diandan_page_member_info"))->SetVisible(false);
+
+	this->UpdateJiesuanInfo();
+}
+
+void CZhengcanDiandanPageUI::ClickMemberInfoShow()
+{
+	if (m_is_show_modal_wnd == true)
+	{
+		return;
+	}
+
+	CHuiyuanInfoShowWnd* pMemberLoginDlg = new CHuiyuanInfoShowWnd();
+
+	if (pMemberLoginDlg != NULL)
+	{
+		m_is_show_modal_wnd = true;
+		m_curModalWnd = pMemberLoginDlg;
+
+		pMemberLoginDlg->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE);
+		pMemberLoginDlg->SetIcon(IDI_ICON_DUILIB);
+		pMemberLoginDlg->CenterWindow();
+
+		pMemberLoginDlg->SetHuiyuanInfo(m_member_name, m_member_level, m_member_level_name, m_card_no, m_balance, m_phone, \
+			m_birthday, m_sex, m_address, m_is_card, m_point, m_open_no_card_payment, m_pay_password, m_freeze, m_card_identify);
+
+		UINT ret = pMemberLoginDlg->ShowModal();
+
+		if (ret == IDOK)
+		{
+			m_is_show_modal_wnd = false;
+			delete pMemberLoginDlg;
+		}
+		else
+		{
+			m_is_show_modal_wnd = false;
+			delete pMemberLoginDlg;
+
+			return;
+		}
+	}
+}
+
 void CZhengcanDiandanPageUI::ClickZhekou()
 {
 	if (m_is_show_modal_wnd == true)
@@ -3578,6 +3652,13 @@ void CZhengcanDiandanPageUI::StartHuiyuanShoukuan()
 		return;
 	}
 
+	if (m_is_member == false)
+	{
+		m_pMainWnd->ShowToast(L"请先登录会员再使用会员支付");
+
+		return;
+	}
+
 	CHuiyuanShoukuanWnd* pShoukuanWnd = new CHuiyuanShoukuanWnd();
 	if (pShoukuanWnd != NULL)
 	{
@@ -3592,6 +3673,9 @@ void CZhengcanDiandanPageUI::StartHuiyuanShoukuan()
 		std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
 		pShoukuanWnd->InitMoney(watchValue);
 
+		//把会员登录的信息传递进去
+		pShoukuanWnd->SetMemberInfo(m_member_id, m_card_no, m_balance, m_member_name, m_member_level_name);
+
 		//这里要对提交订单的参数进行组装,然后方便请求
 		pShoukuanWnd->SetCommonParams(GetSendorderParams());
 

+ 22 - 0
zhipuzi_pos_windows/page/CZhengcanDiandanPageUI.h

@@ -125,6 +125,12 @@ public:
 	//处理会员登录
 	void ClickMemberLogin();
 
+	//处理会员退出登陆
+	void ClickMemberLogout();
+
+	//展示会员详情
+	void ClickMemberInfoShow();
+
 	//点击整单折扣
 	void ClickZhekou();
 
@@ -328,6 +334,22 @@ private:
 
 	double m_total_member_youhui; //会员商品优惠
 
+	//会员登录成功后返回的会员信息
+	std::string m_card_no;
+	std::string m_balance;
+	std::string m_phone;
+	std::string m_birthday;
+	std::string m_sex;
+	std::string m_address;
+	std::string m_is_card;
+	std::string m_point;
+	std::string m_open_no_card_payment;
+	std::string m_pay_password;
+	std::string m_freeze;
+	std::string m_card_identify;
+
+	std::string m_member_id;
+
 	bool m_is_member_zhekou = false;
 	std::string m_member_zhekou_value; //具体会员打几折
 	double m_member_zhekou_youhui; //会员店铺折扣优惠

+ 20 - 583
zhipuzi_pos_windows/wnd/CHuiyuanShoukuanWnd.cpp

@@ -28,421 +28,14 @@ void CHuiyuanShoukuanWnd::Notify(TNotifyUI& msg)
 		{
 			StartShoukuan();
 		}
-		else if (msg.pSender->GetName() == L"shoukuan_btn_saomazhifu")
-		{
-			CHorizontalLayoutUI* pFukuanmaLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("fukuan_input_fukuanma_layout")));			
-			pFukuanmaLayout->SetVisible(true);
-
-			CHorizontalLayoutUI* pShoujihaoLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("fukuan_input_shoujihao_layout")));
-			pShoujihaoLayout->SetVisible(false);
-
-			CHorizontalLayoutUI* pShitikaLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("fukuan_input_shitika_layout")));
-			pShitikaLayout->SetVisible(false);
-
-			CButtonUI* pFukuanmaBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("shoukuan_btn_saomazhifu")));
-			pFukuanmaBtn->SetTextColor(0xFF43A947);
-
-			CButtonUI* pShoujihaoBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("shoukuan_btn_shoujihao")));
-			pShoujihaoBtn->SetTextColor(0xFF555555);
-
-			CButtonUI* pShitikaBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("shoukuan_btn_shitika")));
-			pShitikaBtn->SetTextColor(0xFF555555);
-
-			CControlUI* pFukuanmaLine = static_cast<CControlUI*>(m_pm.FindControl(_T("shoukuan_btn_saomazhifu_line")));
-			pFukuanmaLine->SetVisible(true);
-
-			CControlUI* pShoujihaoLine = static_cast<CControlUI*>(m_pm.FindControl(_T("shoukuan_btn_shoujihao_line")));
-			pShoujihaoLine->SetVisible(false);
-
-			CControlUI* pShitikaLine = static_cast<CControlUI*>(m_pm.FindControl(_T("shoukuan_btn_shitika_line")));
-			pShitikaLine->SetVisible(false);
-
-			m_shoukuanModel = 1;
-		}
-		else if (msg.pSender->GetName() == L"shoukuan_btn_shoujihao")
-		{
-			CHorizontalLayoutUI* pFukuanmaLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("fukuan_input_fukuanma_layout")));
-			pFukuanmaLayout->SetVisible(false);
-
-			CHorizontalLayoutUI* pShoujihaoLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("fukuan_input_shoujihao_layout")));
-			pShoujihaoLayout->SetVisible(true);
-
-			CHorizontalLayoutUI* pShitikaLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("fukuan_input_shitika_layout")));
-			pShitikaLayout->SetVisible(false);
-
-			CButtonUI* pFukuanmaBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("shoukuan_btn_saomazhifu")));
-			pFukuanmaBtn->SetTextColor(0xFF555555);
-
-			CButtonUI* pShoujihaoBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("shoukuan_btn_shoujihao")));
-			pShoujihaoBtn->SetTextColor(0xFF43A947);
-
-			CButtonUI* pShitikaBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("shoukuan_btn_shitika")));
-			pShitikaBtn->SetTextColor(0xFF555555);
-
-			CControlUI* pFukuanmaLine = static_cast<CControlUI*>(m_pm.FindControl(_T("shoukuan_btn_saomazhifu_line")));
-			pFukuanmaLine->SetVisible(false);
-
-			CControlUI* pShoujihaoLine = static_cast<CControlUI*>(m_pm.FindControl(_T("shoukuan_btn_shoujihao_line")));
-			pShoujihaoLine->SetVisible(true);
-
-			CControlUI* pShitikaLine = static_cast<CControlUI*>(m_pm.FindControl(_T("shoukuan_btn_shitika_line")));
-			pShitikaLine->SetVisible(false);
-
-			m_shoukuanModel = 2;
-
-			m_pm.SetNextTabControl(false);
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			pShoujihao->SetFocus();
-		}
-		else if (msg.pSender->GetName() == L"shoukuan_btn_shitika")
-		{
-			CHorizontalLayoutUI* pFukuanmaLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("fukuan_input_fukuanma_layout")));
-			pFukuanmaLayout->SetVisible(false);
-
-			CHorizontalLayoutUI* pShoujihaoLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("fukuan_input_shoujihao_layout")));
-			pShoujihaoLayout->SetVisible(false);
-
-			CHorizontalLayoutUI* pShitikaLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("fukuan_input_shitika_layout")));
-			pShitikaLayout->SetVisible(true);
-
-			CButtonUI* pFukuanmaBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("shoukuan_btn_saomazhifu")));
-			pFukuanmaBtn->SetTextColor(0xFF555555);
-
-			CButtonUI* pShoujihaoBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("shoukuan_btn_shoujihao")));
-			pShoujihaoBtn->SetTextColor(0xFF555555);
-
-			CButtonUI* pShitikaBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("shoukuan_btn_shitika")));
-			pShitikaBtn->SetTextColor(0xFF43A947);
-
-			CControlUI* pFukuanmaLine = static_cast<CControlUI*>(m_pm.FindControl(_T("shoukuan_btn_saomazhifu_line")));
-			pFukuanmaLine->SetVisible(false);
-
-			CControlUI* pShoujihaoLine = static_cast<CControlUI*>(m_pm.FindControl(_T("shoukuan_btn_shoujihao_line")));
-			pShoujihaoLine->SetVisible(false);
-
-			CControlUI* pShitikaLine = static_cast<CControlUI*>(m_pm.FindControl(_T("shoukuan_btn_shitika_line")));
-			pShitikaLine->SetVisible(true);
-
-			m_shoukuanModel = 3;
-		}
-		else if (senderName == L"jianpan_1")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason += L"1";
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_2")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason += L"2";
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_3")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason += L"3";
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_4")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason += L"4";
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_5")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason += L"5";
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_6")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason += L"6";
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_7")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason += L"7";
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_8")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason += L"8";
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_9")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason += L"9";
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_0")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason += L"0";
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_x")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason = wsReason.substr(0, wsReason.length() - 1);
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
-		else if (senderName == L"jianpan_qingkong")
-		{
-			CEditUI* curEdit;
-
-			CEditUI* pShoujihao = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			if (m_inputType == 1)
-			{
-				curEdit = pShoujihao;
-			}
-			else
-			{
-				curEdit = pPassword;
-			}
-			wstring wsReason = curEdit->GetText();
-
-			wsReason.clear();
-
-			curEdit->SetText(wsReason.c_str());
-			curEdit->SetFocus();
-		}
 	}
 	else if (msg.sType == _T("textchanged"))
 	{
-		if (senderName == L"shoujihao_edit")
-		{
-			//只能输入数字,其他的全部删除
-			CEditUI* m_pEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("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;
-					}
-				}
-			}
-		}
 
-		if (senderName == L"password_edit")
-		{
-			//只能输入数字,其他的全部删除
-			CEditUI* m_pEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("password_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;
-					}
-				}
-			}
-		}
 	}
 	else if (msg.sType == _T("setfocus"))
 	{
-		if (senderName == L"shoujihao_edit")
-		{
-			m_inputType = 1;
-		}
-		else if (senderName == L"password_edit")
-		{
-			m_inputType = 2;
-		}
+
 	}
 }
 
@@ -679,10 +272,7 @@ LRESULT CHuiyuanShoukuanWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lPa
 		{
 			if (m_shoukuan_status == 0)
 			{
-				if (m_shoukuanModel == 2)
-				{
-					StartShoukuan();
-				}
+				StartShoukuan();
 			}
 			else if (m_shoukuan_status == 1 || m_shoukuan_status == 2 || m_shoukuan_status == 5)
 			{
@@ -695,10 +285,7 @@ LRESULT CHuiyuanShoukuanWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lPa
 			else if (m_shoukuan_status == 4)
 			{
 				//Close(IDCANCEL);
-				if (m_shoukuanModel == 2)
-				{
-					StartShoukuan();
-				}
+				StartShoukuan();
 			}
 
 			return true;
@@ -738,13 +325,6 @@ void CHuiyuanShoukuanWnd::InitMoney(std::wstring value)
 	m_money = value;
 }
 
-void CHuiyuanShoukuanWnd::InitFukuanma(std::string fukuanma)
-{
-	m_fukuanma = fukuanma;
-
-	this->StartShoukuan();
-}
-
 void CHuiyuanShoukuanWnd::SetCommonParams(std::map<string, string> params)
 {
 	m_commonParams = params;
@@ -762,30 +342,6 @@ LRESULT CHuiyuanShoukuanWnd::OnShoukuanSuccess(UINT uMsg, WPARAM wParam, LPARAM
 
 	bHandled = TRUE;
 	return 0;
-
-	/*
-	CVerticalLayoutUI* paying_layout = static_cast<CVerticalLayoutUI*>(m_pm.FindControl(_T("shoukuan_paying_layout")));
-	paying_layout->SetVisible(false);
-
-	CVerticalLayoutUI* pay_success_layout = static_cast<CVerticalLayoutUI*>(m_pm.FindControl(_T("shoukuan_pay_success_layout")));
-	pay_success_layout->SetVisible(true);
-
-	CLabelUI* pMoneyPaySuccess = static_cast<CLabelUI*>(m_pm.FindControl(_T("shoukuan_pay_success_money")));
-
-	std::wstring valueInfo = L"成功收款:¥" + m_money;
-	pMoneyPaySuccess->SetText(valueInfo.c_str());
-
-	CLabelUI* attention = static_cast<CLabelUI*>(m_pm.FindControl(_T("shouyin_pay_success_attention")));
-	std::wstring ws_attention = L"按任意键关闭窗口," + to_wstring(m_timer_now) + L" 秒后自动关闭";
-	attention->SetText(ws_attention.c_str());
-
-	SetTimer(m_hWnd, WM_TIMER_WND_CLOSE, 1000, NULL);
-
-	SetFocus(m_hWnd);
-
-	bHandled = TRUE;
-	return 0;
-	*/
 }
 
 LRESULT CHuiyuanShoukuanWnd::OnShoukuanFail(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
@@ -851,34 +407,6 @@ void CHuiyuanShoukuanWnd::StartShoukuan()
 		return;
 	}
 
-	//先判断收款码的格式是否正确
-	CEditUI* pShoujihaoEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
-	std::wstring ws_Shoujihao = pShoujihaoEdit->GetText();
-	m_shoujihao = CLewaimaiString::UnicodeToUTF8(ws_Shoujihao);
-
-	CEditUI* pPasswordEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-	std::wstring ws_Password = pPasswordEdit->GetText();
-	m_password = CLewaimaiString::UnicodeToUTF8(ws_Password);
-
-	if (m_shoukuanModel == 2)
-	{
-		if (ws_Shoujihao.length() == 0)
-		{
-			pLabel->SetText(L"手机号不能为空");
-			pLabel->SetVisible(true);
-
-			return;
-		}
-
-		if (ws_Password.length() == 0)
-		{
-			pLabel->SetText(L"密码不能为空");
-			pLabel->SetVisible(true);
-
-			return;
-		}
-	}
-
 	//全部验证通过,就可以开始修改状态了
 	m_shoukuan_status = 1;
 
@@ -930,105 +458,10 @@ void CHuiyuanShoukuanWnd::StartClose()
 void CHuiyuanShoukuanWnd::HandleShoukuan()
 {
 	//生成随机的order_no
-
 	m_commonParams["zhifu_type"] = to_string(4);
 	m_commonParams["zhifu_code"] = "";
 
-	if (m_shoukuanModel == 1)
-	{
-		std::map<string, string> param;
-		param["weixin_password"] = m_fukuanma;
-
-		//先查询会员信息
-		std::string response;
-
-		std::string url = "/member/membercheckbyqrcode";
-		bool ret = CZhipuziHttpClient::GetInstance()->Request(url.c_str(), param, response);
-		if (ret == false)
-		{
-			m_shoukuan_status = 4;
-
-			m_fail_message = L"请求服务器失败,请检查网络设置!";
-
-			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
-			return;
-		}
-
-		rapidjson::Document document;
-		document.Parse(response.c_str());
-
-		if (document.HasParseError())
-		{
-			LOG_INFO("parse response error!");
-			m_shoukuan_status = 4;
-
-			m_fail_message = L"服务器错误";
-
-			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
-			return;
-		}
-
-		if (!document.HasMember("errcode") || !document.HasMember("errmsg"))
-		{
-			LOG_INFO("json error!");
-			m_shoukuan_status = 4;
-
-			m_fail_message = L"服务器错误";
-
-			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
-			return;
-		}
-
-		rapidjson::Value& v_errcode = document["errcode"];
-		int errcode = v_errcode.GetInt();
-		if (errcode != 0)
-		{
-			LOG_INFO("response failed! message:" << document["errmsg"].GetString());
-			m_shoukuan_status = 4;
-
-			std::string errmsg = document["errmsg"].GetString();
-			m_fail_message = CLewaimaiString::UTF8ToUnicode(errmsg);
-
-			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
-			return;
-		}
-
-		if (!document.HasMember("data"))
-		{
-			LOG_INFO("json error!");
-			m_shoukuan_status = 4;
-
-			m_fail_message = L"服务器错误";
-
-			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
-			return;
-		}
-
-		rapidjson::Value& rows = document["data"]["rows"];
-		if (rows.Size() == 0)
-		{
-			//没找到会员
-			m_shoukuan_status = 4;
-
-			m_fail_message = L"未找到对应会员信息";
-
-			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
-			return;
-		}
-		
-		std::string member_id = rows[0]["id"].GetString();
-
-		m_commonParams["member_id"] = member_id;
-	}
-	else if (m_shoukuanModel == 2)
-	{
-		m_commonParams["phone"] = m_shoujihao;
-		m_commonParams["pay_password"] = md5(m_password);
-	}
-	else if (m_shoukuanModel == 3)
-	{
-		m_commonParams["card_identify"] = m_card_identify;
-	}
+	m_commonParams["member_id"] = m_member_id;
 
 	std::string response;
 
@@ -1261,16 +694,20 @@ void CHuiyuanShoukuanWnd::ReadShoukuanValue()
 //处理键盘捕捉结果
 void CHuiyuanShoukuanWnd::HandleTextCapture(std::string content)
 {
-	if (m_shoukuanModel == 1)
-	{
-		m_fukuanma = content;
-
-		StartShoukuan();
-	}
-	else if (m_shoukuanModel == 3)
-	{
-		m_card_identify = content;
-		
-		StartShoukuan();
-	}
+	
 }
+
+void CHuiyuanShoukuanWnd::SetMemberInfo(std::string member_id, std::string card_no, std::string balance, std::string name, std::string member_level_name)
+{
+	m_member_id = member_id;
+
+	m_card_no = card_no;
+	m_member_balance = balance;
+	m_name = name;
+	m_member_level_name = member_level_name;
+
+	m_pm.FindControl(L"huiyuan_num")->SetText((L"会员卡号:" + CLewaimaiString::UTF8ToUnicode(m_card_no)).c_str());
+	m_pm.FindControl(L"huiyuan_name")->SetText((L"会员姓名:" + CLewaimaiString::UTF8ToUnicode(m_name)).c_str());
+	m_pm.FindControl(L"huiyuan_levelname")->SetText((L"会员级别:" + CLewaimaiString::UTF8ToUnicode(m_member_level_name)).c_str());
+	m_pm.FindControl(L"huiyuan_yue")->SetText((L"当前余额:" + CLewaimaiString::UTF8ToUnicode(m_member_balance)).c_str());
+}

+ 6 - 10
zhipuzi_pos_windows/wnd/CHuiyuanShoukuanWnd.h

@@ -60,7 +60,7 @@ public:
 
 	void InitMoney(std::wstring value);
 
-	void InitFukuanma(std::string fukuanma);
+	void SetMemberInfo(std::string member_id, std::string card_no, std::string balance, std::string name, std::string member_level_name);
 
 	void SetCommonParams(std::map<string, string> params);
 
@@ -91,11 +91,11 @@ public:
 
 	std::wstring m_money;
 
-	std::string m_fukuanma;
-	std::string m_shoujihao;
-	std::string m_password;
-
-	std::string m_card_identify;
+	std::string m_member_id;
+	std::string m_card_no;
+	std::string m_member_balance; //支付之前的会员余额
+	std::string m_name;
+	std::string m_member_level_name;
 
 	//收款状态 0:未开始 1:请求发给服务器了,但是暂时还没得到反馈 2:查询密码中 3:成功 4:失败 5:正在取消支付
 	int m_shoukuan_status = 0;
@@ -107,10 +107,6 @@ public:
 
 	std::map<string, string> m_commonParams;
 
-	int m_shoukuanModel = 1; //收款模式 1:会员扫码 2:手机号+密码 3 实体卡
-
-	int m_inputType = 1; //当前输入框 1:输入手机号 2:输入密码
-
 	//支付成功返回的字段
 	std::string m_kucun_string;
 	std::string m_out_trade_no;

+ 24 - 0
zhipuzi_pos_windows/wnd/CMemberLoginWnd.cpp

@@ -944,6 +944,30 @@ void CMemberLoginWnd::HandleLogin()
 	m_member_level = info["member_level"].GetString();
 	m_member_level_name = info["member_level_name"].GetString();
 
+	if (m_shoukuanModel == 2)
+	{
+		if (m_open_no_card_payment == "0")
+		{
+			m_shoukuan_status = 4;
+
+			m_fail_message = L"该会员未开启手机号密码登录";
+
+			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+			return;
+		}
+
+		//进行支付密码比对
+		if (m_pay_password != md5(m_password))
+		{
+			m_shoukuan_status = 4;
+
+			m_fail_message = L"登录密码错误";
+
+			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+			return;
+		}
+	}
+
 	SendMessage(WM_SHOUKUAN_STATUS_SUCCESS, 0, 0);
 }