Преглед изворни кода

正餐订单管理完成了

张洋 пре 3 година
родитељ
комит
9498832c5e

+ 11 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/zhengcan_order_info_page_listitem.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<Window> 
+	<ListContainerElement name="zhengcan_order_info_page_listitem" height="30" minheight="30"> 
+		<HorizontalLayout height="38"> 
+			<Label name="zhengcan_order_info_page_listitem_foodname" /> 
+			<Label name="zhengcan_order_info_page_listitem_quantity" width="200" align="center"/> 
+			<Label name="zhengcan_order_info_page_listitem_price" width="200" align="center"/> 
+		</HorizontalLayout> 
+	</ListContainerElement> 
+</Window>

+ 59 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/zhengcanorder_info_page.xml

@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window>
+	<ZhengcanOrderInfoPage>
+		<VerticalLayout>
+			<HorizontalLayout height="44" bkcolor="#FFFFFFFF" padding="0,0,0,0">
+				<Button name="zhengcan_order_info_page_return" float="true" pos="20,6,120,38" text="返回" textcolor="#FFFFFFFF"/>
+			</HorizontalLayout>
+
+			<HorizontalLayout>
+				<VerticalLayout name="zhengcan_order_info_page_orderlayout" padding="20,20,20,20" vscrollbar="true">
+					<VerticalLayout name="zhengcan_order_info_page_layout_1" bkcolor="#FFFFFFFF" padding="0,0,0,20" inset="20,20,20,20" borderround="10,10" >
+						<HorizontalLayout height="30">
+							<Label float="true" name="zhengcan_order_info_page_order_num" text="订单号:" pos="0,0,500,20" />
+						</HorizontalLayout>
+
+						<Control height="1" bkcolor="#FFEAEAEA" />
+
+						<List name="zhengcan_order_info_page_foodlist">
+							<ListHeader />
+							<ListHeaderItem text="商品" align="left" />
+							<ListHeaderItem text="数量" width="200" align="center" />
+							<ListHeaderItem text="单价" width="200" align="center" />
+						</List>  
+
+						<Control height="10" />
+
+						<Label name="dianneiorder_info_page_memo" minheight="30" multiline="true" text="备注:" />
+
+						<Control height="1" bkcolor="#FFEAEAEA" />
+
+						<VerticalLayout name="zhengcan_order_info_page_fees">				
+
+						</VerticalLayout>
+						
+						<Control name="zhengcan_order_info_page_fees_line" height="1" bkcolor="#FFEAEAEA" />
+						
+						<Label name="zhengcan_order_info_page_totalprice" height="40" padding="0,0,30,0" align="right" text="总计:" />
+					</VerticalLayout>
+
+					<VerticalLayout name="zhengcan_order_info_page_layout_2" height="105" bkcolor="#FFFFFFFF" padding="0,0,0,20" inset="20,20,20,20" borderround="10,10">
+						<Label name="zhengcan_order_info_page_zhuohao" text="桌号:" height="30" />
+						<Label name="zhengcan_order_info_page_renshu" text="人数:" height="30" />
+					</VerticalLayout>			
+					
+					<VerticalLayout name="zhengcan_order_info_page_layout_3" bkcolor="#FFFFFFFF" padding="0,0,0,20" inset="20,20,20,20" borderround="10,10">
+						<Label name="zhengcan_order_info_page_init_date" text="下单时间:" height="30" />
+						<Label name="zhengcan_order_info_page_type" height="30" text="订单来源:" />
+						<Label name="zhengcan_order_info_page_pay_type" height="30" text="付款方式:" />
+						<Label name="zhengcan_order_info_page_refund_status" height="30" text="退款状态:" />						
+					</VerticalLayout>
+				</VerticalLayout>
+
+				<HorizontalLayout width="250" height="200" bkcolor="#FFFFFFFF" padding="0,20,20,0" borderround="10,10">
+					<Button name="zhengcan_order_info_page_refund" float="true" pos="50,108,200,146" text="退款" textcolor="#FFFFFFFF" normalimage="file='btn_border_red.png' corner='5,5,5,5'" hotimage="file='btn_border_red_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_red_Click.png' corner='5,5,5,5'" />
+				</HorizontalLayout>
+			</HorizontalLayout>
+		</VerticalLayout>
+	</ZhengcanOrderInfoPage>
+</Window>

