张洋 4 anni fa
parent
commit
bce41cdd1f

BIN
bin/Win32/Debug/zhipuzi_pos_windows/db/pos.db


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

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<Window> 
+	<ListContainerElement name="diandan_cart_item" height="60"> 
+		<HorizontalLayout> 
+			<Label name="diandan_cart_item_name" width="180" height="80" align="left"/> 
+			<Label name="diandan_cart_item_num" width="60" align="left"/> 
+			<Label name="diandan_cart_item_price" width="60" align="left"/>
+		</HorizontalLayout> 
+	</ListContainerElement> 
+</Window>

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_fooditem.xml

@@ -2,7 +2,7 @@
 <Window>
 	<Font id="diandan_price" name="微软雅黑" size="20" />
 	
-	<DiandanFoodItem bkcolor="#FFFFFFFF" padding="0,0,7,7">
+	<DiandanFoodItem name="diandan_fooditem" bkcolor="#FFFFFFFF" padding="0,0,7,7">
 		<Control name="image" height="135" bkimage="file='food_image_default.png'" padding="0,0,0,0"></Control>
 		<Label name="foodname" width="135" height="40" multiline="true" endellipsis="true"></Label>
 		<Label name="price" height="30" font="daindan_price" textcolor="#FFFF7F50" align="right"></Label>

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_page.xml

@@ -61,7 +61,7 @@
 				<HorizontalLayout height="48" padding="15,15,15,15">
 					<Edit name="diandan_food_search_edit" tooltip="请输入商品名字搜索" width="300" 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'" />
 					
-					<Button name="btn_diandan_budabao" width="100" height="48" padding="10,0,10,0" text="搜索商品" textcolor="#FFFFFFFF" />
+					<Button name="btn_diandan_searchfood" width="100" height="48" padding="10,0,10,0" text="搜索商品" textcolor="#FFFFFFFF" />
 				</HorizontalLayout>
 			</VerticalLayout>
 		</HorizontalLayout>

+ 62 - 16
zhipuzi_pos_windows/control/CDiandanFoodItemUI.cpp

@@ -17,28 +17,74 @@ void CDiandanFoodItemUI::SetFoodInfo(CFood info)
 	m_foodinfo = info;
 }
 
-void CDiandanFoodItemUI::UpdateShow()
+void CDiandanFoodItemUI::SetFoodpackageInfo(CFoodpackage info)
 {
-	CControlUI* pImage = static_cast<CControlUI*>(this->FindSubControl(_T("image")));
+	m_foodpackageinfo = info;
 
-	//获取本地图片的路径
-	std::wstring imagepath = m_foodinfo.getImageTmpPath();
-	if (CSystem::IsFileExist(imagepath.c_str()))
-	{
-		//图片已经存在,直接显示
-		pImage->SetBkImage(imagepath.c_str());
-	}
+	m_is_taocan = true;
+}
+
+CFood CDiandanFoodItemUI::GetFoodInfo()
+{
+	return m_foodinfo;
+}
 
-	CLabelUI* pName = static_cast<CLabelUI*>(this->FindSubControl(_T("foodname")));
-	pName->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.name).c_str());
+CFoodpackage CDiandanFoodItemUI::GetFoodpackageInfo()
+{
+	return m_foodpackageinfo;
+}
 
-	CLabelUI* pPrice = static_cast<CLabelUI*>(this->FindSubControl(_T("price")));
+bool CDiandanFoodItemUI::GetIsTaocan()
+{
+	return m_is_taocan;
+}
 
