张洋 4 лет назад
Родитель
Сommit
18d95e2399
25 измененных файлов с 843 добавлено и 66 удалено
  1. BIN
      bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-16-18-37-04.dmp
  2. BIN
      bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-16-18-40-15.dmp
  3. BIN
      bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-16-18-56-05.dmp
  4. BIN
      bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-16-20-15-39.dmp
  5. BIN
      bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-16-21-03-09.dmp
  6. 41 3
      bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_page.xml
  7. 10 0
      bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_zhifufangshi_item.xml
  8. BIN
      bin/Win32/Debug/zhipuzi_pos_windows/skin/fulika_icon.png
  9. BIN
      bin/Win32/Debug/zhipuzi_pos_windows/skin/weixinzhifu_icon_black.png
  10. 1 1
      zhipuzi_pos_windows/control/CDiandanNatureItemUI.cpp
  11. 56 0
      zhipuzi_pos_windows/control/CDiandanZhifufangshiItemUI.cpp
  12. 18 0
      zhipuzi_pos_windows/control/CDiandanZhifufangshiItemUI.h
  13. 5 0
      zhipuzi_pos_windows/control/ControlEx.h
  14. 5 8
      zhipuzi_pos_windows/network/CZhipuziHttpClient.cpp
  15. 8 7
      zhipuzi_pos_windows/network/CZhipuziHttpClient.h
  16. 196 0
      zhipuzi_pos_windows/page/CDiandanPageUI.cpp
  17. 25 0
      zhipuzi_pos_windows/page/CDiandanPageUI.h
  18. 1 1
      zhipuzi_pos_windows/page/CSettingPageUI.cpp
  19. 3 1
      zhipuzi_pos_windows/pch/pch.cpp
  20. 97 45
      zhipuzi_pos_windows/wnd/CLoginWnd.cpp
  21. 3 0
      zhipuzi_pos_windows/wnd/CLoginWnd.h
  22. 194 0
      zhipuzi_pos_windows/zhipuzi/CShopinfo.cpp
  23. 164 0
      zhipuzi_pos_windows/zhipuzi/CShopinfo.h
  24. 4 0
      zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj
  25. 12 0
      zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

BIN
bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-16-18-37-04.dmp


BIN
bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-16-18-40-15.dmp


BIN
bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-16-18-56-05.dmp


BIN
bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-16-20-15-39.dmp


BIN
bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-16-21-03-09.dmp


+ 41 - 3
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_page.xml

@@ -78,7 +78,7 @@
 						<Control bkimage="xianjinzhifu_icon.png" width="21" height="24" float="true" pos="330,10,351,34" mouse="false"></Control>
 						<Label text="现金支付" width="120" height="35" font="2" float="true" pos="305,35,425,70" textcolor="#FFFFFFFF" mouse="false"></Label>
 						
-						<Button name="btn_diandan_gengduozhifu_pay" text="" heiht="75" width="120" padding="14,0,0,15" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFE8E8E8" bkcolor="#FFFFFFFF"></Button>
+						<Button name="btn_diandan_gengduozhifu_pay" text="" heiht="75" width="120" padding="14,0,0,15" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFC1C1C1" bkcolor="#FFF7F7F7"></Button>
 						<Control bkimage="gengduozhifu_icon.png" width="21" height="21" float="true" pos="465,10,351,31" mouse="false"></Control>
 						<Label text="更多支付" width="120" height="35" font="2" float="true" pos="440,35,560,70" mouse="false"></Label>
 					</HorizontalLayout>
@@ -113,8 +113,8 @@
 					
 					<HorizontalLayout padding="0,15,0,0" height="48">
 						<Label text="整单折扣:" width="120" height="48" padding="20,0,0,0"></Label>
-						<Edit name="diandan_jiesuan_zhekou_value" tooltip="请输入折扣值" width="250" height="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="" width="100" height="48" padding="20,0,0,0"></Label>
+						<Edit name="diandan_jiesuan_zhekou_value" readonly="true" tooltip="请输入折扣值" width="250" height="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="%" width="100" height="48" padding="20,0,0,0"></Label>
 					</HorizontalLayout>
 					
 					<HorizontalLayout padding="0,15,0,0" height="48">
@@ -195,6 +195,44 @@
 					<Label text="支付方式" width="100" height="78" padding="20,30,0,0" font="1"></Label>
 					
 					<Control height="1" bkcolor="#FFEBE8E8" padding="10,0,10,0"></Control>
+					
+					<HorizontalLayout name="diandan_jiesuan_zhifufangshi_layout" height="300">
+						<HorizontalLayout name="diandan_jiesuan_zhifufangshi_weixinzhifu" width="180" hegiht="80" float="true" pos="20,20,200,100">
+							<Button name="" text="" heiht="80" width="180" padding="0,0,0,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#FFFF4242"></Button>
+							<Control name="zhifu_icon" bkimage="weixinzhifu_icon.png" width="24" height="22" float="true" pos="80,10,104,32" mouse="false"></Control>
+							<Label name="zhifu_name" text="微信支付/支付宝" width="180" height="35" font="1" float="true" pos="35,35,215,70" textcolor="#FFFFFFFF" mouse="false"></Label>
+						</HorizontalLayout>
+						
+						<HorizontalLayout name="diandan_jiesuan_zhifufangshi_huiyuan" width="180" hegiht="80" float="true" pos="220,20,400,100">
+							<Button name="" text="" heiht="80" width="180" padding="0,0,0,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#FFFF8910"></Button>
+							<Control name="zhifu_icon" bkimage="huiyuanzhifu_icon.png" width="26" height="20" float="true" pos="80,10,106,30" mouse="false"></Control>
+							<Label name="zhifu_name" text="会员支付" width="180" height="35" font="1" float="true" pos="65,35,245,70" textcolor="#FFFFFFFF" mouse="false"></Label>
+						</HorizontalLayout>
+						
+						<HorizontalLayout name="diandan_jiesuan_zhifufangshi_xianjin" width="180" hegiht="80" float="true" pos="420,20,600,100">
+							<Button name="" text="" heiht="80" width="180" padding="0,0,0,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#FF52CB4B"></Button>
+							<Control name="zhifu_icon" bkimage="xianjinzhifu_icon.png" width="21" height="24" float="true" pos="85,10,106,34" mouse="false"></Control>
+							<Label name="zhifu_name" text="现金支付" width="180" height="35" font="1" float="true" pos="65,35,245,70" textcolor="#FFFFFFFF" mouse="false"></Label>
+						</HorizontalLayout>
+						
+						<HorizontalLayout name="diandan_jiesuan_zhifufangshi_gouwuka" width="182" hegiht="82" float="true" pos="20,120,200,200">
+							<Button name="" text="" heiht="80" width="180" padding="0,0,0,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFC1C1C1" bkcolor="#FFF7F7F7"></Button>
+							<Control name="zhifu_icon" bkimage="fulika_icon.png" width="30" height="30" float="true" pos="73,10,103,40" mouse="false"></Control>
+							<Label name="zhifu_name" text="购物卡" width="180" height="35" font="1" float="true" pos="65,35,245,70" mouse="false"></Label>
+						</HorizontalLayout>
+						
+						<HorizontalLayout name="diandan_jiesuan_zhifufangshi_meishicheng" width="182" hegiht="82" float="true" pos="220,120,400,200">
+							<Button name="" text="" heiht="80" width="180" padding="0,0,0,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFC1C1C1" bkcolor="#FFF7F7F7"></Button>
+							<Control name="zhifu_icon" bkimage="fulika_icon.png" width="30" height="30" float="true" pos="73,10,103,40" mouse="false"></Control>
+							<Label name="zhifu_name" text="美食城临时卡" width="180" height="35" font="1" float="true" pos="45,35,225,70" mouse="false"></Label>
+						</HorizontalLayout>
+						
+						<HorizontalLayout name="diandan_jiesuan_zhifufangshi_fulika" width="182" hegiht="82" float="true" pos="420,120,600,200">
+							<Button name="" text="" heiht="80" width="180" padding="0,0,0,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFC1C1C1" bkcolor="#FFF7F7F7"></Button>
+							<Control name="zhifu_icon" bkimage="fulika_icon.png" width="30" height="30" float="true" pos="73,10,103,40" mouse="false"></Control>
+							<Label name="zhifu_name" text="福利卡" width="180" height="35" font="1" float="true" pos="65,35,245,70" mouse="false"></Label>
+						</HorizontalLayout>
+					</HorizontalLayout>
 				</VerticalLayout>
 			</HorizontalLayout>
 		</HorizontalLayout>

