Sfoglia il codice sorgente

调整优化小屏适配

张洋 3 anni fa
parent
commit
7c33407b86

+ 16 - 8
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_page.xml

@@ -111,27 +111,31 @@
 				</HorizontalLayout>
 			</VerticalLayout>
 			
-			<HorizontalLayout name="diandan_jiesuan_layout" bkcolor="#FFFFFFFF" visible="false" hscrollbar="true">
-				<VerticalLayout width="390">
-					<Label text="选择优惠" width="100" height="58" padding="20,0,0,0" font="20"></Label>
+			<HorizontalLayout name="diandan_jiesuan_layout" bkcolor="#FFFFFFFF" visible="false">
+				<VerticalLayout name="diandan_jiesuan_youhui_layout" width="330">
+					<HorizontalLayout height="58">
+						<Label text="选择优惠" width="100" height="58" padding="20,0,0,0" font="20"></Label>
+						<Control></Control>
+						<Button name="diandan_jiesuan_yincangyouhui_btn" text="隐藏优惠" height="36" width="90" padding="0,11,10,0" textcolor="#FF41A846" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FF41A846" bkcolor="#FFFFFFFF"></Button>
+					</HorizontalLayout>					
 					
 					<Control height="1" bkcolor="#FFEBE8E8" padding="10,0,10,0"></Control>
 					
 					<HorizontalLayout padding="0,15,0,0" height="48">
 						<Label text="整单折扣:" width="90" height="48" padding="20,0,0,0"></Label>
-						<Button name="diandan_jiesuan_zhekou_value" text="" height="48" width="220" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
+						<Button name="diandan_jiesuan_zhekou_value" text="" height="48" width="160" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
 						<Label text="%" width="60" height="48" padding="20,0,0,0"></Label>
 					</HorizontalLayout>
 					
 					<HorizontalLayout padding="0,15,0,0" height="48">
 						<Label text="加价:" width="90" height="48" padding="20,0,0,0"></Label>
-						<Button name="diandan_jiesuan_jiajia_value" text="" height="48" width="220" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
+						<Button name="diandan_jiesuan_jiajia_value" text="" height="48" width="160" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
 						<Label text="元" width="60" height="48" padding="20,0,0,0"></Label>
 					</HorizontalLayout>
 					
 					<HorizontalLayout padding="0,15,0,0" height="48">
 						<Label text="优惠:" width="90" height="48" padding="20,0,0,0"></Label>
-						<Button name="diandan_jiesuan_youhui_value" text="" height="48" width="220" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
+						<Button name="diandan_jiesuan_youhui_value" text="" height="48" width="160" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
 						<Label text="元" width="60" height="48" padding="20,0,0,0"></Label>
 					</HorizontalLayout>
 					
@@ -184,10 +188,14 @@
 					</HorizontalLayout>
 				</VerticalLayout>
 				
-				<Control width="1" bkcolor="#FFEBE8E8"></Control>
+				<Control name="diandan_jiesuan_youhui_line" width="1" bkcolor="#FFEBE8E8"></Control>
 				
 				<VerticalLayout name="diandan_page_jiesuan_zhangdan_layout" vscrollbar="true">
-					<Label text="账单明细" height="58" padding="20,0,0,0" font="20"></Label>
+					<HorizontalLayout height="58">
+						<Label text="账单明细" height="58" padding="20,0,0,0" font="20"></Label>
+						<Control></Control>
+						<Button name="diandan_jiesuan_xianshiyouhui_btn" text="显示优惠" height="36" width="90" padding="0,11,10,0" textcolor="#FF41A846" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FF41A846" bkcolor="#FFFFFFFF"></Button>
+					</HorizontalLayout>		
 					
 					<Control height="1" bkcolor="#FFEBE8E8" padding="10,0,10,0"></Control>
 					

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

@@ -91,7 +91,7 @@
 					<Button name="huiiyuan_page_bangka_btn" width="130" height="45" padding="30,30,0,0" text="绑定实体卡" textcolor="#FFFFFFFF" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
 					<Button name="huiiyuan_page_guashi_btn" width="130" height="45" padding="30,30,0,0" text="挂失实体卡" textcolor="#FFFFFFFF" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
 					<Button name="huiiyuan_page_dongjie_btn" width="130" height="45" padding="30,30,0,0" text="会员冻结" textcolor="#FFFFFFFF" normalimage="file='btn_red_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_red_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_red_dianji.png' corner='5,5,5,5'" />