-	wstring price = L"¥" + CLewaimaiString::UTF8ToUnicode(m_foodinfo.price);
-	if (m_foodinfo.is_nature == "1")
+void CDiandanFoodItemUI::UpdateShow()
+{
+	if (m_is_taocan)
 	{
-		price += L"起";
+		CControlUI* pImage = static_cast<CControlUI*>(this->FindSubControl(_T("image")));
+
+		//获取本地图片的路径
+		std::wstring imagepath = m_foodpackageinfo.getImageTmpPath();
+		if (CSystem::IsFileExist(imagepath.c_str()))
+		{
+			//图片已经存在,直接显示
+			pImage->SetBkImage(imagepath.c_str());
+		}
+
+		CLabelUI* pName = static_cast<CLabelUI*>(this->FindSubControl(_T("foodname")));
+		pName->SetText(CLewaimaiString::UTF8ToUnicode(m_foodpackageinfo.name).c_str());
+
+		CLabelUI* pPrice = static_cast<CLabelUI*>(this->FindSubControl(_T("price")));
+
+		wstring price = L"¥" + CLewaimaiString::UTF8ToUnicode(m_foodpackageinfo.price);
+
+		pPrice->SetText(price.c_str());
 	}
+	else
+	{
+		CControlUI* pImage = static_cast<CControlUI*>(this->FindSubControl(_T("image")));
+
+		//获取本地图片的路径
+		std::wstring imagepath = m_foodinfo.getImageTmpPath();
+		if (CSystem::IsFileExist(imagepath.c_str()))
+		{
+			//图片已经存在,直接显示
+			pImage->SetBkImage(imagepath.c_str());
+		}
+
+		CLabelUI* pName = static_cast<CLabelUI*>(this->FindSubControl(_T("foodname")));
+		pName->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.name).c_str());
 
-	pPrice->SetText(price.c_str());
+		CLabelUI* pPrice = static_cast<CLabelUI*>(this->FindSubControl(_T("price")));
+
+		wstring price = L"¥" + CLewaimaiString::UTF8ToUnicode(m_foodinfo.price);
+		if (m_foodinfo.is_nature == "1")
+		{
+			price += L"起";
+		}
+
+		pPrice->SetText(price.c_str());
+	}
 }

+ 35 - 0
zhipuzi_pos_windows/control/CDiandanFoodItemUI.h

@@ -3,7 +3,12 @@
 #include "../pch/pch.h"
 
 #include "../zhipuzi/CFood.h"
+#include "../zhipuzi/CFoodpackage.h"
 
+
+/**
+ * 商品和商品套餐的ITEM,都用这个
+ */
 class CDiandanFoodItemUI : public CVerticalLayoutUI
 {
 public:
@@ -11,11 +16,41 @@ public:
 	~CDiandanFoodItemUI();
 
 	void SetFoodInfo(CFood info);
+	void SetFoodpackageInfo(CFoodpackage info);
+
+	CFood GetFoodInfo();
+	CFoodpackage GetFoodpackageInfo();
+	bool GetIsTaocan();
 
 	//刷新显示
 	void UpdateShow();
 
+	void DoEvent(TEventUI& event)
+	{
+		if (event.Type == UIEVENT_BUTTONDOWN)
+		{
+			m_pManager->SendNotify(this, DUI_MSGTYPE_CLICK);
+		}
+		else if (event.Type == UIEVENT_MOUSEENTER)
+		{
+			HCURSOR hcur = LoadCursor(NULL, IDC_HAND);  //加载系统自带鼠标样式
+			HWND hwnd = m_pManager->GetPaintWindow(); // 获取绘图窗口句柄
+			SetClassLong(hwnd, GCL_HCURSOR, (long)hcur);
+		}
+		else if (event.Type == UIEVENT_MOUSELEAVE)
+		{
+			HCURSOR hcur = LoadCursor(NULL, IDC_ARROW);  //加载系统自带鼠标样式
+			HWND hwnd = m_pManager->GetPaintWindow(); // 获取绘图窗口句柄
+			SetClassLong(hwnd, GCL_HCURSOR, (long)hcur);
+		}
+
+		CVerticalLayoutUI::DoEvent(event);
+	}
+
 private:
 	CFood m_foodinfo;
+	CFoodpackage m_foodpackageinfo;
+
+	bool m_is_taocan = false;
 };
 

+ 117 - 5
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -48,13 +48,22 @@ void CDiandanPageUI::InitShow()
 		curTypeUI->Selected(true, false);
 	}
 
