张洋 3 weeks ago
parent
commit
cd5ef41105

+ 11 - 12
bin/Win32/Debug/zhipuzi_pos_windows/skin/fuping_cart_item.xml

@@ -1,15 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-
-<Window> 
-	<ListContainerElement name="diandan_cart_item" width="460" height="42">
-		<VerticalLayout>
-			<HorizontalLayout height="42"> 
-				<Label name="diandan_cart_item_name" width="220" height="42" align="left" valign="vcenter" padding="10,0,0,0"  endellipsis="true"/>
-				<Label name="diandan_cart_item_singleprice" width="80" align="center"/> 
-				<Label name="diandan_cart_item_num" width="80" align="center"/> 
-				<Label name="diandan_cart_item_price" width="80" align="center"/>
-			</HorizontalLayout>
-			<Label name="diandan_cart_item_nature" width="220" height="42" align="left" padding="10,0,10,0" textcolor="#FF808080" visible="false" wordbreak="true" endellipsis="true" />
+<Window>
+	<!-- 购物车行:直接子项 = 每列一个(本项目 DuiLib 会把直接子项按索引对齐到表头列,勿包整体容器)。
+	     根 inset 10 与 ListHeader 对齐,商品200 + 单价80 + 数量80 + 金额80(总和 440 <= 440) -->
+	<ListContainerElement name="diandan_cart_item" height="56" inset="10,0,10,0">
+		<VerticalLayout width="200">
+			<Label name="diandan_cart_item_name" width="200" height="56" font="18" align="left" valign="vcenter" endellipsis="true"/>
+			<Label name="diandan_cart_item_nature" width="200" height="42" align="left" textcolor="#FF808080" visible="false" wordbreak="true" endellipsis="true"/>
 		</VerticalLayout>
 		</VerticalLayout>
-	</ListContainerElement> 
+		<Label name="diandan_cart_item_singleprice" width="80" font="16" align="center" valign="vcenter"/>
+		<Label name="diandan_cart_item_num" width="80" font="16" align="center" valign="vcenter"/>
+		<Label name="diandan_cart_item_price" width="80" font="118" align="right" valign="vcenter"/>
+	</ListContainerElement>
 </Window>
 </Window>

+ 36 - 32
bin/Win32/Debug/zhipuzi_pos_windows/skin/fuping_wnd.xml

@@ -4,35 +4,46 @@
 	<VerticalLayout bkimage="shoukuan_bkg.png" >		
 	<VerticalLayout bkimage="shoukuan_bkg.png" >		
 		<HorizontalLayout>
 		<HorizontalLayout>
 			<VerticalLayout width="460">
 			<VerticalLayout width="460">
-				<HorizontalLayout height="50">
-					<Label text="欢迎光临!" font="36" align="center" textcolor="#FFFF8910"></Label>
-				</HorizontalLayout>
-
-				<HorizontalLayout height="30" padding="0,10,0,15">
-					<Label name="shopname" text="" font="22" align="center"></Label>
-				</HorizontalLayout>
+						<HorizontalLayout height="105" bkcolor="0xFF3CB371">
+			<VerticalLayout padding="0,22,0,14">
+				<Label text="欢 迎 光 临" font="14" textcolor="#FFFFFFFF" align="center" height="22"></Label>
+				<Label name="shopname" text="" font="130" textcolor="#FFFFFFFF" align="center" height="40"></Label>
+			</VerticalLayout>
+		</HorizontalLayout>
 				
 				
 				<Control height="1" bkcolor="#FFEBE8E8"></Control>
 				<Control height="1" bkcolor="#FFEBE8E8"></Control>
 				
 				
