zhangyang 4 лет назад
Родитель
Сommit
10a7b2ec16

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


+ 3 - 3
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_cart_item.xml

@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <Window> 
-	<ListContainerElement name="diandan_cart_item" width="350" height="42">
+	<ListContainerElement name="diandan_cart_item" width="430" height="42">
 		<VerticalLayout>
 			<HorizontalLayout height="42"> 
-				<Label name="diandan_cart_item_name" width="220" height="42" align="left" endellipsis="true" />
+				<Label name="diandan_cart_item_name" width="300" height="42" align="left" padding="10,0,0,0" endellipsis="true" />
 				<Control width="10"></Control>
 				<Label name="diandan_cart_item_num" width="60" align="left"/> 
 				<Label name="diandan_cart_item_price" width="60" align="left"/>
 			</HorizontalLayout>
-			<Label name="diandan_cart_item_nature" width="220" height="42" align="left" padding="0,0,10,0" textcolor="#FF808080" visible="false" multiline="true" endellipsis="true" />
+			<Label name="diandan_cart_item_nature" width="310" height="42" align="left" padding="10,0,10,0" textcolor="#FF808080" visible="false" multiline="true" endellipsis="true" />
 		</VerticalLayout>
 	</ListContainerElement> 
 </Window>

Разница между файлами не показана из-за своего большого размера
+ 38 - 12
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_page.xml


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


+ 19 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/memo_edit_dlg.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window size="700,369" caption="0,0,0,36" roundcorner="4,4" >
+	<Font id="0" name="微软雅黑" size="22" />
+	
+	<VerticalLayout bkcolor="#FFFFFFFF">
+		<HorizontalLayout height="50" inset="10,2,10,0">
+			<Label name="memo_dlg_title" text="" align="center" valign="center" padding="0,20,0,0" font="0"/>
+		</HorizontalLayout>
+		
+		<RichEdit name="content" width="520" height="180" padding="90,20,90,0" bkcolor="#FFF2F2F2" />
+		
+		<HorizontalLayout height="56" valign="center" padding="0,30,0,20">
+			<Control />
+			<Button name="quit" align="center" width="100" height="45" padding="0,20,0,0" text="取消" normalimage="file='Btn_White.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_White_Click.png' corner='5,5,5,5'" />
+			<Button name="save" align="center" width="100" height="45" padding="20,20,90,0" text="确认" normalimage="file='Btn_White.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_White_Click.png' corner='5,5,5,5'" />
+			<Control />
+		</HorizontalLayout>
+	</VerticalLayout>
+</Window>

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


+ 66 - 0
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -6,6 +6,7 @@
 #include "../tool/CSqlite3.h"
 
 #include "../wnd/CDiandanNatureWnd.h"
+#include "../wnd/CMemoWnd.h"
 
 CDiandanPageUI::CDiandanPageUI()
 {
@@ -82,6 +83,14 @@ void CDiandanPageUI::HandleClickMsg(TNotifyUI& msg)
 	{
 		this->ClickGuige();
 	}
+	else if (name == L"btn_diandan_qingkong")
+	{
+		this->ClickQingkong();
+	}
+	else if (name == L"btn_diandan_zhengdanbeizhu")
+	{
+		this->ClickZhengdanMemo();
+	}
 }
 
 //处理option切换事件
@@ -281,6 +290,17 @@ void CDiandanPageUI::DelDiandanOrderItemShow(int index)
 	pTotalPrice->SetText((L"总价:¥" + CLewaimaiString::UTF8ToUnicode(m_cur_diandan_order.getTotalPriceShow())).c_str());
 }
 
+void CDiandanPageUI::ClearDiandanOrderItemShow()
+{
+	CListUI* pList = static_cast<CListUI*>(this->FindSubControl(_T("list_diandan_cart")));
+
+	pList->RemoveAll();
+
+	//更新总价显示
+	CLabelUI* pTotalPrice = static_cast<CLabelUI*>(this->FindSubControl(_T("diandan_page_totalprice")));
+	pTotalPrice->SetText((L"总价:¥" + CLewaimaiString::UTF8ToUnicode(m_cur_diandan_order.getTotalPriceShow())).c_str());
+}
+
 void CDiandanPageUI::ClickFoodAction()
 {
 	bool is_taocan = m_cur_click_food_item->GetIsTaocan();
@@ -336,6 +356,8 @@ void CDiandanPageUI::ClickFoodAction()
 				}
 				else
 				{
+					delete pNatureFrame;
+
 					return;
 				}
 			}
@@ -459,3 +481,47 @@ void CDiandanPageUI::ClickGuige()
 		}
 	}
 }