-	this->RefreshFoodShow();
+	this->RefreshFoodlist();
 }
 
 //处理按钮点击类事件
 void CDiandanPageUI::HandleClickMsg(TNotifyUI& msg)
 {
+	CDuiString name = msg.pSender->GetName();
 
+	if (name == L"diandan_fooditem")
+	{
+		CDiandanFoodItemUI* fooditemUI = static_cast<CDiandanFoodItemUI*>(msg.pSender);
+
+		m_cur_click_food_item = fooditemUI;
+
+		this->ClickFoodAction();
+	}
 }
 
 //处理option切换事件
@@ -72,7 +81,7 @@ void CDiandanPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
 
 		m_cur_type_id = id;
 
-		this->RefreshFoodShow();
+		this->RefreshFoodlist();
 	}
 }
 
@@ -93,7 +102,7 @@ void CDiandanPageUI::InitFoodtypeShow()
 		CFoodtypeOptionUI* pItem = static_cast<CFoodtypeOptionUI*>(builder.Create(_T("foodtype_option.xml"), (UINT)0, &cb, m_pManager));
 
 		pItem->SetName(L"商品套餐");
-		pItem->SetTypeId("0");
+		pItem->SetTypeId("taocan");
 		pItem->SetTaocan();
 		pItem->SetGroup(L"diandan_foodtype");
 
@@ -118,11 +127,11 @@ void CDiandanPageUI::InitFoodtypeShow()
 	}
 }
 
-void CDiandanPageUI::RefreshFoodShow()
+void CDiandanPageUI::RefreshFoodlist()
 {
 	m_foodLayout->RemoveAll();
 
-	//如果当前一个分类都没有,那么就处理了
+	//如果当前一个分类都没有,那么就处理了
 	if (m_cur_type_id == "")
 	{
 		return;
@@ -130,6 +139,23 @@ void CDiandanPageUI::RefreshFoodShow()
 	else if (m_cur_type_id == "taocan")
 	{
 		//选择的是套餐分类
+		CSqlite3 sqlite;
+		std::vector<CFoodpackage> foodlist = sqlite.GetFoodpackages(true);
+
+		for (std::vector<CFoodpackage>::iterator it = foodlist.begin(); it != foodlist.end(); it++)
+		{
+			CFoodpackage food = *it;
+
+			CDialogBuilder builder;
+			CDialogBuilderCallbackEx cb;
+
+			CDiandanFoodItemUI* pItem = static_cast<CDiandanFoodItemUI*>(builder.Create(_T("diandan_fooditem.xml"), (UINT)0, &cb, m_pManager));
+
+			pItem->SetFoodpackageInfo(food);
+			pItem->UpdateShow();
+
+			m_foodLayout->Add(pItem);
+		}
 	}
 	else
 	{
@@ -152,3 +178,89 @@ void CDiandanPageUI::RefreshFoodShow()
 		}
 	}
 }