-				<List name="list_diandan_cart" padding="0,10,0,0" itemlinecolor="#FF000000" vscrollbar="true">
-					<ListHeader inset="10,0,0,0"/>
-					<ListHeaderItem text="商品" width="220" align="left" />
-					<ListHeaderItem text="单价" width="80" align="center" />
-					<ListHeaderItem text="数量" width="80" align="center" />
-					<ListHeaderItem text="金额" width="80" align="center" />
-				</List>
-				
-				<HorizontalLayout name="diandan_page_youhui_tishi_layout" height="40" bkcolor="#FFFBEEEE" visible="false">
-					<Label name="diandan_page_youhui_tishi" text="已优惠10元" textcolor="#FFFF3838" padding="15,0,0,0" width="270" hegiht="40"></Label>
-				</HorizontalLayout>
-				
-				<Control height="1" bkcolor="#FFEBE8E8"></Control>
+							<List name="list_diandan_cart" padding="0,10,0,0" itemlinecolor="#FF000000" vscrollbar="true">
+				<ListHeader inset="10,0,10,0"/>
+				<ListHeaderItem text="商品" width="200" height="40" font="15" textcolor="#FF5F6368" align="left" />
+				<ListHeaderItem text="单价" width="80" height="40" font="15" textcolor="#FF5F6368" align="center" />
+				<ListHeaderItem text="数量" width="80" height="40" font="15" textcolor="#FF5F6368" align="center" />
+				<ListHeaderItem text="金额" width="80" height="40" font="15" textcolor="#FF5F6368" align="right" />
+			</List>
 				
 				
-				<HorizontalLayout height="100">
-					<Label name="diandan_page_otherprice" text="" font="20" width="260" align="left" padding="15,40,0,0" wordbreak="true" endellipsis="true"></Label>
-					<Control></Control>
-					<Label name="diandan_page_totalprice" text="总价:¥0.00" font="24" textcolor="#FFFF0000" width="170" align="right" padding="0,8,15,0"></Label>
-				</HorizontalLayout>
+							<!-- 已优惠 明细行 -->
+			<HorizontalLayout name="diandan_page_youhui_tishi_layout" height="32" visible="false">
+				<Label text="已优惠" font="15" textcolor="#FF8A9099" align="left" padding="15,0,0,0"></Label>
+				<Control></Control>
+				<Label name="diandan_page_youhui_tishi" text="" font="114" textcolor="#FFE14B4A" align="right" padding="0,0,15,0"></Label>
+			</HorizontalLayout>
+
+			<!-- 1px 分隔线 -->
+			<Control height="1" bkcolor="#FFEBE8E8"></Control>
+
+			<!-- 其他费用 明细行 -->
+			<HorizontalLayout name="diandan_page_otherprice_layout" height="32" visible="false">
+				<Label text="其他费用" font="15" textcolor="#FF8A9099" align="left" padding="15,0,0,0"></Label>
+				<Control></Control>
+				<Label name="diandan_page_otherprice" text="" font="114" textcolor="#FF5F6368" align="right" padding="0,0,15,0"></Label>
+			</HorizontalLayout>
+
+			<!-- 金色总价条 -->
+			<HorizontalLayout height="56" bkcolor="0xFFF3E9D2">
+				<Label text="应付合计" font="118" textcolor="#FF234D33" align="left" padding="15,0,0,0"></Label>
+				<Control></Control>
+				<Label name="diandan_page_totalprice" text="¥0.00" font="128" textcolor="#FF234D33" align="right" padding="0,0,15,0"></Label>
+			</HorizontalLayout>
 			</VerticalLayout>
 			</VerticalLayout>
 			
 			
 			<Control width="1" bkcolor="#FFEBE8E8"></Control>
 			<Control width="1" bkcolor="#FFEBE8E8"></Control>
@@ -42,13 +53,6 @@
 					<Control name="lunbo_image"></Control>
 					<Control name="lunbo_image"></Control>
 				</HorizontalLayout>
 				</HorizontalLayout>
 			</VerticalLayout>
 			</VerticalLayout>
-		</HorizontalLayout>
-		
-		<HorizontalLayout name="shoukuan_title_bkg" height="36" bkcolor="0xFF60B177">
-			<Control></Control>
-			<Control bkimage="logo_small.png" width="38" height="23" padding="0,6,5,6"></Control>
-			<Label text="智铺子收银系统  www.zhipuzi.com" width="280" textcolor="#FFFFFFFF"></Label>
-			<Control></Control>
 		</HorizontalLayout>	
 		</HorizontalLayout>	
 	</VerticalLayout>
 	</VerticalLayout>
 </Window>
 </Window>

BIN
bin/Win32/Release/zhipuzi_pos_windows/zhipuzi_pos_windows.exe


BIN
zhipuzi_pos_windows/resource/skin.zip


+ 27 - 22
zhipuzi_pos_windows/wnd/CFupingWnd.cpp

@@ -240,7 +240,7 @@ void CFupingWnd::UpdateShow(CDiandanOrder& order, double total_youhui, double to
 
 
 			CLabelUI* pNature = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_nature")));
 			CLabelUI* pNature = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_nature")));
 
 
-			pEle->SetFixedHeight(84);
+			pEle->SetFixedHeight(98);
 			pNature->SetVisible(true);
 			pNature->SetVisible(true);
 			pNature->SetText(CLewaimaiString::UTF8ToUnicode(item.getNatureShow()).c_str());
 			pNature->SetText(CLewaimaiString::UTF8ToUnicode(item.getNatureShow()).c_str());
 		}
 		}