+
+void CDiandanPageUI::ClickQingkong()
+{
+	m_cur_diandan_order.Clear();
+
+	this->ClearDiandanOrderItemShow();
+}
+
+void CDiandanPageUI::ClickZhengdanMemo()
+{
+	CMemoWnd* pMemoDlg = new CMemoWnd();
+
+	if (pMemoDlg != NULL)
+	{
+		pMemoDlg->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE);
+		pMemoDlg->SetIcon(IDI_ICON_DUILIB);
+		pMemoDlg->CenterWindow();
+
+		pMemoDlg->SetTitle(L"整单备注");
+
+		UINT ret = pMemoDlg->ShowModal();
+
+		if (ret == IDOK)
+		{
+			//保存选择的属性
+			std::string sMemo = pMemoDlg->getMemo();
+
+			//渲染整单备注的展示
+			CLabelUI* pLabel = static_cast<CLabelUI*>(this->FindSubControl(_T("diandan_page_label_zhengdanbeizhu")));
+			pLabel->SetText((L"整单备注:" + CLewaimaiString::UTF8ToUnicode(sMemo)).c_str());
+
+			//保存备注,提交订单的时候用
+			m_cur_diandan_order.SetMemo(sMemo);
+
+			delete pMemoDlg;
+		}
+		else
+		{
+			delete pMemoDlg;
+
+			return;
+		}
+	}
+}

+ 9 - 0
zhipuzi_pos_windows/page/CDiandanPageUI.h

@@ -42,6 +42,9 @@ public:
 	//删除购物车中某一个商品
 	void DelDiandanOrderItemShow(int index);
 
+	//清空购物车中所有商品的展示
+	void ClearDiandanOrderItemShow();
+
 	//点击某一个商品的item之后的处理逻辑
 	void ClickFoodAction();
 
@@ -57,6 +60,12 @@ public:
 	//点击规格之后的逻辑
 	void ClickGuige();
 
+	//点击清空之后的逻辑
+	void ClickQingkong();
+
+	//点击整单备注之后的逻辑
+	void ClickZhengdanMemo();
+
 private:
 	CTileLayoutUI* m_foodLayout;
 	CHorizontalLayoutUI* m_foodtypeLayout;

+ 159 - 0
zhipuzi_pos_windows/wnd/CMemoWnd.cpp

@@ -0,0 +1,159 @@
+#include "../pch/pch.h"
+#include "CMemoWnd.h"
+
+LRESULT CMemoWnd::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 CMemoWnd::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 CMemoWnd::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_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;
+	default:
+		bHandled = FALSE;
+	}
+	if (bHandled)
+	{
+		return lRes;
+	}
+	if (m_pm.MessageHandler(uMsg, wParam, lParam, lRes))
+	{
+		return lRes;
+	}
+	return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
+}
+
+LRESULT CMemoWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
+{
+	if (uMsg == WM_KEYDOWN)
+	{
+		if (wParam == VK_RETURN)
+		{
+			return true;
+		}
+		else if (wParam == VK_ESCAPE)
+		{
+			return true;
+		}
+	}
+	return false;
+}
+
+LRESULT CMemoWnd::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("memo_edit_dlg.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;
+}
+
+void CMemoWnd::Notify(TNotifyUI& msg)
+{
+	if (msg.sType == _T("click"))
+	{
+		DuiLib::CDuiString senderName = msg.pSender->GetName();
+
+		if (senderName == _T("quit"))
+		{
+			Close(IDCANCEL);
+			return;
+		}
+		else if (senderName == _T("save"))
+		{
+			//开始保存厨房打印机的数据
+			CEditUI* pContent = static_cast<CEditUI*>(m_pm.FindControl(_T("content")));
+			wstring wsReason = pContent->GetText();
+
+			m_memo = CLewaimaiString::UnicodeToUTF8(wsReason);
+
+			Close(IDOK);
+			return;
+		}
+	}
+}
+
+void CMemoWnd::Init()
+{
+
+}
+
+
+

+ 76 - 0
zhipuzi_pos_windows/wnd/CMemoWnd.h