-					<Button name="huiiyuan_page_jiedong_btn" width="130" height="45" padding="30,30,0,0" text="会员解" textcolor="#FFFFFFFF" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
+					<Button name="huiiyuan_page_jiedong_btn" width="130" height="45" padding="30,30,0,0" text="会员解" textcolor="#FFFFFFFF" normalimage="file='btn_green_zhengchang.png' corner='5,5,5,5'" hotimage="file='btn_green_xuanfu.png' corner='5,5,5,5'" pushedimage="file='btn_green_dianji.png' corner='5,5,5,5'" />
 				</HorizontalLayout>
 			</VerticalLayout>
 		</HorizontalLayout>

+ 5 - 5
bin/Win32/Debug/zhipuzi_pos_windows/skin/shangpin_fooditem.xml

@@ -3,11 +3,11 @@
 	<Font id="shangpin_price" name="微软雅黑" size="18" />
 	<Font id="1" name="微软雅黑" size="14" />
 	
-	<ShangpinFoodItem name="shangpin_fooditem" bkcolor="#FFFFFFFF" padding="0,0,7,7">
-		<Control name="image" height="145" bkimage="file='food_image_default.png'" padding="0,0,0,0"></Control>
-		<Label name="foodname" width="145" height="60" multiline="true" endellipsis="true"></Label>
-		<Label name="price" height="30" font="daindan_price" textcolor="#FFFF7F50" align="left"></Label>
+	<ShangpinFoodItem name="shangpin_fooditem" bkcolor="#FFFFFFFF" padding="0,0,5,5">
+		<Control name="image" height="130" bkimage="file='food_image_default.png'" padding="0,0,0,0"></Control>
+		<Label name="foodname" width="130" height="64" multiline="true" endellipsis="true"></Label>
+		<Label name="price" height="26" font="daindan_price" textcolor="#FFFF7F50" align="left"></Label>
 	
-		<Label name="kucun" visible="false" width="50" height="35" font="1" text="已售空" float="true" pos="0,210,145,235" textcolor="#FFFFFFFF" bkcolor="#FF696969" align="center"></Label>
+		<Label name="kucun" visible="false" width="50" height="35" font="1" text="已售空" float="true" pos="0,185,130,220" textcolor="#FFFFFFFF" bkcolor="#FF696969" align="center"></Label>
 	</ShangpinFoodItem>
 </Window>

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

@@ -3,10 +3,10 @@
 	<Font id="shangpin_price" name="微软雅黑" size="18" />
 	<Font id="1" name="微软雅黑" size="14" />
 	
-	<ShangpinFoodItem name="shangpin_fooditem" bkcolor="#FFFFFFFF" padding="0,0,7,7">
-		<Label name="foodname" width="145" height="60" multiline="true" endellipsis="true"></Label>
-		<Label name="price" height="30" font="daindan_price" textcolor="#FFFF7F50" align="left"></Label>
+	<ShangpinFoodItem name="shangpin_fooditem" bkcolor="#FFFFFFFF" padding="0,0,5,5">
+		<Label name="foodname" width="130" height="64" multiline="true" endellipsis="true"></Label>
+		<Label name="price" height="26" font="daindan_price" textcolor="#FFFF7F50" align="left"></Label>
 			
-		<Label name="kucun" visible="false" width="50" height="35" font="1" text="已售空" float="true" pos="0,55,155,90" textcolor="#FFFFFFFF" bkcolor="#FF696969" align="center"></Label>
+		<Label name="kucun" visible="false" width="50" height="35" font="1" text="已售空" float="true" pos="0,55,130,90" textcolor="#FFFFFFFF" bkcolor="#FF696969" align="center"></Label>
 	</ShangpinFoodItem>
 </Window>

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

@@ -33,7 +33,7 @@
 				</HorizontalLayout>
 				
 				
-				<TileLayout name="shangpin_foodlist" padding="0,0,0,0" inset="15,15,15,15" childpadding="1" itemsize="160,250" vscrollbar="true" hscrollbar="false">
+				<TileLayout name="shangpin_foodlist" padding="0,0,0,0" inset="10,10,0,10" childpadding="1" vscrollbar="true" hscrollbar="false">
 				
 				</TileLayout>
 				

