Parcourir la source

开始做挂失功能

张洋 il y a 3 ans
Parent
commit
fcd09c0cf5

+ 4 - 4
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_add_wnd.xml

@@ -19,13 +19,13 @@
 				</HorizontalLayout>
 				
 				<HorizontalLayout height="50" padding="0,35,0,0">
-					<Label text="支付密码:" font="2" float="true" pos="30,12,180,40"/>
-					<Edit name="password_edit" password="true" float="true" pos="128,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="30,12,180,40" />
+					<CheckBox name="password_pay_open" selected="true" float="true" pos="128,12,200,57" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
 				</HorizontalLayout>
 				
 				<HorizontalLayout height="50" padding="0,35,0,0">
-					<Label text="会员名称:" font="2" float="true" pos="30,12,180,40"/>
-					<Edit name="name_edit" float="true" pos="128,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="30,12,180,40"/>
+					<Edit name="password_edit" password="true" float="true" pos="128,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'" />
 				</HorizontalLayout>
 				
 				<HorizontalLayout height="56" valign="center" padding="30,100,0,20">

+ 32 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_bangka_wnd.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window size="800,534" 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>		
+
+		<VerticalLayout padding="0,0,0,0">
+			<VerticalLayout height="300">				
+				<HorizontalLayout height="141" padding="0,100,0,0">
+					<Control></Control>
+					<Control bkimage="huiyuan_no.png" width="206" height="141"></Control>
+					<Control></Control>
+				</HorizontalLayout>
+				
+				<Label text="请刷会员卡,刷卡成功将自动绑定" align="center" padding="0,30,0,0"></Label>
+			</VerticalLayout>
+			
+			<HorizontalLayout height="50" padding="0,20,0,0">
+				<Control></Control>
+				<Label name="shoukuanresult" font="2" width="380" height="50" multiline="true" text="" visible="false" textcolor="#FF0000" align="center" />
+				<Control></Control>
+			</HorizontalLayout>
+		</VerticalLayout>
+    </VerticalLayout>
+</Window>

+ 17 - 2
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_page.xml

@@ -66,17 +66,32 @@
 
 			<VerticalLayout name="huiyuan_info_layout" padding="15,0,0,0" bordercorner="10,10" bkcolor="#FFFFFFFF" visible="false">
 				<Label name="huiyuan_num" text="会员卡号:" heiht="30" padding="30,10,10,10"></Label>
+				
+				<HorizontalLayout height="30" padding="30,10,10,10">
+					<Label name="huiyuan_phone" text="手机号:" width="200" heiht="30" padding="0,0,0,0"></Label>
+					<Label name="huiyuan_mimazhifu" text="密码支付:" width="200" heiht="30" padding="30,0,0,0"></Label>
+				</HorizontalLayout>
+				
 				<Label name="huiyuan_yue" text="当前余额:" heiht="30" padding="30,10,10,10"></Label>
 				<Label name="huiyuan_name" text="会员姓名:" heiht="30" padding="30,10,10,10"></Label>
-				<Label name="huiyuan_phone" text="电话:" heiht="30" padding="30,10,10,10"></Label>
 				<Label name="huiyuan_sex" text="性别:" heiht="30" padding="30,10,10,10"></Label>
 				<Label name="huiyuan_address" text="地址:" heiht="30" padding="30,10,10,10"></Label>
 				<Label name="huiyuan_birthday" text="生日:" heiht="30" padding="30,10,10,10"></Label>
 				<Label name="huiyuan_levelname" text="会员级别:" heiht="30" padding="30,10,10,10"></Label>
 				<Label name="huiyuan_shitika" text="实体卡:" heiht="30" padding="30,10,10,10"></Label>
+				<Label name="huiyuan_status" text="会员状态:" heiht="30" padding="30,10,10,10"></Label>
 				
-				<HorizontalLayout>
+				<HorizontalLayout height="75">
 					<Button name="huiiyuan_page_chongzhi_btn" width="130" height="45" padding="30,30,0,0" text="会员充值" textcolor="#FFFFFFFF" 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'" />
+					<Button name="huiiyuan_page_xiugaiziliao_btn" width="130" height="45" padding="30,30,0,0" text="修改资料" textcolor="#FFFFFFFF" 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'" />
+					<Button name="huiiyuan_page_xiugaipassword_btn" width="130" height="45" padding="30,30,0,0" text="修改支付密码" textcolor="#FFFFFFFF" 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'" />
+				</HorizontalLayout>
+				
+				<HorizontalLayout height="75">
+					<Button name="huiiyuan_page_bangka_btn" width="130" height="45" padding="30,30,0,0" text="绑定实体卡" textcolor="#FFFFFFFF" 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'" />
+					<Button name="huiiyuan_page_guashi_btn" width="130" height="45" padding="30,30,0,0" text="挂失实体卡" textcolor="#FFFFFFFF" 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'" />
+					<Button name="huiiyuan_page_dongjie_btn" width="130" height="45" padding="30,30,0,0" text="会员冻结" textcolor="#FFFFFFFF" 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'" />
+					<Button name="huiiyuan_page_jiedong_btn" width="130" height="45" padding="30,30,0,0" text="会员解结" textcolor="#FFFFFFFF" 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'" />
 				</HorizontalLayout>
 			</VerticalLayout>
 		</HorizontalLayout>

+ 49 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_xiugaimima_wnd.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window size="800,534" 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>		
+
+		<VerticalLayout padding="0,0,0,0">
+			<VerticalLayout height="300">
+				<HorizontalLayout height="34" padding="0,15,0,0">
+					<Label name="member_phone" text="手机号:" font="2" float="true" pos="30,0,280,34"/>
+				</HorizontalLayout>
+				
+				<HorizontalLayout height="45" padding="0,15,0,0">
+					<Label text="密码支付" font="2" float="true" pos="30,0,180,45" />
+					<CheckBox name="password_pay_open" selected="true" float="true" pos="128,0,200,45" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
+				</HorizontalLayout>
+				
+				<HorizontalLayout height="34" padding="0,15,0,0">
+					<Label text="支付密码:" font="2" float="true" pos="30,0,180,34"/>
+					<Edit name="password_edit" password="true" float="true" pos="128,0,355,34" 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="34" padding="0,15,0,0">
+					<Label text="确认密码:" font="2" float="true" pos="30,0,180,34"/>
+					<Edit name="password_edit_2" password="true" float="true" pos="128,0,355,34" normalimage="file='Chat_InputBox_BG.png' corner='4,4,4,4'" hotimage="file='Chat_InputBox_BG_Hover.png' corner='4,4,4,4'" />
+				</HorizontalLayout>
+			</VerticalLayout>
+			
+			<HorizontalLayout height="50" padding="0,20,0,0">
+				<Control></Control>
+				<Label name="shoukuanresult" font="2" width="380" height="50" multiline="true" text="" visible="false" textcolor="#FF0000" align="center" />
+				<Control></Control>
+			</HorizontalLayout>
+			
+			<HorizontalLayout height="50" valign="center" padding="235,0,0,0">
+				<Button name="save" align="center" text="确认" textcolor="#FFFFFFFF" height="50" width="330" padding="0,0,0,0" 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'" />
+			</HorizontalLayout>
+			
+			<Control></Control>
+		</VerticalLayout>
+    </VerticalLayout>
+</Window>

