Procházet zdrojové kódy

完成会员和现金支付

张洋 před 4 roky
rodič
revize
4237971c93

binární
bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-20-18-42-33.dmp


binární
bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-20-18-42-43.dmp


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

@@ -1,31 +1,55 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<Window size="520,410" caption="0,0,0,44" roundcorner="4,4" >
+<Window size="580,550" 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" />
 	<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="会员收款11" height="44" align="center" valign="center" padding="0,0,0,0" textcolor="#FFFFFFFF" font="2"/>
 		</HorizontalLayout>
 		
-		<VerticalLayout visible="true" name="shoukuan_before_pay_layout" height="290" padding="0,20,0,0">
+		<VerticalLayout visible="true" name="shoukuan_before_pay_layout" height="400" padding="0,20,0,0">
 			<HorizontalLayout name="shoukuan_money_input_layout" height="60" padding="0,15,0,0">
 				<Label height="40" padding="190,20,0,10" name="shoukuan_before_pay_huobi" text="¥" font="0" textcolor="0xFF3CB371"></Label>
 				<Edit name="money_edit" float="true" pos="223,0,400,60" font="1" textcolor="0xFF3CB371" bkcolor="0xFFFCFCFC" nativebkcolor="0xFFFCFCFC"/>
 			</HorizontalLayout>
 			
 			<HorizontalLayout name="shoukuan_money_show_layout" height="50" padding="0,15,0,15" visible="false">
-				<Label text="¥" font="0" textcolor="0xFF3CB371" float="true" pos="200,24,215,50"/>
-				<Label name="shoukuan_money_show_money" font="1" textcolor="0xFF3CB371" float="true" pos="225,12,500,48"/>
+				<Label text="¥" font="0" textcolor="0xFF3CB371" float="true" pos="220,24,235,50"/>
+				<Label name="shoukuan_money_show_money" font="1" textcolor="0xFF3CB371" float="true" pos="245,12,520,48"/>
 			</HorizontalLayout>
 			
-			<HorizontalLayout height="50" padding="0,15,0,0">
-				<Label text="付款码:" font="2" float="true" pos="100,12,180,40"/>
-				<Edit name="fukuanma_edit" float="true" pos="183,12,400,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 height="40" padding="0,20,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" height="2" bkcolor="#FF43A947" padding="70,0,70,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" height="2" bkcolor="#FF43A947" padding="70,0,70,0"></Control>
+				</VerticalLayout>
+			</HorizontalLayout>
+			
+			<HorizontalLayout name="fukuan_input_fukuanma_layout" height="120" padding="0,30,0,0">
+				<Label text="会员付款码:" font="2" float="true" pos="100,35,200,60"/>
+				<Edit name="fukuanma_edit" float="true" pos="203,32,420,68" 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" padding="0,30,0,0">
+			<VerticalLayout visible="false" name="fukuan_input_shoujihao_layout" height="120" padding="0,30,0,0">
+				<HorizontalLayout height="60">
+					<Label text="手机号:" font="2" float="true" pos="100,15,200,40"/>
+					<Edit name="shoujihao_edit" float="true" pos="203,12,420,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="100,15,200,40"/>
+					<Edit name="password_edit" float="true" pos="203,12,420,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>
+			</VerticalLayout>
+			
+			<HorizontalLayout height="80" padding="0,30,0,0">
 				<Control></Control>
 				<Button name="shoukuanBtn" text="确认" font="2" textcolor="#FFFFFFFF" height="50" width="150" padding="0,0,0,0" tooltip="点击这里确认收款" normalimage="file='Btn_Green.png' corner='5,5,5,5'" hotimage="file='Btn_Green_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" />
 				<Button name="closebtn" text="关闭" font="2" textcolor="#FFFFFFFF" height="50" width="150" padding="20,0,0,0" tooltip="点击这里取消收款" normalimage="file='Btn_Red.png' corner='5,5,5,5'" hotimage="file='Btn_Red_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" />