+ 10 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_zhifufangshi_item.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window>
+	<Font id="1" name="微软雅黑" size="16" />
+	
+	<DiandanZhifufangshiItem width="180" hegiht="80" padding="0,0,0,0" float="true">
+		<Button name="" text="" heiht="75" width="120" padding="14,0,0,15" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#FFFF4242"></Button>
+		<Control name="zhifu_icon" bkimage="" width="24" height="22" float="true" pos="60,10,84,32" mouse="false"></Control>
+		<Label name="zhifu_name" text="" width="180" height="35" font="1" float="true" pos="15,35,165,70" textcolor="#FFFFFFFF" mouse="false"></Label>
+	</DiandanZhifufangshiItem>
+</Window>

BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/fulika_icon.png


BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/weixinzhifu_icon_black.png


+ 1 - 1
zhipuzi_pos_windows/control/CDiandanNatureItemUI.cpp

@@ -74,7 +74,7 @@ void CDiandanNatureItemUI::ShowNatureValue(int nSelected)
 
 		//设置位置,根据行数和列数来计算,行数和列数第一个都是1,按钮宽度145,高度44,右和下间距10
 		int curRow = value_num / 5 + 1;
-		int curCol = (value_num + 1) % 5;
+		int curCol = value_num % 5 + 1;
 
 		RECT rect;
 		rect.left = (curCol - 1) * 155;

+ 56 - 0
zhipuzi_pos_windows/control/CDiandanZhifufangshiItemUI.cpp

@@ -0,0 +1,56 @@
+#include "CDiandanZhifufangshiItemUI.h"
+
+
+
+CDiandanZhifufangshiItemUI::CDiandanZhifufangshiItemUI()
+{
+}
+
+
+CDiandanZhifufangshiItemUI::~CDiandanZhifufangshiItemUI()
+{
+}
+
+void CDiandanZhifufangshiItemUI::setNum(int num)
+{
+	int curRow = num / 4 + 1;
+	int curCol = (num + 1) % 4;
+
+	RECT rect;
+	rect.left = (curCol - 1) * 200 + 20;
+	rect.right = rect.left + 180;
+	rect.top = (curRow - 1) * 100;
+	rect.bottom = rect.top + 80;
+
+	this->SetFloat(true);
+	this->SetPos(rect);
+}
+
+void CDiandanZhifufangshiItemUI::SetType(std::string typeName)
+{
+	CLabelUI* pName = static_cast<CLabelUI*>(this->FindSubControl(_T("zhifu_name")));
+	CControlUI* pImage = static_cast<CControlUI*>(this->FindSubControl(_T("zhifu_icon")));
+
+	if (typeName == "weixinzhifu")
+	{
+		
+	}
+	else if (typeName == "huiyuan")
+	{
+	}
+	else if (typeName == "xianjin")
+	{
+	}
+	else if (typeName == "gouwuka")
+	{
+	}
+	else if (typeName == "meishicheng")
+	{
+	}
+	else if (typeName == "fulika")
+	{
+	}
+	else if (typeName == "zidingyi")
+	{
+	}
+}

+ 18 - 0
zhipuzi_pos_windows/control/CDiandanZhifufangshiItemUI.h

@@ -0,0 +1,18 @@
+#pragma once
+
+#include "../pch/pch.h"
+
+class CDiandanZhifufangshiItemUI : public CHorizontalLayoutUI
+{
+public:
+	CDiandanZhifufangshiItemUI();
+	~CDiandanZhifufangshiItemUI();
+
+public:
+	//设置这个支付方式是第几个,根据数量来调整位置
+	void setNum(int num);
+
+	//设置是什么类型,根据类型来展示不同的内容
+	void SetType(std::string typeName);
+};
+

+ 5 - 0
zhipuzi_pos_windows/control/ControlEx.h

@@ -11,6 +11,7 @@
 #include "CDiandanFoodItemUI.h"
 #include "CFoodtypeOptionUI.h"
 #include "CDiandanNatureItemUI.h"
+#include "CDiandanZhifufangshiItemUI.h"
 
 class CDialogBuilderCallbackEx : public IDialogBuilderCallback
 {
@@ -52,6 +53,10 @@ public:
 		{
 			return new CDiandanNatureItemUI;
 		}
+		else if (_tcscmp(pstrClass, _T("DiandanZhifufangshiItem")) == 0)
+		{
+			return new CDiandanZhifufangshiItemUI;
+		}
 
 		return NULL;
 	}

+ 5 - 8
zhipuzi_pos_windows/network/CZhipuziHttpClient.cpp

@@ -136,14 +136,15 @@ bool CZhipuziHttpClient::Login(std::string& errmsg)
 		m_client.m_yewu_url = m_client.m_lingshou_yewu_url;
 	}
 
-	rapidjson::Value& v_lwm_sess_token = v_data["lwm_sess_token"];
-	m_client.lwm_sess_token = v_lwm_sess_token.GetString();
+	m_client.lwm_sess_token = v_data["lwm_sess_token"].GetString();
 
-    LOG_INFO("login success!");
+	//保存店铺信息
+	CShopinfo::m_shopinfo.InitShopinfoByLogin(v_data);
 
     return true;
 }
 