+
+void CDiandanPageUI::AddDiandanOrderItemShow(CDiandanOrderItem item)
+{
+	CListUI* pList = static_cast<CListUI*>(this->FindSubControl(_T("list_diandan_cart")));
+
+	CDialogBuilder builder;
+	CListContainerElementUI* pEle = static_cast<CListContainerElementUI*>(builder.Create(_T("diandan_cart_item.xml"), (UINT)0, NULL, m_pManager));
+
+	CLabelUI* pName = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_name")));
+	pName->SetText(CLewaimaiString::UTF8ToUnicode(item.food_name).c_str());
+
+	CLabelUI* pNum = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_num")));
+	pNum->SetText(CLewaimaiString::UTF8ToUnicode(item.num).c_str());
+
+	CLabelUI* pPrice = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_price")));
+	pPrice->SetText(CLewaimaiString::UTF8ToUnicode(item.price).c_str());
+
+	pList->Add(pEle);
+}
+
+void CDiandanPageUI::UpdateDiandanOrderItemShow(int index)
+{
+	CDiandanOrderItem item = m_cur_diandan_order.getDiandanOrderItem(index);
+
+	CListUI* pList = static_cast<CListUI*>(this->FindSubControl(_T("list_diandan_cart")));
+
+	CListContainerElementUI* pEle = static_cast<CListContainerElementUI*>(pList->GetItemAt(index));
+
+	CLabelUI* pName = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_name")));
+	pName->SetText(CLewaimaiString::UTF8ToUnicode(item.food_name).c_str());
+
+	CLabelUI* pNum = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_num")));
+	pNum->SetText(CLewaimaiString::UTF8ToUnicode(item.num).c_str());
+
+	CLabelUI* pPrice = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_price")));
+	pPrice->SetText(CLewaimaiString::UTF8ToUnicode(item.price).c_str());
+}
+
+void CDiandanPageUI::ClickFoodAction()
+{
+	bool is_taocan = m_cur_click_food_item->GetIsTaocan();
+
+	if (is_taocan)
+	{
+		//点击套餐之后的处理逻辑
+	}
+	else
+	{
+		//点击普通商品之后的处理逻辑
+		CFood foodinfo = m_cur_click_food_item->GetFoodInfo();
+
+		if (foodinfo.is_nature == "1")
+		{
+			//商品有商品属性
+		}
+		else
+		{
+			//商品没有商品属性
+			CDiandanOrderItem clickItem;
+
+			clickItem.food_id = foodinfo.id;
+			clickItem.food_name = foodinfo.name;
+			clickItem.type_id = foodinfo.type_id;
+			clickItem.price = foodinfo.price;
+			clickItem.is_dabao = "";
+			clickItem.num = "1";
+			clickItem.is_foodpackage = "0";
+			clickItem.is_weight = "0";
+
+			bool is_add_new = false;
+
+			int index = m_cur_diandan_order.AddItem(clickItem, is_add_new);
+
+			if (is_add_new)
+			{
+				//说明是新增了一项,要刷新一下购物车展示
+				this->AddDiandanOrderItemShow(clickItem);
+			}
+			else
+			{
+				//没有新增,而是修改了一项
+				this->UpdateDiandanOrderItemShow(index);
+			}
+		}
+	}
+}

+ 19 - 1
zhipuzi_pos_windows/page/CDiandanPageUI.h

@@ -3,7 +3,12 @@
 #include "../pch/pch.h"
 #include "CBasePageUI.h"
 
+#include "../zhipuzi/CFood.h"
 #include "../zhipuzi/CFoodtype.h"
+#include "../zhipuzi/CFoodpackage.h"
+
+#include "../control/CDiandanFoodItemUI.h"
+#include "../zhipuzi/CDiandanOrder.h"
 
 class CDiandanPageUI : public CBasePageUI
 {
@@ -26,7 +31,16 @@ public:
 	void InitFoodtypeShow();
 
 	//刷新商品展示
-	void RefreshFoodShow();
+	void RefreshFoodlist();
+
+	//添加一个新的商品到购物车展示
+	void AddDiandanOrderItemShow(CDiandanOrderItem item);
+
+	//刷新某个购物车商品的显示
+	void UpdateDiandanOrderItemShow(int index);
+
+	//点击某一个商品的item之后的处理逻辑
+	void ClickFoodAction();
 
 private:
 	CTileLayoutUI* m_foodLayout;
@@ -40,5 +54,9 @@ private:
 
 	//当前选中的商品分类ID,为空表示没选中任何分类,为taocan表示选中套餐分类,如果选中普通商品分类就是分类ID
 	std::string m_cur_type_id = "";
+
+	CDiandanFoodItemUI* m_cur_click_food_item;
+	
+	CDiandanOrder m_cur_diandan_order;
 };
 

+ 52 - 0
zhipuzi_pos_windows/tool/CSqlite3.cpp

@@ -1101,4 +1101,56 @@ std::vector<CFood> CSqlite3::GetFoodByTypeid(std::string type_id, bool is_shouyi
 	}
 
 	return data;