+ 29 - 21
bin/Win32/Debug/zhipuzi_pos_windows/skin/zhengcan_diandan_page.xml

@@ -47,19 +47,19 @@
 						<Control width="1" bkcolor="#FFEBE8E8"></Control>
 						
 						<VerticalLayout width="110" padding="0,0,0,0" vscrollbar="true">
-							<Button name="btn_diandan_tuicai" width="90" height="40" padding="10,50,10,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="btn_diandan_tuicai" width="90" height="40" padding="10,30,10,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="btn_diandan_jia" width="90" height="40" padding="10,50,10,0" text="+" font="24" 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="btn_diandan_jian" width="90" height="40" padding="10,15,10,0" text="-" font="24" 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="btn_diandan_shanchu" width="90" height="40" padding="10,15,10,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="btn_diandan_guige" width="90" height="40" padding="10,15,10,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="btn_diandan_jia" width="90" height="40" padding="10,30,10,0" text="+" font="24" 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="btn_diandan_jian" width="90" height="40" padding="10,10,10,0" text="-" font="24" 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="btn_diandan_shanchu" width="90" height="40" padding="10,10,10,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="btn_diandan_guige" width="90" height="40" padding="10,10,10,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="btn_diandan_dabao" width="90" height="40" padding="10,15,10,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="btn_diandan_dabao" width="90" height="40" padding="10,10,10,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="btn_diandan_zhengdanbeizhu" width="90" height="40" padding="10,15,10,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="btn_diandan_zhengdanbeizhu" width="90" height="40" padding="10,10,10,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="btn_diandan_chetai" width="90" height="40" padding="10,15,10,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="btn_diandan_huantai" width="90" height="40" padding="10,15,10,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="btn_diandan_chetai" width="90" height="40" padding="10,10,10,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="btn_diandan_huantai" width="90" height="40" padding="10,10,10,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="btn_diandan_qianxiang" width="90" height="40" padding="10,15,10,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'" />
 							-->
@@ -68,9 +68,9 @@
 					
 					<Control height="1" bkcolor="#FFEBE8E8"></Control>
 					
-					<VerticalLayout height="165" bkcolor="#FFFFFFFF">
-						<HorizontalLayout height="70">
-							<Label name="diandan_page_otherprice" text="" width="260" align="left" padding="15,24,0,0" multiline="true" endellipsis="true"></Label>
+					<VerticalLayout height="125" bkcolor="#FFFFFFFF">
+						<HorizontalLayout height="50">
+							<Label name="diandan_page_otherprice" text="" width="260" align="left" padding="15,14,0,0" multiline="true" endellipsis="true"></Label>
 							<Label name="diandan_page_totalprice" text="总价:¥0.00" font="22" textcolor="#FFFF0000" width="200" align="right" padding="0,0,15,0"></Label>
 						</HorizontalLayout>
 						
@@ -97,7 +97,7 @@
 						</HorizontalLayout>
 					</VerticalLayout>
 					
-					<TileLayout name="diandan_foodlist" padding="0,0,0,0" inset="15,15,15,15" childpadding="1" itemsize="160,250" vscrollbar="true" hscrollbar="false">
+					<TileLayout name="diandan_foodlist" padding="0,0,0,0" inset="10,10,0,10" childpadding="1" vscrollbar="true" hscrollbar="false">
 					
 					</TileLayout>
 					
@@ -112,27 +112,31 @@
 					</HorizontalLayout>
 				</VerticalLayout>
 				
-				<HorizontalLayout name="diandan_jiesuan_layout" bkcolor="#FFFFFFFF" visible="false" hscrollbar="true">
-					<VerticalLayout width="390">
-						<Label text="选择优惠" width="100" height="58" padding="20,0,0,0" font="20"></Label>
+				<HorizontalLayout name="diandan_jiesuan_layout" bkcolor="#FFFFFFFF" visible="false">
+					<VerticalLayout name="diandan_jiesuan_youhui_layout" width="330">
+						<HorizontalLayout height="58">
+							<Label text="选择优惠" width="100" height="58" padding="20,0,0,0" font="20"></Label>
+							<Control></Control>
+							<Button name="diandan_jiesuan_yincangyouhui_btn" text="隐藏优惠" height="36" width="90" padding="0,11,10,0" textcolor="#FF41A846" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FF41A846" bkcolor="#FFFFFFFF"></Button>
+						</HorizontalLayout>	
 						
 						<Control height="1" bkcolor="#FFEBE8E8" padding="10,0,10,0"></Control>
 						
 						<HorizontalLayout padding="0,15,0,0" height="48">
 							<Label text="整单折扣:" width="90" height="48" padding="20,0,0,0"></Label>