+ 69 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_xiugaiziliao_wnd.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window size="800,536" 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>		
+
+		<VerticalLayout padding="0,0,0,0">
+			<HorizontalLayout height="420">
+				<VerticalLayout width="420">
+					<HorizontalLayout height="36" padding="0,15,0,0">
+						<Label name="member_phone" text="手机号:" font="2" float="true" pos="30,0,280,36"/>
+					</HorizontalLayout>
+					
+					<HorizontalLayout height="36" padding="0,15,0,0">
+						<Label text="会员卡号:" font="2" float="true" pos="30,0,180,36"/>
+						<Edit name="kahao_edit" float="true" pos="128,0,355,36" 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="36" padding="0,15,0,0">
+						<Label text="会员姓名:" font="2" float="true" pos="30,0,180,36"/>
+						<Edit name="name_edit" float="true" pos="128,0,355,36" 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="36" padding="0,15,0,0">
+						<Label text="会员性别:" font="2" width="80" height="36" padding="30,0,0,0" />
+						
+						<HorizontalLayout padding="20,0,0,0" width="40" height="30">
+							<CheckBox name="xingbie_setting_nan" group="jinezhuaqu_setting_type" selected="true" padding="0,7,0,7" width="13" height="13" normalimage="file='RadioBtnNon.png'" hotimage="file='RadioBtnNon.png'" selectedimage="file='RadioBtnSel.png'"/>
+							<Label name="xingbie_setting_nan_name" text="男" width="300" padding="10,0,0,0"/>
+						</HorizontalLayout>
+						<HorizontalLayout padding="20,0,0,0" width="40" height="30">
+							<CheckBox name="xingbie_setting_nv" group="jinezhuaqu_setting_type" padding="0,7,0,7" width="13" height="13" normalimage="file='RadioBtnNon.png'" hotimage="file='RadioBtnNon.png'" selectedimage="file='RadioBtnSel.png'"/>
+							<Label name="xingbie_setting_nv_name" text="女" width="300" padding="10,0,0,0"/>
+						</HorizontalLayout>
+					</HorizontalLayout>
+					
+					<HorizontalLayout height="36" padding="0,15,0,0">
+						<Label text="会员地址:" font="2" float="true" pos="30,0,180,36"/>
+						<Edit name="address_edit" float="true" pos="128,0,355,36" 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="36" padding="0,15,0,0">
+						<Label text="会员生日:" font="2" float="true" pos="30,0,180,36"/>
+						<Datetime name="shengri_date" float="true" pos="128,0,308,36" width="180" height="36" bordersize="1" bordercolor="#FF000000"></Datetime>
+					</HorizontalLayout>	
+				</VerticalLayout>
+				
+				<HorizontalLayout height="50" padding="0,200,0,0">
+					<Control></Control>
+					<Label name="shoukuanresult" font="2" width="380" height="50" multiline="true" text="" visible="false" textcolor="#FF0000" align="center" />
+					<Control></Control>
+				</HorizontalLayout>
+			</HorizontalLayout>	
+			
+			<HorizontalLayout height="50" valign="center" padding="235,0,0,0">
+				<Button name="save" align="center" text="确认" textcolor="#FFFFFFFF" height="50" width="330" padding="0,0,0,0" 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'" />
+			</HorizontalLayout>
+			
+			<Control></Control>
+		</VerticalLayout>
+    </VerticalLayout>
+</Window>

+ 171 - 17
zhipuzi_pos_windows/page/CHuiyuanPageUI.cpp

@@ -3,6 +3,9 @@
 
 #include "../wnd/CHuiyuanChongzhiWnd.h"
 #include "../wnd/CHuiyuanAddWnd.h"
+#include "../wnd/CHuiyuanXiugaiziliaoWnd.h"
+#include "../wnd/CHuiyuanXiugaimimaWnd.h"
+#include "../wnd/CHuiyuanBangkaWnd.h"
 
 #include "../zhipuzi/CHuiyuanchognzhiOrder.h"
 #include "../print/CPosPrinter.h"
@@ -166,6 +169,22 @@ void CHuiyuanPageUI::HandleClickMsg(TNotifyUI& msg)
 	{
 		StartAddHuiyuan();
 	}
+	else if (senderName == L"huiiyuan_page_xiugaiziliao_btn")
+	{
+		StartXiugaiziliao();
+	}
+	else if (senderName == L"huiiyuan_page_xiugaipassword_btn")
+	{
+		StartXiugaimima();
+	}
+	else if (senderName == L"huiiyuan_page_bangka_btn")
+	{
+		StartBangka();
+	}
+	else if (senderName == L"huiiyuan_page_guashi_btn")
+	{
+		StartGuashi();
+	}
 }
 
 //处理option切换事件
@@ -303,18 +322,17 @@ void CHuiyuanPageUI::StartHuiyuanSousuo()
 
 		rapidjson::Value& rowinfo = rows[0];
 
-		std::string card_no = rowinfo["card_no"].GetString();
-		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();
+		m_name = rowinfo["name"].GetString();
+		m_phone = rowinfo["phone"].GetString();
+		m_sex = rowinfo["sex"].GetString();
+		m_birthday = rowinfo["birthday"].GetString();
+		m_balance = rowinfo["balance"].GetString();
 		std::string member_level_name = rowinfo["member_level_name"].GetString();
-		std::string address = rowinfo["address"].GetString();
+		m_address = rowinfo["address"].GetString();
 
-		std::string card_identify = rowinfo["card_identify"].GetString();
+		m_card_identify = rowinfo["card_identify"].GetString();
 		bool is_card;
-		if (card_identify == "")
+		if (m_card_identify == "")
 		{
 			is_card = false;
 		}
@@ -323,18 +341,32 @@ void CHuiyuanPageUI::StartHuiyuanSousuo()
 			is_card = true;
 		}
 
+		std::string freeze = rowinfo["freeze"].GetString();
+		m_is_open_pay_password = rowinfo["open_no_card_payment"].GetString();
+
+		m_md5_password = rowinfo["pay_password"].GetString();
+
 		m_member_id = rowinfo["id"].GetString();
-		m_balance = balance;
 		m_member_card_no = rowinfo["card_no"].GetString();
 
