张洋 1 month ago
parent
commit
a84484ce96

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

@@ -5,15 +5,15 @@
 		<Label name="saomashouyin_cart_item_xuhao" width="50" height="42" align="center"/> 
 
 		<VerticalLayout width="200" height="84">
-			<Label name="saomashouyin_cart_item_name" width="200" height="42" align="left" valign="vcenter" padding="0,0,0,0"  endellipsis="true"/>
+			<Label name="saomashouyin_cart_item_name" width="200" height="42" align="center" valign="vcenter" padding="0,0,0,0"  endellipsis="true"/>
 
-			<Label name="saomashouyin_cart_item_nature" width="200" height="42" align="left" padding="0,0,10,0" textcolor="#FF808080" visiable="false" wordbreak="true" endellipsis="true" />
+			<Label name="saomashouyin_cart_item_nature" width="200" height="42" align="center" padding="0,0,10,0" textcolor="#FF808080" visiable="false" wordbreak="true" endellipsis="true" />
 		</VerticalLayout>
 		
-		<Label name="saomashouyin_cart_item_tiaoma" width="120" height="42" align="center"/> 
+		<Label name="saomashouyin_cart_item_tiaoma" width="150" height="42" align="center"/> 
 
 		<Label name="saomashouyin_cart_item_danjia" width="80" height="42" align="center"/> 
-		<Label name="saomashouyin_cart_item_num" width="80" height="42" align="center"/> 
+		<Label name="saomashouyin_cart_item_num" width="50" height="42" align="center"/> 
 		<Label name="saomashouyin_cart_item_price" width="80" height="42" align="center"/>
 	</ListContainerElement> 
 </Window>

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

@@ -35,10 +35,10 @@
 					<List name="list_saomashouyin_cart" padding="0,0,0,0" itemlinecolor="#FF000000" itemvalign="vcenter" vscrollbar="true">
 						<ListHeader inset="0,0,0,0" height="42">
 							<ListHeaderItem text="序号" width="50" align="center" />
-							<ListHeaderItem text="商品" width="200" align="left" />
-							<ListHeaderItem text="条码" width="120" align="center" />
+							<ListHeaderItem text="商品" width="200" align="center" />
+							<ListHeaderItem text="条码" width="150" align="center" />
 							<ListHeaderItem text="单价" width="80" align="center" />
-							<ListHeaderItem text="数量" width="80" align="center" />
+							<ListHeaderItem text="数量" width="50" align="center" />
 							<ListHeaderItem text="小计" width="80" align="center" />
 						</ListHeader>
 					</List>

+ 2 - 1
zhipuzi_pos_windows/page/CSaomashouyinPageUI.cpp

@@ -904,7 +904,7 @@ void CSaomashouyinPageUI::UpdateShopcartShow(bool is_add_new)
 			pName->SetText(CLewaimaiString::UTF8ToUnicode(item.getNameShow()).c_str());
 
 			CLabelUI* pTiaoma = static_cast<CLabelUI*>(pEle->FindSubControl(_T("saomashouyin_cart_item_tiaoma")));
-			pTiaoma->SetText(L"abc");
+			pTiaoma->SetText(CLewaimaiString::UTF8ToUnicode(item.barcode).c_str());
 
 			CLabelUI* pDanjia = static_cast<CLabelUI*>(pEle->FindSubControl(_T("saomashouyin_cart_item_danjia")));
 			pDanjia->SetText(CLewaimaiString::UTF8ToUnicode(item.price).c_str());
@@ -1584,6 +1584,7 @@ void CSaomashouyinPageUI::ClickFoodAction()
 		clickItem.food_id = foodinfo.id;
 		clickItem.food_name = foodinfo.name;
 		clickItem.type_id = foodinfo.type_id;
+		clickItem.barcode = foodinfo.barcode;
 		clickItem.price = foodinfo.price;
 		clickItem.is_dabao = false;
 		clickItem.dabao_money = foodinfo.dabao_money;

+ 20 - 18
zhipuzi_pos_windows/zhipuzi/CDiandanOrderItem.h

@@ -1,4 +1,4 @@
-#pragma once
+锘�#pragma once
 
 #include "../zhipuzi/CFood.h"
 #include "../zhipuzi/CFoodpackage.h"