-							<Button name="diandan_jiesuan_zhekou_value" text="" height="48" width="220" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
+							<Button name="diandan_jiesuan_zhekou_value" text="" height="48" width="160" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
 							<Label text="%" width="60" height="48" padding="20,0,0,0"></Label>
 						</HorizontalLayout>
 						
 						<HorizontalLayout padding="0,15,0,0" height="48">
 							<Label text="加价:" width="90" height="48" padding="20,0,0,0"></Label>
-							<Button name="diandan_jiesuan_jiajia_value" text="" height="48" width="220" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
+							<Button name="diandan_jiesuan_jiajia_value" text="" height="48" width="160" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
 							<Label text="元" width="60" height="48" padding="20,0,0,0"></Label>
 						</HorizontalLayout>
 						
 						<HorizontalLayout padding="0,15,0,0" height="48">
 							<Label text="优惠:" width="90" height="48" padding="20,0,0,0"></Label>
-							<Button name="diandan_jiesuan_youhui_value" text="" height="48" width="220" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
+							<Button name="diandan_jiesuan_youhui_value" text="" height="48" width="160" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
 							<Label text="元" width="60" height="48" padding="20,0,0,0"></Label>
 						</HorizontalLayout>
 						
@@ -185,10 +189,14 @@
 						</HorizontalLayout>
 					</VerticalLayout>
 					
-					<Control width="1" bkcolor="#FFEBE8E8"></Control>
+					<Control name="diandan_jiesuan_youhui_line" width="1" bkcolor="#FFEBE8E8"></Control>
 					
 					<VerticalLayout name="diandan_page_jiesuan_zhangdan_layout" vscrollbar="true">
-						<Label text="账单明细" height="58" padding="20,0,0,0" font="20"></Label>
+						<HorizontalLayout height="58">
+							<Label text="账单明细" height="58" padding="20,0,0,0" font="20"></Label>
+							<Control></Control>
+							<Button name="diandan_jiesuan_xianshiyouhui_btn" text="显示优惠" height="36" width="90" padding="0,11,10,0" textcolor="#FF41A846" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FF41A846" bkcolor="#FFFFFFFF"></Button>
+						</HorizontalLayout>	
 						
 						<Control height="1" bkcolor="#FFEBE8E8" padding="10,0,10,0"></Control>
 						

+ 64 - 9
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -181,7 +181,7 @@ void CDiandanPageUI::UpdateFoodtypePos()
 	}
 
 	//根据宽度计算每行显示的数量
-	int nMeihangNum = (nWidth - 491) / 135;
+	int nMeihangNum = (nWidth - 491) / 140;
 
 	int num = 0;
 
@@ -194,9 +194,9 @@ void CDiandanPageUI::UpdateFoodtypePos()
 		int curCol = num % nMeihangNum + 1;
 
 		RECT rect;
-		rect.left = (curCol - 1) * 135 + 15;
-		rect.right = rect.left + 120;
-		rect.top = (curRow - 1) * 61 + 19;
+		rect.left = (curCol - 1) * 140 + 10;
+		rect.right = rect.left + 130;
+		rect.top = (curRow - 1) * 52 + 10;
 		rect.bottom = rect.top + 42;
 
 		curItem->SetFloat(true);
@@ -207,7 +207,7 @@ void CDiandanPageUI::UpdateFoodtypePos()
 
 	//调整区域高度
 	int lastRow = (num - 1) / nMeihangNum + 1;
-	pFenleiLayout->SetFixedHeight(lastRow * 61 + 19);
+	pFenleiLayout->SetFixedHeight(lastRow * 52 + 10);
 
 	//处理滚动条问题
 	CVerticalLayoutUI* pFenleiScrollLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(_T("diandan_fenlei_layout_scrolllayout")));
@@ -216,7 +216,7 @@ void CDiandanPageUI::UpdateFoodtypePos()
 		lastRow = 2;
 	}
 
-	pFenleiScrollLayout->SetFixedHeight(lastRow * 61 + 19);
+	pFenleiScrollLayout->SetFixedHeight(lastRow * 52 + 10);
 
 	SIZE size;
 	size.cx = 0;