+}
+
+std::vector<CFoodpackage> CSqlite3::GetFoodpackages(bool is_shouyinji_show)
+{
+	std::vector<CFoodpackage> data;
+
+	std::string sql;
+
+	if (is_shouyinji_show)
+	{
+		sql = "SELECT * FROM pos_foodpackage WHERE is_shouyinji_show = '1'";
+	}
+	else
+	{
+		sql = "SELECT * FROM pos_foodpackage";
+	}
+
+	sqlite3_stmt * stmt = NULL;
+
+	if (sqlite3_prepare_v2(m_db, sql.c_str(), -1, &stmt, NULL) == SQLITE_OK)
+	{
+		while (sqlite3_step(stmt) == SQLITE_ROW)
+		{
+			CFoodpackage newFood;
+
+			newFood.id = (char*)sqlite3_column_text(stmt, 0);
+			newFood.shop_id = (char*)sqlite3_column_text(stmt, 1);
+			newFood.name = (char*)sqlite3_column_text(stmt, 2);
+			newFood.price = (char*)sqlite3_column_text(stmt, 3);
+			newFood.tag = (char*)sqlite3_column_text(stmt, 4);
+			newFood.status = (char*)sqlite3_column_text(stmt, 5);
+			newFood.is_dabao = (char*)sqlite3_column_text(stmt, 6);
+			newFood.dabao_money = (char*)sqlite3_column_text(stmt, 7);
+			newFood.nature = (char*)sqlite3_column_text(stmt, 8);
+			newFood.goods_img = (char*)sqlite3_column_text(stmt, 9);
+			newFood.unit = (char*)sqlite3_column_text(stmt, 10);
+			newFood.supporttype = (char*)sqlite3_column_text(stmt, 11);
+			newFood.is_shouyinji_show = (char*)sqlite3_column_text(stmt, 12);
+			newFood.barcode = (char*)sqlite3_column_text(stmt, 13);
+
+			data.push_back(newFood);
+		}
+
+		sqlite3_finalize(stmt);
+	}
+	else
+	{
+		//Òì³£Çé¿ö
+		sqlite3_finalize(stmt);
+	}
+
+	return data;
 }

+ 2 - 1
zhipuzi_pos_windows/tool/CSqlite3.h

@@ -6,6 +6,7 @@
 
 #include "../zhipuzi/CFoodtype.h"
 #include "../zhipuzi/CFood.h"
+#include "../zhipuzi/CFoodpackage.h"
 
 class CSqlite3
 {
@@ -37,8 +38,8 @@ public:
 	int GetFoodpackageNum();
 
 	std::vector<CFoodType> GetFoodtypes(bool is_shouyinji_show = true);
-
 	std::vector<CFood> GetFoodByTypeid(std::string type_id, bool is_shouyinji_show = true);
+	std::vector<CFoodpackage> GetFoodpackages(bool is_shouyinji_show = true);
 
 private:
 	bool ExeSQl(std::string sql);

+ 32 - 0
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -69,6 +69,38 @@ void CMainWnd::UpdateFoodImage()
 			LOG_INFO("URLDownloadToFile Fail,Error"<<GetLastError());
 		}
 	}	
+
+	//再处理商品套餐的图片
+	std::vector<CFoodpackage> foodpackagelist = sqlite.GetFoodpackages(true);
+	for (std::vector<CFoodpackage>::iterator it = foodpackagelist.begin(); it != foodpackagelist.end(); it++)
+	{
+		CFoodpackage food = *it;
+
+		if (food.goods_img.size() == 0)
+		{
+			//没有图片,直接跳过
+			continue;
+		}
+		std::wstring ws_goods_img = food.getImageUrl();
+		ws_goods_img += L"!max200"; //下载小图
+
+		wstring imagePath = food.getImageTmpPath();
+		if (CSystem::IsFileExist(imagePath))
+		{
+			//如果图片文件已经存在,直接跳过
+			continue;
+		}
+
+		//图片还不存在,开始下载
+		if (URLDownloadToFile(NULL, ws_goods_img.c_str(), imagePath.c_str(), 0, NULL) == S_OK)
+		{
+			//图片下载成功了,发个消息,更新图片
+		}
+		else
+		{
+			LOG_INFO("URLDownloadToFile Fail,Error" << GetLastError());
+		}
+	}
 }
 
 void CMainWnd::SwitchPage(MainPageName name)