+ 108 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/xianjin_shoukuan_wnd.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window size="580,550" 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"/>
+		</HorizontalLayout>
+		
+		<VerticalLayout visible="true" name="shoukuan_before_pay_layout" height="520" padding="0,20,0,0">
+			<HorizontalLayout name="shoukuan_money_input_layout" height="60" padding="0,15,0,0">
+				<Label height="40" padding="190,20,0,10" name="shoukuan_before_pay_huobi" text="¥" font="0" textcolor="0xFF3CB371"></Label>
+				<Edit name="money_edit" float="true" pos="223,0,400,60" font="1" textcolor="0xFF3CB371" bkcolor="0xFFFCFCFC" nativebkcolor="0xFFFCFCFC"/>
+			</HorizontalLayout>
+			
+			<HorizontalLayout name="shoukuan_money_show_layout" height="50" padding="0,15,0,15" visible="false">
+				<Label text="¥" font="0" textcolor="0xFF3CB371" float="true" pos="230,24,245,50"/>
+				<Label name="shoukuan_money_show_money" font="1" textcolor="0xFF3CB371" float="true" pos="255,12,530,48"/>
+			</HorizontalLayout>
+			
+			<HorizontalLayout height="50" padding="0,15,0,0">
+				<Label text="实收金额:" font="2" float="true" pos="100,12,180,40"/>
+				<Edit name="shishou_edit" float="true" pos="188,12,405,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="412,15,520,40"/>
+			</HorizontalLayout>
+			
+			<HorizontalLayout height="50" padding="0,15,0,0">
+				<Label text="快捷选择" font="2" float="true" pos="100,12,180,40"/>
+				<Button name="xianjin_kuaijie_10" font="4" text="10元" heiht="36" width="55" padding="190,10,0,0" textcolor="#FFFFFFFF" normalimage="" hotimage="" pushedimage="" bordersize="0" bordercolor="#FFC1C1C1" bkcolor="#FF3CB371"></Button>
+				<Button name="xianjin_kuaijie_20" font="4" text="20元" heiht="36" width="55" padding="14,10,0,0" textcolor="#FFFFFFFF" normalimage="" hotimage="" pushedimage="" bordersize="0" bordercolor="#FFC1C1C1" bkcolor="#FF3CB371"></Button>
+				<Button name="xianjin_kuaijie_50" font="4" text="50元" heiht="36" width="55" padding="14,10,0,0" textcolor="#FFFFFFFF" normalimage="" hotimage="" pushedimage="" bordersize="0" bordercolor="#FFC1C1C1" bkcolor="#FF3CB371"></Button>
+				<Button name="xianjin_kuaijie_100" font="4" text="100元" heiht="36" width="55" padding="14,10,0,0" textcolor="#FFFFFFFF" normalimage="" hotimage="" pushedimage="" bordersize="0" bordercolor="#FFC1C1C1" bkcolor="#FF3CB371"></Button>
+				<Button name="xianjin_kuaijie_200" font="4" text="200元" heiht="36" width="55" padding="14,10,0,0" textcolor="#FFFFFFFF" normalimage="" hotimage="" pushedimage="" bordersize="0" bordercolor="#FFC1C1C1" bkcolor="#FF3CB371"></Button>
+			</HorizontalLayout>
+			
+			<HorizontalLayout height="50" padding="0,15,0,0">
+				<Label text="找零:" font="2" float="true" pos="100,12,180,40"/>
+				<Label name="xianjin_zhaoling_label" text="0元" font="2" float="true" pos="185,12,300,40"/>
+			</HorizontalLayout>
+			
+			<HorizontalLayout height="60" padding="0,50,0,0">
+				<Control></Control>
+				<Button name="shoukuanBtn" text="确认" font="2" textcolor="#FFFFFFFF" height="50" width="150" padding="0,0,0,0" tooltip="点击这里确认收款" normalimage="file='Btn_Green.png' corner='5,5,5,5'" hotimage="file='Btn_Green_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" />
+				<Button name="closebtn" text="关闭" font="2" textcolor="#FFFFFFFF" height="50" width="150" padding="20,0,0,0" tooltip="点击这里取消收款" normalimage="file='Btn_Red.png' corner='5,5,5,5'" hotimage="file='Btn_Red_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" />
+				<Control></Control>
+			</HorizontalLayout>	
+
+			<HorizontalLayout height="50" padding="0,20,0,0">
+				<Control></Control>
+				<Label name="shoukuanresult" font="2" width="400" height="50" multiline="true" text="" visible="false" textcolor="#FF0000" align="center" />
+				<Control></Control>
+			</HorizontalLayout>			
+		</VerticalLayout>
+		
+		<VerticalLayout name="shoukuan_paying_layout" visible="false">
+			<HorizontalLayout name="shoukuan_paying_loading" height="24" padding="0, 20, 0, 20">
+				<Control></Control>
+				<VerticalLayout width="24">
+					<Control></Control>
+					<HorizontalLayout height="24">
+						<GifAnim bkimage="loading.gif" autosize="true"></GifAnim>
+					</HorizontalLayout>
+					<Control></Control>
+				</VerticalLayout>
+				<Control></Control>
+			</HorizontalLayout>
+			
+			<Label height="40" padding="0,10,0,10" name="shoukuan_paying_money" text="收款金额:" font="3" textcolor="0xFF3CB371" align="center"></Label>
+			
+			<Label height="32" padding="0,10,0,10" name="shoukuan_paying_status" text="请求支付中..." font="2" textcolor="0xFF3CB371" align="center"></Label>
+			
+			<Label height="60" padding="20,30,20,0" name="shouyin_paying_attention" text="如果用户没有支付成功,则请确认客户不再进行支付时再关闭此窗口,按【Esc】取消本次支付" font="2" textcolor="0xFF808080" multiline="true" align="center" />
+		</VerticalLayout>
+		
+		<VerticalLayout name="shoukuan_pay_success_layout" visible="false">
+			<HorizontalLayout name="shoukuan_pay_success_logo_wx" height="100" padding="0,20,0,0" visible="false">
+				<Control></Control>
+				<Control bkimage="wx_logo.png" width="100" height="100" align="center"></Control>
+				<Control></Control>
+			</HorizontalLayout>
+			
+			<HorizontalLayout name="shoukuan_pay_success_logo_zhifubao" height="100" padding="0,20,0,0" visible="false">
+				<Control></Control>
+				<Control bkimage="zhifubao_logo.png"  width="100" height="100" align="center"></Control>
+				<Control></Control>
+			</HorizontalLayout>
+			
+			<Label height="40" padding="0,20,0,20" name="shoukuan_pay_success_money" text="成功收款:" font="3" textcolor="0xFF3CB371" align="center"></Label>
+			
+			<Label height="60" padding="20,30,20,0" name="shouyin_pay_success_attention" text="按任意键关闭窗口" font="2" textcolor="0xFF808080" multiline="true" align="center" />
+		</VerticalLayout>
+		
+		<VerticalLayout name="shoukuan_pay_fail_layout" visible="false">
+			<HorizontalLayout height="100" padding="0,20,0,0">
+				<Control></Control>
+				<Control bkimage="pay_fail.png" width="100" height="100" align="center"></Control>
+				<Control></Control>
+			</HorizontalLayout>
+			
+			<Label height="40" padding="0,20,0,20" name="shoukuan_pay_fail_money" text="订单支付失败" font="3" textcolor="0xFFD33E3A" align="center"></Label>
+			
+			<Label height="60" padding="20,30,20,0" name="shouyin_pay_fail_attention" text="" font="2" textcolor="0xFF808080" multiline="true" align="center" />
+		</VerticalLayout>
+    </VerticalLayout>
+</Window>

+ 60 - 0
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -19,6 +19,7 @@
 #include "../wnd/CCanpaiWnd.h"
 #include "../wnd/CWeixinzhifuShoukuanWnd.h"
 #include "../wnd/CHuiyuanShoukuanWnd.h"
+#include "../wnd/CXianjinShoukuanWnd.h"
 
 CDiandanPageUI::CDiandanPageUI()
 {
@@ -452,6 +453,11 @@ void CDiandanPageUI::HandleClickMsg(TNotifyUI& msg)
 		//点击会员收款
 		this->StartHuiyuanShoukuan();
 	}