@@ -0,0 +1,76 @@
+#pragma once
+
+#include "../pch/pch.h"
+#include "CMainWnd.h"
+
+class CMemoWnd : public CWindowWnd, public INotifyUI, public IMessageFilterUI
+{
+public:
+	LPCTSTR GetWindowClassName() const
+	{
+		return _T("UIMemoWndFrame");
+	};
+
+	UINT GetClassStyle() const
+	{
+		return UI_CLASSSTYLE_DIALOG;
+	};
+
+	void OnFinalMessage(HWND /*hWnd*/)
+	{
+		//WindowImplBase::OnFinalMessage(hWnd);
+		m_pm.RemovePreMessageFilter(this);
+
+		//delete this;
+	};
+
+	void Init();
+
+	std::string getMemo()
+	{
+		return m_memo;
+	}
+
+	void SetTitle(std::wstring title)
+	{
+		CLabelUI* pLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("memo_dlg_title")));
+		pLabel->SetText(title.c_str());
+	}
+
+	void Notify(TNotifyUI& msg);
+
+	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		if (::IsIconic(*this))
+		{
+			bHandled = FALSE;
+		}
+		return (wParam == 0) ? TRUE : FALSE;
+	}
+
+	LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		return 0;
+	}
+
+	LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+	{
+		return 0;
+	}
+
+	LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+
+	LRESULT OnSize(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);
+
+public:
+	CPaintManagerUI m_pm;
+
+	std::string m_memo;
+};
+

+ 182 - 0
zhipuzi_pos_windows/zhipuzi/CDiandanOrder.cpp

@@ -0,0 +1,182 @@
+#include "../pch/pch.h"
+#include "CDiandanOrder.h"
+
+int CDiandanOrder::getItemNum()
+{
+	return m_items.size();
+}
+
+std::string CDiandanOrder::getTotalPriceShow()
+{
+	return m_total_price_show;
+}
+
+CDiandanOrderItem CDiandanOrder::getDiandanOrderItem(int index)
+{
+	return m_items[index];
+}
+
+//这个函数的逻辑是选择一个新商品的时候,与已有商品进行对比,看看是加一个新的商品,还是对已有商品增加数量
+//返回值是表示新加的item,在第几个元素,方便刷新显示
+int CDiandanOrder::AddItem(CDiandanOrderItem newitem, bool& is_add_new)
+{
+	int index = 0;
+	bool is_found = false;
+
+	for (std::vector<CDiandanOrderItem>::iterator it = m_items.begin(); it != m_items.end(); it++)
+	{
+		CDiandanOrderItem curItem = *it;
+
+		if (curItem == newitem)
+		{
+			is_found = true;
+			break;
+		}
+
+		index++;
+	}
+
+	//如果找到了,更新数量
+	if (is_found)
+	{
+		std::string old_num = m_items[index].num;
+
+		double d_old_num = std::stod(old_num);
+		double d_new_num = d_old_num + 1;
+
+		//如果新的数量是一个整数,那么展示的时候就把小数去掉
+		if (d_new_num - (int)d_new_num < 0.0001)
+		{
+			m_items[index].num = std::to_string((int)d_new_num);
+		}
+		else
+		{
+			m_items[index].num = CLewaimaiString::DoubleToString(d_new_num, 3);
+		}
+
+		m_items[index].UpdateShowPrice();
+
+		UpdateTotalPriceShow();
+
+		is_add_new = false;
+	}
+	else
+	{
+		//如果没找到,直接加一个新的item
+		m_items.push_back(newitem);
+
+		m_items[index].UpdateShowPrice();
+
+		UpdateTotalPriceShow();
+
+		is_add_new = true;
+	}
+
+	return index;
+}
+
+void CDiandanOrder::UpdateItemGuige(int index, std::vector<FoodNatureSelectValue>& natureSelectedArray)
+{
+	m_items[index].natureSelectedArray = natureSelectedArray;
+
+	this->UpdateGuigePrice(index);
+}
+
+void CDiandanOrder::UpdateTotalPriceShow()
+{
+	double total_price_show = 0;
+
+	for (std::vector<CDiandanOrderItem>::iterator it = m_items.begin(); it != m_items.end(); it++)
+	{
+		total_price_show += std::stod((*it).show_price);
+	}
+
+	m_total_price_show = CLewaimaiString::DoubleToString(total_price_show, 2);
+}
+
+//给某一项添加一个数量
+void CDiandanOrder::AddNum(int index)
+{
+	std::string old_num = m_items[index].num;
+
+	double d_old_num = std::stod(old_num);
+	double d_new_num = d_old_num + 1;
+
+	//如果新的数量是一个整数,那么展示的时候就把小数去掉
+	if (d_new_num - (int)d_new_num < 0.0001)
+	{
+		m_items[index].num = std::to_string((int)d_new_num);
+	}
+	else
+	{
+		m_items[index].num = CLewaimaiString::DoubleToString(d_new_num, 3);
+	}
+
+	m_items[index].UpdateShowPrice();
+
+	UpdateTotalPriceShow();
+}
+
+//给某一项减少一个数量,返回值为true表示商品本删掉了,也就是为0份;如果为false表示没被删掉
+bool CDiandanOrder::DelNum(int index)
+{
+	std::string old_num = m_items[index].num;
+
+	double d_old_num = std::stod(old_num);
+	double d_new_num = d_old_num - 1;
+
+	if (d_new_num < 0.0001)
+	{
+		//已经减为0了,那么就删掉这个item
+		m_items.erase(m_items.begin() + index);
+		UpdateTotalPriceShow();
+
+		return true;
+	}
+	else
+	{
+		//如果新的数量是一个整数,那么展示的时候就把小数去掉
+		if (d_new_num - (int)d_new_num < 0.0001)
+		{
+			m_items[index].num = std::to_string((int)d_new_num);
+		}
+		else
+		{
+			m_items[index].num = CLewaimaiString::DoubleToString(d_new_num, 3);
+		}
+
+		m_items[index].UpdateShowPrice();
+	}
+
+	UpdateTotalPriceShow();
+
+	return false;
+}
+
+//删除某一项
+void CDiandanOrder::Remove(int index)
+{
+	//已经减为0了,那么就删掉这个item
+	m_items.erase(m_items.begin() + index);
+	UpdateTotalPriceShow();
+}
+
+//更新了某项的规格,那么重新刷新显示和价格
+void CDiandanOrder::UpdateGuigePrice(int index)
+{
+	m_items[index].UpdateShowPrice();
+
+	UpdateTotalPriceShow();
+}
+
+//清空商品
+void CDiandanOrder::Clear()
+{
+	m_items.clear();
+	UpdateTotalPriceShow();
+}
+
+void CDiandanOrder::SetMemo(std::string memo)
+{
+	m_memo = memo;
+}