@@ -555,10 +555,19 @@ void CDiandanPageUI::UpdateJiesuanZhifuPos()
 		return;
 	}
 
-	int nZhangdanWidth = nWidth - 491 - 391 - 5;
-	if (nZhangdanWidth < 290)
+	int nZhangdanWidth;
+	if (m_is_yincangyouhui == true)
+	{
+		nZhangdanWidth = nWidth - 491 - 5;
+	}
+	else
 	{
-		nZhangdanWidth = 290;
+		nZhangdanWidth = nWidth - 491 - 331 - 5;
+	}
+	
+	if (nZhangdanWidth < 300)
+	{
+		nZhangdanWidth = 300;
 	}
 	CVerticalLayoutUI* pZhangdanLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(L"diandan_page_jiesuan_zhangdan_layout"));
 	pZhangdanLayout->SetFixedWidth(nZhangdanWidth);
@@ -823,6 +832,14 @@ void CDiandanPageUI::HandleClickMsg(TNotifyUI& msg)
 	{
 		this->ClickQuxiaoCika();
 	}
+	else if (name == L"diandan_jiesuan_yincangyouhui_btn")
+	{
+		this->YincangYouhui();
+	}
+	else if (name == L"diandan_jiesuan_xianshiyouhui_btn")
+	{
+		this->XianshiYouhui();
+	}
 }
 
 //处理option切换事件
@@ -3705,6 +3722,16 @@ void CDiandanPageUI::SetPos(RECT rc, bool bNeedInvalidate)
 {
 	m_nPageWidth = rc.right - rc.left;
 
+	if (m_nPageWidth + 91 < 1260)
+	{
+		//小屏幕上,默认隐藏优惠区域
+		this->YincangYouhui();
+	}
+	else
+	{
+		this->XianshiYouhui();
+	}
+
 	//拖动窗口的时候,更新位置
 	UpdateJiesuanZhifuPos();
 
@@ -3712,4 +3739,32 @@ void CDiandanPageUI::SetPos(RECT rc, bool bNeedInvalidate)
 	UpdateFoodtypePos();
 
 	CContainerUI::SetPos(rc, bNeedInvalidate);
+}
+
+//隐藏优惠区域
+void CDiandanPageUI::YincangYouhui()
+{
+	m_is_yincangyouhui = true;
+
+	this->FindSubControl(L"diandan_jiesuan_youhui_layout")->SetVisible(false);
+	this->FindSubControl(L"diandan_jiesuan_youhui_line")->SetVisible(false);
+
+	this->FindSubControl(L"diandan_jiesuan_yincangyouhui_btn")->SetVisible(false);
+	this->FindSubControl(L"diandan_jiesuan_xianshiyouhui_btn")->SetVisible(true);
+
+	UpdateJiesuanZhifuPos();
+}
+
+//显示优惠区域
+void CDiandanPageUI::XianshiYouhui()
+{
+	m_is_yincangyouhui = false;
+
+	this->FindSubControl(L"diandan_jiesuan_youhui_layout")->SetVisible(true);
+	this->FindSubControl(L"diandan_jiesuan_youhui_line")->SetVisible(true);
+	
+	this->FindSubControl(L"diandan_jiesuan_yincangyouhui_btn")->SetVisible(true);
+	this->FindSubControl(L"diandan_jiesuan_xianshiyouhui_btn")->SetVisible(false);
+
+	UpdateJiesuanZhifuPos();
 }

+ 8 - 0
zhipuzi_pos_windows/page/CDiandanPageUI.h

@@ -186,6 +186,12 @@ public:
 
 	void SetPos(RECT rc, bool bNeedInvalidate = true);
 
+	//隐藏优惠区域
+	void YincangYouhui();
+
+	//显示优惠区域
+	void XianshiYouhui();
+
 private:
 	//获取用于提交订单的参数结构
 	std::map<string, string> GetSendorderParams();
@@ -319,4 +325,6 @@ private:
 
 	//当前控件的实际宽度
 	int m_nPageWidth;
+
+	bool m_is_yincangyouhui = false;
 };

+ 12 - 12
zhipuzi_pos_windows/page/CShangpinPageUI.cpp

@@ -103,7 +103,7 @@ void CShangpinPageUI::UpdateFoodtypePos()
 	}
 
 	//根据宽度计算每行显示的数量
