소스 검색

相关bug的修复

张洋 2 년 전
부모
커밋
182afc8bcb

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

@@ -5,7 +5,7 @@
 			<Label float="true" name="diannei_order_list_order_num" text="订单号:" pos="10,6,320,36" />
 			<Label float="true" name="diannei_order_list_qucanhao" text="取餐码:" pos="350,6,582,36" />			
 			
-			<Label float="true" name="diannei_order_list_zhuowei" text="桌位:" pos="10,36,182,66" />
+			<Label float="true" name="diannei_order_list_zhuowei" text="桌位:" pos="10,36,320,66" />
 			<Label float="true" name="diannei_order_list_renshu" text="人数:" pos="350,36,600,66" />			
 			
 			<Label float="true" name="diannei_order_list_init_date" text="下单时间:" pos="10,66,300,96" />
@@ -13,7 +13,7 @@
 			<Label float="true" name="diannei_order_list_zhifu_type" text="支付方式:" pos="10,96,400,126" />
 			<Label float="true" name="diannei_order_list_price" text="价格:" pos="350,96,500,126" />
 			
-			<Label float="true" name="diannei_order_list_from" text="订单来源:" pos="10,126,282,156" />
+			<Label float="true" name="diannei_order_list_from" text="订单来源:" pos="10,126,500,156" />
 		</HorizontalLayout>
 		
 		<HorizontalLayout width="200">

+ 16 - 0
zhipuzi_pos_windows/control/CDianneiOrderItemUI.cpp

@@ -23,6 +23,7 @@ void CDianneiOrderItemUI::SetData(rapidjson::Value& orderinfo)
 	m_total_price = orderinfo["total_price"].GetString();
 	m_zhifu_type = orderinfo["zhifu_type"].GetString();
 	m_yingshou_price = orderinfo["yingshou_price"].GetString();
+	m_fromtype = orderinfo["from_type"].GetString();
 
 	std::wstring qucanhao_show = L"取餐码:" + CLewaimaiString::UTF8ToUnicode(m_take_food_code);
 	this->FindSubControl(L"diannei_order_list_qucanhao")->SetText(qucanhao_show.c_str());
@@ -45,5 +46,20 @@ void CDianneiOrderItemUI::SetData(rapidjson::Value& orderinfo)
 	std::wstring zhifufangshi_show = L"支付方式:" + CLewaimaiString::UTF8ToUnicode(m_zhifu_type);
 	this->FindSubControl(L"diannei_order_list_zhifu_type")->SetText(zhifufangshi_show.c_str());
 
+	
+	std::wstring ws_from_type;
+	if (m_fromtype == "1")
+	{
+		ws_from_type = L"订单来源:收银系统";
+	}
+	else if (m_fromtype == "4")
+	{
+		ws_from_type = L"订单来源:商家app";
+	}
+	else if (m_fromtype == "2" || m_fromtype == "3" || m_fromtype == "5")
+	{
+		ws_from_type = L"订单来源:扫码下单";
+	}
 
+	this->FindSubControl(L"diannei_order_list_from")->SetText(ws_from_type.c_str());
 }

+ 1 - 0
zhipuzi_pos_windows/control/CDianneiOrderItemUI.h

@@ -35,4 +35,5 @@ private:
 	std::string m_total_price;
 	std::string m_zhifu_type;
 	std::string m_yingshou_price;
+	std::string m_fromtype;
 };

+ 8 - 1
zhipuzi_pos_windows/print/CPosPrinterData.cpp

@@ -1170,7 +1170,7 @@ std::string CPosPrinterData::PrintDiandanOrderShouyin(CDiandanOrder& order)
 
 		if (order.m_canpai.length() > 0)
 		{
-			string order_num = "餐牌:" + CLewaimaiString::UTF8ToANSI(order.m_canpai);
+			string order_num = "餐牌/桌号:" + CLewaimaiString::UTF8ToANSI(order.m_canpai);
 			POS_TextOut(order_num, false, false);
 			POS_FeedLine();
 		}
@@ -1804,6 +1804,13 @@ std::vector<ChufangPrinterContent> CPosPrinterData::PrintDiandanOrderChufang(CDi
 			POS_TextOut(take_food_code, false, false, 0);
 			POS_FeedLine();
 
+			if (order.m_canpai.length() > 0)
+			{
+				string order_num = "餐牌/桌号:" + CLewaimaiString::UTF8ToANSI(order.m_canpai);
+				POS_TextOut(order_num, false, false, 0);
+				POS_FeedLine();
+			}
+
 			string init_time = "下单时间:" + order.init_time;
 			POS_TextOut(init_time, false, false, 0);
 			POS_FeedLine();

+ 1 - 1
zhipuzi_pos_windows/zhipuzi/CDiandanOrder.cpp

@@ -464,7 +464,7 @@ bool CDiandanOrder::InitData(std::string order_id)
 		{
 			order_from = 2;
 		}
-		else if (fromtype == "2" || fromtype == "3")
+		else if (fromtype == "2" || fromtype == "3" || fromtype == "5")
 		{
 			order_from = 3;
 		}

+ 14 - 0
zhipuzi_pos_windows/zhipuzi/CFood.h

@@ -47,6 +47,13 @@ public:
 			return L"";
 		}
 
+		size_t pos = goods_img.find(";");
+		if (pos != string::npos)
+		{
+			//表示图片地址里面有多个图片,默认取第一个
+			goods_img = goods_img.substr(0, pos);
+		}
+
 		std::string url_goods_img = "http://img.zhipuzi.com" + goods_img;
 		std::wstring ws_url_goods_img = CLewaimaiString::UTF8ToUnicode(url_goods_img);
 
@@ -61,6 +68,13 @@ public:
 			return L"";
 		}
 
+		size_t pos = goods_img.find(";");
+		if (pos != string::npos)
+		{
+			//表示图片地址里面有多个图片,默认取第一个
+			goods_img = goods_img.substr(0, pos);
+		}
+
 		//纯文件名
 		std::string file_name = CLewaimaiString::GetPathOrURLShortName(goods_img);
 

+ 14 - 0
zhipuzi_pos_windows/zhipuzi/CFoodpackage.h

@@ -29,6 +29,13 @@ public:
 			return L"";
 		}
 
+		size_t pos = goods_img.find(";");
+		if (pos != string::npos)
+		{
+			//表示图片地址里面有多个图片,默认取第一个
+			goods_img = goods_img.substr(0, pos);
+		}
+
 		std::string url_goods_img = "http://img.zhipuzi.com" + goods_img;
 		std::wstring ws_url_goods_img = CLewaimaiString::UTF8ToUnicode(url_goods_img);
 
@@ -43,6 +50,13 @@ public:
 			return L"";
 		}
 
+		size_t pos = goods_img.find(";");
+		if (pos != string::npos)
+		{
+			//表示图片地址里面有多个图片,默认取第一个
+			goods_img = goods_img.substr(0, pos);
+		}
+
 		//纯文件名
 		std::string file_name = CLewaimaiString::GetPathOrURLShortName(goods_img);
 

+ 3 - 0
zhipuzi_pos_windows/zhipuzi/CShopinfo.cpp

@@ -528,6 +528,9 @@ bool CShopinfo::GetTabletypeInfo()
 	rapidjson::Value& data = document["data"];
 	rapidjson::Value& tabletype = data["type"];
 
+	//先清空一次,不然退出登陆重新登录会重复添加
+	m_tabletypes.clear();
+
 	for (rapidjson::SizeType i = 0; i < tabletype.Size(); ++i)
 	{
 		rapidjson::Value& typeinfo = tabletype[i];