+ 4 - 4
bin/Win32/Debug/zhipuzi_pos_windows/skin/zhengcanorder_list_page.xml

@@ -44,10 +44,10 @@
 
 			<HorizontalLayout height="52" bkcolor="#FFFFFFFF" >
 				<Control />
-				<Button name="diannei_order_list_refresh" width="70" height="44" padding="20,4,0,0" text="刷新" textcolor="#FFFFFFFF" />
-				<Button name="diannei_order_list_last" width="70" height="44" padding="20,4,0,0" text="上一页" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-				<Button name="diannei_order_list_next" width="70" height="44" padding="20,4,0,0" text="下一页" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-				<Label name="diannei_order_list_page" width="150" height="44" padding="20,4,0,0" />
+				<Button name="zhengcan_order_list_refresh" width="70" height="44" padding="20,4,0,0" text="刷新" textcolor="#FFFFFFFF" />
+				<Button name="zhengcan_order_list_last" width="70" height="44" padding="20,4,0,0" text="上一页" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
+				<Button name="zhengcan_order_list_next" width="70" height="44" padding="20,4,0,0" text="下一页" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
+				<Label name="zhengcan_order_list_page" width="150" height="44" padding="20,4,0,0" />
 			</HorizontalLayout>
 		</VerticalLayout>
 	</ZhengcanOrderListPage>

+ 5 - 0
zhipuzi_pos_windows/control/ControlEx.h

@@ -21,6 +21,7 @@
 #include "../page/CShangpinUpdatePageUI.h"
 #include "../page/CZhengcanDiandanPageUI.h"
 #include "../page/CZhengcanOrderListPageUI.h"
+#include "../page/CZhengcanOrderInfoPageUI.h"
 
 #include "CWaimaiOrderItemUI.h"
 #include "CDianneiOrderItemUI.h"
@@ -114,6 +115,10 @@ public:
 		{
 			return new CZhengcanOrderListPageUI;
 		}
+		else if (_tcscmp(pstrClass, _T("ZhengcanOrderInfoPage")) == 0)
+		{
+			return new CZhengcanOrderInfoPageUI;
+		}
 
 		//控件相关的
 		else if (_tcscmp(pstrClass, _T("WaimaiOrderItem")) == 0)

+ 412 - 0
zhipuzi_pos_windows/page/CZhengcanOrderInfoPageUI.cpp