@@ -261,13 +261,13 @@ void CFupingWnd::UpdateShow(CDiandanOrder& order, double total_youhui, double to
 			CLabelUI* pNature = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_nature")));
 			CLabelUI* pNature = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_nature")));
 			if (item.is_nature)
 			if (item.is_nature)
 			{
 			{
-				pEle->SetFixedHeight(84);
+				pEle->SetFixedHeight(98);
 				pNature->SetVisible(true);
 				pNature->SetVisible(true);
 				pNature->SetText(CLewaimaiString::UTF8ToUnicode(item.getNatureShow()).c_str());
 				pNature->SetText(CLewaimaiString::UTF8ToUnicode(item.getNatureShow()).c_str());
 			}
 			}
 			else
 			else
 			{
 			{
-				pEle->SetFixedHeight(42);
+				pEle->SetFixedHeight(56);
 				pNature->SetVisible(false);
 				pNature->SetVisible(false);
 			}
 			}
 		}
 		}
@@ -279,7 +279,7 @@ void CFupingWnd::UpdateShow(CDiandanOrder& order, double total_youhui, double to
 
 
 	if (total_youhui > 0)
 	if (total_youhui > 0)
 	{
 	{
-		std::wstring youhuilabel = L"已优惠 " + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(total_youhui, 2)) + L" 元";
+		std::wstring youhuilabel = L"-" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(total_youhui, 2));
 		pYouhuiLabel->SetText(youhuilabel.c_str());
 		pYouhuiLabel->SetText(youhuilabel.c_str());
 
 
 		pYouhuiLayout->SetVisible(true);
 		pYouhuiLayout->SetVisible(true);
@@ -290,20 +290,23 @@ void CFupingWnd::UpdateShow(CDiandanOrder& order, double total_youhui, double to
 	}
 	}
 
 
 	//再刷新打包费展示
 	//再刷新打包费展示
+	CHorizontalLayoutUI* pOtherPriceLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("diandan_page_otherprice_layout")));
 	CLabelUI* pOtherPriceLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("diandan_page_otherprice")));
 	CLabelUI* pOtherPriceLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("diandan_page_otherprice")));
-	if (dabao_money > 0)
-	{
-		std::wstring ws_dabaofei = L"打包费 " + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(dabao_money, 2)) + L" 元";
-		pOtherPriceLabel->SetText(ws_dabaofei.c_str());
-	}
-	else
-	{
-		pOtherPriceLabel->SetText(L"");
-	}
+		if (dabao_money > 0)
+		{
+			std::wstring ws_dabaofei = L"打包费 " + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(dabao_money, 2)) + L" 元";
+			pOtherPriceLabel->SetText(ws_dabaofei.c_str());
+			pOtherPriceLayout->SetVisible(true);
+		}
+		else
+		{
+			pOtherPriceLabel->SetText(L"");
+			pOtherPriceLayout->SetVisible(false);
+		}
 
 
 	//再刷新总价展示
 	//再刷新总价展示
 	CLabelUI* pTotalPrice = static_cast<CLabelUI*>(this->m_pm.FindControl(_T("diandan_page_totalprice")));
 	CLabelUI* pTotalPrice = static_cast<CLabelUI*>(this->m_pm.FindControl(_T("diandan_page_totalprice")));
-	pTotalPrice->SetText((L"总价:¥" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(total_price, 2))).c_str());
+	pTotalPrice->SetText((L"¥" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(total_price, 2))).c_str());
 }
 }
 
 
 void CFupingWnd::UpdateShow(CZhengcanOrder& order, double total_youhui, double total_price, double dabao_money, double kaitai_money, double chawei_money)
 void CFupingWnd::UpdateShow(CZhengcanOrder& order, double total_youhui, double total_price, double dabao_money, double kaitai_money, double chawei_money)
@@ -338,7 +341,7 @@ void CFupingWnd::UpdateShow(CZhengcanOrder& order, double total_youhui, double t
 
 
 			CLabelUI* pNature = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_nature")));
 			CLabelUI* pNature = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_nature")));
 
 
-			pEle->SetFixedHeight(84);
+			pEle->SetFixedHeight(98);
 			pNature->SetVisible(true);
 			pNature->SetVisible(true);
 			pNature->SetText(CLewaimaiString::UTF8ToUnicode(item.getNatureShow()).c_str());
 			pNature->SetText(CLewaimaiString::UTF8ToUnicode(item.getNatureShow()).c_str());
 		}
 		}