+ 99 - 0
zhipuzi_pos_windows/zhipuzi/CDiandanOrder.h

@@ -0,0 +1,99 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+/**
+ * 订单中的一个商品
+ */
+class CDiandanOrderItem
+{
+public:
+	std::string food_id;
+	std::string food_name;
+	std::string type_id;
+	std::string price;
+	std::string is_dabao;
+	std::string num;
+	std::string is_foodpackage;
+	std::string is_weight;
+
+	bool is_nature;
+	std::string select_nature;
+};
+
+/**
+ * 点单里面的一个“订单”,每个选中的商品被加入订单,通过订单数据来计算价格,渲染界面,提交订单也是通过这个数据来提交
+ * 挂单、取单操作的也是订单
+ */
+class CDiandanOrder
+{
+public:
+	std::vector<CDiandanOrderItem> m_items;
+
+	int getItemNum()
+	{
+		return m_items.size();
+	}
+
+	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.food_id == newitem.food_id)
+			{
+				//商品ID一样,继续比较商品属性是否一样
+				if (curItem.is_nature)
+				{
+					if (curItem.select_nature == newitem.select_nature)
+					{
+						is_found = true;
+						break;
+					}
+				}
+				else
+				{
+					//如果没有属性,只要商品ID一样就行
+					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;
+
+			m_items[index].num = CLewaimaiString::DoubleToString(d_new_num, 3);
+
+			is_add_new = false;
+		}
+		else
+		{
+			//如果没找到,直接加一个新的item
+			m_items.push_back(newitem);
+
+			is_add_new = true;
+		}
+
+		return index;
+	}
+};

+ 55 - 0
zhipuzi_pos_windows/zhipuzi/CFoodpackage.h

@@ -0,0 +1,55 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+class CFoodpackage
+{
+public:
+	std::string id;
+	std::string shop_id;
+	std::string name;
+	std::string price;
+	std::string tag;
+	std::string status;
+	std::string is_dabao;
+	std::string dabao_money;
+	std::string nature;
+	std::string goods_img;
+	std::string unit;
+	std::string supporttype;
+	std::string is_shouyinji_show;
+	std::string barcode;
+
+	//获得图片完整的下载地址
+	std::wstring getImageUrl()
+	{
+		if (goods_img.size() == 0)
+		{
+			return L"";
+		}
+
+		std::string url_goods_img = "http://img.zhipuzi.com" + goods_img;
+		std::wstring ws_url_goods_img = CLewaimaiString::UTF8ToUnicode(url_goods_img);
+
+		return ws_url_goods_img;
+	}
+
+	//获取图片的本地临时目录存放路径
+	std::wstring getImageTmpPath()
+	{
+		if (goods_img.size() == 0)
+		{
+			return L"";
+		}
+
+		//纯文件名
+		std::string file_name = CLewaimaiString::GetPathOrURLShortName(goods_img);
+
+		//根据文件名,计算文件临时路径
+		wstring folderPath = CSystem::GetProgramDir() + L"\\tmp\\image\\";
+		wstring imagePath = folderPath + CLewaimaiString::UTF8ToUnicode(file_name);
+
+		return imagePath;
+	}
+};

+ 2 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -245,7 +245,9 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="tool\CSetting.h" />
     <ClInclude Include="tool\CSqlite3.h" />
     <ClInclude Include="network\CMessagePush.h" />
+    <ClInclude Include="zhipuzi\CDiandanOrder.h" />
     <ClInclude Include="zhipuzi\CFood.h" />
+    <ClInclude Include="zhipuzi\CFoodpackage.h" />
     <ClInclude Include="zhipuzi\CFoodtype.h" />
     <ClInclude Include="zhipuzi\CWaimaiOrder.h" />
     <ClInclude Include="tool\CPosPrinter.h" />

+ 6 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -132,6 +132,12 @@
     <ClInclude Include="zhipuzi\CFood.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="zhipuzi\CFoodpackage.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="zhipuzi\CDiandanOrder.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">