@@ -0,0 +1,412 @@
+#include "../pch/pch.h"
+#include "CZhengcanOrderInfoPageUI.h"
+
+#include "../control/ControlEx.h"
+
+#include "../wnd/CMainWnd.h"
+
+#include "../print/CPosPrinter.h"
+
+CZhengcanOrderInfoPageUI::CZhengcanOrderInfoPageUI()
+{
+
+}
+
+CZhengcanOrderInfoPageUI::~CZhengcanOrderInfoPageUI()
+{
+
+}
+
+//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
+void CZhengcanOrderInfoPageUI::InitShow()
+{
+	//请求服务器,获取订单数据
+	CZhengcanOrder order;
+	order.InitData(m_order_id);
+	order.UpdateItemPrint();
+
+	//刷新订单详情页数据
+	this->SetDate(order);
+	this->Refresh(order);
+}
+
+//处理按钮点击类事件
+void CZhengcanOrderInfoPageUI::HandleClickMsg(TNotifyUI& msg)
+{
+	CDuiString name = msg.pSender->GetName();
+
+	if (name == _T("zhengcan_order_info_page_return"))
+	{
+		m_pMainWnd->SwitchPage(CMainWnd::ZHENGCANDINGDAN);
+	}
+	else if (name == _T("zhengcan_order_info_page_refund"))
+	{
+		std::string zhengcan_order_id = this->m_order.m_order_id;
+
+		CZhengcanOrder order;
+		bool ret = order.Refund(zhengcan_order_id);
+
+		if (ret)
+		{
+			//订单设为成功,这里怎么处理
+			//请求服务器,获取订单数据
+			CZhengcanOrder new_order;
+			new_order.InitData(zhengcan_order_id);
+			new_order.UpdateItemPrint();
+
+			//刷新订单详情页数据
+			this->SetDate(new_order);
+			this->Refresh(new_order);
+		}
+	}
+}
+
+//处理option切换事件
+void CZhengcanOrderInfoPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
+{
+
+}
+
+//处理下拉框、radio的切换事件
+void CZhengcanOrderInfoPageUI::HandleItemSelectMsg(TNotifyUI& msg)
+{
+
+}
+
+//处理编辑框输入内容改变事件
+void CZhengcanOrderInfoPageUI::HandleTextChangedMsg(TNotifyUI& msg)
+{
+
+}
+
+//处理扫码枪捕捉到的扫码信息
+void CZhengcanOrderInfoPageUI::HandleTextCapture(std::string content)
+{
+
+}
+
+//刷新当前页面的内容,注意这个函数不会改变当前的订单状态以及“页数”
+void CZhengcanOrderInfoPageUI::SetDate(CZhengcanOrder& order)
+{
+	m_order = order;
+}
+
+void CZhengcanOrderInfoPageUI::Refresh(CZhengcanOrder& order)
+{
+	std::wstring order_no_show = L"订单号:" + CLewaimaiString::UTF8ToUnicode(order.show_trade_no);
+	this->FindSubControl(_T("zhengcan_order_info_page_order_num"))->SetText(order_no_show.c_str());
+
+	//商品详情的渲染
+	CListUI* pFoodList = static_cast<CListUI*>(this->FindSubControl(_T("zhengcan_order_info_page_foodlist")));
+	pFoodList->RemoveAll();
+
+	int show_num = 0;
+
+	for (std::vector<CZhengcanOrderItemPrint>::iterator it = order.m_items_print.begin(); it != order.m_items_print.end(); it++)
+	{
+		if (it->is_taocan_item == true)
+		{
+			//套餐的详情不展示
+			continue;
+		}
+
+		std::string food_name = (*it).m_food_name;
+		std::string food_price = (*it).m_item_price;
+		std::string quantity = (*it).m_quantity;
+
+		CDialogBuilder builder;
+		CListContainerElementUI* pEle = static_cast<CListContainerElementUI *>(builder.Create(_T("zhengcan_order_info_page_listitem.xml"), (UINT)0, NULL, m_pManager));
+
+		CLabelUI *pName = static_cast<CLabelUI *>(pEle->FindSubControl(_T("zhengcan_order_info_page_listitem_foodname")));
+		pName->SetText(CLewaimaiString::UTF8ToUnicode(food_name).c_str());
+
+		CLabelUI *pQuantity = static_cast<CLabelUI *>(pEle->FindSubControl(_T("zhengcan_order_info_page_listitem_quantity")));
+		pQuantity->SetText(CLewaimaiString::UTF8ToUnicode(quantity).c_str());
+
+		CLabelUI *pPrice = static_cast<CLabelUI *>(pEle->FindSubControl(_T("zhengcan_order_info_page_listitem_price")));
+		pPrice->SetText(CLewaimaiString::UTF8ToUnicode(food_price).c_str());
+
+		pFoodList->Add(pEle);
+
+		show_num++;
+	}
+
+	//重设商品列表的高度
+	int order_item_height = (show_num + 1) * 30;
+	pFoodList->SetFixedHeight(order_item_height);
+
+	CLabelUI *pMemo = static_cast<CLabelUI *>(this->FindSubControl(_T("dianneiorder_info_page_memo")));
+	wstring memo = _T("备注:") + CLewaimaiString::UTF8ToUnicode(order.m_memo);
+	pMemo->SetText(memo.c_str());
+
+	//开始展示各种费用
+	CVerticalLayoutUI* pFeesLayout = static_cast<CVerticalLayoutUI *>(this->FindSubControl(_T("zhengcan_order_info_page_fees")));
+	pFeesLayout->RemoveAll();
+
+	int fees_num = 0;
+
+	if (atof(order.m_shangpinquan_youhui.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"商品券优惠金额:" + CLewaimaiString::UTF8ToUnicode(order.m_shangpinquan_youhui);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_cika_youhui.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"次卡优惠金额:" + CLewaimaiString::UTF8ToUnicode(order.m_cika_youhui);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_total_member_youhui.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"商品会员价优惠金额:" + CLewaimaiString::UTF8ToUnicode(order.m_total_member_youhui);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_zhekou_youhui.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"整单折扣优惠金额:" + CLewaimaiString::UTF8ToUnicode(order.m_zhekou_youhui);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_member_zhekou_youhui.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"会员折扣优惠金额:" + CLewaimaiString::UTF8ToUnicode(order.m_member_zhekou_youhui);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_quanyika_youhui.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"权益卡优惠金额:" + CLewaimaiString::UTF8ToUnicode(order.m_quanyika_youhui);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_manjian_youhui.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"满减优惠金额:" + CLewaimaiString::UTF8ToUnicode(order.m_manjian_youhui);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_youhuiquan_youhui.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"优惠券优惠金额:" + CLewaimaiString::UTF8ToUnicode(order.m_youhuiquan_youhui);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_rengong_youhui.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"人工优惠金额:" + CLewaimaiString::UTF8ToUnicode(order.m_rengong_youhui);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_dabao_money.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"打包费金额:" + CLewaimaiString::UTF8ToUnicode(order.m_dabao_money);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_chawei_money.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"茶位费金额:" + CLewaimaiString::UTF8ToUnicode(order.m_chawei_money);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_kaitai_money.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"开台费金额:" + CLewaimaiString::UTF8ToUnicode(order.m_kaitai_money);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_jiajia.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"加价金额:" + CLewaimaiString::UTF8ToUnicode(order.m_jiajia);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	if (atof(order.m_moling_youhui.c_str()) > 0)
+	{
+		CLabelUI *pFee = new CLabelUI;
+		pFee->SetFixedHeight(38);
+
+		wstring delivery_fee = L"抹零优惠金额:" + CLewaimaiString::UTF8ToUnicode(order.m_moling_youhui);
+		pFee->SetText(delivery_fee.c_str());
+
+		pFeesLayout->Add(pFee);
+
+		fees_num++;
+	}
+
+	int fees_height;
+	if (fees_num == 0)
+	{
+		pFeesLayout->SetVisible(false);
+		this->FindSubControl(_T("zhengcan_order_info_page_fees_line"))->SetVisible(false);
+
+		fees_height = 0;
+	}
+	else
+	{
+		pFeesLayout->SetVisible(true);
+		this->FindSubControl(_T("zhengcan_order_info_page_fees_line"))->SetVisible(true);
+		pFeesLayout->SetFixedHeight(fees_num * 38);
+
+		fees_height = fees_num * 38;
+	}
+
+	CLabelUI *pTotalPrice = static_cast<CLabelUI *>(this->FindSubControl(_T("zhengcan_order_info_page_totalprice")));
+	wstring price = L"总计:¥" + CLewaimaiString::UTF8ToUnicode(order.m_total_price);
+	pTotalPrice->SetText(price.c_str());
+
+	int nTotalHeight = order_item_height + fees_height + 173;
+	this->FindSubControl(_T("zhengcan_order_info_page_layout_1"))->SetFixedHeight(nTotalHeight);
+
+	//开始显示顾客信息
+	std::wstring table_name = L"桌号:" + CLewaimaiString::UTF8ToUnicode(order.table_name);
+	this->FindSubControl(_T("zhengcan_order_info_page_zhuohao"))->SetText(table_name.c_str());
+
+	std::wstring renshu_show = L"人数:" + CLewaimaiString::UTF8ToUnicode(order.m_renshu);
+	this->FindSubControl(_T("zhengcan_order_info_page_renshu"))->SetText(renshu_show.c_str());
+
+	std::wstring order_date_show = L"下单时间:" + CLewaimaiString::UTF8ToUnicode(order.init_time);
+	this->FindSubControl(_T("zhengcan_order_info_page_init_date"))->SetText(order_date_show.c_str());
+
+	//开始处理订单信息
+	std::wstring laiyuan;
+	if (order.order_from == 1)
+	{
+		laiyuan = L"收银机下单";
+	}
+	else if (order.order_from == 2)
+	{
+		laiyuan = L"商家app下单";
+	}
+	else if (order.order_from == 3)
+	{
+		laiyuan = L"扫码下单";
+	}
+
+	CLabelUI *pType = static_cast<CLabelUI *>(this->FindSubControl(_T("zhengcan_order_info_page_type")));
+	wstring wsType = _T("订单来源:") + laiyuan;
+	pType->SetText(wsType.c_str());
+
+	CLabelUI *pPayType = static_cast<CLabelUI *>(this->FindSubControl(_T("zhengcan_order_info_page_pay_type")));
+	wstring wsPayType = _T("付款方式:") + CLewaimaiString::UTF8ToUnicode(order.shoukuan_type);
+	pPayType->SetText(wsPayType.c_str());
+
+	CLabelUI *pRefund = static_cast<CLabelUI *>(this->FindSubControl(_T("zhengcan_order_info_page_refund_status")));
+	if (order.is_refund == "1")
+	{
+		wstring wsPayType = _T("退款状态:已退款");
+		pRefund->SetText(wsPayType.c_str());
+	}
+	else
+	{
+		wstring wsPayType = _T("退款状态:未退款");
+		pRefund->SetText(wsPayType.c_str());
+	}
+
+	this->FindSubControl(_T("zhengcan_order_info_page_layout_3"))->SetFixedHeight(181);
+
+	//退款按钮
+	CButtonUI* refund_button = static_cast<CButtonUI *>(m_pManager->FindControl(_T("zhengcan_order_info_page_refund")));
+
+	if (order.is_refund == "1")
+	{
+		refund_button->SetVisible(false);
+	}
+	else
+	{
+		refund_button->SetVisible(true);
+	}
+}

+ 49 - 0
zhipuzi_pos_windows/page/CZhengcanOrderInfoPageUI.h

@@ -0,0 +1,49 @@
+#pragma once
+
+#include "../pch/pch.h"
+#include "CBasePageUI.h"
+
+#include "../zhipuzi/CZhengcanOrder.h"
+
+class CZhengcanOrderInfoPageUI : public CBasePageUI
+{
+public:
+	CZhengcanOrderInfoPageUI();
+
+	~CZhengcanOrderInfoPageUI();
+
+	//初始化当前页面的展示,处理默认展示效果,在页面每次被选中加载(注意不是页面创建构造)的时候调用,如果多次选中会多次调用,这里要避免数据重复处理
+	void InitShow();
+
+	//处理按钮点击类事件
+	void HandleClickMsg(TNotifyUI& msg);
+
+	//处理option切换事件
+	void HandleSelectChangeMsg(TNotifyUI& msg);
+
+	//处理下拉框、radio的切换事件
+	void HandleItemSelectMsg(TNotifyUI& msg);
+
+	//处理编辑框输入内容改变事件
+	void HandleTextChangedMsg(TNotifyUI& msg);
+
+	//处理扫码枪捕捉到的扫码信息
+	void HandleTextCapture(std::string content);
+
+	//处理自定义消息,各个页面处理各个页面自己的(是自己处理的消息返回true,不是自己处理的消息返回false)
+	bool HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+	{
+		return false;
+	}
+
+	//刷新当前页面的内容,注意这个函数不会改变当前的订单状态以及“页数”
+	void SetDate(CZhengcanOrder& order);
+
+	//根据外卖订单数据,刷新订单详情页的显示
+	void Refresh(CZhengcanOrder& order);
+
+public:
+	CZhengcanOrder m_order;
+
+	std::string m_order_id;
+};

+ 17 - 25
zhipuzi_pos_windows/page/CZhengcanOrderListPageUI.cpp

@@ -33,33 +33,25 @@ void CZhengcanOrderListPageUI::HandleClickMsg(TNotifyUI& msg)
 {
 	CDuiString name = msg.pSender->GetName();
 
-	if (name == _T("diannei_order_list_print"))
+	if (name == _T("zhengcan_order_list_info"))
 	{
-		CDianneiOrderItemUI* item = static_cast<CDianneiOrderItemUI*>(msg.pSender->GetParent()->GetParent());
-		std::string diannei_order_id = item->getOrderID();
+		CZhengcanOrderItemUI* item = static_cast<CZhengcanOrderItemUI*>(msg.pSender->GetParent()->GetParent());
+		std::string zhengcan_order_id = item->getOrderID();
 
-		CPosPrinter printer;
-		printer.PrintDiandanOrder(diannei_order_id);
-	}
-	else if (name == _T("diannei_order_list_info"))
-	{
-		CDianneiOrderItemUI* item = static_cast<CDianneiOrderItemUI*>(msg.pSender->GetParent()->GetParent());
-		std::string diannei_order_id = item->getOrderID();
-
-		CDianneiOrderInfoPageUI* page = static_cast<CDianneiOrderInfoPageUI*>(m_pMainWnd->GetPage(CMainWnd::DIANNEIINFO));
-		page->m_order_id = diannei_order_id;
+		CZhengcanOrderInfoPageUI* page = static_cast<CZhengcanOrderInfoPageUI*>(m_pMainWnd->GetPage(CMainWnd::ZHENGCANINFO));
+		page->m_order_id = zhengcan_order_id;
 
-		m_pMainWnd->SwitchPage(CMainWnd::DIANNEIINFO);
+		m_pMainWnd->SwitchPage(CMainWnd::ZHENGCANINFO);
 	}
-	else if (name == _T("diannei_order_list_last"))
+	else if (name == _T("zhengcan_order_list_last"))
 	{
 		this->LastPage();
 	}
-	else if (name == _T("diannei_order_list_next"))
+	else if (name == _T("zhengcan_order_list_next"))
 	{
 		this->NextPage();
 	}
-	else if (name == _T("diannei_order_list_refresh"))
+	else if (name == _T("zhengcan_order_list_refresh"))
 	{
 		this->Refresh();
 	}
@@ -200,28 +192,28 @@ void CZhengcanOrderListPageUI::DoRefresh()
 	if (m_page <= 1)
 	{
 		m_page = 1;
-		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("diannei_order_list_last")));
+		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("zhengcan_order_list_last")));
 		pControl->SetEnabled(false);
 	}
 	if (m_page >= m_total_page)
 	{
 		m_page = m_total_page;
-		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("diannei_order_list_next")));
+		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("zhengcan_order_list_next")));
 		pControl->SetEnabled(false);
 	}
 
 	if (m_page > 1)
 	{
-		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("diannei_order_list_last")));
+		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("zhengcan_order_list_last")));
 		pControl->SetEnabled(true);
 	}
 	if (m_page < m_total_page)
 	{
-		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("diannei_order_list_next")));
+		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("zhengcan_order_list_next")));
 		pControl->SetEnabled(true);
 	}
 
