Browse Source

优化会员

张洋 3 years ago
parent
commit
020b9f7948

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

@@ -19,12 +19,12 @@
 				</HorizontalLayout>
 				
 				<HorizontalLayout height="50" padding="0,35,0,0">
-					<Label text="密码支付" font="2" float="true" pos="30,12,180,40" />
+					<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"/>
+					<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>
 				

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

@@ -69,7 +69,7 @@
 				
 				<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>
+					<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>
@@ -84,7 +84,7 @@
 				<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'" />
+					<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">

+ 3 - 3
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_xiugaimima_wnd.xml

@@ -7,7 +7,7 @@
 	<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"/>
+			<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>		
 
@@ -18,12 +18,12 @@
 				</HorizontalLayout>
 				
 				<HorizontalLayout height="45" padding="0,15,0,0">
-					<Label text="密码支付" font="2" float="true" pos="30,0,180,45" />
+					<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"/>
+					<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>
 				

+ 2 - 2
bin/Win32/Debug/zhipuzi_pos_windows/skin/shoukuan_page.xml

@@ -5,13 +5,13 @@
 			<Control width="1" bkcolor="#FFD1D1D1"></Control>
 			
 			<VerticalLayout width="420" bkcolor="#FFFFFFFF">
-				<Label text="收款金额" heiht="30" padding="40,20,10,10"></Label>
+				<Label text="收款金额" font="20" width="150" height="30" padding="40,14,10,10"></Label>
 				
 				<HorizontalLayout height="68">
 					<Button name="shoukuan_page_money_edit" align="left" font="32" width="340" height="68" padding="40,0,40,0" textpadding="10,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF" textcolor="0xFF3CB371"/>
 				</HorizontalLayout>
 				
-				<HorizontalLayout width="340" height="416" bkcolor="#FFF3F3F3" padding="40,50,40,10">
+				<HorizontalLayout width="340" height="416" bkcolor="#FFF3F3F3" padding="40,30,40,10">
 					<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>

+ 3 - 3
zhipuzi_pos_windows/page/CHuiyuanPageUI.cpp

@@ -364,11 +364,11 @@ void CHuiyuanPageUI::StartHuiyuanSousuo()
 
 		if (m_is_open_pay_password == "1")
 		{
-			this->FindSubControl(L"huiyuan_mimazhifu")->SetText(L"쵱쯤連마:綠역폘");
+			this->FindSubControl(L"huiyuan_mimazhifu")->SetText(L"쵱쯤되쩌:綠역폘");
 		}
 		else
 		{
-			this->FindSubControl(L"huiyuan_mimazhifu")->SetText(L"쵱쯤連마:灌역폘");
+			this->FindSubControl(L"huiyuan_mimazhifu")->SetText(L"쵱쯤되쩌:灌역폘");
 		}
 
 		this->FindSubControl(L"huiyuan_name")->SetText((L"삔逃檎츰:" + CLewaimaiString::UTF8ToUnicode(m_name)).c_str());
@@ -563,7 +563,7 @@ void CHuiyuanPageUI::StartXiugaiziliao()
 	}
 }
 
-//錦맣連마쵱쯤
+//錦맣되쩌쵱쯤
 void CHuiyuanPageUI::StartXiugaimima()
 {
 	if (m_is_show_modal_wnd == true)

+ 81 - 0
zhipuzi_pos_windows/page/CShoukuanPageUI.cpp

@@ -8,6 +8,7 @@
 #include "../wnd/CXianjinShoukuanWnd.h"
 #include "../wnd/CFulikaShoukuanWnd.h"
 #include "../wnd/CZidingyiShoukuanWnd.h"
+#include "../wnd/CMemberLoginWnd.h"
 
 #include "../wnd/CMainWnd.h"
 
@@ -624,6 +625,9 @@ void CShoukuanPageUI::StartHuiyuanShoukuan()
 		return;
 	}
 
+	this->ClickMemberLogin();
+
+	//登录成功了,马上开始进行支付确认
 	CHuiyuanShoukuanWnd* pShoukuanWnd = new CHuiyuanShoukuanWnd();
 	if (pShoukuanWnd != NULL)
 	{
@@ -640,6 +644,9 @@ void CShoukuanPageUI::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());
 
@@ -879,6 +886,9 @@ void CShoukuanPageUI::StartWorkAfterShoukuan(std::string show_trade_no, std::str
 	//最后还原收款金额
 	this->InitMoney();
 
+	//还原会员状态
+	this->ClickMemberLogout();
+
 	this->UpdateJiesuanInfo();
 }
 
@@ -938,4 +948,75 @@ void CShoukuanPageUI::SetPos(RECT rc, bool bNeedInvalidate)
 	UpdateJiesuanZhifuPos();
 
 	CContainerUI::SetPos(rc, bNeedInvalidate);
+}
+
+void CShoukuanPageUI::ClickMemberLogin()
+{
+	if (m_is_show_modal_wnd == true)
+	{
+		return;
+	}
+
+	CMemberLoginWnd* pMemberLoginDlg = new CMemberLoginWnd();
+
+	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();
+
+		UINT ret = pMemberLoginDlg->ShowModal();
+
+		if (ret == IDOK)
+		{
+			//这说明会员登录成功了
+			m_is_member = true;
+
+			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;
+
+			this->UpdateJiesuanInfo();
+
+			m_is_show_modal_wnd = false;
+			delete pMemberLoginDlg;
+		}
+		else
+		{
+			m_is_show_modal_wnd = false;
+			delete pMemberLoginDlg;
+
+			return;
+		}
+	}
+}
+
+//处理会员退出登陆
+void CShoukuanPageUI::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();
 }

+ 30 - 0
zhipuzi_pos_windows/page/CShoukuanPageUI.h

@@ -40,6 +40,12 @@ public:
 
 	void SetPos(RECT rc, bool bNeedInvalidate = true);
 
+	//处理会员登录
+	void ClickMemberLogin();
+
+	//处理会员退出登陆
+	void ClickMemberLogout();
+
 private:
 	void ShowError(std::wstring err);
 
@@ -102,4 +108,28 @@ private:
 	//仅用于现金收银成功后,对于实收和找零的临时记录
 	std::string m_shishou_value;
 	std::string m_zhaoling_value;
+
+	//会员相关
+	bool m_is_member = false;
+	std::string m_member_name;
+	std::string m_member_level;
+	std::string m_member_level_name;
+
+	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;
 };

+ 1 - 7
zhipuzi_pos_windows/page/CZhengcanDiandanPageUI.cpp

@@ -474,13 +474,7 @@ void CZhengcanDiandanPageUI::InitFoodShow()
 void CZhengcanDiandanPageUI::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;

+ 2 - 2
zhipuzi_pos_windows/wnd/CHuiyuanAddWnd.cpp

@@ -631,7 +631,7 @@ void CHuiyuanAddWnd::StartYanzheng()
 
 	if (wsPassword.length() == 0)
 	{
-		m_errorInfo = _T("支付密码不能为空");
+		m_errorInfo = _T("登录密码不能为空");
 		PostMessage(WM_MEMBER_CHECK_FAIL);
 
 		return;
@@ -639,7 +639,7 @@ void CHuiyuanAddWnd::StartYanzheng()
 
 	if (wsPassword.length() != 6)
 	{
-		m_errorInfo = _T("支付密码只能为6位数字");
+		m_errorInfo = _T("登录密码只能为6位数字");
 		PostMessage(WM_MEMBER_CHECK_FAIL);
 
 		return;