张洋 1 month ago
parent
commit
05ceaf27a1

+ 10 - 8
bin/Win32/Debug/zhipuzi_pos_windows/skin/huiyuan_shoukuan_wnd.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<Window size="800,660" caption="0,0,0,44" roundcorner="4,4" shadowsize="3" showshadow="true">
+<Window size="700,560" caption="0,0,0,44" roundcorner="4,4" shadowsize="3" showshadow="true">
 	<Font id="0" name="微软雅黑" size="24" />
 	<Font id="0" name="微软雅黑" size="24" />
 	<Font id="1" name="微软雅黑" size="40" />
 	<Font id="1" name="微软雅黑" size="40" />
 	<Font id="2" name="微软雅黑" size="18" />
 	<Font id="2" name="微软雅黑" size="18" />
@@ -11,15 +11,17 @@
 		</HorizontalLayout>
 		</HorizontalLayout>
 		
 		
 		<VerticalLayout visible="true" name="shoukuan_before_pay_layout" padding="0,0,0,0">			
 		<VerticalLayout visible="true" name="shoukuan_before_pay_layout" padding="0,0,0,0">			
-			<HorizontalLayout name="shoukuan_money_show_layout" height="50" padding="0,15,0,15">
-				<Label text="¥" font="0" textcolor="0xFF3CB371" float="true" pos="320,24,335,50"/>
-				<Label name="shoukuan_money_show_money" font="1" textcolor="0xFF3CB371" float="true" pos="345,12,620,48"/>
+			<HorizontalLayout name="shoukuan_money_show_layout" height="50" padding="0,25,0,15">\
+				<Control></Control>
+				<Label text="¥" font="34" textcolor="0xFF3CB371" width="25"/>
+				<Label name="shoukuan_money_show_money" font="34" textcolor="0xFF3CB371" width="130"/>
+				<Control></Control>
 			</HorizontalLayout>
 			</HorizontalLayout>
 			
 			
-			<Label name="huiyuan_num" text="会员卡号:" heiht="30" padding="250,50,10,10"></Label>
-			<Label name="huiyuan_yue" text="当前余额:" heiht="30" padding="250,10,10,10"></Label>
-			<Label name="huiyuan_name" text="会员姓名:" heiht="30" padding="250,10,10,10"></Label>
-			<Label name="huiyuan_levelname" text="会员级别:" heiht="30" padding="250,10,10,10"></Label>
+			<Label name="huiyuan_num" text="会员卡号:" height="30" padding="250,20,10,10"></Label>
+			<Label name="huiyuan_yue" text="当前余额:" height="30" padding="250,10,10,10"></Label>
+			<Label name="huiyuan_name" text="会员姓名:" height="30" padding="250,10,10,10"></Label>
+			<Label name="huiyuan_levelname" text="会员级别:" height="30" padding="250,10,10,10"></Label>
 			
 			
 			<Label height="60" padding="20,50,20,0" name="shouyin_paying_attention" text="确认使用当前登录会员进行支付吗?" font="2" textcolor="0xFF808080" wordbreak="true" align="center" />
 			<Label height="60" padding="20,50,20,0" name="shouyin_paying_attention" text="确认使用当前登录会员进行支付吗?" font="2" textcolor="0xFF808080" wordbreak="true" align="center" />
 			
 			