+//请求业务系统旧接口用这个
 bool CZhipuziHttpClient::Request(std::string url, std::map<string, string> params, std::string& response)
 {
 	std::string timestamp = to_string(time(NULL));
@@ -215,6 +216,7 @@ bool CZhipuziHttpClient::Request(std::string url, std::map<string, string> param
 	return false;
 }
 
+//请求业务系统新接口用这个
 bool CZhipuziHttpClient::RequestNew(std::string url, std::map<string, string> params, std::string& response)
 {
 	std::string timestamp = to_string(time(NULL));
@@ -427,8 +429,3 @@ bool CZhipuziHttpClient::RequestPingtaiNew(std::string url, std::map<string, str
 
 	return false;
 }
-
-std::string CZhipuziHttpClient::getShopId()
-{
-	return m_client.m_shop_id;
-}

+ 8 - 7
zhipuzi_pos_windows/network/CZhipuziHttpClient.h

@@ -2,6 +2,7 @@
 
 #include "CHttpClient.h"
 #include "CZhipuziHttpProxy.h"
+#include "../zhipuzi/CShopinfo.h"
 
 class CZhipuziHttpClient
 {
@@ -29,8 +30,6 @@ public:
 	static bool RequestPingtai(std::string url, std::map<string, string> params, std::string& response);
 	static bool RequestPingtaiNew(std::string url, std::map<string, string> params, std::string& response);
 
-	static std::string getShopId();
-
 public:
 	static CZhipuziHttpClient m_client;
 
@@ -44,15 +43,17 @@ private:
 	std::string m_canyin_yewu_url = "";
 	std::string m_lingshou_yewu_url = "";
 
+public:
+	//当前系统版本 1餐饮版 2零售版
 	std::string m_version_type;
-	std::string lwm_sess_token;
-
-	Env m_env;
 
-	//这个是当前登陆的账号对应的店铺ID
-	std::string m_shop_id;
+	//身份token
+	std::string lwm_sess_token;
 
 	//htttp代理相关的参数
 	CZhipuziHttpProxy m_http_proxy;
+
+	//当前运行环境
+	Env m_env;
 };
 

+ 196 - 0
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -52,6 +52,202 @@ void CDiandanPageUI::InitShow()
 	}
 
 	this->RefreshFoodlist();
+
+	//根据店铺设置,初始化结算信息
+	this->InitJiesuanInfo();
+}
+
+//初始化结算页面的信息
+void CDiandanPageUI::InitJiesuanInfo()
+{
+	CShopinfo shopinfo = CShopinfo::m_shopinfo;
+
+	//先初始化折扣值
+	m_discount = 100;
+
+	CEditUI* pZhekouEdit = static_cast<CEditUI*>(this->FindSubControl(_T("diandan_jiesuan_zhekou_value")));
+	pZhekouEdit->SetText(L"100");
+
+	//再初始化加价
+	m_jiajia = 0;
+
+	//初始化优惠
+	m_youhui = 0;
+
+	//优惠券
+	m_is_youhuiquan = false;
+
+	//商品券
+	m_is_shangpinquan = false;
+
+	//次卡
+	m_is_cika = false;
+
+	//权益卡
+	m_is_quanyika = false;
+
+	//抹零
+	m_moling_type = 0;
+
+	CDialogBuilder builder;
+	CDialogBuilderCallbackEx cb;
+	CDiandanZhifufangshiItemUI* pItem = static_cast<CDiandanZhifufangshiItemUI*>(builder.Create(_T("diandan_zhifufangshi_item.xml"), (UINT)0, &cb, m_pManager));
+
+	//添加支付方式
+	int num = 0;
+
+	CHorizontalLayoutUI* pWeixinLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_weixinzhifu")));
+	if (shopinfo.m_is_online_pay_open == "1")
+	{
+		//展示微信支付,并且调整位置
+		pWeixinLayout->SetVisible(true);
+
+		int curRow = num / 3 + 1;
+		int curCol = num % 3 + 1;
+
+		RECT rect;
+		rect.left = (curCol - 1) * 200 + 20;
+		rect.right = rect.left + 180;
+		rect.top = (curRow - 1) * 100 + 20;
+		rect.bottom = rect.top + 80;
+
+		pWeixinLayout->SetFloat(true);
+		pWeixinLayout->SetPos(rect);
+
+		num++;	
+	}
+	else
+	{
+		pWeixinLayout->SetVisible(false);
+	}
+
+	//会员支付
+	CHorizontalLayoutUI* pHuiyuanLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_huiyuan")));
+	if (shopinfo.m_is_vip_pay_open == "1")
+	{
+		pHuiyuanLayout->SetVisible(true);
+
+		int curRow = num / 3 + 1;
+		int curCol = num % 3 + 1;
+
+		RECT rect;
+		rect.left = (curCol - 1) * 200 + 20;
+		rect.right = rect.left + 180;
+		rect.top = (curRow - 1) * 100 + 20;
+		rect.bottom = rect.top + 80;
+
+		pHuiyuanLayout->SetFloat(true);
+		pHuiyuanLayout->SetPos(rect);
+
+		num++;
+	}
+	else
+	{
+		pHuiyuanLayout->SetVisible(false);
+	}
+
+	//现金支付
+	CHorizontalLayoutUI* pXianjinLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_xianjin")));
+	if (shopinfo.m_is_cash_pay_open == "1")
+	{
+		pXianjinLayout->SetVisible(true);
+
+		int curRow = num / 3 + 1;
+		int curCol = num % 3 + 1;
+
+		RECT rect;
+		rect.left = (curCol - 1) * 200 + 20;
+		rect.right = rect.left + 180;
+		rect.top = (curRow - 1) * 100 + 20;
+		rect.bottom = rect.top + 80;
+
+		pXianjinLayout->SetFloat(true);
+		pXianjinLayout->SetPos(rect);
+
+		num++;
+	}
+	else
+	{
+		pXianjinLayout->SetVisible(false);
+	}
+
+	//购物卡
+	CHorizontalLayoutUI* pGouwukaLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_gouwuka")));
+	if (shopinfo.m_is_giftcard_pay_open == "1")
+	{
+		pGouwukaLayout->SetVisible(true);
+
+		int curRow = num / 3 + 1;
+		int curCol = num % 3 + 1;
+
+		RECT rect;
+		rect.left = (curCol - 1) * 200 + 20;
+		rect.right = rect.left + 180;
+		rect.top = (curRow - 1) * 100 + 20;
+		rect.bottom = rect.top + 80;
+
+		pGouwukaLayout->SetFloat(true);
+		pGouwukaLayout->SetPos(rect);
+
+		num++;
+	}
+	else
+	{
+		pGouwukaLayout->SetVisible(false);
+	}
+
+	//美食城临时卡
+	CHorizontalLayoutUI* pMeishichengLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_meishicheng")));
+	if (shopinfo.m_is_food_town_card_pay_open == "1")
+	{
+		pMeishichengLayout->SetVisible(true);
+
+		int curRow = num / 3 + 1;
+		int curCol = num % 3 + 1;
+
+		RECT rect;
+		rect.left = (curCol - 1) * 200 + 20;
+		rect.right = rect.left + 180;
+		rect.top = (curRow - 1) * 100 + 20;
+		rect.bottom = rect.top + 80;
+
+		pMeishichengLayout->SetFloat(true);
+		pMeishichengLayout->SetPos(rect);
+
+		num++;
+	}
+	else
+	{
+		pMeishichengLayout->SetVisible(false);
+	}
+
+	//福利卡
+	CHorizontalLayoutUI* pFulikaLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_fulika")));
+	if (shopinfo.m_is_open_fulika_pay == "1")
+	{
+		pFulikaLayout->SetVisible(true);
+
+		int curRow = num / 3 + 1;
+		int curCol = num % 3 + 1;
+
+		RECT rect;
+		rect.left = (curCol - 1) * 200 + 20;
+		rect.right = rect.left + 180;
+		rect.top = (curRow - 1) * 100 + 20;
+		rect.bottom = rect.top + 80;
+
+		pFulikaLayout->SetFloat(true);
+		pFulikaLayout->SetPos(rect);
+
+		num++;
+	}
+	else
+	{
+		pFulikaLayout->SetVisible(false);
+	}
+
+	//接着添加自定义支付的
+
 }
 
 //处理按钮点击类事件

+ 25 - 0
zhipuzi_pos_windows/page/CDiandanPageUI.h

@@ -19,6 +19,9 @@ public:
 	//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
 	void InitShow();
 
+	//初始化结算页面的信息
+	void InitJiesuanInfo();
+
 	//处理按钮点击类事件
 	void HandleClickMsg(TNotifyUI& msg);
 
@@ -85,9 +88,31 @@ private:
 	//当前选中的商品分类ID,为空表示没选中任何分类,为taocan表示选中套餐分类,如果选中普通商品分类就是分类ID
 	std::string m_cur_type_id = "";
 
+	//当前点击的哪个商品
 	CDiandanFoodItemUI* m_cur_click_food_item;
 	
 	//当前购物车的订单,根据这个来进行渲染显示
 	CDiandanOrder m_cur_diandan_order;