-	int nMeihangNum = (nWidth - 381) / 135;
+	int nMeihangNum = (nWidth - 321) / 140;
 
 	int num = 0;
 
@@ -118,9 +118,9 @@ void CShangpinPageUI::UpdateFoodtypePos()
 		int curCol = num % nMeihangNum + 1;
 
 		RECT rect;
-		rect.left = (curCol - 1) * 135 + 15;
-		rect.right = rect.left + 120;
-		rect.top = (curRow - 1) * 61 + 19;
+		rect.left = (curCol - 1) * 140 + 10;
+		rect.right = rect.left + 130;
+		rect.top = (curRow - 1) * 52 + 10;
 		rect.bottom = rect.top + 42;
 
 		curItem->SetFloat(true);
@@ -135,9 +135,9 @@ void CShangpinPageUI::UpdateFoodtypePos()
 	int curCol = num % nMeihangNum + 1;
 
 	RECT rect;
-	rect.left = (curCol - 1) * 135 + 15;
-	rect.right = rect.left + 120;
-	rect.top = (curRow - 1) * 61 + 19;
+	rect.left = (curCol - 1) * 140 + 10;
+	rect.right = rect.left + 130;
+	rect.top = (curRow - 1) * 52 + 10;
 	rect.bottom = rect.top + 42;
 
 	pNewType->SetFloat(true);
@@ -149,7 +149,7 @@ void CShangpinPageUI::UpdateFoodtypePos()
 
 	//调整区域高度
 	int lastRow = (num - 1) / nMeihangNum + 1;
-	pFenleiLayout->SetFixedHeight(lastRow * 61 + 19);
+	pFenleiLayout->SetFixedHeight(lastRow * 52 + 10);
 }
 
 void CShangpinPageUI::InitFoodShow()
@@ -172,8 +172,8 @@ void CShangpinPageUI::InitFoodShow()
 	if (is_youtu)
 	{
 		SIZE itemsize;
-		itemsize.cx = 160;
-		itemsize.cy = 250;
+		itemsize.cx = 140;
+		itemsize.cy = 230;
 		m_foodLayout->SetItemSize(itemsize);
 
 		xml_name = _T("shangpin_fooditem.xml");
@@ -181,8 +181,8 @@ void CShangpinPageUI::InitFoodShow()
 	else
 	{
 		SIZE itemsize;
-		itemsize.cx = 160;
-		itemsize.cy = 105;
+		itemsize.cx = 140;
+		itemsize.cy = 100;
 		m_foodLayout->SetItemSize(itemsize);
 
 		xml_name = _T("shangpin_fooditem_wutu.xml");

+ 68 - 13
zhipuzi_pos_windows/page/CZhengcanDiandanPageUI.cpp

@@ -317,7 +317,7 @@ void CZhengcanDiandanPageUI::UpdateFoodtypePos()
 	}
 
 	//根据宽度计算每行显示的数量
-	int nMeihangNum = (nWidth - 491) / 135;
+	int nMeihangNum = (nWidth - 491) / 140;
 
 	int num = 0;
 
@@ -330,9 +330,9 @@ void CZhengcanDiandanPageUI::UpdateFoodtypePos()
 		int curCol = num % nMeihangNum + 1;
 
 		RECT rect;
-		rect.left = (curCol - 1) * 135 + 15;
-		rect.right = rect.left + 120;
-		rect.top = (curRow - 1) * 61 + 19;
+		rect.left = (curCol - 1) * 140 + 10;
+		rect.right = rect.left + 130;
+		rect.top = (curRow - 1) * 52 + 10;
 		rect.bottom = rect.top + 42;
 
 		curItem->SetFloat(true);
@@ -343,7 +343,7 @@ void CZhengcanDiandanPageUI::UpdateFoodtypePos()
 
 	//调整区域高度
 	int lastRow = (num - 1) / nMeihangNum + 1;
-	pFenleiLayout->SetFixedHeight(lastRow * 61 + 19);
+	pFenleiLayout->SetFixedHeight(lastRow * 52 + 10);
 
 	//处理滚动条问题
 	CVerticalLayoutUI* pFenleiScrollLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(_T("diandan_fenlei_layout_scrolllayout")));
@@ -352,7 +352,7 @@ void CZhengcanDiandanPageUI::UpdateFoodtypePos()
 		lastRow = 2;
 	}
 