+ 10 - 2
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -370,7 +370,7 @@ void CDiandanPageUI::InitFoodShow()
 	{
 	{
 		//选择的是套餐分类
 		//选择的是套餐分类
 		CSqlite3 sqlite;
 		CSqlite3 sqlite;
-		std::vector<CFoodpackage> foodlist = sqlite.GetFoodpackages(true);
+		std::vector<CFoodpackage> foodlist = sqlite.GetFoodpackages();
 
 
 		for (std::vector<CFoodpackage>::iterator it = foodlist.begin(); it != foodlist.end(); it++)
 		for (std::vector<CFoodpackage>::iterator it = foodlist.begin(); it != foodlist.end(); it++)
 		{
 		{
@@ -2526,6 +2526,9 @@ void CDiandanPageUI::ClickMemberLogin()
 		}
 		}
 		else
 		else
 		{
 		{
+			//关闭窗口,会员未成功登陆
+			m_is_member = false;
+
 			m_is_show_modal_wnd = false;
 			m_is_show_modal_wnd = false;
 			delete pMemberLoginDlg;
 			delete pMemberLoginDlg;
 
 
@@ -3250,8 +3253,13 @@ void CDiandanPageUI::StartHuiyuanShoukuan()
 
 
 	if (m_is_member == false)
 	if (m_is_member == false)
 	{
 	{
-		m_pMainWnd->ShowToast(L"请先登录会员再使用会员支付");
+		//会员还没登录,提示先登录会员
+		this->ClickMemberLogin();
+	}
 
 
+	if (m_is_member == false)
+	{
+		//说明会员没有成功登陆
 		return;
 		return;
 	}
 	}
 
 

+ 9 - 1
zhipuzi_pos_windows/page/CSaomashouyinPageUI.cpp

@@ -2048,6 +2048,9 @@ void CSaomashouyinPageUI::ClickMemberLogin()
 		}
 		}
 		else
 		else
 		{
 		{
+			//说明会员登录失败了
+			m_is_member = false;
+
 			m_is_show_modal_wnd = false;
 			m_is_show_modal_wnd = false;
 			delete pMemberLoginDlg;
 			delete pMemberLoginDlg;
 
 
@@ -2725,8 +2728,13 @@ void CSaomashouyinPageUI::StartHuiyuanShoukuan()
 
 
 	if (m_is_member == false)
 	if (m_is_member == false)
 	{
 	{
-		m_pMainWnd->ShowToast(L"请先登录会员再使用会员支付");
+		//会员还没登录,提示先登录会员
+		this->ClickMemberLogin();
+	}
 
 
+	if (m_is_member == false)
+	{
+		//说明会员没有成功登陆
 		return;
 		return;
 	}
 	}
 
 

+ 1 - 1
zhipuzi_pos_windows/page/CYubaozhuangbiaoqianPageUI.cpp

@@ -342,7 +342,7 @@ void CYubaozhuangbiaoqianPageUI::InitFoodShow()
 	{
 	{
 		//选择的是套餐分类
 		//选择的是套餐分类
 		CSqlite3 sqlite;
 		CSqlite3 sqlite;
-		std::vector<CFoodpackage> foodlist = sqlite.GetFoodpackages(true);
+		std::vector<CFoodpackage> foodlist = sqlite.GetFoodpackages();
 
 
 		for (std::vector<CFoodpackage>::iterator it = foodlist.begin(); it != foodlist.end(); it++)
 		for (std::vector<CFoodpackage>::iterator it = foodlist.begin(); it != foodlist.end(); it++)
 		{
 		{

+ 11 - 3
zhipuzi_pos_windows/page/CZhengcanDiandanPageUI.cpp

@@ -426,7 +426,7 @@ void CZhengcanDiandanPageUI::InitFoodShow()
 	{
 	{
 		//选择的是套餐分类
 		//选择的是套餐分类
 		CSqlite3 sqlite;
 		CSqlite3 sqlite;
-		std::vector<CFoodpackage> foodlist = sqlite.GetFoodpackages(true);
+		std::vector<CFoodpackage> foodlist = sqlite.GetFoodpackages();
 
 
 		for (std::vector<CFoodpackage>::iterator it = foodlist.begin(); it != foodlist.end(); it++)
 		for (std::vector<CFoodpackage>::iterator it = foodlist.begin(); it != foodlist.end(); it++)
 		{
 		{
@@ -3013,6 +3013,9 @@ void CZhengcanDiandanPageUI::ClickMemberLogin()
 		}
 		}
 		else
 		else
 		{
 		{
+			//这说明会员登录失败了
+			m_is_member = false;
+
 			m_is_show_modal_wnd = false;
 			m_is_show_modal_wnd = false;
 			delete pMemberLoginDlg;
 			delete pMemberLoginDlg;
 
 
@@ -3766,8 +3769,13 @@ void CZhengcanDiandanPageUI::StartHuiyuanShoukuan()
 
 
 	if (m_is_member == false)
 	if (m_is_member == false)
 	{
 	{
-		m_pMainWnd->ShowToast(L"请先登录会员再使用会员支付");
+		//会员还没登录,提示先登录会员
+		this->ClickMemberLogin();
+	}
 
 
+	if (m_is_member == false)
+	{
+		//说明会员没有成功登陆
 		return;
 		return;
 	}
 	}
 
 
@@ -4764,4 +4772,4 @@ void CZhengcanDiandanPageUI::XianshiYouhui()
 	this->FindSubControl(L"diandan_jiesuan_xianshiyouhui_btn")->SetVisible(false);
 	this->FindSubControl(L"diandan_jiesuan_xianshiyouhui_btn")->SetVisible(false);
 
 
 	UpdateJiesuanZhifuPos();
 	UpdateJiesuanZhifuPos();
-}
+}

+ 6 - 35
zhipuzi_pos_windows/tool/CSqlite3.cpp

@@ -1175,20 +1175,11 @@ int CSqlite3::GetFoodpackageNum()
 	return count;
 	return count;
 }
 }
 
 
-std::vector<CFoodType> CSqlite3::GetFoodtypes(bool is_shouyinji_show)
+std::vector<CFoodType> CSqlite3::GetFoodtypes()
 {
 {
 	std::vector<CFoodType> data;
 	std::vector<CFoodType> data;
 
 
-	std::string sql;
-	
-	if (is_shouyinji_show)
-	{
-		sql = "SELECT * FROM pos_foodtype WHERE is_shouyinji_show = '1';";
-	}
-	else
-	{
-		sql = "SELECT * FROM pos_foodtype;";
-	}
+	std::string sql = "SELECT * FROM pos_foodtype WHERE is_shouyinji_show = '1';";
 	
 	
 	sqlite3_stmt * stmt = NULL;
 	sqlite3_stmt * stmt = NULL;
 
 
@@ -1452,25 +1443,14 @@ std::vector<CFood> CSqlite3::GetFoodForTiaomacheng()
 	return data;
 	return data;
 }
 }
 
 
-std::vector<CFood> CSqlite3::GetFoodByFoodname(std::string foodname, bool is_shouyinji_show)
+std::vector<CFood> CSqlite3::GetFoodByFoodname(std::string foodname)
 {
 {
 	std::vector<CFood> data;
 	std::vector<CFood> data;
 
 
-	std::string sql;
+	std::string sql = "SELECT * FROM pos_food WHERE name LIKE '%" + foodname + "%' AND status='NORMAL' AND is_shouyinji_show = '1' ORDER BY tag";
 
 
 	foodname = CLewaimaiString::SqlZhuanyi(foodname);
 	foodname = CLewaimaiString::SqlZhuanyi(foodname);
 
 
-	if (is_shouyinji_show)
-	{
-		sql = "SELECT * FROM pos_food WHERE name LIKE '%" + foodname + "%' AND status='NORMAL' AND is_shouyinji_show = '1'";
-	}
-	else
-	{
-		sql = "SELECT * FROM pos_food WHERE name LIKE '%" + foodname + "%' AND status='NORMAL'";
-	}
-
-	sql += " ORDER BY tag";
-
 	sqlite3_stmt * stmt = NULL;
 	sqlite3_stmt * stmt = NULL;
 
 
 	if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
 	if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
@@ -1526,20 +1506,11 @@ std::vector<CFood> CSqlite3::GetFoodByFoodname(std::string foodname, bool is_sho
 	return data;
 	return data;
 }
 }
 
 
-std::vector<CFoodpackage> CSqlite3::GetFoodpackages(bool is_shouyinji_show)
+std::vector<CFoodpackage> CSqlite3::GetFoodpackages()
 {
 {
 	std::vector<CFoodpackage> data;
 	std::vector<CFoodpackage> data;
 
 
-	std::string sql;
-
-	if (is_shouyinji_show)
-	{
-		sql = "SELECT * FROM pos_foodpackage WHERE status='NORMAL' AND is_shouyinji_show = '1' ORDER BY tag";
-	}
-	else
-	{
-		sql = "SELECT * FROM pos_foodpackage WHERE status='NORMAL' ORDER BY tag";
-	}
+	std::string sql = "SELECT * FROM pos_foodpackage WHERE status='NORMAL' AND is_shouyinji_show = '1' ORDER BY tag";
 
 
 	sqlite3_stmt * stmt = NULL;
 	sqlite3_stmt * stmt = NULL;
 
 

+ 3 - 3
zhipuzi_pos_windows/tool/CSqlite3.h

@@ -41,7 +41,7 @@ public:
 	int GetFoodpackageNum();
 	int GetFoodpackageNum();
 
 
 	//获取所有分类信息
 	//获取所有分类信息
-	std::vector<CFoodType> GetFoodtypes(bool is_shouyinji_show = true);
+	std::vector<CFoodType> GetFoodtypes();
 
 
 	bool GetFoodtypeById(std::string foodtype_id, CFoodType& newFoodType);
 	bool GetFoodtypeById(std::string foodtype_id, CFoodType& newFoodType);
 
 
@@ -55,9 +55,9 @@ public:
 	std::vector<CFood> GetFoodForTiaomacheng();
 	std::vector<CFood> GetFoodForTiaomacheng();
 
 
 	//用于商品搜索
 	//用于商品搜索
-	std::vector<CFood> GetFoodByFoodname(std::string foodname, bool is_shouyinji_show = true);
+	std::vector<CFood> GetFoodByFoodname(std::string foodname);
 
 
-	std::vector<CFoodpackage> GetFoodpackages(bool is_shouyinji_show = true);
+	std::vector<CFoodpackage> GetFoodpackages();
 
 
 	//通过商品ID查找商品,如果找到返回true,找不到返回false
 	//通过商品ID查找商品,如果找到返回true,找不到返回false
 	bool GetFoodById(std::string food_id, CFood& newFood);
 	bool GetFoodById(std::string food_id, CFood& newFood);

+ 4 - 1
zhipuzi_pos_windows/wnd/CHuiyuanChongzhiWnd.cpp

@@ -1431,6 +1431,7 @@ void CHuiyuanChongzhiWnd::InitJiesuanZhifu()
 		pZhifufangshiLayout->RemoveAt(num);
 		pZhifufangshiLayout->RemoveAt(num);
 	}
 	}
 
 
+	/*
 	//接着添加自定义支付的
 	//接着添加自定义支付的
 	for (std::vector<SelfPay>::iterator it = CShopinfo::GetInstance()->m_self_pay.begin(); it != CShopinfo::GetInstance()->m_self_pay.end(); it++)
 	for (std::vector<SelfPay>::iterator it = CShopinfo::GetInstance()->m_self_pay.begin(); it != CShopinfo::GetInstance()->m_self_pay.end(); it++)
 	{
 	{
@@ -1460,6 +1461,8 @@ void CHuiyuanChongzhiWnd::InitJiesuanZhifu()
 		}
 		}
 	}
 	}
 
 
+	*/
+
 	m_nZhiufuNum = num;
 	m_nZhiufuNum = num;
 }
 }
 
 
@@ -1510,4 +1513,4 @@ void CHuiyuanChongzhiWnd::UpdateJiesuanZhifuPos()
 	//调整区域高度
 	//调整区域高度
 	int lastRow = (num - 1) / nMeihangNum + 1;
 	int lastRow = (num - 1) / nMeihangNum + 1;
 	pZhifufangshiLayout->SetFixedHeight(lastRow * 105);
 	pZhifufangshiLayout->SetFixedHeight(lastRow * 105);
-}
+}

+ 1 - 1
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -125,7 +125,7 @@ void CMainWnd::UpdateFoodImage()
 	}	
 	}	
 
 
 	//再处理商品套餐的图片
 	//再处理商品套餐的图片
-	std::vector<CFoodpackage> foodpackagelist = sqlite.GetFoodpackages(true);
+	std::vector<CFoodpackage> foodpackagelist = sqlite.GetFoodpackages();
 	for (std::vector<CFoodpackage>::iterator it = foodpackagelist.begin(); it != foodpackagelist.end(); it++)
 	for (std::vector<CFoodpackage>::iterator it = foodpackagelist.begin(); it != foodpackagelist.end(); it++)
 	{
 	{
 		CFoodpackage food = *it;
 		CFoodpackage food = *it;