@@ -359,13 +362,13 @@ void CFupingWnd::UpdateShow(CZhengcanOrder& order, double total_youhui, double t
 			CLabelUI* pNature = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_nature")));
 			CLabelUI* pNature = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_nature")));
 			if (item.is_nature)
 			if (item.is_nature)
 			{
 			{
-				pEle->SetFixedHeight(84);
+				pEle->SetFixedHeight(98);
 				pNature->SetVisible(true);
 				pNature->SetVisible(true);
 				pNature->SetText(CLewaimaiString::UTF8ToUnicode(item.getNatureShow()).c_str());
 				pNature->SetText(CLewaimaiString::UTF8ToUnicode(item.getNatureShow()).c_str());
 			}
 			}
 			else
 			else
 			{
 			{
-				pEle->SetFixedHeight(42);
+				pEle->SetFixedHeight(56);
 				pNature->SetVisible(false);
 				pNature->SetVisible(false);
 			}
 			}
 		}
 		}
@@ -428,7 +431,7 @@ void CFupingWnd::UpdateShow(CZhengcanOrder& order, double total_youhui, double t
 			{
 			{
 				CLabelUI* pNature = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_nature")));
 				CLabelUI* pNature = static_cast<CLabelUI*>(pEle->FindSubControl(_T("diandan_cart_item_nature")));
 
 
-				pEle->SetFixedHeight(84);
+				pEle->SetFixedHeight(98);
 				pNature->SetVisible(true);
 				pNature->SetVisible(true);
 				pNature->SetText(CLewaimaiString::UTF8ToUnicode(item.getHistoryNatureShow()).c_str());
 				pNature->SetText(CLewaimaiString::UTF8ToUnicode(item.getHistoryNatureShow()).c_str());
 
 
@@ -436,7 +439,7 @@ void CFupingWnd::UpdateShow(CZhengcanOrder& order, double total_youhui, double t
 			}
 			}
 			else
 			else
 			{
 			{
-				pEle->SetFixedHeight(42);
+				pEle->SetFixedHeight(56);
 			}
 			}
 		}
 		}
 	}
 	}
@@ -447,7 +450,7 @@ void CFupingWnd::UpdateShow(CZhengcanOrder& order, double total_youhui, double t
 
 
 	if (total_youhui > 0)
 	if (total_youhui > 0)
 	{
 	{
-		std::wstring youhuilabel = L"已优惠 " + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(total_youhui, 2)) + L" 元";
+		std::wstring youhuilabel = L"-" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(total_youhui, 2));
 		pYouhuiLabel->SetText(youhuilabel.c_str());
 		pYouhuiLabel->SetText(youhuilabel.c_str());
 
 
 		pYouhuiLayout->SetVisible(true);
 		pYouhuiLayout->SetVisible(true);
@@ -458,8 +461,9 @@ void CFupingWnd::UpdateShow(CZhengcanOrder& order, double total_youhui, double t
 	}
 	}
 
 
 	//再刷新打包费展示
 	//再刷新打包费展示
+	CHorizontalLayoutUI* pOtherPriceLayout = static_cast<CHorizontalLayoutUI*>(m_pm.FindControl(_T("diandan_page_otherprice_layout")));
 	CLabelUI* pOtherPriceLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("diandan_page_otherprice")));
 	CLabelUI* pOtherPriceLabel = static_cast<CLabelUI*>(m_pm.FindControl(_T("diandan_page_otherprice")));
-	std::wstring feiyong = L"";
+		std::wstring feiyong = L"";
 
 
 	if (dabao_money > 0)
 	if (dabao_money > 0)
 	{
 	{
@@ -477,10 +481,11 @@ void CFupingWnd::UpdateShow(CZhengcanOrder& order, double total_youhui, double t
 	}
 	}
 
 
 	pOtherPriceLabel->SetText(feiyong.c_str());
 	pOtherPriceLabel->SetText(feiyong.c_str());
+		pOtherPriceLayout->SetVisible(!feiyong.empty());
 
 
 	//再刷新总价展示
 	//再刷新总价展示
 	CLabelUI* pTotalPrice = static_cast<CLabelUI*>(this->m_pm.FindControl(_T("diandan_page_totalprice")));
 	CLabelUI* pTotalPrice = static_cast<CLabelUI*>(this->m_pm.FindControl(_T("diandan_page_totalprice")));
-	pTotalPrice->SetText((L"总价:¥" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(total_price, 2))).c_str());
+	pTotalPrice->SetText((L"¥" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(total_price, 2))).c_str());
 }
 }
 
 
 void CFupingWnd::Stop()
 void CFupingWnd::Stop()