+ 20 - 151
zhipuzi_pos_windows/zhipuzi/CDiandanOrder.h

@@ -162,171 +162,40 @@ public:
 
 	std::string m_total_price_show;
 
-	int getItemNum()
-	{
-		return m_items.size();
-	}
-
-	std::string getTotalPriceShow()
-	{
-		return m_total_price_show;
-	}
-
-	CDiandanOrderItem getDiandanOrderItem(int index)
-	{
-		return m_items[index];
-	}
-
-	//这个函数的逻辑是选择一个新商品的时候,与已有商品进行对比,看看是加一个新的商品,还是对已有商品增加数量
-	//返回值是表示新加的item,在第几个元素,方便刷新显示
-	int AddItem(CDiandanOrderItem newitem, bool& is_add_new)
-	{
-		int index = 0;
-		bool is_found = false;
-
-		for (std::vector<CDiandanOrderItem>::iterator it = m_items.begin(); it != m_items.end(); it++)
-		{
-			CDiandanOrderItem curItem = *it;
-
-			if (curItem == newitem)
-			{
-				is_found = true;
-				break;
-			}
-
-			index++;
-		}
-
-		//如果找到了,更新数量
-		if (is_found)
-		{
-			std::string old_num = m_items[index].num;
-
-			double d_old_num = std::stod(old_num);
-			double d_new_num = d_old_num + 1;
-
-			//如果新的数量是一个整数,那么展示的时候就把小数去掉
-			if (d_new_num - (int)d_new_num < 0.0001)
-			{
-				m_items[index].num = std::to_string((int)d_new_num);
-			}
-			else
-			{
-				m_items[index].num = CLewaimaiString::DoubleToString(d_new_num, 3);
-			}
-
-			m_items[index].UpdateShowPrice();
-
-			UpdateTotalPriceShow();
-
-			is_add_new = false;
-		}
-		else
-		{
-			//如果没找到,直接加一个新的item
-			m_items.push_back(newitem);
-
-			m_items[index].UpdateShowPrice();
-
-			UpdateTotalPriceShow();
+private:
+	//订单的整单备注
+	std::string m_memo;
 
-			is_add_new = true;
-		}
+public:
 
-		return index;
-	}
+	int getItemNum();
 
-	void UpdateItemGuige(int index, std::vector<FoodNatureSelectValue>& natureSelectedArray)
-	{
-		m_items[index].natureSelectedArray = natureSelectedArray;
+	std::string getTotalPriceShow();
 
-		this->UpdateGuigePrice(index);
-	}
+	CDiandanOrderItem getDiandanOrderItem(int index);
 