+	else if (name == L"btn_diandan_xianjinzhifu_pay")
+	{
+		//点击现金收款
+		this->StartXianjinShoukuan();
+	}
 }
 
 //处理option切换事件
@@ -2287,4 +2293,58 @@ std::map<string, string> CDiandanPageUI::GetSendorderParams()
 	params["total_delete_money"] = CLewaimaiString::DoubleToString(m_total_youhui, 2);
 
 	return params;
+}
+
+//开始进行现金收款
+void CDiandanPageUI::StartXianjinShoukuan()
+{
+	if (m_is_show_shoukuan == true)
+	{
+		return;
+	}
+
+	if (m_cur_diandan_order.getItemNum() == 0)
+	{
+		return;
+	}
+
+	CXianjinShoukuanWnd* pShoukuanWnd = new CXianjinShoukuanWnd();
+	if (pShoukuanWnd != NULL)
+	{
+		pShoukuanWnd->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
+		pShoukuanWnd->SetIcon(IDI_ICON_DUILIB);
+		pShoukuanWnd->CenterWindow();
+
+		m_is_show_shoukuan = true;
+
+		std::string format_string = CLewaimaiString::DoubleToString(m_cur_total_price, 2);
+		std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
+		pShoukuanWnd->InitMoney(watchValue);
+
+		//这里要对提交订单的参数进行组装,然后方便请求
+		pShoukuanWnd->SetCommonParams(GetSendorderParams());
+
+		/*
+		if (m_is_start_catch && m_catch_string.length() == 18)
+		{
+			pShoukuanWnd->InitFukuanma(m_catch_string);
+		}
+		}*/
+
+		UINT ret = pShoukuanWnd->ShowModal();
+		if (ret == IDOK)
+		{
+			//说明收款成功了,需要进行一些后续的处理
+
+			//初始化页面信息
+			InitJiesuanInfo();
+
+			//处理打印
+
+		}
+
+		delete pShoukuanWnd;
+
+		m_is_show_shoukuan = false;
+	}
 }

+ 3 - 0
zhipuzi_pos_windows/page/CDiandanPageUI.h

@@ -120,6 +120,9 @@ public:
 	//开始进行会员收款
 	void StartHuiyuanShoukuan();
 
+	//开始进行现金收款
+	void StartXianjinShoukuan();
+
 private:
 	//获取用于提交订单的参数结构
 	std::map<string, string> GetSendorderParams();

+ 152 - 76
zhipuzi_pos_windows/wnd/CHuiyuanShoukuanWnd.cpp

@@ -5,6 +5,8 @@
 
 #include "../helper/CSpeech.h"
 
+#include "../helper/MD5.h"
+
 #define WM_TIMER_WND_CLOSE 200001
 
 void CHuiyuanShoukuanWnd::Init()
@@ -25,6 +27,50 @@ 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);
+
+			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);
+
+			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);
+
+			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);
+
+			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);
+
+			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);
+
+			m_shoukuanModel = 2;
+		}
 	}
 }
 
@@ -445,16 +491,9 @@ LRESULT CHuiyuanShoukuanWnd::OnShoukuanSuccess(UINT uMsg, WPARAM wParam, LPARAM
 
 	CHorizontalLayoutUI* wx_logo = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("shoukuan_pay_success_logo_wx")));
 	CHorizontalLayoutUI* zhifubao_logo = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("shoukuan_pay_success_logo_zhifubao")));
-	if (m_fukuanma_type == 1)
-	{
-		wx_logo->SetVisible(true);
-		zhifubao_logo->SetVisible(false);
-	}
-	else if (m_fukuanma_type == 2 || m_fukuanma_type == 3)
-	{
-		wx_logo->SetVisible(false);
-		zhifubao_logo->SetVisible(true);
-	}
+
+	wx_logo->SetVisible(true);
+	zhifubao_logo->SetVisible(false);
 
 	CLabelUI* attention = static_cast<CLabelUI*>(m_pm.FindControl(_T("shouyin_pay_success_attention")));
 	std::wstring ws_attention = L"按任意键关闭窗口," + to_wstring(m_timer_now) + L" 秒后自动关闭";
@@ -540,64 +579,15 @@ void CHuiyuanShoukuanWnd::StartShoukuan()
 	//先判断收款码的格式是否正确
 	CEditUI* pFukuanmaEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("fukuanma_edit")));
 	std::wstring ws_Fukuanma = pFukuanmaEdit->GetText();
-	std::string s_Fukuanma = CLewaimaiString::UnicodeToUTF8(ws_Fukuanma);
+	m_fukuanma = CLewaimaiString::UnicodeToUTF8(ws_Fukuanma);
 
-	int length = s_Fukuanma.size();
-	if (length != 18 && length != 19)
-	{
-		pLabel->SetText(L"收款码格式不对,请检查后重新输入!");
-		pLabel->SetVisible(true);
+	CEditUI* pShoujihaoEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shoujihao_edit")));
+	std::wstring ws_Shoujihao = pShoujihaoEdit->GetText();
+	m_shoujihao = CLewaimaiString::UnicodeToUTF8(ws_Shoujihao);
 
-		return;
-	}
-
-	for (int i = 0; i < length; i++)
-	{
-		char c = *(s_Fukuanma.c_str() + i);
-		if (isdigit(c) == 0)
-		{
-			//不是数字
-			pLabel->SetText(L"收款码格式不对,请检查后重新输入!");
-			pLabel->SetVisible(true);
-
-			return;
-		}
-	}
-
-	if (s_Fukuanma.find("10") == 0 \
-		|| s_Fukuanma.find("11") == 0 \
-		|| s_Fukuanma.find("12") == 0 \
-		|| s_Fukuanma.find("13") == 0 \
-		|| s_Fukuanma.find("14") == 0 \
-		|| s_Fukuanma.find("15") == 0)
-	{
-		//微信付款码
-		m_fukuanma_type = 1;
-	}
-	else if (s_Fukuanma.find("25") == 0 \
-		|| s_Fukuanma.find("26") == 0 \
-		|| s_Fukuanma.find("27") == 0 \
-		|| s_Fukuanma.find("28") == 0 \
-		|| s_Fukuanma.find("29") == 0 \
-		|| s_Fukuanma.find("30") == 0)
-	{
-		//支付宝付款码
-		m_fukuanma_type = 2;
-	}
-	else if (s_Fukuanma.find("62") == 0)
-	{
-		//云闪付付款码
-		m_fukuanma_type = 3;
-	}
-	else
-	{
-		pLabel->SetText(L"收款码格式不对,请检查后重新输入!");
-		pLabel->SetVisible(true);
-
-		return;
-	}
-
-	m_fukuanma = ws_Fukuanma;
+	CEditUI* pPasswordEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("password_edit")));
+	std::wstring ws_Password = pPasswordEdit->GetText();
+	m_password = CLewaimaiString::UnicodeToUTF8(ws_Password);
 
 	//全部验证通过,就可以开始修改状态了
 	m_shoukuan_status = 1;