+
+	//下面是结算相关信息
+	double m_discount;
+
+	double m_jiajia;
+	double m_youhui;
+
+	//优惠券
+	bool m_is_youhuiquan;
+
+	//商品券
+	bool m_is_shangpinquan;
+
+	//次卡
+	bool m_is_cika;
+
+	//权益卡
+	bool m_is_quanyika;
+
+	//抹零 0:不抹零 1:抹零到角 2:抹零到元
+	int m_moling_type;
 };
 

+ 1 - 1
zhipuzi_pos_windows/page/CSettingPageUI.cpp

@@ -461,7 +461,7 @@ void CSettingPageUI::InitShow()
 	//先清空一次分类(主要考虑退出登陆重新登录的情况)
 	CSetting::ClearFoodtype();
 
-	std::string shop_id = CZhipuziHttpClient::getShopId();
+	std::string shop_id = CShopinfo::m_shopinfo.m_shop_id;
 	if (shop_id != "0")
 	{
 		std::map<string, string> params;

+ 3 - 1
zhipuzi_pos_windows/pch/pch.cpp

@@ -9,4 +9,6 @@
 //最先初始化sqllite数据
 CSetting CSetting::m_setting;
 
-CZhipuziHttpClient CZhipuziHttpClient::m_client;
+CZhipuziHttpClient CZhipuziHttpClient::m_client;
+
+CShopinfo CShopinfo::m_shopinfo;

+ 97 - 45
zhipuzi_pos_windows/wnd/CLoginWnd.cpp

@@ -1,4 +1,4 @@
-#include "../pch/pch.h"
+#include "../pch/pch.h"
 #include "CLoginWnd.h"
 #include "CUpdateWnd.h"
 
@@ -6,11 +6,11 @@
 
 void CLoginWnd::Init()
 {
-	//刷新版本号
+	//刷新版本号
 	CLabelUI* version = static_cast<CLabelUI*>(m_pm.FindControl(_T("login_version")));
-	version->SetText((L"智铺子收银系统 " + CLewaimaiString::UTF8ToUnicode(CSystem::GetVersion())).c_str());
+	version->SetText((L"智铺子收银系统 " + CLewaimaiString::UTF8ToUnicode(CSystem::GetVersion())).c_str());
 
-	//初始化下拉框的用户名
+	//鍒濆�鍖栦笅鎷夋�鐨勭敤鎴峰悕
 	CComboUI* pCom = static_cast<CComboUI*>(m_pm.FindControl(_T("accountcombo")));
 
 	std::map<string, string> users = CSetting::getUsers();
@@ -38,7 +38,7 @@ void CLoginWnd::Init()
 
 	if (CSetting::GetParam("setting_is_auto_login") == "1")
 	{
-		//自动登录开启了,记住密码一定要开启
+		//自动登录开启了,记住密码一定要开启
 		pAuto->Selected(true, false);
 		pRemember->Selected(true, false);
 	}
@@ -144,7 +144,7 @@ LRESULT CLoginWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHand
     styleValue &= ~WS_CAPTION;
     ::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
 
-    // 把自己的窗口句柄与窗口绘制管理器挂接在一起
+    // 把自己的窗口句柄与窗口绘制管理器挂接在一起
     m_pm.Init(m_hWnd);
     m_pm.AddPreMessageFilter(this);
 
@@ -153,10 +153,10 @@ LRESULT CLoginWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHand
     CControlUI* pRoot = builder.Create(_T("login.xml"), (UINT)0, NULL, &m_pm);
     ASSERT(pRoot && "Failed to parse XML");
 
-    // 把这些控件绘制到本窗口上
+    // 鎶婅繖浜涙帶浠剁粯鍒跺埌鏈�獥鍙d笂
     m_pm.AttachDialog(pRoot);
 
-    // 把自己加入到CPaintManagerUI的m_aNotifiers数组中,用于处理Notify函数
+    // 鎶婅嚜宸卞姞鍏ュ埌CPaintManagerUI鐨刴_aNotifiers鏁扮粍涓�紝鐢ㄤ簬澶勭悊Notify鍑芥暟
     m_pm.AddNotifier(this);
 
     Init();
@@ -171,7 +171,7 @@ LRESULT CLoginWnd::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandl
 }
 
 /*
- *这个是窗口被销毁的时候调用的
+ *杩欎釜鏄�獥鍙h�閿€姣佺殑鏃跺€欒皟鐢ㄧ殑
  **/
 LRESULT CLoginWnd::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
@@ -195,7 +195,7 @@ LRESULT CLoginWnd::OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& b
 
 LRESULT CLoginWnd::OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
 {
-	//在这里设置焦点才有用
+	//鍦ㄨ繖閲岃�缃�劍鐐规墠鏈夌敤
 	CEditUI* pAccountEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("accountedit")));
 	if (pAccountEdit)
 	{
@@ -312,7 +312,7 @@ LRESULT CLoginWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool&
                 }
                 else
                 {
-					//这里如果不把焦点设置为窗口,登录的时候会显示输入框(好像是个bug?获得焦点的控件无法隐藏?)
+					//杩欓噷濡傛灉涓嶆妸鐒︾偣璁剧疆涓虹獥鍙o紝鐧诲綍鐨勬椂鍊欎細鏄剧ず杈撳叆妗嗭紙濂藉儚鏄�釜bug锛熻幏寰楃劍鐐圭殑鎺т欢鏃犳硶闅愯棌锛燂級
 					SetFocus(this->GetHWND());
 
 					this->StartLogin();
@@ -339,7 +339,7 @@ LRESULT CLoginWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool&
 	}
 	else if (uMsg == WM_NEED_UPDATE)
 	{
-		//说明需要升级了
+		//璇存槑闇€瑕佸崌绾т簡
 
 		ShowUpdate();
 
@@ -361,7 +361,7 @@ LRESULT CLoginWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool&
 
 void CLoginWnd::StartLogin()
 {
-	//隐藏密码输入框,显示进度条
+	//隐藏密码输入框,显示进度条
 	CVerticalLayoutUI* pInput = static_cast<CVerticalLayoutUI*>(m_pm.FindControl(_T("login_input")));
 	pInput->SetVisible(false);
 
@@ -374,7 +374,7 @@ void CLoginWnd::StartLogin()
 	CLabelUI* pLoginResultLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("loginresult")));
 	pLoginResultLabel->SetVisible(false);
 
-	//开启一个线程,开始处理登录
+	//开启一个线程,开始处理登录
 	std::thread(&CLoginWnd::HandleLogin, this).detach();
 }
 
@@ -382,14 +382,14 @@ void CLoginWnd::HandleLogin()
 {
 	CLabelUI* pLoginResultLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("loginresult")));
 