-		this->FindSubControl(L"huiyuan_num")->SetText((L"会员卡号:" + CLewaimaiString::UTF8ToUnicode(card_no)).c_str());
-		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_address")->SetText((L"地址:" + CLewaimaiString::UTF8ToUnicode(address)).c_str());
-		this->FindSubControl(L"huiyuan_birthday")->SetText((L"生日:" + CLewaimaiString::UTF8ToUnicode(birthday)).c_str());
+		this->FindSubControl(L"huiyuan_num")->SetText((L"会员卡号:" + CLewaimaiString::UTF8ToUnicode(m_member_card_no)).c_str());
+		this->FindSubControl(L"huiyuan_phone")->SetText((L"手机号:" + CLewaimaiString::UTF8ToUnicode(m_phone)).c_str());
+
+		if (m_is_open_pay_password == "1")
+		{
+			this->FindSubControl(L"huiyuan_mimazhifu")->SetText(L"密码支付:已开启");
+		}
+		else
+		{
+			this->FindSubControl(L"huiyuan_mimazhifu")->SetText(L"密码支付:未开启");
+		}
+
+		this->FindSubControl(L"huiyuan_name")->SetText((L"会员姓名:" + CLewaimaiString::UTF8ToUnicode(m_name)).c_str());
+		this->FindSubControl(L"huiyuan_sex")->SetText((L"性别:" + CLewaimaiString::UTF8ToUnicode(m_sex)).c_str());
+		this->FindSubControl(L"huiyuan_address")->SetText((L"地址:" + CLewaimaiString::UTF8ToUnicode(m_address)).c_str());
+		this->FindSubControl(L"huiyuan_birthday")->SetText((L"生日:" + CLewaimaiString::UTF8ToUnicode(m_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_yue")->SetText((L"当前余额:" + CLewaimaiString::UTF8ToUnicode(m_balance)).c_str());
 
 		if (is_card)
 		{
@@ -345,6 +377,21 @@ void CHuiyuanPageUI::StartHuiyuanSousuo()
 			this->FindSubControl(L"huiyuan_shitika")->SetText(L"实体会员卡:未绑定");
 		}
 
+		if (freeze == "0")
+		{
+			this->FindSubControl(L"huiyuan_status")->SetText(L"会员状态:正常");
+
+			this->FindSubControl(L"huiiyuan_page_dongjie_btn")->SetVisible(true);
+			this->FindSubControl(L"huiiyuan_page_jiedong_btn")->SetVisible(false);
+		}
+		else
+		{
+			this->FindSubControl(L"huiyuan_status")->SetText(L"会员状态:已冻结");
+
+			this->FindSubControl(L"huiiyuan_page_dongjie_btn")->SetVisible(false);
+			this->FindSubControl(L"huiiyuan_page_jiedong_btn")->SetVisible(true);
+		}
+
 		this->FindSubControl(L"huiyuan_info_layout")->SetVisible(true);
 		this->FindSubControl(L"huiyuan_page_no_layout")->SetVisible(false);
 
@@ -464,6 +511,113 @@ void CHuiyuanPageUI::StartHuiyuanChongzhi()
 	}
 }
 
+void CHuiyuanPageUI::StartXiugaiziliao()
+{
+	if (m_is_show_modal_wnd == true)
+	{
+		return;
+	}
+
+	CHuiyuanXiugaiziliaoWnd* pXiugaiziliaoWnd = new CHuiyuanXiugaiziliaoWnd();
+	if (pXiugaiziliaoWnd != NULL)
+	{
+		m_is_show_modal_wnd = true;
+		m_curModalWnd = pXiugaiziliaoWnd;
+
+		pXiugaiziliaoWnd->SetMemberInfo(m_member_id, m_phone, m_is_open_pay_password, m_name, m_member_card_no, m_sex, m_birthday, m_address, m_card_identify, m_md5_password);
+
+		pXiugaiziliaoWnd->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
+		pXiugaiziliaoWnd->SetIcon(IDI_ICON_DUILIB);
+		pXiugaiziliaoWnd->CenterWindow();
+
+		UINT ret = pXiugaiziliaoWnd->ShowModal();
+		if (ret == IDOK)
+		{
+			//重新搜索,更新会员信息
+			StartHuiyuanSousuo();
+		}
+
+		m_is_show_modal_wnd = false;
+		delete pXiugaiziliaoWnd;
+	}
+}
+
+//修改支付密码
+void CHuiyuanPageUI::StartXiugaimima()
+{
+	if (m_is_show_modal_wnd == true)
+	{
+		return;
+	}
+
+	CHuiyuanXiugaimimaWnd* pXiugaiziliaoWnd = new CHuiyuanXiugaimimaWnd();
+	if (pXiugaiziliaoWnd != NULL)
+	{
+		m_is_show_modal_wnd = true;
+		m_curModalWnd = pXiugaiziliaoWnd;
+
+		pXiugaiziliaoWnd->SetMemberInfo(m_member_id, m_phone, m_is_open_pay_password, m_name, m_member_card_no, m_sex, m_birthday, m_address, m_card_identify);
+
+		pXiugaiziliaoWnd->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
+		pXiugaiziliaoWnd->SetIcon(IDI_ICON_DUILIB);
+		pXiugaiziliaoWnd->CenterWindow();
+
+		UINT ret = pXiugaiziliaoWnd->ShowModal();
+		if (ret == IDOK)
+		{
+			//重新搜索,更新会员信息
+			StartHuiyuanSousuo();
+		}
+
+		m_is_show_modal_wnd = false;
+		delete pXiugaiziliaoWnd;
+	}
+}
+
+void CHuiyuanPageUI::StartBangka()
+{
+	if (m_card_identify != "")
+	{
+		m_pMainWnd->ShowToast(L"该会员已绑卡,无需再次绑卡");
+		return;
+	}
+
+	if (m_is_show_modal_wnd == true)
+	{
+		return;
+	}
+
+	CHuiyuanBangkaWnd* pXiugaiziliaoWnd = new CHuiyuanBangkaWnd();
+	if (pXiugaiziliaoWnd != NULL)
+	{
+		m_is_show_modal_wnd = true;
+		m_curModalWnd = pXiugaiziliaoWnd;
+
+		pXiugaiziliaoWnd->SetMemberInfo(m_member_id, m_phone, m_is_open_pay_password, m_name, m_member_card_no, m_sex, m_birthday, m_address, m_card_identify, m_md5_password);
+
+		pXiugaiziliaoWnd->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
+		pXiugaiziliaoWnd->SetIcon(IDI_ICON_DUILIB);
+		pXiugaiziliaoWnd->CenterWindow();
+
+		UINT ret = pXiugaiziliaoWnd->ShowModal();
+		if (ret == IDOK)
+		{
+			m_pMainWnd->ShowToast(L"绑定实体卡成功");
+
+			//重新搜索,更新会员信息
+			StartHuiyuanSousuo();
+		}
+
+		m_is_show_modal_wnd = false;
+		delete pXiugaiziliaoWnd;
+	}
+}
+
+void CHuiyuanPageUI::StartGuashi()
+{
+
+}
+
 void CHuiyuanPageUI::HideError()
 {
 	CLabelUI* m_pLabel = static_cast<CLabelUI*>(this->FindSubControl(_T("errorinfo")));

+ 21 - 1
zhipuzi_pos_windows/page/CHuiyuanPageUI.h

@@ -43,6 +43,18 @@ private:
 
 	void StartHuiyuanChongzhi();
 
+	//修改会员资料
+	void StartXiugaiziliao();
+
+	//修改支付密码
+	void StartXiugaimima();
+
+	//绑定实体卡
+	void StartBangka();
+
+	//挂失实体卡
+	void StartGuashi();
+
 	void ShowError(std::wstring err);
 
 	void HideError();
@@ -59,8 +71,16 @@ private:
 	std::string m_member_id;
 	std::string m_balance;
 	std::string m_member_card_no;
+	std::string m_sex;
+	std::string m_birthday;
+	std::string m_address;
+	std::string m_is_open_pay_password;
+	std::string m_name;
+	std::string m_card_identify;
+
+	std::string m_md5_password;
 
 	//模态对话框有关的
 	bool m_is_show_modal_wnd = false;
 	CModalWnd* m_curModalWnd;
-};
+};

+ 40 - 38
zhipuzi_pos_windows/wnd/CHuiyuanAddWnd.cpp

@@ -123,12 +123,12 @@ LRESULT CHuiyuanAddWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam,
 		CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 		pPhone->SetEnabled(true);
 
+		CCheckBoxUI* pOpen = static_cast<CCheckBoxUI*>(m_pm.FindControl((L"password_pay_open")));
+		pOpen->SetEnabled(true);
+
 		CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
 		pPassword->SetEnabled(true);
 
-		CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
-		pName->SetEnabled(true);
-
 		CButtonUI* pSave = static_cast<CButtonUI*>(m_pm.FindControl(_T("save")));
 		pSave->SetEnabled(true);
 
@@ -203,7 +203,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -214,8 +213,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason += L"1";
@@ -229,7 +229,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -240,8 +239,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason += L"2";
@@ -255,7 +255,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -266,8 +265,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason += L"3";
@@ -281,7 +281,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -292,8 +291,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason += L"4";
@@ -307,7 +307,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -318,8 +317,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason += L"5";
@@ -333,7 +333,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -344,8 +343,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason += L"6";
@@ -359,7 +359,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -370,8 +369,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason += L"7";
@@ -385,7 +385,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -396,8 +395,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason += L"8";
@@ -411,7 +411,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -422,8 +421,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason += L"9";
@@ -437,7 +437,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -448,8 +447,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason += L"0";
@@ -463,7 +463,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -474,8 +473,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason = wsReason.substr(0, wsReason.length() - 1);
@@ -489,7 +489,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 
 			CEditUI* pPhone = static_cast<CEditUI*>(m_pm.FindControl(_T("phone_edit")));
 			CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
-			CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
 			if (m_inputType == 1)
 			{
 				curEdit = pPhone;
@@ -500,8 +499,9 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 			}
 			else
 			{
-				curEdit = pName;
+				return;
 			}
+
 			wstring wsReason = curEdit->GetText();
 
 			wsReason.clear();
@@ -583,10 +583,6 @@ void CHuiyuanAddWnd::Notify(TNotifyUI& msg)
 		{
 			m_inputType = 2;
 		}
-		else if (senderName == L"name_edit")
-		{
-			m_inputType = 3;
-		}
 	}
 }
 
@@ -618,6 +614,17 @@ void CHuiyuanAddWnd::StartYanzheng()
 
 	pPhone->SetEnabled(false);
 
+	CCheckBoxUI* pOpen = static_cast<CCheckBoxUI*>(m_pm.FindControl((L"password_pay_open")));
+	if (pOpen->IsSelected())
+	{
+		m_is_open_pay_password = "1";
+	}
+	else
+	{
+		m_is_open_pay_password = "0";
+	}
+	pOpen->SetEnabled(false);
+
 	CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
 	wstring wsPassword = pPassword->GetText();
 	m_password = CLewaimaiString::UnicodeToUTF8(wsPassword);
@@ -640,11 +647,6 @@ void CHuiyuanAddWnd::StartYanzheng()
 
 	pPassword->SetEnabled(false);
 
-	CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
-	wstring wsName = pName->GetText();
-	m_name = CLewaimaiString::UnicodeToUTF8(wsName);
-	pName->SetEnabled(false);
-
 	CButtonUI* pSave = static_cast<CButtonUI*>(m_pm.FindControl(_T("save")));
 	pSave->SetEnabled(false);
 