@@ -624,8 +614,100 @@ void CHuiyuanShoukuanWnd::HandleShoukuan()
 {
 	//生成随机的order_no
 
-	m_commonParams["zhifu_type"] = to_string(7);
-	m_commonParams["zhifu_code"] = CLewaimaiString::UnicodeToUTF8(m_fukuanma);
+	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::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);
+	}
 
 	std::string response;
 
@@ -701,8 +783,6 @@ void CHuiyuanShoukuanWnd::HandleShoukuan()
 		//支付成功
 		m_shoukuan_status = 3;
 
-		m_out_trade_no = data["trade_no"].GetString();
-
 		SendMessage(WM_SHOUKUAN_STATUS_SUCCESS, 0, 0);
 	}
 	else if (s_status == "fail")
@@ -718,8 +798,6 @@ void CHuiyuanShoukuanWnd::HandleShoukuan()
 	{
 		m_shoukuan_status = 2;
 
-		m_out_trade_no = data["out_trade_no"].GetString();
-
 		//需要查询支付状态
 		SendMessage(WM_SHOUKUAN_STATUS_NEEDPASSWORD, 0, 0);
 	}
@@ -737,7 +815,7 @@ void CHuiyuanShoukuanWnd::HandleShoukuanPassword()
 {
 	std::map<string, string> params;
 
-	params["trade_no"] = m_out_trade_no;
+	params["trade_no"] = "";
 
 	while (m_shoukuan_status == 2)
 	{
@@ -803,8 +881,6 @@ void CHuiyuanShoukuanWnd::HandleShoukuanPassword()
 			//支付成功
 			m_shoukuan_status = 3;
 
-			m_out_trade_no = data["out_trade_no"].GetString();
-
 			SendMessage(WM_SHOUKUAN_STATUS_SUCCESS, 0, 0);
 
 			break;
@@ -848,7 +924,7 @@ void CHuiyuanShoukuanWnd::HandleCancelShoukuan()
 {
 	std::map<string, string> params;
 
-	params["trade_no"] = m_out_trade_no;
+	params["trade_no"] = "";
 
 	std::string response;
 

+ 5 - 11
zhipuzi_pos_windows/wnd/CHuiyuanShoukuanWnd.h

@@ -2,8 +2,6 @@
 
 #include "../pch/pch.h"
 
-class CValueWnd;
-
 class CHuiyuanShoukuanWnd : public CWindowWnd, public INotifyUI, public IMessageFilterUI
 {
 public:
@@ -27,11 +25,6 @@ public:
 		m_pm.RemovePreMessageFilter(this);
 	};
 
-	void setValueWnd(CValueWnd* valueWnd)
-	{
-		m_valueWnd = valueWnd;
-	}
-
 	void Init();
 
 	void Notify(TNotifyUI& msg);
@@ -96,13 +89,12 @@ public:
 public:
 	CPaintManagerUI m_pm;
 
-	CValueWnd* m_valueWnd;
-
 	bool m_is_money_init = false;
 	std::wstring m_money;
 
-	std::wstring m_fukuanma;
-	int m_fukuanma_type; //付款码类型 1:微信支付 2:支付宝 3:其他的
+	std::string m_fukuanma;
+	std::string m_shoujihao;
+	std::string m_password;
 
 	std::string m_order_no;
 	std::string m_out_trade_no;
@@ -116,5 +108,7 @@ public:
 	int m_timer_now = 4;
 
 	std::map<string, string> m_commonParams;
+
+	int m_shoukuanModel = 1; //收款模式 1:会员扫码 2:手机号+密码
 };
 

+ 0 - 9
zhipuzi_pos_windows/wnd/CWeixinzhifuShoukuanWnd.h

@@ -2,8 +2,6 @@
 
 #include "../pch/pch.h"
 
-class CValueWnd;
-
 class CWeixinzhifuShoukuanWnd : public CWindowWnd, public INotifyUI, public IMessageFilterUI
 {
 public:
@@ -27,11 +25,6 @@ public:
 		m_pm.RemovePreMessageFilter(this);
 	};
 
-	void setValueWnd(CValueWnd* valueWnd)
-	{
-		m_valueWnd = valueWnd;
-	}
-
 	void Init();
 
 	void Notify(TNotifyUI& msg);
@@ -96,8 +89,6 @@ public:
 public:
 	CPaintManagerUI m_pm;
 
-	CValueWnd* m_valueWnd;
-
 	bool m_is_money_init = false;
 	std::wstring m_money;
 

+ 968 - 0
zhipuzi_pos_windows/wnd/CXianjinShoukuanWnd.cpp

@@ -0,0 +1,968 @@
+#include "../pch/pch.h"
+#include "CXianjinShoukuanWnd.h"
+
+#include "CMessageboxWnd.h"
+
+#include "../helper/CSpeech.h"
+
+#include "../helper/MD5.h"
+
+#define WM_TIMER_WND_CLOSE 200001
+
+void CXianjinShoukuanWnd::Init()
+{
+	//::SetWindowPos(m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+}
+
+void CXianjinShoukuanWnd::Notify(TNotifyUI& msg)
+{
+	if (msg.sType == _T("click"))
+	{
+		if (msg.pSender->GetName() == _T("closebtn"))
+		{
+			Close(IDCANCEL);
+			return;
+		}
+		else if (msg.pSender->GetName() == _T("shoukuanBtn"))
+		{
+			StartShoukuan();
+		}
+		else if (msg.pSender->GetName() == L"xianjin_kuaijie_10")
+		{
+			//这里直接SetText,不会触发textchange事件
+			CEditUI* pFukuanmaEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shishou_edit")));
+			pFukuanmaEdit->SetText(L"10");
+
+			UpdateZhaoling();
+		}
+		else if (msg.pSender->GetName() == L"xianjin_kuaijie_20")
+		{
+			CEditUI* pFukuanmaEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shishou_edit")));
+			pFukuanmaEdit->SetText(L"20");
+
+			UpdateZhaoling();
+		}
+		else if (msg.pSender->GetName() == L"xianjin_kuaijie_50")
+		{
+			CEditUI* pFukuanmaEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shishou_edit")));
+			pFukuanmaEdit->SetText(L"50");
+
+			UpdateZhaoling();
+		}
+		else if (msg.pSender->GetName() == L"xianjin_kuaijie_100")
+		{
+			CEditUI* pFukuanmaEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shishou_edit")));
+			pFukuanmaEdit->SetText(L"100");
+
+			UpdateZhaoling();
+		}
+		else if (msg.pSender->GetName() == L"xianjin_kuaijie_200")
+		{
+			CEditUI* pFukuanmaEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shishou_edit")));
+			pFukuanmaEdit->SetText(L"200");
+
+			UpdateZhaoling();
+		}
+	}
+	else if (msg.sType == _T("textchanged"))
+	{
+		//只能输入数字,其他的全部删除
+		CEditUI* m_pEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shishou_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;
+				}
+			}
+
+			UpdateZhaoling();
+		}
+	}
+}
+
+LRESULT CXianjinShoukuanWnd::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("xianjin_shoukuan_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;
+}
+
+LRESULT CXianjinShoukuanWnd::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	//销毁定时器
+	KillTimer(m_hWnd, WM_TIMER_WND_CLOSE);
+
+	bHandled = FALSE;
+	return 0;
+}
+
+/*
+ *这个是窗口被销毁的时候调用的
+ **/
+LRESULT CXianjinShoukuanWnd::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	bHandled = FALSE;
+	return 0;
+}
+
+LRESULT CXianjinShoukuanWnd::OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	if (::IsIconic(*this))
+	{
+		bHandled = FALSE;
+	}
+
+	return (wParam == 0) ? TRUE : FALSE;
+}
+
+LRESULT CXianjinShoukuanWnd::OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	return 0;
+}
+
+LRESULT CXianjinShoukuanWnd::OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	UpdateFocus();
+
+	return 0;
+}
+
+LRESULT CXianjinShoukuanWnd::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 CXianjinShoukuanWnd::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 CXianjinShoukuanWnd::OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	bHandled = TRUE;
+
+	return 0;
+}
+
+LRESULT CXianjinShoukuanWnd::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	if (wParam != WM_TIMER_WND_CLOSE)
+	{
+		bHandled = FALSE;
+		return 0;
+	}
+
+	if (m_shoukuan_status == 0 || m_shoukuan_status == 1)
+	{
+	}
+	else if (m_shoukuan_status == 2)
+	{
+	}
+	else if (m_shoukuan_status == 3)
+	{
+		m_timer_now--;
+
+		if (m_timer_now > 0)
+		{
+			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());
+		}
+		else
+		{
+			Close(IDOK);
+		}
+	}
+	else if (m_shoukuan_status == 4)
+	{
+		m_timer_now--;
+
+		if (m_timer_now > 0)
+		{
+			CLabelUI* pFailMessage = static_cast<CLabelUI*>(m_pm.FindControl(_T("shouyin_pay_fail_attention")));
+
+			std::wstring ws_fail_message = L"失败信息:" + m_fail_message + L",按任意键关闭窗口,";
+			std::wstring ws_attention = ws_fail_message + to_wstring(m_timer_now) + L" 秒后自动关闭";
+
+			pFailMessage->SetText(ws_attention.c_str());
+		}
+		else
+		{
+			Close(IDCANCEL);
+		}
+	}
+
+	bHandled = TRUE;
+
+	return 0;
+}
+
+LRESULT CXianjinShoukuanWnd::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_CLOSE:
+		lRes = OnClose(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_DESTROY:
+		lRes = OnDestroy(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;
+	case WM_MOUSEHOVER:
+		lRes = OnMouseMove(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_SHOUKUAN_STATUS_NEEDPASSWORD:
+		lRes = OnShoukuanNeedPassword(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_SHOUKUAN_STATUS_SUCCESS:
+		lRes = OnShoukuanSuccess(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_SHOUKUAN_STATUS_FAIL:
+		lRes = OnShoukuanFail(uMsg, wParam, lParam, bHandled);
+		break;
+	case WM_TIMER:
+		lRes = OnTimer(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 CXianjinShoukuanWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
+{
+	if (uMsg == WM_KEYDOWN)
+	{
+		if (wParam == VK_RETURN)
+		{
+			if (m_shoukuan_status == 0)
+			{
+				StartShoukuan();
+			}
+			else if (m_shoukuan_status == 1 || m_shoukuan_status == 2 || m_shoukuan_status == 5)
+			{
+				//正在支付的过程中,这个时候按Enter键,不做任何处理
+			}
+			else if (m_shoukuan_status == 3)
+			{
+				//已经明确成功或者失败了,那么久直接关闭就可以了
+				Close(IDOK);
+			}
+			else if (m_shoukuan_status == 4)
+			{
+				Close(IDCANCEL);
+			}
+
+			return true;
+		}
+		else if (wParam == VK_ESCAPE)
+		{
+			if (m_shoukuan_status == 0)
+			{
+				//还没开始支付,按Esc直接退出
+				Close(IDCANCEL);
+			}
+			else if (m_shoukuan_status == 1 || m_shoukuan_status == 5)
+			{
+				//不能做任何处理
+			}
+			else if (m_shoukuan_status == 2)
+			{
+				//查询密码的过程中,取消付款
+				CancelShoukuanPassword();
+			}
+			else if (m_shoukuan_status == 3)
+			{
+				Close(IDOK);
+			}
+			else if (m_shoukuan_status == 4)
+			{
+				Close(IDCANCEL);
+			}
+
+			return true;
+		}
+
+		if (m_shoukuan_status == 3)
+		{
+			Close(IDOK);
+
+			return true;
+		}
+		else if (m_shoukuan_status == 4)
+		{
+			Close(IDCANCEL);
+
+			return true;
+		}
+	}
+
+	return false;
+}
+
+void CXianjinShoukuanWnd::InitMoney(std::wstring value)
+{
+	CHorizontalLayoutUI* pInputLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("shoukuan_money_input_layout")));
+	pInputLayout->SetVisible(false);
+
+	CHorizontalLayoutUI* pShowLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("shoukuan_money_show_layout")));
+	pShowLayout->SetVisible(true);
+
+	CLabelUI* pMoneyLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("shoukuan_money_show_money")));
+	if (pMoneyLabel)
+	{
+		pMoneyLabel->SetText(value.c_str());
+	}
+
+	m_is_money_init = true;
+	m_money = value;
+}
+
+void CXianjinShoukuanWnd::InitFukuanma(std::string fukuanma)
+{
+	std::wstring ws_fukuanma = CLewaimaiString::UTF8ToUnicode(fukuanma);
+
+	CLabelUI* pFukuanmaLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("shishou_edit")));
+	if (pFukuanmaLabel)
+	{
+		pFukuanmaLabel->SetText(ws_fukuanma.c_str());
+	}
+
+	std::string shoukuan_setting_mianqueren = CSetting::GetParam("shoukuan_setting_mianqueren");
+	if (shoukuan_setting_mianqueren == "1")
+	{
+		if (m_is_money_init)
+		{
+			//如果金额也是初始化好的,可以直接支付了
+			this->StartShoukuan();
+		}
+	}
+}
+
+void CXianjinShoukuanWnd::SetCommonParams(std::map<string, string> params)
+{
+	m_commonParams = params;
+}
+
+void CXianjinShoukuanWnd::UpdateFocus()
+{
+	if (m_is_money_init == false)
+	{
+		//如果没初始化,这个时候有2个编辑框,不能抢焦点
+		CEditUI* pMoneyEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("money_edit")));
+
+		pMoneyEdit->SetFocus();
+
+		//下一个焦点的,就设置为这个控件
+		m_pm.SetFocusNeeded(pMoneyEdit);
+
+		//这个干嘛的不知道,但是不加好像不行
+		m_pm.SetNextTabControl(false);
+	}
+	else
+	{
+		CEditUI* pFukuanEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shishou_edit")));
+
+		pFukuanEdit->SetFocus();
+	}
+}
+
+LRESULT CXianjinShoukuanWnd::OnShoukuanNeedPassword(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	wstring path = CSystem::GetProgramDir() + L"\\music\\pay_password.wav";
+
+	if (CSetting::GetParam("shoukuan_setting_yuyinbobao") == "1")
+	{
+		PlaySound(path.c_str(), NULL, SND_FILENAME | SND_ASYNC);
+	}
+
+	CLabelUI* pFukuanEdit = static_cast<CLabelUI*>(m_pm.FindControl(_T("shoukuan_paying_status")));
+	pFukuanEdit->SetText(L"用户支付中,需要输入密码");
+
+	//需要用户输入密码,开始查询状态
+	std::thread(&CXianjinShoukuanWnd::HandleShoukuanPassword, this).detach();
+
+	bHandled = TRUE;
+	return 0;
+}
+
+LRESULT CXianjinShoukuanWnd::OnShoukuanSuccess(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	//判断是否要打印
+	/*
+	int dayinji_setting_auto_print = atoi(CSetting::GetParam("system_setting_dayinji_setting_auto_print").c_str());
+	if (dayinji_setting_auto_print == 1)
+	{
+		m_valueWnd->PrintZhifu(m_out_trade_no);
+	}
+	}*/
+
+	//播放收款成功的金额
+	//if (CSetting::GetParam("shoukuan_setting_yuyinbobao") == "1")
+	//{
+	std::thread(&CXianjinShoukuanWnd::ReadShoukuanValue, this).detach();
+	//}
+
+	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());
+
+	CHorizontalLayoutUI* wx_logo = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("shoukuan_pay_success_logo_wx")));
+	CHorizontalLayoutUI* zhifubao_logo = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("shoukuan_pay_success_logo_zhifubao")));
+
+	wx_logo->SetVisible(true);
+	zhifubao_logo->SetVisible(false);
+
+	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 CXianjinShoukuanWnd::OnShoukuanFail(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+	wstring path = CSystem::GetProgramDir() + L"\\music\\pay_fail.wav";
+
+	//if (CSetting::GetParam("shoukuan_setting_yuyinbobao") == "1")
+	//{
+	PlaySound(path.c_str(), NULL, SND_FILENAME | SND_ASYNC);
+	//}
+
+	CVerticalLayoutUI* paying_layout = static_cast<CVerticalLayoutUI*>(m_pm.FindControl(_T("shoukuan_paying_layout")));
+	paying_layout->SetVisible(false);
+
+	CVerticalLayoutUI* pay_fail_layout = static_cast<CVerticalLayoutUI*>(m_pm.FindControl(_T("shoukuan_pay_fail_layout")));
+	pay_fail_layout->SetVisible(true);
+
+	CHorizontalLayoutUI* title_layout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("shoukuan_title_bkg")));
+	title_layout->SetBkColor(0xFFD33E3A);
+
+	CLabelUI* pFailMessage = static_cast<CLabelUI*>(m_pm.FindControl(_T("shouyin_pay_fail_attention")));
+
+	std::wstring ws_fail_message = L"失败信息:" + m_fail_message + L",按任意键关闭窗口,";
+	std::wstring ws_attention = ws_fail_message + to_wstring(m_timer_now) + L" 秒后自动关闭";
+
+	pFailMessage->SetText(ws_attention.c_str());
+
+	SetTimer(m_hWnd, WM_TIMER_WND_CLOSE, 1000, NULL);
+
+	SetFocus(m_hWnd);
+
+	bHandled = TRUE;
+	return 0;
+}
+
+void CXianjinShoukuanWnd::StartShoukuan()
+{
+	CLabelUI* pLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("shoukuanresult")));
+
+	//检查收款金额
+	if (m_is_money_init == false)
+	{
+		CEditUI* pMoneyEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("money_edit")));
+		m_money = pMoneyEdit->GetText();
+
+		if (m_money == L"")
+		{
+			pLabel->SetText(L"收款金额不能为空,请重新输入!");
+			pLabel->SetVisible(true);
+
+			return;
+		}
+
+		if (m_money == L"0.00")
+		{
+			pLabel->SetText(L"收款金额不能为 0 元,请重新输入!");
+			pLabel->SetVisible(true);
+
+			return;
+		}
+
+		double money_value = atof(CLewaimaiString::UnicodeToUTF8(m_money).c_str());
+		if (!money_value || money_value < 0.01)
+		{
+			pLabel->SetText(L"收款金额错误,请重新输入!");
+			pLabel->SetVisible(true);
+
+			return;
+		}
+	}
+
+	CEditUI* pShishouEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shishou_edit")));
+	std::wstring ws_Shishou = pShishouEdit->GetText();
+	m_shishou = CLewaimaiString::UnicodeToUTF8(ws_Shishou);
+
+	double money_value = atof(CLewaimaiString::UnicodeToUTF8(m_money).c_str());
+	double shishou_value = atof(m_shishou.c_str());
+
+	if (shishou_value < money_value)
+	{
+		pLabel->SetText(L"实收金额不能小于应付金额!");
+		pLabel->SetVisible(true);
+
+		return;
+	}
+
+	//全部验证通过,就可以开始修改状态了
+	m_shoukuan_status = 1;
+
+	//不加这个的话,edit按回车之后样式有问题
+	SetFocus(m_hWnd);
+
+	CVerticalLayoutUI* before_pay_layout = static_cast<CVerticalLayoutUI*>(m_pm.FindControl(_T("shoukuan_before_pay_layout")));
+	before_pay_layout->SetVisible(false);
+
+	CVerticalLayoutUI* paying_layout = static_cast<CVerticalLayoutUI*>(m_pm.FindControl(_T("shoukuan_paying_layout")));
+	paying_layout->SetVisible(true);
+
+	CLabelUI* pMoneyPaying = static_cast<CLabelUI*>(m_pm.FindControl(_T("shoukuan_paying_money")));
+
+	std::wstring valueInfo = L"付款金额:¥" + m_money;
+	pMoneyPaying->SetText(valueInfo.c_str());
+
+	//开启一个线程,开始处理登录
+	std::thread(&CXianjinShoukuanWnd::HandleShoukuan, this).detach();
+}
+
+void CXianjinShoukuanWnd::HandleShoukuan()
+{
+	//生成随机的order_no
+
+	m_commonParams["zhifu_type"] = to_string(0);
+	m_commonParams["zhifu_code"] = "";
+	m_commonParams["shishou_value"] = m_shishou;
+	m_commonParams["zhaoling_value"] = m_zhaoling;
+	
+	std::string response;
+
+	std::string url = "/diancan/sendorder";
+	bool ret = CZhipuziHttpClient::Request(url.c_str(), m_commonParams, 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& data = document["data"];
+	rapidjson::Value& status = data["status"];
+
+	std::string s_status = status.GetString();
+
+	if (s_status == "success")
+	{
+		//支付成功
+		m_shoukuan_status = 3;
+
+		SendMessage(WM_SHOUKUAN_STATUS_SUCCESS, 0, 0);
+	}
+	else if (s_status == "fail")
+	{
+		//支付失败
+		m_shoukuan_status = 4;
+
+		m_fail_message = CLewaimaiString::UTF8ToUnicode(data["message"].GetString());
+
+		SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+	}
+	else if (s_status == "password")
+	{
+		m_shoukuan_status = 2;
+
+		//需要查询支付状态
+		SendMessage(WM_SHOUKUAN_STATUS_NEEDPASSWORD, 0, 0);
+	}
+	else
+	{
+		m_shoukuan_status = 4;
+
+		m_fail_message = L"服务器错误";
+
+		SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+	}
+}
+
+void CXianjinShoukuanWnd::HandleShoukuanPassword()
+{
+	std::map<string, string> params;
+
+	params["trade_no"] = "";
+
+	while (m_shoukuan_status == 2)
+	{
+		std::string response;
+
+		std::string url = "/diancan/queryorderstatus";
+		bool ret = CZhipuziHttpClient::Request(url.c_str(), params, 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") || !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& v_errcode = document["errcode"];
+		int errcode = v_errcode.GetInt();
+		if (errcode != 0)
+		{
+			LOG_INFO("response failed! message:" << document["errmsg"].GetString());
+			m_shoukuan_status = 4;
+
+			m_fail_message = L"服务器错误";
+
+			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+			return;
+		}
+
+		rapidjson::Value& data = document["data"];
+		rapidjson::Value& status = data["status"];
+
+		std::string s_status = status.GetString();
+
+		if (s_status == "success")
+		{
+			//支付成功
+			m_shoukuan_status = 3;
+
+			SendMessage(WM_SHOUKUAN_STATUS_SUCCESS, 0, 0);
+
+			break;
+		}
+		else if (s_status == "closed")
+		{
+			//表示顾客那边出问题,已经失败了
+			m_shoukuan_status = 4;
+
+			m_fail_message = L"顾客取消支付,请重新扫码收款";
+
+			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+
+			break;
+		}
+		else if (s_status == "fail")
+		{
+			//这个只是表示状态未知
+			Sleep(1000);
+		}
+		else
+		{
+			m_shoukuan_status = 4;
+
+			m_fail_message = L"服务器错误";
+
+			SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+			break;
+		}
+	}
+}
+
+void CXianjinShoukuanWnd::CancelShoukuanPassword()
+{
+	m_shoukuan_status = 5;
+
+	std::thread(&CXianjinShoukuanWnd::HandleCancelShoukuan, this).detach();
+}
+
+void CXianjinShoukuanWnd::HandleCancelShoukuan()
+{
+	std::map<string, string> params;
+
+	params["trade_no"] = "";
+
+	std::string response;
+
+	std::string url = "/diancan/closeorder";
+	bool ret = CZhipuziHttpClient::Request(url.c_str(), params, 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") || !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& v_errcode = document["errcode"];
+	int errcode = v_errcode.GetInt();
+	if (errcode != 0)
+	{
+		LOG_INFO("response failed! message:" << document["errmsg"].GetString());
+		m_shoukuan_status = 4;
+
+		m_fail_message = L"服务器错误";
+
+		SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+		return;
+	}
+
+	rapidjson::Value& data = document["data"];
+	rapidjson::Value& status = data["status"];
+
+	std::string s_status = status.GetString();
+
+	if (s_status == "success")
+	{
+		//取消成功,订单变为失败状态
+		m_shoukuan_status = 4;
+
+		m_fail_message = L"商家取消收款";
+		SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+	}
+
+	m_shoukuan_status = 4;
+
+	m_fail_message = L"服务器错误";
+
+	SendMessage(WM_SHOUKUAN_STATUS_FAIL, 0, 0);
+}
+
+bool CXianjinShoukuanWnd::IsCanClose()
+{
+	if (m_shoukuan_status == 0 || m_shoukuan_status == 3 || m_shoukuan_status == 4)
+	{
+		return true;
+	}
+
+	return false;
+}
+
+void CXianjinShoukuanWnd::ReadShoukuanValue()
+{
+	CSpeech::SpeakNum(1, CLewaimaiString::UnicodeToUTF8(m_money));
+}
+
+
+void CXianjinShoukuanWnd::UpdateZhaoling()
+{
+	CEditUI* pFukuanmaEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("shishou_edit")));
+	std::wstring ws_shishou = pFukuanmaEdit->GetText();
+	std::string s_shishou = CLewaimaiString::UnicodeToUTF8(ws_shishou);
+
+	double shishiou = atof(s_shishou.c_str());
+
+	double yingshou = atof(CLewaimaiString::UnicodeToUTF8(m_money).c_str());
+
+	double zhaoling = shishiou - yingshou;
+
+	m_zhaoling = CLewaimaiString::DoubleToString(zhaoling, 2);
+
+	CLabelUI* pZhaolingLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("xianjin_zhaoling_label")));
+
+	std::wstring zhaoling_value = CLewaimaiString::UTF8ToUnicode(m_zhaoling) + L"元";
+
+	pZhaolingLabel->SetText(zhaoling_value.c_str());
+}