@@ -14,40 +14,42 @@ public:
 };
 
 /**
- * 订单中的一个商品
+ * 璁㈠崟涓�殑涓€涓�晢鍝�
  */
 class CDiandanOrderItem
 {
 public:
-	//是否套餐的Item,因为目前套餐和普通商品都是用同一个Item类
+	//鏄�惁濂楅�鐨処tem锛屽洜涓虹洰鍓嶅�椁愬拰鏅�€氬晢鍝侀兘鏄�敤鍚屼竴涓狪tem绫�
 	bool m_is_taocan = false;
 
-	//普通商品才有的信息
+	//鏅�€氬晢鍝佹墠鏈夌殑淇℃伅
 	std::string food_id;
 	std::string food_name;
 	std::string type_id;
+	std::string barcode;
+
 	bool is_weight = false;
 
 	bool is_nature = false;
 
-	//会员价
+	//浼氬憳浠�
 	bool is_member_price_used;
 	std::vector<MemberPrice> m_member_price;
 
-	//套餐才有的信息
+	//濂楅�鎵嶆湁鐨勪俊鎭�
 	std::string foodpackage_id;
 	std::string foodpackage_name;
 
-	//这个是套餐和普通商品共有的信息
+	//杩欎釜鏄��椁愬拰鏅�€氬晢鍝佸叡鏈夌殑淇℃伅
 	std::string price;
 	bool is_dabao = false;
 	std::string dabao_money;
 	std::string num;
 
-	//这个用来存储所有属性选择的信息,每个属性选择的是第几个,什么价格等等
+	//杩欎釜鐢ㄦ潵瀛樺偍鎵€鏈夊睘鎬ч€夋嫨鐨勪俊鎭�紝姣忎釜灞炴€ч€夋嫨鐨勬槸绗�嚑涓�紝浠€涔堜环鏍肩瓑绛�
 	std::vector<FoodNatureSelectValue> natureSelectedArray;
 
-	//这个是商品对外展示的价格,根据数量和属性来计算的,不包含打包费
+	//杩欎釜鏄�晢鍝佸�澶栧睍绀虹殑浠锋牸锛屾牴鎹�暟閲忓拰灞炴€ф潵璁$畻鐨勶紝涓嶅寘鍚�墦鍖呰垂
 	std::string show_price;
 
 private:
@@ -72,30 +74,30 @@ public:
 
 	bool GetIsTaocan();
 
-	//根据当前选中的商品属性、份数,计算商品的展示价格
+	//鏍规嵁褰撳墠閫変腑鐨勫晢鍝佸睘鎬с€佷唤鏁帮紝璁$畻鍟嗗搧鐨勫睍绀轰环鏍�
 	void UpdateShowPrice();
 
-	//这个是单价,包含属性价格,不考虑数量,也就是“1份”的价格
+	//杩欎釜鏄�崟浠凤紝鍖呭惈灞炴€т环鏍硷紝涓嶈€冭檻鏁伴噺锛屼篃灏辨槸鈥�1浠解€濈殑浠锋牸
 	std::string getSinglePrice();
 
-	//获取用户展示的商品名字,如果有打包会在前面显示【打包】,不包含商品属性
+	//鑾峰彇鐢ㄦ埛灞曠ず鐨勫晢鍝佸悕瀛楋紝濡傛灉鏈夋墦鍖呬細鍦ㄥ墠闈㈡樉绀恒€愭墦鍖呫€戯紝涓嶅寘鍚�晢鍝佸睘鎬�
 	std::string getNameShow();
 
-	//获取用于展示的属性名字,仅仅是属性名字,如“热、多糖、大杯”
+	//鑾峰彇鐢ㄤ簬灞曠ず鐨勫睘鎬у悕瀛楋紝浠呬粎鏄�睘鎬у悕瀛楋紝濡傗€滅儹銆佸�绯栥€佸ぇ鏉�€�
 	std::string getNatureShow();
 
-	//获取用于完整展示的商品名字,包含商品本身的名字和属性,例如“【打包】珍珠奶茶【大杯、热、多糖】”
+	//鑾峰彇鐢ㄤ簬瀹屾暣灞曠ず鐨勫晢鍝佸悕瀛楋紝鍖呭惈鍟嗗搧鏈�韩鐨勫悕瀛楀拰灞炴€э紝渚嬪�鈥溿€愭墦鍖呫€戠弽鐝犲ザ鑼躲€愬ぇ鏉�€佺儹銆佸�绯栥€戔€�
 	std::string getNameWanzhengShow();
 
-	//根据当前会员等级,计算该商品的会员优惠金额
+	//鏍规嵁褰撳墠浼氬憳绛夌骇锛岃�绠楄�鍟嗗搧鐨勪細鍛樹紭鎯犻噾棰�
 	double getMemberYouhui(std::string member_level);
 
-	//计算当前这个商品的打包费
+	//璁$畻褰撳墠杩欎釜鍟嗗搧鐨勬墦鍖呰垂
 	double getDabaoMoney();
 
-	//获取点单相关的参数(仅用于非套餐)
+	//鑾峰彇鐐瑰崟鐩稿叧鐨勫弬鏁帮紙浠呯敤浜庨潪濂楅�锛�
 	std::map<std::string, std::string> getDiandanParam();
 
-	//获取点单相关的套餐参数(仅用于套餐)
+	//鑾峰彇鐐瑰崟鐩稿叧鐨勫�椁愬弬鏁帮紙浠呯敤浜庡�椁愶級
 	rapidjson::Document getDiandanTaocanParam(rapidjson::Document::AllocatorType &allocator);
 };