@@ -662,9 +664,9 @@ void CHuiyuanAddWnd::ConfirmMember()
 {
 	std::map<string, string> params;
 	params["phone"] = m_phone;
-	params["name"] = m_name;
+	params["name"] = "";
 	params["pay_password"] = md5(m_password);
-	params["open_no_card_payment"] = "1";
+	params["open_no_card_payment"] = m_is_open_pay_password;
 	params["is_no_card"] = "1";
 
 	std::string response;

+ 2 - 1
zhipuzi_pos_windows/wnd/CHuiyuanAddWnd.h

@@ -72,6 +72,7 @@ public:
 	CPaintManagerUI m_pm;
 
 	std::string m_phone;
+	std::string m_is_open_pay_password;
 	std::string m_password;
 	std::string m_name;
 
@@ -80,5 +81,5 @@ public:
 	std::mutex m_qingqiu_mutex;
 	bool m_is_qingqiu = false;
 
-	int m_inputType = 1; //当前输入框 1:手机号 2:密码 3:会员名字
+	int m_inputType = 1; //当前输入框 1:手机号 2:密码
 };

+ 307 - 0
zhipuzi_pos_windows/wnd/CHuiyuanBangkaWnd.cpp

@@ -0,0 +1,307 @@
+#include "../pch/pch.h"
+#include "CHuiyuanBangkaWnd.h"
+
+#include "../helper/MD5.h"
+
+LRESULT CHuiyuanBangkaWnd::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	POINT pt;
+	pt.x = GET_X_LPARAM(lParam);
+	pt.y = GET_Y_LPARAM(lParam);
+	::ScreenToClient(*this, &pt);
+
+	RECT rcClient;
+	::GetClientRect(*this, &rcClient);
+
+	RECT rcCaption = m_pm.GetCaptionRect();
+	if (pt.x >= rcClient.left + rcCaption.left && pt.x < rcClient.right - rcCaption.right \
+		&& pt.y >= rcCaption.top && pt.y < rcCaption.bottom)
+	{
+		CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(pt));
+		if (pControl && _tcscmp(pControl->GetClass(), DUI_CTR_BUTTON) != 0)
+		{
+			return HTCAPTION;
+		}
+	}
+
+	return HTCLIENT;
+}
+
+LRESULT CHuiyuanBangkaWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	SIZE szRoundCorner = m_pm.GetRoundCorner();
+	if (!::IsIconic(*this) && (szRoundCorner.cx != 0 || szRoundCorner.cy != 0))
+	{
+		CDuiRect rcWnd;
+		::GetWindowRect(*this, &rcWnd);
+		rcWnd.Offset(-rcWnd.left, -rcWnd.top);
+		rcWnd.right++;
+		rcWnd.bottom++;
+		HRGN hRgn = ::CreateRoundRectRgn(rcWnd.left, rcWnd.top, rcWnd.right, rcWnd.bottom, szRoundCorner.cx, szRoundCorner.cy);
+		::SetWindowRgn(*this, hRgn, TRUE);
+		::DeleteObject(hRgn);
+	}
+
+	bHandled = FALSE;
+	return 0;
+}
+
+LRESULT CHuiyuanBangkaWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+	LRESULT lRes = 0;
+	BOOL bHandled = TRUE;
+	switch (uMsg)
+	{
+	case WM_CREATE:
+		lRes = OnCreate(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCACTIVATE:
+		lRes = OnNcActivate(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCCALCSIZE:
+		lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCPAINT:
+		lRes = OnNcPaint(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCHITTEST:
+		lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_SIZE:
+		lRes = OnSize(uMsg, wParam, lParam, bHandled);
+		break;
+	default:
+		bHandled = FALSE;
+	}
+	if (bHandled)
+	{
+		return lRes;
+	}
+	if (m_pm.MessageHandler(uMsg, wParam, lParam, lRes))
+	{
+		return lRes;
+	}
+	return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
+}
+
+LRESULT CHuiyuanBangkaWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
+{
+	if (uMsg == WM_KEYDOWN)
+	{
+		if (wParam == VK_RETURN)
+		{
+			StartYanzheng();
+
+			return true;
+		}
+		else if (wParam == VK_ESCAPE)
+		{
+			if (m_is_qingqiu == false)
+			{
+				Close(IDCANCEL);
+			}
+
+			return true;
+		}
+	}
+	else if (uMsg == WM_MEMBER_CHECK_SUCCESS)
+	{
+		m_qingqiu_mutex.lock();
+
+		m_is_qingqiu = false;
+
+		m_qingqiu_mutex.unlock();
+
+		//验证成功了
+		Close(IDOK);
+
+		return true;
+	}
+	else if (uMsg == WM_MEMBER_CHECK_FAIL)
+	{
+		//验证失败了
+		
+		//失败原因
+		CLabelUI* pErrorInfo = static_cast<CLabelUI*>(m_pm.FindControl(_T("shoukuanresult")));
+		pErrorInfo->SetText(m_errorInfo.c_str());
+		pErrorInfo->SetVisible(true);
+
+		m_qingqiu_mutex.lock();
+
+		m_is_qingqiu = false;
+
+		m_qingqiu_mutex.unlock();
+
+		return true;
+	}
+
+	return false;
+}
+
+LRESULT CHuiyuanBangkaWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
+	styleValue &= ~WS_CAPTION;
+	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
+
+	// 把自己的窗口句柄与窗口绘制管理器挂接在一起
+	m_pm.Init(m_hWnd);
+
+	m_pm.AddPreMessageFilter(this);
+
+	CDialogBuilder builder;
+
+	CControlUI* pRoot = builder.Create(_T("huiyuan_bangka_wnd.xml"), (UINT)0, NULL, &m_pm);
+	ASSERT(pRoot && "Failed to parse XML");
+
+	// 把这些控件绘制到本窗口上
+	m_pm.AttachDialog(pRoot);
+
+	// 把自己加入到CPaintManagerUI的m_aNotifiers数组中,用于处理Notify函数
+	m_pm.AddNotifier(this);
+
+	Init();
+
+	return 0;
+}
+
+void CHuiyuanBangkaWnd::Notify(TNotifyUI& msg)
+{
+	DuiLib::CDuiString senderName = msg.pSender->GetName();
+
+	if (msg.sType == _T("click"))
+	{
+		DuiLib::CDuiString senderName = msg.pSender->GetName();
+
+		if (senderName == _T("closebtn"))
+		{
+			if (m_is_qingqiu == false)
+			{
+				Close(IDCANCEL);
+			}
+
+			return;
+		}
+	}
+	else if (msg.sType == _T("textchanged"))
+	{
+
+	}
+	else if (msg.sType == L"windowinit")
+	{
+		m_pm.SetNextTabControl(false);
+	}
+	else if (msg.sType == _T("setfocus"))
+	{
+
+	}
+}
+
+void CHuiyuanBangkaWnd::Init()
+{
+	
+}
+
+void CHuiyuanBangkaWnd::SetMemberInfo(std::string member_id, std::string phone, std::string is_open_pay_password, std::string name, std::string member_card_no, std::string sex, std::string birthday, std::string address, std::string card_identify, std::string md5_password)
+{
+	m_member_id = member_id;
+	m_phone = phone;
+	m_is_open_pay_password = is_open_pay_password;
+	m_name = name;
+	m_member_card_no = member_card_no;
+
+	if (CLewaimaiString::UTF8ToUnicode(sex) == L"男")
+	{
+		m_sex = "0";
+	}
+	else
+	{
+		m_sex = "1";
+	}
+
+	m_birthday = birthday;
+	m_address = address;
+	m_card_identify = card_identify;
+
+	m_md5_password = md5_password;
+}
+
+void CHuiyuanBangkaWnd::StartYanzheng()
+{
+	m_qingqiu_mutex.lock();
+
+	m_is_qingqiu = true;
+
+	m_qingqiu_mutex.unlock();
+
+	//开始处理
+	std::thread(&CHuiyuanBangkaWnd::ConfirmMember, this).detach();
+}
+
+void CHuiyuanBangkaWnd::ConfirmMember()
+{
+	std::map<string, string> params;
+	params["card_no"] = m_member_card_no;
+	params["name"] = m_name;
+	params["birthday"] = m_birthday;
+	params["address"] = m_address;
+	params["sex"] = m_sex;
+	params["captcha"] = "";
+	params["pay_password"] = m_md5_password;
+	params["open_no_card_payment"] = m_is_open_pay_password;
+	params["is_no_card"] = "1";
+	params["member_id"] = m_member_id;
+	params["card_identify"] = m_card_identify;
+
+	std::string response;
+	bool ret = CZhipuziHttpClient::GetInstance()->Request("/member/changeinfo", params, response);
+	if (!ret)
+	{
+		m_errorInfo = _T("网络请求出错");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+
+	rapidjson::Document document;
+	document.Parse(response.c_str());
+
+	if (document.HasParseError())
+	{
+		m_errorInfo = _T("服务器返回数据格式错误");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+	else
+	{
+		if (!document.HasMember("errcode") || !document.HasMember("errmsg"))
+		{
+			m_errorInfo = _T("服务器返回数据格式错误");
+			PostMessage(WM_MEMBER_CHECK_FAIL);
+
+			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());
+			m_errorInfo = CLewaimaiString::UTF8ToUnicode(errmsg);
+			PostMessage(WM_MEMBER_CHECK_FAIL);
+
+			return;
+		}
+
+		PostMessage(WM_MEMBER_CHECK_SUCCESS);
+	}
+}
+
+//处理键盘捕捉结果
+void CHuiyuanBangkaWnd::HandleTextCapture(std::string content)
+{
+	m_card_identify = content;
+
+	StartYanzheng();
+}

+ 92 - 0
zhipuzi_pos_windows/wnd/CHuiyuanBangkaWnd.h

@@ -0,0 +1,92 @@
+#pragma once
+
+#include "../pch/pch.h"
+#include "CMainWnd.h"
+#include "CModalWnd.h"
+
+class CHuiyuanBangkaWnd : public CModalWnd
+{
+public:
+	LPCTSTR GetWindowClassName() const
+	{
+		return _T("UIMemoWndFrame");
+	};
+
+	UINT GetClassStyle() const
+	{
+		return UI_CLASSSTYLE_DIALOG;
+	};
+
+	void OnFinalMessage(HWND /*hWnd*/)
+	{
+		//WindowImplBase::OnFinalMessage(hWnd);
+		m_pm.RemovePreMessageFilter(this);
+
+		//delete this;
+	};
+
+	void Init();
+
+	void Notify(TNotifyUI& msg);
+
+	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		if (::IsIconic(*this))
+		{
+			bHandled = FALSE;
+		}
+		return (wParam == 0) ? TRUE : FALSE;
+	}
+
+	LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		return 0;
+	}
+
+	LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		return 0;
+	}
+
+	LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnSize(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 SetMemberInfo(std::string member_id, std::string phone, std::string is_open_pay_password, std::string name, std::string member_card_no, std::string sex, std::string birthday, std::string address, std::string card_identify, std::string md5_password);
+
+	void StartYanzheng();
+
+	void ConfirmMember();
+
+	//处理键盘捕捉结果
+	void HandleTextCapture(std::string content);
+
+public:
+	CPaintManagerUI m_pm;
+
+	std::string m_member_id;
+	std::string m_phone;
+
+	std::string m_is_open_pay_password;
+	std::string m_name;
+	std::string m_member_card_no;
+	std::string m_sex;
+	std::string m_birthday;
+	std::string m_address;
+
+	std::wstring m_errorInfo;
+
+	std::string m_card_identify; //这个其实修改资料没用,但是接口那里目前是必传,如果不传就直接抹掉了这个
+
+	std::string m_md5_password;
+
+	std::mutex m_qingqiu_mutex;
+	bool m_is_qingqiu = false;
+};