-	void UpdateTotalPriceShow()
-	{
-		double total_price_show = 0;
+	//这个函数的逻辑是选择一个新商品的时候,与已有商品进行对比,看看是加一个新的商品,还是对已有商品增加数量
+	//返回值是表示新加的item,在第几个元素,方便刷新显示
+	int AddItem(CDiandanOrderItem newitem, bool& is_add_new);
 
-		for (std::vector<CDiandanOrderItem>::iterator it = m_items.begin(); it != m_items.end(); it++)
-		{
-			total_price_show += std::stod((*it).show_price);
-		}
+	void UpdateItemGuige(int index, std::vector<FoodNatureSelectValue>& natureSelectedArray);
 
-		m_total_price_show = CLewaimaiString::DoubleToString(total_price_show, 2);
-	}
+	void UpdateTotalPriceShow();
 
 	//给某一项添加一个数量
-	void AddNum(int index)
-	{
-		std::string old_num = m_items[index].num;
-
-		double d_old_num = std::stod(old_num);
-		double d_new_num = d_old_num + 1;
-
-		//如果新的数量是一个整数,那么展示的时候就把小数去掉
-		if (d_new_num - (int)d_new_num < 0.0001)
-		{
-			m_items[index].num = std::to_string((int)d_new_num);
-		}
-		else
-		{
-			m_items[index].num = CLewaimaiString::DoubleToString(d_new_num, 3);
-		}
-
-		m_items[index].UpdateShowPrice();
-
-		UpdateTotalPriceShow();
-	}
+	void AddNum(int index);
 
 	//给某一项减少一个数量,返回值为true表示商品本删掉了,也就是为0份;如果为false表示没被删掉
-	bool DelNum(int index)
-	{
-		std::string old_num = m_items[index].num;
-
-		double d_old_num = std::stod(old_num);
-		double d_new_num = d_old_num - 1;
-
-		if (d_new_num < 0.0001)
-		{
-			//已经减为0了,那么就删掉这个item
-			m_items.erase(m_items.begin() + index);
-			UpdateTotalPriceShow();
-
-			return true;
-		}
-		else
-		{
-			//如果新的数量是一个整数,那么展示的时候就把小数去掉
-			if (d_new_num - (int)d_new_num < 0.0001)
-			{
-				m_items[index].num = std::to_string((int)d_new_num);
-			}
-			else
-			{
-				m_items[index].num = CLewaimaiString::DoubleToString(d_new_num, 3);
-			}
-
-			m_items[index].UpdateShowPrice();
-		}
-
-		UpdateTotalPriceShow();
-
-		return false;
-	}
+	bool DelNum(int index);
 
 	//删除某一项
-	void Remove(int index)
-	{
-		//已经减为0了,那么就删掉这个item
-		m_items.erase(m_items.begin() + index);
-		UpdateTotalPriceShow();
-	}
+	void Remove(int index);
 
 	//更新了某项的规格,那么重新刷新显示和价格
-	void UpdateGuigePrice(int index)
-	{
-		m_items[index].UpdateShowPrice();
+	void UpdateGuigePrice(int index);
 
-		UpdateTotalPriceShow();
-	}
+	//清空商品
+	void Clear();
+
+	void SetMemo(std::string memo);
 };

+ 3 - 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\CMemoWnd.h" />
     <ClInclude Include="control\CDiandanNatureItemUI.h" />
     <ClInclude Include="wnd\CDiandanNatureWnd.h" />
     <ClInclude Include="control\CFoodtypeOptionUI.h" />
@@ -270,6 +271,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="helper\CSystem.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="wnd\CMemoWnd.cpp" />
     <ClCompile Include="control\CDiandanNatureItemUI.cpp" />
     <ClCompile Include="wnd\CDiandanNatureWnd.cpp" />
     <ClCompile Include="control\CFoodtypeOptionUI.cpp" />
@@ -289,6 +291,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClCompile Include="tool\CSetting.cpp" />
     <ClCompile Include="tool\CSqlite3.cpp" />
     <ClCompile Include="network\CMessagePush.cpp" />
+    <ClCompile Include="zhipuzi\CDiandanOrder.cpp" />
     <ClCompile Include="zhipuzi\CWaimaiOrder.cpp" />
     <ClCompile Include="tool\CPosPrinter.cpp" />
     <ClCompile Include="control\CWaimaiOrderItemUI.cpp" />

+ 9 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -144,6 +144,9 @@
     <ClInclude Include="control\CDiandanNatureItemUI.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="wnd\CMemoWnd.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">
@@ -248,6 +251,12 @@
     <ClCompile Include="control\CDiandanNatureItemUI.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="wnd\CMemoWnd.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="zhipuzi\CDiandanOrder.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="resource\zhipuzi.ico">