-	CLabelUI* pControl = static_cast<CLabelUI*>(this->FindSubControl(_T("diannei_order_list_page")));
+	CLabelUI* pControl = static_cast<CLabelUI*>(this->FindSubControl(_T("zhengcan_order_list_page")));
 	wstring pageinfo = _T("µÚ ") + CLewaimaiString::ANSIToUnicode(to_string(m_page)) + _T("Ò³/¹² ") + CLewaimaiString::ANSIToUnicode(to_string(m_total_page)) + _T("Ò³");
 	pControl->SetText(pageinfo.c_str());
 
@@ -247,7 +239,7 @@ void CZhengcanOrderListPageUI::DoRefresh()
 		}
 		else
 		{
-			LOG_INFO("create diannei_order_item fail!");
+			LOG_INFO("create zhengcan_order_item fail!");
 		}
 	}
 
@@ -272,7 +264,7 @@ void CZhengcanOrderListPageUI::LastPage()
 
 	if (m_page == 1)
 	{
-		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("diannei_order_list_last")));
+		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("zhengcan_order_list_last")));
 		pControl->SetEnabled(false);
 	}
 
@@ -289,7 +281,7 @@ void CZhengcanOrderListPageUI::NextPage()
 
 	if (m_page == m_total_page)
 	{
-		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("diannei_order_list_next")));
+		CButtonUI* pControl = static_cast<CButtonUI*>(this->FindSubControl(_T("zhengcan_order_list_next")));
 		pControl->SetEnabled(false);
 	}
 