+ 443 - 0
zhipuzi_pos_windows/wnd/CHuiyuanXiugaimimaWnd.cpp

@@ -0,0 +1,443 @@
+#include "../pch/pch.h"
+#include "CHuiyuanXiugaimimaWnd.h"
+
+#include "../helper/MD5.h"
+
+LRESULT CHuiyuanXiugaimimaWnd::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	POINT pt;
+	pt.x = GET_X_LPARAM(lParam);
+	pt.y = GET_Y_LPARAM(lParam);
+	::ScreenToClient(*this, &pt);
+
+	RECT rcClient;
+	::GetClientRect(*this, &rcClient);
+
+	RECT rcCaption = m_pm.GetCaptionRect();
+	if (pt.x >= rcClient.left + rcCaption.left && pt.x < rcClient.right - rcCaption.right \
+		&& pt.y >= rcCaption.top && pt.y < rcCaption.bottom)
+	{
+		CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(pt));
+		if (pControl && _tcscmp(pControl->GetClass(), DUI_CTR_BUTTON) != 0)
+		{
+			return HTCAPTION;
+		}
+	}
+
+	return HTCLIENT;
+}
+
+LRESULT CHuiyuanXiugaimimaWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	SIZE szRoundCorner = m_pm.GetRoundCorner();
+	if (!::IsIconic(*this) && (szRoundCorner.cx != 0 || szRoundCorner.cy != 0))
+	{
+		CDuiRect rcWnd;
+		::GetWindowRect(*this, &rcWnd);
+		rcWnd.Offset(-rcWnd.left, -rcWnd.top);
+		rcWnd.right++;
+		rcWnd.bottom++;
+		HRGN hRgn = ::CreateRoundRectRgn(rcWnd.left, rcWnd.top, rcWnd.right, rcWnd.bottom, szRoundCorner.cx, szRoundCorner.cy);
+		::SetWindowRgn(*this, hRgn, TRUE);
+		::DeleteObject(hRgn);
+	}
+
+	bHandled = FALSE;
+	return 0;
+}
+
+LRESULT CHuiyuanXiugaimimaWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+	LRESULT lRes = 0;
+	BOOL bHandled = TRUE;
+	switch (uMsg)
+	{
+	case WM_CREATE:
+		lRes = OnCreate(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCACTIVATE:
+		lRes = OnNcActivate(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCCALCSIZE:
+		lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCPAINT:
+		lRes = OnNcPaint(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCHITTEST:
+		lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_SIZE:
+		lRes = OnSize(uMsg, wParam, lParam, bHandled);
+		break;
+	default:
+		bHandled = FALSE;
+	}
+	if (bHandled)
+	{
+		return lRes;
+	}
+	if (m_pm.MessageHandler(uMsg, wParam, lParam, lRes))
+	{
+		return lRes;
+	}
+	return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
+}
+
+LRESULT CHuiyuanXiugaimimaWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
+{
+	if (uMsg == WM_KEYDOWN)
+	{
+		if (wParam == VK_RETURN)
+		{
+			StartYanzheng();
+
+			return true;
+		}
+		else if (wParam == VK_ESCAPE)
+		{
+			if (m_is_qingqiu == false)
+			{
+				Close(IDCANCEL);
+			}
+
+			return true;
+		}
+	}
+	else if (uMsg == WM_MEMBER_CHECK_SUCCESS)
+	{
+		m_qingqiu_mutex.lock();
+
+		m_is_qingqiu = false;
+
+		m_qingqiu_mutex.unlock();
+
+		//验证成功了
+		Close(IDOK);
+
+		return true;
+	}
+	else if (uMsg == WM_MEMBER_CHECK_FAIL)
+	{
+		//验证失败了
+		CCheckBoxUI* pOpen = static_cast<CCheckBoxUI*>(m_pm.FindControl((L"password_pay_open")));
+		pOpen->SetEnabled(true);
+
+		CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
+		pPassword->SetEnabled(true);
+
+		CEditUI* pPassword2 = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit_2")));
+		pPassword2->SetEnabled(true);
+
+		CButtonUI* pSave = static_cast<CButtonUI*>(m_pm.FindControl(_T("save")));
+		pSave->SetEnabled(true);
+
+		//失败原因
+		CLabelUI* pErrorInfo = static_cast<CLabelUI*>(m_pm.FindControl(_T("shoukuanresult")));
+		pErrorInfo->SetText(m_errorInfo.c_str());
+		pErrorInfo->SetVisible(true);
+
+		m_qingqiu_mutex.lock();
+
+		m_is_qingqiu = false;
+
+		m_qingqiu_mutex.unlock();
+
+		return true;
+	}
+
+	return false;
+}
+
+LRESULT CHuiyuanXiugaimimaWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
+	styleValue &= ~WS_CAPTION;
+	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
+
+	// 把自己的窗口句柄与窗口绘制管理器挂接在一起
+	m_pm.Init(m_hWnd);
+
+	m_pm.AddPreMessageFilter(this);
+
+	CDialogBuilder builder;
+
+	CControlUI* pRoot = builder.Create(_T("huiyuan_xiugaimima_wnd.xml"), (UINT)0, NULL, &m_pm);
+	ASSERT(pRoot && "Failed to parse XML");
+
+	// 把这些控件绘制到本窗口上
+	m_pm.AttachDialog(pRoot);
+
+	// 把自己加入到CPaintManagerUI的m_aNotifiers数组中,用于处理Notify函数
+	m_pm.AddNotifier(this);
+
+	Init();
+
+	return 0;
+}
+
+void CHuiyuanXiugaimimaWnd::Notify(TNotifyUI& msg)
+{
+	DuiLib::CDuiString senderName = msg.pSender->GetName();
+
+	if (msg.sType == _T("click"))
+	{
+		DuiLib::CDuiString senderName = msg.pSender->GetName();
+
+		if (senderName == _T("closebtn"))
+		{
+			if (m_is_qingqiu == false)
+			{
+				Close(IDCANCEL);
+			}
+
+			return;
+		}
+		else if (senderName == _T("save"))
+		{
+			StartYanzheng();
+		}
+	}
+	else if (msg.sType == _T("textchanged"))
+	{
+		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;
+					}
+				}
+			}
+		}
+
+		if (senderName == L"password_edit_2")
+		{
+
+			//只能输入数字,其他的全部删除
+			CEditUI* m_pEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit_2")));
+			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 == L"windowinit")
+	{
+		m_pm.SetNextTabControl(false);
+
+		CEditUI* pFukuanEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
+		pFukuanEdit->SetFocus();
+	}
+	else if (msg.sType == _T("setfocus"))
+	{
+
+	}
+}
+
+void CHuiyuanXiugaimimaWnd::Init()
+{
+	m_pm.FindControl(_T("member_phone"))->SetText((L"手机号:" + CLewaimaiString::UTF8ToUnicode(m_phone)).c_str());
+
+	CCheckBoxUI* pOpen = static_cast<CCheckBoxUI*>(m_pm.FindControl(L"password_pay_open"));
+	if (m_is_open_pay_password == "1")
+	{
+		pOpen->Selected(true, false);
+	}
+	else
+	{
+		pOpen->Selected(false, false);
+	}
+}
+
+void CHuiyuanXiugaimimaWnd::SetMemberInfo(std::string member_id, std::string phone, std::string is_open_pay_password, std::string name, std::string member_card_no, std::string sex, std::string birthday, std::string address, std::string card_identify)
+{
+	m_member_id = member_id;
+	m_phone = phone;
+	m_is_open_pay_password = is_open_pay_password;
+	m_name = name;
+	m_member_card_no = member_card_no;
+
+	if (CLewaimaiString::UTF8ToUnicode(sex) == L"男")
+	{
+		m_sex = "0";
+	}
+	else
+	{
+		m_sex = "1";
+	}
+
+	m_birthday = birthday;
+	m_address = address;
+	m_card_identify = card_identify;
+}
+
+void CHuiyuanXiugaimimaWnd::StartYanzheng()
+{
+	CCheckBoxUI* pOpen = static_cast<CCheckBoxUI*>(m_pm.FindControl((L"password_pay_open")));
+	if (pOpen->IsSelected())
+	{
+		m_is_open_pay_password = "1";
+	}
+	else
+	{
+		m_is_open_pay_password = "0";
+	}
+	pOpen->SetEnabled(false);
+
+	CEditUI* pPassword = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
+	wstring wsPassword = pPassword->GetText();
+	m_password = CLewaimaiString::UnicodeToUTF8(wsPassword);
+
+	if (wsPassword.length() == 0)
+	{
+		m_errorInfo = _T("支付密码不能为空");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+
+	if (wsPassword.length() != 6)
+	{
+		m_errorInfo = _T("支付密码只能为6位数字");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+
+	pPassword->SetEnabled(false);
+
+	CEditUI* pPassword2 = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit_2")));
+	wstring wsPassword2 = pPassword2->GetText();
+	std::string password_2 = CLewaimaiString::UnicodeToUTF8(wsPassword2);
+
+	if (wsPassword2.length() == 0)
+	{
+		m_errorInfo = _T("确认密码不能为空");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+
+	if (wsPassword2.length() != 6)
+	{
+		m_errorInfo = _T("确认密码只能为6位数字");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+
+	if (m_password != password_2)
+	{
+		m_errorInfo = _T("两次输入的密码不一样");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+
+	pPassword2->SetEnabled(false);
+
+	CButtonUI* pSave = static_cast<CButtonUI*>(m_pm.FindControl(_T("save")));
+	pSave->SetEnabled(false);
+
+	m_qingqiu_mutex.lock();
+
+	m_is_qingqiu = true;
+
+	m_qingqiu_mutex.unlock();
+
+	//开始处理
+	std::thread(&CHuiyuanXiugaimimaWnd::ConfirmMember, this).detach();
+}
+
+void CHuiyuanXiugaimimaWnd::ConfirmMember()
+{
+	std::map<string, string> params;
+	params["card_no"] = m_member_card_no;
+	params["name"] = m_name;
+	params["birthday"] = m_birthday;
+	params["address"] = m_address;
+	params["sex"] = m_sex;
+	params["captcha"] = "";
+	params["pay_password"] = md5(m_password);
+	params["open_no_card_payment"] = m_is_open_pay_password;
+	params["is_no_card"] = "1";
+	params["member_id"] = m_member_id;
+	params["card_identify"] = m_card_identify;
+
+	std::string response;
+	bool ret = CZhipuziHttpClient::GetInstance()->Request("/member/changeinfo", params, response);
+	if (!ret)
+	{
+		m_errorInfo = _T("网络请求出错");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+
+	rapidjson::Document document;
+	document.Parse(response.c_str());
+
+	if (document.HasParseError())
+	{
+		m_errorInfo = _T("服务器返回数据格式错误");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+	else
+	{
+		if (!document.HasMember("errcode") || !document.HasMember("errmsg"))
+		{
+			m_errorInfo = _T("服务器返回数据格式错误");
+			PostMessage(WM_MEMBER_CHECK_FAIL);
+
+			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());
+			m_errorInfo = CLewaimaiString::UTF8ToUnicode(errmsg);
+			PostMessage(WM_MEMBER_CHECK_FAIL);
+
+			return;
+		}
+
+		PostMessage(WM_MEMBER_CHECK_SUCCESS);
+	}
+}

+ 95 - 0
zhipuzi_pos_windows/wnd/CHuiyuanXiugaimimaWnd.h

@@ -0,0 +1,95 @@
+#pragma once
+
+#include "../pch/pch.h"
+#include "CMainWnd.h"
+#include "CModalWnd.h"
+
+class CHuiyuanXiugaimimaWnd : public CModalWnd
+{
+public:
+	LPCTSTR GetWindowClassName() const
+	{
+		return _T("UIMemoWndFrame");
+	};
+
+	UINT GetClassStyle() const
+	{
+		return UI_CLASSSTYLE_DIALOG;
+	};
+
+	void OnFinalMessage(HWND /*hWnd*/)
+	{
+		//WindowImplBase::OnFinalMessage(hWnd);
+		m_pm.RemovePreMessageFilter(this);
+
+		//delete this;
+	};
+
+	void Init();
+
+	void Notify(TNotifyUI& msg);
+
+	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		if (::IsIconic(*this))
+		{
+			bHandled = FALSE;
+		}
+		return (wParam == 0) ? TRUE : FALSE;
+	}
+
+	LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		return 0;
+	}
+
+	LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		return 0;
+	}
+
+	LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnSize(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 SetMemberInfo(std::string member_id, std::string phone, std::string is_open_pay_password, std::string name, std::string member_card_no, std::string sex, std::string birthday, std::string address, std::string card_identify);
+
+	void StartYanzheng();
+
+	void ConfirmMember();
+
+	//处理键盘捕捉结果
+	void HandleTextCapture(std::string content)
+	{
+
+	}
+
+public:
+	CPaintManagerUI m_pm;
+
+	std::string m_member_id;
+	std::string m_phone;
+
+	std::string m_is_open_pay_password;
+	std::string m_name;
+	std::string m_member_card_no;
+	std::string m_sex;
+	std::string m_birthday;
+	std::string m_address;
+
+	std::wstring m_errorInfo;
+
+	std::string m_card_identify; //这个其实修改资料没用,但是接口那里目前是必传,如果不传就直接抹掉了这个
+
+	std::string m_password;
+
+	std::mutex m_qingqiu_mutex;
+	bool m_is_qingqiu = false;
+};

+ 367 - 0
zhipuzi_pos_windows/wnd/CHuiyuanXiugaiziliaoWnd.cpp

@@ -0,0 +1,367 @@
+#include "../pch/pch.h"
+#include "CHuiyuanXiugaiziliaoWnd.h"
+
+#include "../helper/MD5.h"
+
+LRESULT CHuiyuanXiugaiziliaoWnd::OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	POINT pt;
+	pt.x = GET_X_LPARAM(lParam);
+	pt.y = GET_Y_LPARAM(lParam);
+	::ScreenToClient(*this, &pt);
+
+	RECT rcClient;
+	::GetClientRect(*this, &rcClient);
+
+	RECT rcCaption = m_pm.GetCaptionRect();
+	if (pt.x >= rcClient.left + rcCaption.left && pt.x < rcClient.right - rcCaption.right \
+		&& pt.y >= rcCaption.top && pt.y < rcCaption.bottom)
+	{
+		CControlUI* pControl = static_cast<CControlUI*>(m_pm.FindControl(pt));
+		if (pControl && _tcscmp(pControl->GetClass(), DUI_CTR_BUTTON) != 0)
+		{
+			return HTCAPTION;
+		}
+	}
+
+	return HTCLIENT;
+}
+
+LRESULT CHuiyuanXiugaiziliaoWnd::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	SIZE szRoundCorner = m_pm.GetRoundCorner();
+	if (!::IsIconic(*this) && (szRoundCorner.cx != 0 || szRoundCorner.cy != 0))
+	{
+		CDuiRect rcWnd;
+		::GetWindowRect(*this, &rcWnd);
+		rcWnd.Offset(-rcWnd.left, -rcWnd.top);
+		rcWnd.right++;
+		rcWnd.bottom++;
+		HRGN hRgn = ::CreateRoundRectRgn(rcWnd.left, rcWnd.top, rcWnd.right, rcWnd.bottom, szRoundCorner.cx, szRoundCorner.cy);
+		::SetWindowRgn(*this, hRgn, TRUE);
+		::DeleteObject(hRgn);
+	}
+
+	bHandled = FALSE;
+	return 0;
+}
+
+LRESULT CHuiyuanXiugaiziliaoWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+	LRESULT lRes = 0;
+	BOOL bHandled = TRUE;
+	switch (uMsg)
+	{
+	case WM_CREATE:
+		lRes = OnCreate(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCACTIVATE:
+		lRes = OnNcActivate(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCCALCSIZE:
+		lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCPAINT:
+		lRes = OnNcPaint(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_NCHITTEST:
+		lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_SIZE:
+		lRes = OnSize(uMsg, wParam, lParam, bHandled);
+		break;
+	default:
+		bHandled = FALSE;
+	}
+	if (bHandled)
+	{
+		return lRes;
+	}
+	if (m_pm.MessageHandler(uMsg, wParam, lParam, lRes))
+	{
+		return lRes;
+	}
+	return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
+}
+
+LRESULT CHuiyuanXiugaiziliaoWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
+{
+	if (uMsg == WM_KEYDOWN)
+	{
+		if (wParam == VK_RETURN)
+		{
+			StartYanzheng();
+
+			return true;
+		}
+		else if (wParam == VK_ESCAPE)
+		{
+			if (m_is_qingqiu == false)
+			{
+				Close(IDCANCEL);
+			}
+
+			return true;
+		}
+	}
+	else if (uMsg == WM_MEMBER_CHECK_SUCCESS)
+	{
+		m_qingqiu_mutex.lock();
+
+		m_is_qingqiu = false;
+
+		m_qingqiu_mutex.unlock();
+
+		//验证成功了
+		Close(IDOK);
+
+		return true;
+	}
+	else if (uMsg == WM_MEMBER_CHECK_FAIL)
+	{
+		//验证失败了
+		CButtonUI* pSave = static_cast<CButtonUI*>(m_pm.FindControl(_T("save")));
+		pSave->SetEnabled(true);
+
+		//失败原因
+		CLabelUI* pErrorInfo = static_cast<CLabelUI*>(m_pm.FindControl(_T("shoukuanresult")));
+		pErrorInfo->SetText(m_errorInfo.c_str());
+		pErrorInfo->SetVisible(true);
+
+		m_qingqiu_mutex.lock();
+
+		m_is_qingqiu = false;
+
+		m_qingqiu_mutex.unlock();
+
+		return true;
+	}
+
+	return false;
+}
+
+LRESULT CHuiyuanXiugaiziliaoWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
+	styleValue &= ~WS_CAPTION;
+	::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
+
+	// 把自己的窗口句柄与窗口绘制管理器挂接在一起
+	m_pm.Init(m_hWnd);
+
+	m_pm.AddPreMessageFilter(this);
+
+	CDialogBuilder builder;
+
+	CControlUI* pRoot = builder.Create(_T("huiyuan_xiugaiziliao_wnd.xml"), (UINT)0, NULL, &m_pm);
+	ASSERT(pRoot && "Failed to parse XML");
+
+	// 把这些控件绘制到本窗口上
+	m_pm.AttachDialog(pRoot);
+
+	// 把自己加入到CPaintManagerUI的m_aNotifiers数组中,用于处理Notify函数
+	m_pm.AddNotifier(this);
+
+	Init();
+
+	return 0;
+}
+
+void CHuiyuanXiugaiziliaoWnd::Notify(TNotifyUI& msg)
+{
+	DuiLib::CDuiString senderName = msg.pSender->GetName();
+
+	if (msg.sType == _T("click"))
+	{
+		DuiLib::CDuiString senderName = msg.pSender->GetName();
+
+		if (senderName == _T("closebtn"))
+		{
+			if (m_is_qingqiu == false)
+			{
+				Close(IDCANCEL);
+			}
+
+			return;
+		}
+		else if (senderName == _T("save"))
+		{
+			StartYanzheng();
+		}
+	}
+	else if (msg.sType == _T("textchanged"))
+	{
+		
+	}
+	else if (msg.sType == L"windowinit")
+	{
+		m_pm.SetNextTabControl(false);
+
+		CEditUI* pFukuanEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("kahao_edit")));
+		pFukuanEdit->SetFocus();
+	}
+	else if (msg.sType == _T("setfocus"))
+	{
+		
+	}
+}
+
+void CHuiyuanXiugaiziliaoWnd::Init()
+{
+	m_pm.FindControl(_T("member_phone"))->SetText((L"手机号:" + CLewaimaiString::UTF8ToUnicode(m_phone)).c_str());
+
+	m_pm.FindControl(L"kahao_edit")->SetText(CLewaimaiString::UTF8ToUnicode(m_member_card_no).c_str());
+
+	m_pm.FindControl(L"name_edit")->SetText(CLewaimaiString::UTF8ToUnicode(m_name).c_str());
+
+	CCheckBoxUI* pNan = static_cast<CCheckBoxUI*>(m_pm.FindControl(L"xingbie_setting_nan"));
+	CCheckBoxUI* pNv = static_cast<CCheckBoxUI*>(m_pm.FindControl(L"xingbie_setting_nv"));
+	if (m_sex == "0")
+	{
+		pNan->Selected(true, false);
+	}
+	else
+	{
+		pNv->Selected(true, false);
+	}
+
+	m_pm.FindControl(L"address_edit")->SetText(CLewaimaiString::UTF8ToUnicode(m_address).c_str());
+
+	CDateTimeUI* pBirthday = static_cast<CDateTimeUI*>(m_pm.FindControl(L"shengri_date"));
+
+	if (m_birthday != "")
+	{
+		pBirthday->SetText(CLewaimaiString::UTF8ToUnicode(m_birthday).c_str());
+	}
+}
+
+void CHuiyuanXiugaiziliaoWnd::SetMemberInfo(std::string member_id, std::string phone, std::string is_open_pay_password, std::string name, std::string member_card_no, std::string sex, std::string birthday, std::string address, std::string card_identify, std::string md5_password)
+{
+	m_member_id = member_id;
+	m_phone = phone;
+	m_is_open_pay_password = is_open_pay_password;
+	m_name = name;
+	m_member_card_no = member_card_no;
+
+	if (CLewaimaiString::UTF8ToUnicode(sex) == L"男")
+	{
+		m_sex = "0";
+	}
+	else
+	{
+		m_sex = "1";
+	}
+
+	m_birthday = birthday;
+	m_address = address;
+	m_card_identify = card_identify;
+
+	m_md5_password = md5_password;
+}
+
+void CHuiyuanXiugaiziliaoWnd::StartYanzheng()
+{
+	//会员卡号
+	CEditUI* pCardNo = static_cast<CEditUI*>(m_pm.FindControl(_T("kahao_edit")));
+	wstring wsKahao = pCardNo->GetText();
+	m_member_card_no = CLewaimaiString::UnicodeToUTF8(wsKahao);
+
+	//会员姓名
+	CEditUI* pName = static_cast<CEditUI*>(m_pm.FindControl(_T("name_edit")));
+	wstring wsName = pName->GetText();
+	m_name = CLewaimaiString::UnicodeToUTF8(wsName);
+
+	//会员性别
+	CCheckBoxUI* pNan = static_cast<CCheckBoxUI*>(m_pm.FindControl((L"xingbie_setting_nan")));
+	if (pNan->IsSelected())
+	{
+		//选中男性
+		m_sex = "0";
+	}
+	else
+	{
+		m_sex = "1";
+	}
+
+	//会员地址
+	CEditUI* pAddress = static_cast<CEditUI*>(m_pm.FindControl(_T("address_edit")));
+	wstring wsAddress = pAddress->GetText();
+	m_address = CLewaimaiString::UnicodeToUTF8(wsAddress);
+
+	//会员生日
+	CDateTimeUI* pBirthday = static_cast<CDateTimeUI*>(m_pm.FindControl(L"shengri_date"));
+	std::wstring wsBirthday = pBirthday->GetText();
+	m_birthday = CLewaimaiString::UnicodeToUTF8(wsBirthday);
+
+	CButtonUI* pSave = static_cast<CButtonUI*>(m_pm.FindControl(_T("save")));
+	pSave->SetEnabled(false);
+
+	m_qingqiu_mutex.lock();
+
+	m_is_qingqiu = true;
+
+	m_qingqiu_mutex.unlock();
+
+	//开始处理
+	std::thread(&CHuiyuanXiugaiziliaoWnd::ConfirmMember, this).detach();
+}
+
+void CHuiyuanXiugaiziliaoWnd::ConfirmMember()
+{
+	std::map<string, string> params;
+	params["card_no"] = m_member_card_no;
+	params["name"] = m_name;
+	params["birthday"] = m_birthday;
+	params["address"] = m_address;
+	params["sex"] = m_sex;
+	params["captcha"] = "";
+	params["pay_password"] = m_md5_password;
+	params["open_no_card_payment"] = m_is_open_pay_password;
+	params["is_no_card"] = "1";
+	params["member_id"] = m_member_id;
+	params["card_identify"] = m_card_identify;
+
+	std::string response;
+	bool ret = CZhipuziHttpClient::GetInstance()->Request("/member/changeinfo", params, response);
+	if (!ret)
+	{
+		m_errorInfo = _T("网络请求出错");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+
+	rapidjson::Document document;
+	document.Parse(response.c_str());
+
+	if (document.HasParseError())
+	{
+		m_errorInfo = _T("服务器返回数据格式错误");
+		PostMessage(WM_MEMBER_CHECK_FAIL);
+
+		return;
+	}
+	else
+	{
+		if (!document.HasMember("errcode") || !document.HasMember("errmsg"))
+		{
+			m_errorInfo = _T("服务器返回数据格式错误");
+			PostMessage(WM_MEMBER_CHECK_FAIL);
+
+			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());
+			m_errorInfo = CLewaimaiString::UTF8ToUnicode(errmsg);
+			PostMessage(WM_MEMBER_CHECK_FAIL);
+
+			return;
+		}
+
+		PostMessage(WM_MEMBER_CHECK_SUCCESS);
+	}
+}

+ 95 - 0
zhipuzi_pos_windows/wnd/CHuiyuanXiugaiziliaoWnd.h

@@ -0,0 +1,95 @@
+#pragma once
+
+#include "../pch/pch.h"
+#include "CMainWnd.h"
+#include "CModalWnd.h"
+
+class CHuiyuanXiugaiziliaoWnd : public CModalWnd
+{
+public:
+	LPCTSTR GetWindowClassName() const
+	{
+		return _T("UIMemoWndFrame");
+	};
+
+	UINT GetClassStyle() const
+	{
+		return UI_CLASSSTYLE_DIALOG;
+	};
+
+	void OnFinalMessage(HWND /*hWnd*/)
+	{
+		//WindowImplBase::OnFinalMessage(hWnd);
+		m_pm.RemovePreMessageFilter(this);
+
+		//delete this;
+	};
+
+	void Init();
+
+	void Notify(TNotifyUI& msg);
+
+	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		if (::IsIconic(*this))
+		{
+			bHandled = FALSE;
+		}
+		return (wParam == 0) ? TRUE : FALSE;
+	}
+
+	LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		return 0;
+	}
+
+	LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		return 0;
+	}
+
+	LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnSize(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 SetMemberInfo(std::string member_id, std::string phone, std::string is_open_pay_password, std::string name, std::string member_card_no, std::string sex, std::string birthday, std::string address, std::string card_identify, std::string md5_password);
+
+	void StartYanzheng();
+
+	void ConfirmMember();
+
+	//处理键盘捕捉结果
+	void HandleTextCapture(std::string content)
+	{
+
+	}
+
+public:
+	CPaintManagerUI m_pm;
+
+	std::string m_member_id;
+	std::string m_phone;
+
+	std::string m_is_open_pay_password;
+	std::string m_name;
+	std::string m_member_card_no;
+	std::string m_sex;
+	std::string m_birthday;
+	std::string m_address;
+
+	std::wstring m_errorInfo;
+
+	std::string m_card_identify; //这个其实修改资料没用,但是接口那里目前是必传,如果不传就直接抹掉了这个
+
+	std::string m_md5_password;
+
+	std::mutex m_qingqiu_mutex;
+	bool m_is_qingqiu = false;
+};