+ 114 - 0
zhipuzi_pos_windows/wnd/CXianjinShoukuanWnd.h

@@ -0,0 +1,114 @@
+#pragma once
+
+#include "../pch/pch.h"
+
+class CXianjinShoukuanWnd : public CWindowWnd, public INotifyUI, public IMessageFilterUI
+{
+public:
+	CXianjinShoukuanWnd()
+	{
+
+	}
+
+	LPCTSTR GetWindowClassName() const
+	{
+		return _T("UIShoukuanFrame");
+	};
+
+	UINT GetClassStyle() const
+	{
+		return UI_CLASSSTYLE_DIALOG;
+	};
+
+	void OnFinalMessage(HWND /*hWnd*/)
+	{
+		m_pm.RemovePreMessageFilter(this);
+	};
+
+	void Init();
+
+	void Notify(TNotifyUI& msg);
+
+	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnShoukuanNeedPassword(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnShoukuanSuccess(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnShoukuanFail(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+	LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
+
+	void InitMoney(std::wstring value);
+
+	void InitFukuanma(std::string fukuanma);
+
+	void SetCommonParams(std::map<string, string> params);
+
+	void UpdateFocus();
+
+	//点击确认,开始执行收款
+	void StartShoukuan();
+
+	//处理收款
+	void HandleShoukuan();
+
+	//处理收款的密码查询
+	void HandleShoukuanPassword();
+
+	//取消查询密码
+	void CancelShoukuanPassword();
+
+	//处理取消收款
+	void HandleCancelShoukuan();
+
+	bool IsCanClose();
+
+	void ReadShoukuanValue();
+
+	void UpdateZhaoling();
+
+public:
+	CPaintManagerUI m_pm;
+
+	bool m_is_money_init = false;
+	std::wstring m_money;
+
+	std::string m_shishou;
+
+	std::string m_order_no;
+	std::string m_out_trade_no;
+
+	//收款状态 0:未开始 1:请求发给服务器了,但是暂时还没得到反馈 2:查询密码中 3:成功 4:失败 5:正在取消支付
+	int m_shoukuan_status = 0;
+
+	std::wstring m_fail_message;
+
+	//窗口关闭的定时器时间
+	int m_timer_now = 4;
+
+	std::map<string, string> m_commonParams;
+
+	std::string m_zhaoling;
+};
+

+ 2 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -225,6 +225,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClInclude Include="wnd\CXianjinShoukuanWnd.h" />
     <ClInclude Include="wnd\CHuiyuanShoukuanWnd.h" />
     <ClInclude Include="helper\CSpeech.h" />
     <ClInclude Include="wnd\CCanpaiWnd.h" />
@@ -286,6 +287,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="helper\CSystem.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="wnd\CXianjinShoukuanWnd.cpp" />
     <ClCompile Include="wnd\CHuiyuanShoukuanWnd.cpp" />
     <ClCompile Include="helper\CSpeech.cpp" />
     <ClCompile Include="wnd\CCanpaiWnd.cpp" />

+ 6 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -192,6 +192,9 @@
     <ClInclude Include="wnd\CHuiyuanShoukuanWnd.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="wnd\CXianjinShoukuanWnd.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">
@@ -347,6 +350,9 @@
     <ClCompile Include="wnd\CHuiyuanShoukuanWnd.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="wnd\CXianjinShoukuanWnd.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="resource\zhipuzi.ico">