-	pFenleiScrollLayout->SetFixedHeight(lastRow * 61 + 19);
+	pFenleiScrollLayout->SetFixedHeight(lastRow * 52 + 10);
 
 	SIZE size;
 	size.cx = 0;
@@ -380,8 +380,8 @@ void CZhengcanDiandanPageUI::InitFoodShow()
 	if (is_youtu)
 	{
 		SIZE itemsize;
-		itemsize.cx = 160;
-		itemsize.cy = 250;
+		itemsize.cx = 140;
+		itemsize.cy = 230;
 		m_foodLayout->SetItemSize(itemsize);
 
 		xml_name = _T("diandan_fooditem.xml");
@@ -389,8 +389,8 @@ void CZhengcanDiandanPageUI::InitFoodShow()
 	else
 	{
 		SIZE itemsize;
-		itemsize.cx = 160;
-		itemsize.cy = 105;
+		itemsize.cx = 140;
+		itemsize.cy = 100;
 		m_foodLayout->SetItemSize(itemsize);
 
 		xml_name = _T("diandan_fooditem_wutu.xml");
@@ -682,10 +682,19 @@ void CZhengcanDiandanPageUI::UpdateJiesuanZhifuPos()
 		return;
 	}
 
-	int nZhangdanWidth = nWidth - 491 - 391 - 5;
-	if (nZhangdanWidth < 290)
+	int nZhangdanWidth;
+	if (m_is_yincangyouhui == true)
+	{
+		nZhangdanWidth = nWidth - 491 - 5;
+	}
+	else
+	{
+		nZhangdanWidth = nWidth - 491 - 331 - 5;
+	}
+
+	if (nZhangdanWidth < 300)
 	{
-		nZhangdanWidth = 290;
+		nZhangdanWidth = 300;
 	}
 	CVerticalLayoutUI* pZhangdanLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(L"diandan_page_jiesuan_zhangdan_layout"));
 	pZhangdanLayout->SetFixedWidth(nZhangdanWidth);
@@ -1041,6 +1050,14 @@ void CZhengcanDiandanPageUI::HandleClickMsg(TNotifyUI& msg)
 	{
 		this->ClickYulan();
 	}
+	else if (name == L"diandan_jiesuan_yincangyouhui_btn")
+	{
+		this->YincangYouhui();
+	}
+	else if (name == L"diandan_jiesuan_xianshiyouhui_btn")
+	{
+		this->XianshiYouhui();
+	}
 }
 
 //处理option切换事件
@@ -4501,6 +4518,16 @@ void CZhengcanDiandanPageUI::SetPos(RECT rc, bool bNeedInvalidate)
 {
 	m_nPageWidth = rc.right - rc.left;
 
+	if (m_nPageWidth + 91 < 1260)
+	{
+		//小屏幕上,默认隐藏优惠区域
+		this->YincangYouhui();
+	}
+	else
+	{
+		this->XianshiYouhui();
+	}
+
 	//拖动窗口的时候,更新位置
 	UpdateJiesuanZhifuPos();
 
@@ -4513,4 +4540,32 @@ void CZhengcanDiandanPageUI::SetPos(RECT rc, bool bNeedInvalidate)
 void CZhengcanDiandanPageUI::SetTableId(std::string table_id)
 {
 	m_table_id = table_id;
+}
+
+//隐藏优惠区域
+void CZhengcanDiandanPageUI::YincangYouhui()
+{
+	m_is_yincangyouhui = true;
+
+	this->FindSubControl(L"diandan_jiesuan_youhui_layout")->SetVisible(false);
+	this->FindSubControl(L"diandan_jiesuan_youhui_line")->SetVisible(false);
+
+	this->FindSubControl(L"diandan_jiesuan_yincangyouhui_btn")->SetVisible(false);
+	this->FindSubControl(L"diandan_jiesuan_xianshiyouhui_btn")->SetVisible(true);
+
+	UpdateJiesuanZhifuPos();
+}
+
+//显示优惠区域
+void CZhengcanDiandanPageUI::XianshiYouhui()
+{
+	m_is_yincangyouhui = false;
+
+	this->FindSubControl(L"diandan_jiesuan_youhui_layout")->SetVisible(true);
+	this->FindSubControl(L"diandan_jiesuan_youhui_line")->SetVisible(true);
+
+	this->FindSubControl(L"diandan_jiesuan_yincangyouhui_btn")->SetVisible(true);
+	this->FindSubControl(L"diandan_jiesuan_xianshiyouhui_btn")->SetVisible(false);
+
+	UpdateJiesuanZhifuPos();
 }

+ 8 - 0
zhipuzi_pos_windows/page/CZhengcanDiandanPageUI.h

@@ -208,6 +208,12 @@ public:
 	//刚进入桌子的时候,设置桌子ID
 	void SetTableId(std::string table_id);
 
+	//隐藏优惠区域
+	void YincangYouhui();
+
+	//显示优惠区域
+	void XianshiYouhui();
+
 private:
 	//获取用于提交订单的参数结构
 	std::map<string, string> GetSendorderParams();
@@ -360,4 +366,6 @@ private:
 
 	//每次刷新购物车时候,用来保存历史的item,用来处理这些item的展示(比如颜色、是否可点击)
 	std::vector<CListContainerElementUI*> m_history_cart_item;
+
+	bool m_is_yincangyouhui = false;
 };