+ 7 - 0
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -1413,6 +1413,13 @@ void CMainWnd::CreatePages()
 		m_pages[ZHENGCANDINGDAN] = pChildContainer;
 	}
 
+	{
+		CDialogBuilder builder;
+		CDialogBuilderCallbackEx cb;
+		pChildContainer = static_cast<CBasePageUI*>(builder.Create(_T("zhengcanorder_info_page.xml"), (UINT)0, &cb, &m_pm));
+		m_pages[ZHENGCANINFO] = pChildContainer;
+	}
+
 	//这里纯粹只是创建对象,不做任何初始化等处理
 }
 

+ 1 - 1
zhipuzi_pos_windows/zhipuzi/CZhengcanOrder.cpp

@@ -829,7 +829,7 @@ bool CZhengcanOrder::InitData(std::string order_id)
 
 bool CZhengcanOrder::Refund(std::string order_id)
 {
-	std::string url = "/diancan/refund";
+	std::string url = "/dinnercash/refund";
 
 	//ÇëÇóÍâÂôµÄδ´¦Àí¶©µ¥
 	std::map<string, string> params;

+ 2 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -230,6 +230,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="control\CZhengcanOrderItemUI.h" />
+    <ClInclude Include="page\CZhengcanOrderInfoPageUI.h" />
     <ClInclude Include="page\CZhengcanOrderListPageUI.h" />
     <ClInclude Include="wnd\CZhengcanSaomadiancanWnd.h" />
     <ClInclude Include="wnd\CAttentionWnd.h" />
@@ -340,6 +341,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="control\CZhengcanOrderItemUI.cpp" />
+    <ClCompile Include="page\CZhengcanOrderInfoPageUI.cpp" />
     <ClCompile Include="page\CZhengcanOrderListPageUI.cpp" />
     <ClCompile Include="wnd\CZhengcanSaomadiancanWnd.cpp" />
     <ClCompile Include="wnd\CAttentionWnd.cpp" />

+ 6 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -339,6 +339,9 @@
     <ClInclude Include="control\CZhengcanOrderItemUI.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="page\CZhengcanOrderInfoPageUI.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">
@@ -638,6 +641,9 @@
     <ClCompile Include="control\CZhengcanOrderItemUI.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="page\CZhengcanOrderInfoPageUI.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="resource\zhipuzi.ico">