-	//真正登录前,先检测是否有需要更新
+	//真正登录前,先检测是否有需要更新
 	std::map<string, string> params;
 
 	std::string response;
 	bool ret = CZhipuziHttpClient::RequestPingtaiNew("/version/getwindowsposversion", params, response);
 	if (!ret)
 	{
-		m_wsLoginErrMsg = _T("网络请求出错");
+		m_wsLoginErrMsg = _T("缃戠粶璇锋眰鍑洪敊");
 		PostMessage(WM_LOGIN_ERROR);
 
 		return;
@@ -400,7 +400,7 @@ void CLoginWnd::HandleLogin()
 
 	if (document.HasParseError())
 	{
-		m_wsLoginErrMsg = _T("服务器返回数据格式错误");
+		m_wsLoginErrMsg = _T("服务器返回数据格式错误");
 		PostMessage(WM_LOGIN_ERROR);
 
 		return;
@@ -409,7 +409,7 @@ void CLoginWnd::HandleLogin()
 	{
 		if (!document.HasMember("errcode") || !document.HasMember("errmsg") || !document.HasMember("data"))
 		{
-			m_wsLoginErrMsg = _T("服务器返回数据格式错误");
+			m_wsLoginErrMsg = _T("服务器返回数据格式错误");
 			PostMessage(WM_LOGIN_ERROR);
 
 			return;
@@ -433,13 +433,13 @@ void CLoginWnd::HandleLogin()
 
 		if (newest_version > CSystem::GetVersion())
 		{
-			//说明有新版本,要更新
+			//璇存槑鏈夋柊鐗堟湰锛岃�鏇存柊
 			PostMessage(WM_NEED_UPDATE);
 			return;
 		}
 	}
 
-    //判断账号密码是否正确
+    //鍒ゆ柇璐﹀彿瀵嗙爜鏄�惁姝g‘
     std::wstring account, password;
     CEditUI* pAccountEdit = static_cast<CEditUI*>(m_pm.FindControl(_T("accountedit")));
     if(pAccountEdit)
@@ -453,8 +453,8 @@ void CLoginWnd::HandleLogin()
         password = pPasswordEdit->GetText().GetData();
     }
 
-	//把第1个中文冒号替换成英文冒号
-	CLewaimaiString::Replace(account, _T(":"), _T(":"), 1);
+	//鎶婄�1涓�腑鏂囧啋鍙锋浛鎹㈡垚鑻辨枃鍐掑彿
+	CLewaimaiString::Replace(account, _T(":"), _T(":"), 1);
 
     //LOG_INFO("account:" << account.c_str() << ", password:" << password.c_str());
 
@@ -466,7 +466,7 @@ void CLoginWnd::HandleLogin()
 
 	if (s_account.compare("") == 0)
 	{
-		m_wsLoginErrMsg = _T("用户名不能为空");
+		m_wsLoginErrMsg = _T("用户名不能为空");
 		PostMessage(WM_LOGIN_ERROR);
 
 		return;
@@ -474,7 +474,7 @@ void CLoginWnd::HandleLogin()
 
 	if (s_password.compare("") == 0)
 	{
-		m_wsLoginErrMsg = _T("密码不能为空");
+		m_wsLoginErrMsg = _T("瀵嗙爜涓嶈兘涓虹┖");
 		PostMessage(WM_LOGIN_ERROR);
 
 		return;
@@ -487,6 +487,15 @@ void CLoginWnd::HandleLogin()
 
     if(res)
     {
+		//判断当前shop_id是否为0,如果为0说明是主账号还没有绑定店铺,那么就跳转进行店铺绑定
+		if (CShopinfo::m_shopinfo.m_is_shop == "0")
+		{
+			m_wsLoginErrMsg = _T("涓昏处鍙锋湭缁戝畾搴楅摵");
+			PostMessage(WM_LOGIN_ERROR);
+
+			return;
+		}
+
 		CCheckBoxUI* pAuto = static_cast<CCheckBoxUI*>(m_pm.FindControl(_T("login_auto_login")));
 		CCheckBoxUI* pRemember = static_cast<CCheckBoxUI*>(m_pm.FindControl(_T("login_remember_password")));
 
@@ -495,7 +504,7 @@ void CLoginWnd::HandleLogin()
 			CSetting::SetParam("setting_is_auto_login", "1", false);
 			CSetting::SetParam("setting_is_remember_password", "1", false);
 
-			//相当于开启自动登录,默认就是开启了记住密码了
+			//相当于开启自动登录,默认就是开启了记住密码了
 			CSetting::SetUser(s_account, s_password, true);
 		}
 		else
@@ -522,28 +531,37 @@ void CLoginWnd::HandleLogin()
 			}
 		}		
 
-		//在这里设置完参数后,统一保存到数据库
+		//鍦ㄨ繖閲岃�缃�畬鍙傛暟鍚庯紝缁熶竴淇濆瓨鍒版暟鎹�簱
 		CSetting::SetParam("last_login_username", s_account, true);
 
-		//把用户名和密码保存起来
+		//把用户名和密码保存起来
 		CSetting::SetLoginInfo(s_account, s_password);
 
-		//发送一个消息,更新界面状态
+		//发送一个消息,更新界面状态
 		PostMessage(WM_LOGIN_START_INIT_DATA);
 
-		//然后进行服务器数据的同步,同步完成了才切换到收银系统主页面
+		//然后进行服务器数据的同步,同步完成了才切换到收银系统主页面
 		bool ret = this->HandleInitData();
-		if (ret)
+		if (!ret)
 		{
-			PostMessage(WM_LOGIN_SUCCESS);
+			return;
 		}
 
+		//鑾峰彇搴楅摵淇℃伅
+		ret = this->GetShopinfo();
+		if (!ret)
+		{
+			return;
+		}
+
+		PostMessage(WM_LOGIN_SUCCESS);
+
 		return;
     }
     else
     {
-        //登录失败了
-		m_wsLoginErrMsg = std::wstring(_T("登录失败:") + CLewaimaiString::UTF8ToUnicode(errmsg));
+        //登录失败了
+		m_wsLoginErrMsg = std::wstring(_T("登录失败:") + CLewaimaiString::UTF8ToUnicode(errmsg));
 		PostMessage(WM_LOGIN_ERROR);
 
 		return;
@@ -559,7 +577,7 @@ void CLoginWnd::ShowLoginSuccess()
 	}
 
 	pFrame->SetIcon(IDI_ICON_DUILIB);
-	pFrame->Create(NULL, _T("智铺子收银系统"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 1024, 768);
+	pFrame->Create(NULL, _T("智铺子收银系统"), UI_WNDSTYLE_FRAME, 0L, 0, 0, 1024, 768);
 	pFrame->CenterWindow();
 
 	::ShowWindow(*pFrame, SW_SHOWMAXIMIZED);
@@ -599,7 +617,7 @@ void CLoginWnd::ShowUpdate()
 	pFrame->InitData(url, filename);
 
 	pFrame->SetIcon(IDI_ICON_DUILIB);
-	pFrame->Create(NULL, _T("自动更新"), UI_WNDSTYLE_DIALOG, 0, 0, 0, 0, 0, NULL);
+	pFrame->Create(NULL, _T("鑷�姩鏇存柊"), UI_WNDSTYLE_DIALOG, 0, 0, 0, 0, 0, NULL);
 	pFrame->CenterWindow();
 
 	::ShowWindow(*pFrame, SW_SHOWNORMAL);
@@ -609,7 +627,7 @@ void CLoginWnd::ShowUpdate()
 
 void CLoginWnd::ShowLoginAgainOut()
 {
-	//这种模式是本人强制挤下线了
+	//这种模式是本人强制挤下线了
 	CMessageboxWnd* pMessagebox = new CMessageboxWnd;
 	pMessagebox->Create(m_hWnd, _T(""), UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE);
 	pMessagebox->SetIcon(IDI_ICON_DUILIB);
@@ -637,7 +655,7 @@ bool CLoginWnd::HandleInitData()
 	bool ret = CZhipuziHttpClient::Request("/goods/getallgoods", params, response);
 	if (!ret)
 	{
-		m_wsLoginErrMsg = _T("网络请求出错");
+		m_wsLoginErrMsg = _T("缃戠粶璇锋眰鍑洪敊");
 		PostMessage(WM_LOGIN_ERROR);
 
 		return false;
@@ -648,45 +666,45 @@ bool CLoginWnd::HandleInitData()
 
 	if (document.HasParseError())
 	{
-		m_wsLoginErrMsg = _T("服务器返回数据格式错误");
+		m_wsLoginErrMsg = _T("服务器返回数据格式错误");
 		PostMessage(WM_LOGIN_ERROR);
 
 		return false;
 	}
 
-	//获得数据成功
+	//鑾峰緱鏁版嵁鎴愬姛
 	rapidjson::Value& data = document["data"];
 
 	CSqlite3 sqlite;
 
-	//先处理商品的
+	//鍏堝�鐞嗗晢鍝佺殑
 	rapidjson::Value& v_goods_rows = data["goods_rows"];
 	ret = sqlite.InitFoodData(v_goods_rows);
 	if (!ret)
 	{
-		m_wsLoginErrMsg = _T("商品数据库数据同步失败!");
+		m_wsLoginErrMsg = _T("鍟嗗搧鏁版嵁搴撴暟鎹�悓姝ュけ璐ワ紒");
 		PostMessage(WM_LOGIN_ERROR);
 
 		return false;
 	}
 
-	//再处理商品分类的
+	//鍐嶅�鐞嗗晢鍝佸垎绫荤殑
 	rapidjson::Value& v_types_lv1_ids = data["types_lv1_ids"];
 	ret = sqlite.InitFoodtypeData(v_types_lv1_ids);
 	if (!ret)
 	{
-		m_wsLoginErrMsg = _T("商品分类数据库数据同步失败!");
+		m_wsLoginErrMsg = _T("鍟嗗搧鍒嗙被鏁版嵁搴撴暟鎹�悓姝ュけ璐ワ紒");
 		PostMessage(WM_LOGIN_ERROR);
 
 		return false;
 	}
 
-	//再处理商品套餐的
+	//鍐嶅�鐞嗗晢鍝佸�椁愮殑
 	rapidjson::Value& v_food_package = data["food_package"];
 	ret = sqlite.InitFoodpackageData(v_food_package);
 	if (!ret)
 	{
-		m_wsLoginErrMsg = _T("商品套餐数据库数据同步失败!");
+		m_wsLoginErrMsg = _T("鍟嗗搧濂楅�鏁版嵁搴撴暟鎹�悓姝ュけ璐ワ紒");
 		PostMessage(WM_LOGIN_ERROR);
 
 		return false;
@@ -694,3 +712,37 @@ bool CLoginWnd::HandleInitData()
 
 	return true;
 }
+
+bool CLoginWnd::GetShopinfo()
+{
+	std::map<string, string> params;
+
+	std::string response;
+	bool ret = CZhipuziHttpClient::Request("/shop/getoneshopinfo", params, response);
+	if (!ret)
+	{
+		m_wsLoginErrMsg = _T("缃戠粶璇锋眰鍑洪敊");
+		PostMessage(WM_LOGIN_ERROR);
+
+		return false;
+	}
+
+	rapidjson::Document document;
+	document.Parse(response.c_str());
+
+	if (document.HasParseError())
+	{
+		m_wsLoginErrMsg = _T("服务器返回数据格式错误");
+		PostMessage(WM_LOGIN_ERROR);
+
+		return false;
+	}
+
+	//鑾峰緱鏁版嵁鎴愬姛
+	rapidjson::Value& data = document["data"];
+
+	//把获取到的数据保存起来
+	CShopinfo::m_shopinfo.InitShopinfoByGetshopinfo(data);
+
+	return true;
+}

+ 3 - 0
zhipuzi_pos_windows/wnd/CLoginWnd.h

@@ -78,6 +78,9 @@ public:
 	//处理服务器数据同步工作,把服务器数据存在本地数据库(商品数据等)
 	bool HandleInitData();
 
+	//获取店铺信息(例如支付方式、打印二维码等等)
+	bool GetShopinfo();
+
 public:
     CPaintManagerUI m_pm;
 

+ 194 - 0
zhipuzi_pos_windows/zhipuzi/CShopinfo.cpp

@@ -0,0 +1,194 @@
+#include "../pch/pch.h"
+#include "CShopinfo.h"
+
+
+
+CShopinfo::CShopinfo()
+{
+}
+
+
+CShopinfo::~CShopinfo()
+{
+}
+
+// 处理登录接口返回的店铺信息
+void CShopinfo::InitShopinfoByLogin(rapidjson::Value& v_data)
+{
+	this->m_shop_id = v_data["shop_id"].GetString();
+	this->m_shop_name = v_data["shop_name"].GetString();
+	this->m_is_member_fun_module = v_data["is_member_fun_module"].GetInt();
+
+	//当前账号的权限判断
+	rapidjson::Value& v_authority = v_data["authority"];
+
+	this->m_is_statistics_chart = v_authority["is_statistics_chart"].GetString();
+	this->m_is_statistics_waimaiorder = v_authority["is_statistics_waimaiorder"].GetString();
+	this->m_is_statistics_tangshiorder = v_authority["is_statistics_tangshiorder"].GetString();
+	this->m_is_statistics_shouyintai = v_authority["is_statistics_shouyintai"].GetString();
+	this->m_is_statistics_machine_diancan_order = v_authority["is_statistics_machine_diancan_order"].GetString();
+	this->m_is_statistics_machine_saoma_order = v_authority["is_statistics_machine_saoma_order"].GetString();
+	this->m_is_statistics_machine_chengzhong_order = v_authority["is_statistics_machine_chengzhong_order"].GetString();
+	this->m_is_statistics_machine_shouyin_order = v_authority["is_statistics_machine_shouyin_order"].GetString();
+	this->m_is_statistics_machine_zhengcan_order = v_authority["is_statistics_machine_zhengcan_order"].GetString();
+	this->m_is_statistics_member = v_authority["is_statistics_member"].GetString();
+	this->m_is_shop = v_authority["is_shop"].GetString();
+	this->m_is_goods = v_authority["is_goods"].GetString();
+	this->m_is_diandan_shouyin = v_authority["is_diandan_shouyin"].GetString();
+	this->m_is_diandan_shouyin_tuikuan = v_authority["is_diandan_shouyin_tuikuan"].GetString();
+	this->m_is_zhengcan_shouyin = v_authority["is_zhengcan_shouyin"].GetString();
+	this->m_is_zhengcan_shouyin_jiesuan = v_authority["is_zhengcan_shouyin_jiesuan"].GetString();
+	this->m_is_zhengcan_shouyin_tuikuan = v_authority["is_zhengcan_shouyin_tuikuan"].GetString();
+	this->m_is_zhengcan_shouyin_saoma_setting = v_authority["is_zhengcan_shouyin_saoma_setting"].GetString();
+	this->m_is_saoma_shoukuan = v_authority["is_saoma_shoukuan"].GetString();
+	this->m_is_saoma_shoukuan_tuiukuan = v_authority["is_saoma_shoukuan_tuiukuan"].GetString();
+	this->m_is_chengzhong_shouyin = v_authority["is_chengzhong_shouyin"].GetString();
+	this->m_is_chengzhong_shouyin_tuikuan = v_authority["is_chengzhong_shouyin_tuikuan"].GetString();
+	this->m_is_saoma_shouyin = v_authority["is_saoma_shouyin"].GetString();
+	this->m_is_saoma_shouyin_tuikuan = v_authority["is_saoma_shouyin_tuikuan"].GetString();
+	this->m_is_waimaiorder = v_authority["is_waimaiorder"].GetString();
+	this->m_is_waimaiorder_setting = v_authority["is_waimaiorder_setting"].GetString();
+	this->m_is_waimaiorder_tuikuan = v_authority["is_waimaiorder_tuikuan"].GetString();
+	this->m_is_tangshiorder = v_authority["is_tangshiorder"].GetString();
+	this->m_is_tangshiorder_setting = v_authority["is_tangshiorder_setting"].GetString();
+	this->m_is_tangshiorder_tuikuan = v_authority["is_tangshiorder_tuikuan"].GetString();
+	this->m_is_shouyintai = v_authority["is_shouyintai"].GetString();
+	this->m_is_message_list = v_authority["is_message_list"].GetString();
+	this->m_is_comment_list = v_authority["is_comment_list"].GetString();
+	this->m_is_shop_kucun = v_authority["is_shop_kucun"].GetString();
+	this->m_is_shop_kucun_ruku = v_authority["is_shop_kucun_ruku"].GetString();
+	this->m_is_shop_kucun_chuku = v_authority["is_shop_kucun_chuku"].GetString();
+	this->m_is_shop_kucun_pandian = v_authority["is_shop_kucun_pandian"].GetString();
+	this->m_is_shop_kucun_chaixiang = v_authority["is_shop_kucun_chaixiang"].GetString();
+	this->m_is_shop_kucun_rukutongji = v_authority["is_shop_kucun_rukutongji"].GetString();
+	this->m_is_shop_kucun_chukutongji = v_authority["is_shop_kucun_chukutongji"].GetString();
+	this->m_is_shop_kucun_kucunyujing = v_authority["is_shop_kucun_kucunyujing"].GetString();
+	this->m_is_shop_caigou = v_authority["is_shop_caigou"].GetString();
+	this->m_is_shop_caigou_faqi = v_authority["is_shop_caigou_faqi"].GetString();
+	this->m_is_shop_caigou_order = v_authority["is_shop_caigou_order"].GetString();
+	this->m_is_member_new = v_authority["is_member_new"].GetString();
+	this->m_is_member_yue = v_authority["is_member_yue"].GetString();
+	this->m_is_member_info = v_authority["is_member_info"].GetString();
+	this->m_is_member_tongji = v_authority["is_member_tongji"].GetString();
+	this->m_is_member_manage = v_authority["is_member_manage"].GetString();
+	this->m_is_member_yingxiao = v_authority["is_member_yingxiao"].GetString();
+	this->m_is_coupon = v_authority["is_coupon"].GetString();
+	this->m_is_send_coupon = v_authority["is_send_coupon"].GetString();
+	this->m_is_hexiao_coupon = v_authority["is_hexiao_coupon"].GetString();
+	this->m_is_product_coupon = v_authority["is_product_coupon"].GetString();
+	this->m_is_send_product_coupon = v_authority["is_send_product_coupon"].GetString();
+	this->m_is_hexiao_product_coupon = v_authority["is_hexiao_product_coupon"].GetString();
+	this->m_is_gouwuka = v_authority["is_gouwuka"].GetString();
+	this->m_is_gouwuka_jihuo = v_authority["is_gouwuka_jihuo"].GetString();
+	this->m_is_meishicheng = v_authority["is_meishicheng"].GetString();
+}
+
+//处理登录成功后,通过获取店铺信息接口获取的信息并保存
+void CShopinfo::InitShopinfoByGetshopinfo(rapidjson::Value& data)
+{
+	m_is_discount = data["is_discount"].GetString();
+	m_discount_value = data["discount_value"].GetString();
+	m_discountlimitmember = data["discountlimitmember"].GetString();
+	m_open_addservice = data["open_addservice"].GetString();
+
+	rapidjson::Value& addservice = data["addservice"];
+	for (rapidjson::SizeType i = 0; i < addservice.Size(); ++i)
+	{
+		rapidjson::Value& addserviceinfo = addservice[i];
+
+		AddService newAddService;
+		newAddService.start = addserviceinfo["start"].GetString();
+		newAddService.stop = addserviceinfo["stop"].GetString();
+		newAddService.name = addserviceinfo["name"].GetString();
+		newAddService.price = addserviceinfo["price"].GetDouble();
+
+		m_addservice.push_back(newAddService);
+	}
+
+	m_open_promotion = data["open_promotion"].GetString();
+
+	rapidjson::Value& promotion = data["promotion"];
+	for (rapidjson::SizeType i = 0; i < promotion.Size(); ++i)
+	{
+		rapidjson::Value& promotioninfo = promotion[i];
+
+		Promotion newPromotion;
+		newPromotion.amount = promotioninfo["amount"].GetDouble();
+		newPromotion.discount = promotioninfo["discount"].GetDouble();
+
+		m_promotion.push_back(newPromotion);
+	}
+
+	m_is_eq_card_discount = data["is_eq_card_discount"].GetString();
+	m_eq_card_discount_value = data["eq_card_discount_value"].GetString();
+
+	//处理会员折扣
+	std::string s_discount_info = data["discount_info"].GetString();
+
+	rapidjson::Document document;
+	document.Parse(s_discount_info.c_str());
+
+	rapidjson::Value& discount = document;
+	for (rapidjson::SizeType i = 0; i < discount.Size(); ++i)
+	{
+		rapidjson::Value& discountinfo = discount[i];
+
+		DiscountInfo newDiscount;
+		newDiscount.level_id = discountinfo["level_id"].GetString();
+		newDiscount.discount_value = discountinfo["discount_value"].GetString();
+
+		if (discountinfo["is_discount"].IsInt())
+		{
+			newDiscount.is_discount = to_string(discountinfo["is_discount"].GetInt());
+		}
+		else
+		{
+			newDiscount.is_discount = discountinfo["is_discount"].GetString();
+		}
+
+		m_discount_info.push_back(newDiscount);
+	}
+
+	m_is_only_promotion = data["is_only_promotion"].GetString();
+	m_is_only_discount = data["is_only_discount"].GetString();
+	m_is_vip_price_for_yue = data["is_vip_price_for_yue"].GetString();
+	m_is_discount_for_yue = data["is_discount_for_yue"].GetString();
+	m_machine_qrcode_url = data["machine_qrcode_url"].GetString();
+	m_machine_qrcode_open = data["machine_qrcode_open"].GetString();
+	m_machine_qrcode_title = data["machine_qrcode_title"].GetString();
+	m_lunbo_logo = data["lunbo_logo"].GetString();
+	m_machine_logo_url = data["machine_logo_url"].GetString();
+	m_machine_logo_open = data["machine_logo_open"].GetString();
+	m_self_defined_content1 = data["self_defined_content1"].GetString();
+	m_self_defined_content2 = data["self_defined_content2"].GetString();
+	m_self_defined_open = data["self_defined_open"].GetString();
+	m_header_text = data["header_text"].GetString();
+	m_machinecode_logo = data["machinecode_logo"].GetString();
+
+	//开始处理自定义支付
+	rapidjson::Value& self_pay = data["self_pay"];
+	for (rapidjson::SizeType i = 0; i < self_pay.Size(); ++i)
+	{
+		rapidjson::Value& self_pay_info = self_pay[i];
+
+		SelfPay newSelfpayInfo;
+		newSelfpayInfo.id = self_pay_info["id"].GetString();
+		newSelfpayInfo.name = self_pay_info["name"].GetString();
+		newSelfpayInfo.is_open = self_pay_info["is_open"].GetString();
+		newSelfpayInfo.is_bind = self_pay_info["is_bind"].GetString();
+		newSelfpayInfo.channel_id = self_pay_info["channel_id"].GetString();
+		newSelfpayInfo.channel_name = self_pay_info["channel_name"].GetString();
+
+		m_self_pay.push_back(newSelfpayInfo);
+	}
+
+	m_pointnum = data["point_set"]["pointnum"].GetString();
+	m_open_foodpoint = data["point_set"]["open_foodpoint"].GetString();
+
+	m_is_cash_pay_open = data["default_pay_open"]["is_cash_pay_open"].GetString();
+	m_is_online_pay_open = data["default_pay_open"]["is_online_pay_open"].GetString();
+	m_is_vip_pay_open = data["default_pay_open"]["is_vip_pay_open"].GetString();
+	m_is_giftcard_pay_open = data["default_pay_open"]["is_giftcard_pay_open"].GetString();
+	m_is_food_town_card_pay_open = data["default_pay_open"]["is_food_town_card_pay_open"].GetString();
+	m_is_open_fulika_pay = data["default_pay_open"]["is_open_fulika_pay"].GetString();
+}

+ 164 - 0
zhipuzi_pos_windows/zhipuzi/CShopinfo.h

@@ -0,0 +1,164 @@
+#pragma once
+
+class AddService
+{
+public:
+	std::string start;
+	std::string stop;
+	std::string name;
+	double price;
+};
+
+class Promotion
+{
+public:
+	double amount;
+	double discount;
+};
+
+class DiscountInfo
+{
+public:
+	std::string level_id;
+	std::string discount_value;
+	std::string is_discount;
+};
+
+class SelfPay
+{
+public:
+	std::string id;
+	std::string name;
+	std::string is_open;
+	std::string is_bind;
+	std::string channel_id;
+	std::string channel_name;
+};
+
+//这个用来保存与当前登录的店铺相关的所有信息
+class CShopinfo
+{
+public:
+	CShopinfo();
+	~CShopinfo();
+
+public:
+	static CShopinfo m_shopinfo;
+
+	//处理登录接口返回的店铺信息
+	void InitShopinfoByLogin(rapidjson::Value& v_data);
+
+	//处理登录成功后,通过获取店铺信息接口获取的信息并保存
+	void InitShopinfoByGetshopinfo(rapidjson::Value& data);
+
+public:
+	//这个是当前登陆的账号对应的店铺ID
+	std::string m_shop_id;
+
+	//当前登录的账号对应的店铺名字
+	std::string m_shop_name;
+
+	//是否开通会员功能
+	int m_is_member_fun_module;
+
+	//权限判断相关的参数
+	std::string m_is_statistics_chart;
+	std::string m_is_statistics_waimaiorder;
+	std::string m_is_statistics_tangshiorder;
+	std::string m_is_statistics_shouyintai;
+	std::string m_is_statistics_machine_diancan_order;
+	std::string m_is_statistics_machine_saoma_order;
+	std::string m_is_statistics_machine_chengzhong_order;
+	std::string m_is_statistics_machine_shouyin_order;
+	std::string m_is_statistics_machine_zhengcan_order;
+	std::string m_is_statistics_member;
+	std::string m_is_shop;
+	std::string m_is_goods;
+	std::string m_is_diandan_shouyin;
+	std::string m_is_diandan_shouyin_tuikuan;
+	std::string m_is_zhengcan_shouyin;
+	std::string m_is_zhengcan_shouyin_jiesuan;
+	std::string m_is_zhengcan_shouyin_tuikuan;
+	std::string m_is_zhengcan_shouyin_saoma_setting;
+	std::string m_is_saoma_shoukuan;
+	std::string m_is_saoma_shoukuan_tuiukuan;
+	std::string m_is_chengzhong_shouyin;
+	std::string m_is_chengzhong_shouyin_tuikuan;
+	std::string m_is_saoma_shouyin;
+	std::string m_is_saoma_shouyin_tuikuan;
+	std::string m_is_waimaiorder;
+	std::string m_is_waimaiorder_setting;
+	std::string m_is_waimaiorder_tuikuan;
+	std::string m_is_tangshiorder;
+	std::string m_is_tangshiorder_setting;
+	std::string m_is_tangshiorder_tuikuan;
+	std::string m_is_shouyintai;
+	std::string m_is_message_list;
+	std::string m_is_comment_list;
+	std::string m_is_shop_kucun;
+	std::string m_is_shop_kucun_ruku;
+	std::string m_is_shop_kucun_chuku;
+	std::string m_is_shop_kucun_pandian;
+	std::string m_is_shop_kucun_chaixiang;
+	std::string m_is_shop_kucun_rukutongji;
+	std::string m_is_shop_kucun_chukutongji;
+	std::string m_is_shop_kucun_kucunyujing;
+	std::string m_is_shop_caigou;
+	std::string m_is_shop_caigou_faqi;
+	std::string m_is_shop_caigou_order;
+	std::string m_is_member_new;
+	std::string m_is_member_yue;
+	std::string m_is_member_info;
+	std::string m_is_member_tongji;
+	std::string m_is_member_manage;
+	std::string m_is_member_yingxiao;
+	std::string m_is_coupon;
+	std::string m_is_send_coupon;
+	std::string m_is_hexiao_coupon;
+	std::string m_is_product_coupon;
+	std::string m_is_send_product_coupon;
+	std::string m_is_hexiao_product_coupon;
+	std::string m_is_gouwuka;
+	std::string m_is_gouwuka_jihuo;
+	std::string m_is_meishicheng;
+
+	//店铺信息接口返回
+	std::string m_is_discount;
+	std::string m_discount_value;
+	std::string m_discountlimitmember;
+	std::string m_open_addservice;
+	std::vector<AddService> m_addservice;
+	std::string m_open_promotion;
+	std::vector<Promotion> m_promotion;
+	std::string m_is_eq_card_discount;
+	std::string m_eq_card_discount_value;
+	std::vector<DiscountInfo> m_discount_info;
+	std::string m_is_only_promotion;
+	std::string m_is_only_discount;
+	std::string m_is_vip_price_for_yue;
+	std::string m_is_discount_for_yue;
+	std::string m_machine_qrcode_url;
+	std::string m_machine_qrcode_open;
+	std::string m_machine_qrcode_title;
+	std::string m_lunbo_logo;
+	std::string m_machine_logo_url;
+	std::string m_machine_logo_open;
+	std::string m_self_defined_content1;
+	std::string m_self_defined_content2;
+	std::string m_self_defined_open;
+	std::string m_header_text;
+	std::string m_machinecode_logo;
+
+	std::vector<SelfPay> m_self_pay;
+
+	std::string m_pointnum;
+	std::string m_open_foodpoint;
+
+	std::string m_is_cash_pay_open;
+	std::string m_is_online_pay_open;
+	std::string m_is_vip_pay_open;
+	std::string m_is_giftcard_pay_open;
+	std::string m_is_food_town_card_pay_open;
+	std::string m_is_open_fulika_pay;
+};
+

+ 4 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -225,6 +225,8 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClInclude Include="control\CDiandanZhifufangshiItemUI.h" />
+    <ClInclude Include="zhipuzi\CShopinfo.h" />
     <ClInclude Include="wnd\CMemoWnd.h" />
     <ClInclude Include="control\CDiandanNatureItemUI.h" />
     <ClInclude Include="wnd\CDiandanNatureWnd.h" />
@@ -271,6 +273,8 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="helper\CSystem.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="control\CDiandanZhifufangshiItemUI.cpp" />
+    <ClCompile Include="zhipuzi\CShopinfo.cpp" />
     <ClCompile Include="wnd\CMemoWnd.cpp" />
     <ClCompile Include="control\CDiandanNatureItemUI.cpp" />
     <ClCompile Include="wnd\CDiandanNatureWnd.cpp" />

+ 12 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -147,6 +147,12 @@
     <ClInclude Include="wnd\CMemoWnd.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="zhipuzi\CShopinfo.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="control\CDiandanZhifufangshiItemUI.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">
@@ -257,6 +263,12 @@
     <ClCompile Include="zhipuzi\CDiandanOrder.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="zhipuzi\CShopinfo.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="control\CDiandanZhifufangshiItemUI.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="resource\zhipuzi.ico">