+ 10 - 10
zhipuzi_pos_windows/page/CZhengcanPageUI.cpp

@@ -197,7 +197,7 @@ void CZhengcanPageUI::UpdateTabletypePos()
 	}
 
 	//根据宽度计算每行显示的数量
-	int nMeihangNum = (nWidth - 20) / 135;
+	int nMeihangNum = (nWidth - 20) / 140;
 
 	if (nMeihangNum < 1)
 	{
@@ -215,9 +215,9 @@ void CZhengcanPageUI::UpdateTabletypePos()
 		int curCol = num % nMeihangNum + 1;
 
 		RECT rect;
-		rect.left = (curCol - 1) * 135 + 15;
-		rect.right = rect.left + 120;
-		rect.top = (curRow - 1) * 61 + 19;
+		rect.left = (curCol - 1) * 140 + 10;
+		rect.right = rect.left + 130;
+		rect.top = (curRow - 1) * 52 + 10;
 		rect.bottom = rect.top + 42;
 
 		curItem->SetFloat(true);
@@ -228,7 +228,7 @@ void CZhengcanPageUI::UpdateTabletypePos()
 
 	//调整区域高度
 	int lastRow = (num - 1) / nMeihangNum + 1;
-	pFenleiLayout->SetFixedHeight(lastRow * 61 + 19);
+	pFenleiLayout->SetFixedHeight(lastRow * 52 + 10);
 
 	//处理滚动条问题
 	CVerticalLayoutUI* pFenleiScrollLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(_T("zhengcan_zhuozi_type_layout_scrolllayout")));
@@ -237,7 +237,7 @@ void CZhengcanPageUI::UpdateTabletypePos()
 		lastRow = 2;
 	}
 
-	pFenleiScrollLayout->SetFixedHeight(lastRow * 61 + 19);
+	pFenleiScrollLayout->SetFixedHeight(lastRow * 52 + 10);
 
 	SIZE size;
 	size.cx = 0;
@@ -378,7 +378,7 @@ void CZhengcanPageUI::UpdateTablePos()
 	}
 
 	//根据宽度计算每行显示的数量
-	int nMeihangNum = (nWidth - 20) / 192;
+	int nMeihangNum = (nWidth - 20) / 187;
 
 	if (nMeihangNum < 1)
 	{
@@ -396,9 +396,9 @@ void CZhengcanPageUI::UpdateTablePos()
 		int curCol = num % nMeihangNum + 1;
 
 		RECT rect;
-		rect.left = (curCol - 1) * 192 + 15;
+		rect.left = (curCol - 1) * 187 + 10;
 		rect.right = rect.left + 177;
-		rect.top = (curRow - 1) * 155 + 15;
+		rect.top = (curRow - 1) * 150 + 10;
 		rect.bottom = rect.top + 140;
 
 		curItem->SetFloat(true);
@@ -409,7 +409,7 @@ void CZhengcanPageUI::UpdateTablePos()
 
 	//调整区域高度
 	int lastRow = (num - 1) / nMeihangNum + 1;
-	pTabllistLayout->SetFixedHeight(lastRow * 155 + 15);
+	pTabllistLayout->SetFixedHeight(lastRow * 150 + 10);
 
 	SIZE size;
 	size.cx = 0;