+ 6 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -229,6 +229,9 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClInclude Include="wnd\CHuiyuanBangkaWnd.h" />
+    <ClInclude Include="wnd\CHuiyuanXiugaimimaWnd.h" />
+    <ClInclude Include="wnd\CHuiyuanXiugaiziliaoWnd.h" />
     <ClInclude Include="control\CShoukuanOrderItemUI.h" />
     <ClInclude Include="page\CShoukuanOrderInfoPageUI.h" />
     <ClInclude Include="page\CShoukuanOrderListPageUI.h" />
@@ -344,6 +347,9 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="helper\CSystem.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="wnd\CHuiyuanBangkaWnd.cpp" />
+    <ClCompile Include="wnd\CHuiyuanXiugaimimaWnd.cpp" />
+    <ClCompile Include="wnd\CHuiyuanXiugaiziliaoWnd.cpp" />
     <ClCompile Include="control\CShoukuanOrderItemUI.cpp" />
     <ClCompile Include="page\CShoukuanOrderInfoPageUI.cpp" />
     <ClCompile Include="page\CShoukuanOrderListPageUI.cpp" />

+ 18 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -354,6 +354,15 @@
     <ClInclude Include="page\CShoukuanOrderInfoPageUI.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="wnd\CHuiyuanXiugaiziliaoWnd.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="wnd\CHuiyuanXiugaimimaWnd.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="wnd\CHuiyuanBangkaWnd.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">
@@ -668,6 +677,15 @@
     <ClCompile Include="page\CShoukuanOrderInfoPageUI.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="wnd\CHuiyuanXiugaiziliaoWnd.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="wnd\CHuiyuanXiugaimimaWnd.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="wnd\CHuiyuanBangkaWnd.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="resource\zhipuzi.ico">