Browse Source

完成无图模式

张洋 4 years ago
parent
commit
577274ae83

BIN
bin/Win32/Debug/zhipuzi_pos_windows/dump/2021-11-23-14-27-33.dmp


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

@@ -7,9 +7,9 @@
 		<Control name="image" height="155" bkimage="file='food_image_default.png'" padding="0,0,0,0"></Control>
 		<Label name="foodname" width="155" height="60" multiline="true" endellipsis="true"></Label>
 		<Label name="price" height="30" font="daindan_price" textcolor="#FFFF7F50" align="left"></Label>
-		<Label name="nature" visible="false" width="50" height="26" font="1" text="多属性" float="true" pos="100,214,150,240" textcolor="#FFFFFFFF" bkcolor="#FF2E8B57" align="center"></Label>		
-		<Label name="chengzhong" visible="false" width="50" height="26" font="1" text="称重" float="true" pos="100,214,150,240" textcolor="#FFFFFFFF" bkcolor="#FFFF4500" align="center"></Label>
 		
-		<Label name="kucun" visible="false" width="50" height="26" font="1" text="已售空" float="true" pos="0,210,155,245" textcolor="#FFFFFFFF" bkcolor="#FF696969" align="center"></Label>
+		<Label name="nature" visible="false" width="50" height="26" font="1" text="多属性" float="true" pos="100,214,150,240" textcolor="#FFFFFFFF" bkcolor="#FF2E8B57" align="center"></Label>		
+		<Label name="chengzhong" visible="false" width="50" height="26" font="1" text="称重" float="true" pos="100,214,150,240" textcolor="#FFFFFFFF" bkcolor="#FFFF4500" align="center"></Label>		
+		<Label name="kucun" visible="false" width="50" height="35" font="1" text="已售空" float="true" pos="0,210,155,245" textcolor="#FFFFFFFF" bkcolor="#FF696969" align="center"></Label>
 	</DiandanFoodItem>
 </Window>

+ 14 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_fooditem_wutu.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window>
+	<Font id="diandan_price" name="微软雅黑" size="18" />
+	<Font id="1" name="微软雅黑" size="14" />
+	
+	<DiandanFoodItem name="diandan_fooditem" bkcolor="#FFFFFFFF" padding="0,0,7,7">
+		<Label name="foodname" width="155" height="60" multiline="true" endellipsis="true"></Label>
+		<Label name="price" height="30" font="daindan_price" textcolor="#FFFF7F50" align="left"></Label>
+		
+		<Label name="nature" visible="false" width="50" height="26" font="1" text="多属性" float="true" pos="100,59,150,85" textcolor="#FFFFFFFF" bkcolor="#FF2E8B57" align="center"></Label>		
+		<Label name="chengzhong" visible="false" width="50" height="26" font="1" text="称重" float="true" pos="100,59,150,85" textcolor="#FFFFFFFF" bkcolor="#FFFF4500" align="center"></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>
+	</DiandanFoodItem>
+</Window>

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

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Window>
-	<FoodtypeOption endellipsis="true" align="center" valign="center" width="120" height="42" padding="15,19,0,0" bkcolor="#FFECECEC" selectedtextcolor="#FF3CB371">
+	<FoodtypeOption endellipsis="true" align="center" valign="center" width="120" height="42" padding="15,19,0,0" bkcolor="#FFECECEC" selectedtextcolor="#FFFFFFFF">
 	</FoodtypeOption>
 </Window>

File diff suppressed because it is too large
+ 33 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_biaoqian_print.xml


File diff suppressed because it is too large
+ 22 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_chufang_print.xml


+ 10 - 158
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_page.xml

@@ -8,6 +8,7 @@
 					<Option name="setting_printer_switch" text="小票打印设置" group="setting_switch" align="center" height="38" normalimage="file='Btn_White.png' corner='5,5,5,5'" selectedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" hottextcolor="#CC1010" selectedtextcolor="#FFFFFFFF" />
 					<Option name="setting_biaoqian_printer_switch" text="标签打印设置" group="setting_switch" align="center" height="38" normalimage="file='Btn_White.png' corner='5,5,5,5'" selectedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" hottextcolor="#CC1010" selectedtextcolor="#FFFFFFFF" />
 					<Option name="setting_chufang_printer_switch" text="厨房打印设置" group="setting_switch" align="center" height="38" normalimage="file='Btn_White.png' corner='5,5,5,5'" selectedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" hottextcolor="#CC1010" selectedtextcolor="#FFFFFFFF" />
+					<Option name="setting_xianshi_switch" text="显示设置" group="setting_switch" align="center" height="38" normalimage="file='Btn_White.png' corner='5,5,5,5'" selectedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" hottextcolor="#CC1010" selectedtextcolor="#FFFFFFFF" />
 					<Option name="setting_system_switch" text="系统设置" group="setting_switch" align="center" height="38" normalimage="file='Btn_White.png' corner='5,5,5,5'" selectedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" hottextcolor="#CC1010" selectedtextcolor="#FFFFFFFF" />
 					<Option name="setting_system_about" text="关于" group="setting_switch" align="center" height="38" normalimage="file='Btn_White.png' corner='5,5,5,5'" selectedimage="file='Btn_Green_Click.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" hottextcolor="#CC1010" selectedtextcolor="#FFFFFFFF" />
 
@@ -17,176 +18,27 @@
 
 			<TabLayout name="setting_switch">
 				<VerticalLayout bkcolor="#FFFFFFFF" padding="0,20,20,20" inset="15,15,15,15">
-					<HorizontalLayout height="44">
-						<Label text="新订单语音通知" width="260" />
-						<CheckBox name="setting_is_new_waimai_voice" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="新订单自动接单" width="260"/>
-						<CheckBox name="setting_is_new_waimai_autoconfirm" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44" visible="false">
-						<Label text="新订单右下角弹框提醒" width="260"/>
-						<CheckBox name="setting_is_new_waimai_dialog" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
+					<Include source="setting_waimai_tixing.xml" />
 				</VerticalLayout>
 
 				<VerticalLayout bkcolor="#FFFFFFFF" padding="0,20,20,20" inset="15,15,15,15" vscrollbar="true">
-					<HorizontalLayout height="44">
-						<Label text="新订单自动打印" width="260" />
-						<CheckBox name="setting_is_new_waimai_printer" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="打印机规格" width="260"/>
-						<Combo name="setting_printer_guige" padding="0,9,0,0" width="140" height="26" tooltip="请点击这里选择您的打印机纸张宽度规格" normalimage="file='Setting_Combox_Normal.png' corner='2,2,24,2'" hotimage="file='Setting_Combox_Hover.png' corner='2,2,24,2'" pushedimage="Setting_Combox_Click.png' corner='2,2,24,2'" textpadding="10,1,1,1" >
-							<ListLabelElement text="58mm" selected="true" />
-							<ListLabelElement text="80mm" />
-						</Combo>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="打印联数" width="260"/>
-						<Combo name="setting_printer_lianshu" padding="0,9,0,0" width="140" height="26" tooltip="请点击这里选择您的打印机打印小票联数" normalimage="file='Setting_Combox_Normal.png' corner='2,2,24,2'" hotimage="file='Setting_Combox_Hover.png' corner='2,2,24,2'" pushedimage="Setting_Combox_Click.png' corner='2,2,24,2'" textpadding="10,1,1,1" >
-							<ListLabelElement text="1联" selected="true" />
-							<ListLabelElement text="2联" />
-							<ListLabelElement text="3联" />
-							<ListLabelElement text="4联" />
-						</Combo>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="打印机接口类型" width="260"/>
-						<Combo name="setting_printer_leixing" padding="0,9,0,0" width="140" height="26" tooltip="请点击这里选择您的打印机接口类型" normalimage="file='Setting_Combox_Normal.png' corner='2,2,24,2'" hotimage="file='Setting_Combox_Hover.png' corner='2,2,24,2'" pushedimage="Setting_Combox_Click.png' corner='2,2,24,2'" textpadding="10,1,1,1" >
-							<ListLabelElement text="智能识别模式" selected="true" />
-							<ListLabelElement text="usb" />
-							<ListLabelElement text="并口" />
-							<ListLabelElement text="串口" />
-							<ListLabelElement text="网口" />
-						</Combo>
-					</HorizontalLayout>
-					<HorizontalLayout height="44" name="setting_printer_usb_layout">
-						<Label text="usb打印机端口选择" width="260"/>
-						<Combo name="setting_printer_usb" padding="0,9,0,0" width="800" height="26" tooltip="请点击这里选择您的打印机端口" normalimage="file='Setting_Combox_Normal.png' corner='2,2,24,2'" hotimage="file='Setting_Combox_Hover.png' corner='2,2,24,2'" pushedimage="Setting_Combox_Click.png' corner='2,2,24,2'" textpadding="10,1,1,1" >
-						</Combo>
-					</HorizontalLayout>
-					<HorizontalLayout height="56" name="setting_printer_wangkou_layout">
-						<Label text="网口IP地址" width="260"/>
-						<Edit name="setting_printer_wangkou_ip" width="200" height="32" padding="0,12,0,12" 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="setting_printer_wangkouk_save_btn" align="center" width="100" height="38" padding="20,8,0,3" 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'" />
-					</HorizontalLayout>
-					<HorizontalLayout height="44" padding="0,20,0,0">
-						<Label text="小票格式设置" width="260" />
-					</HorizontalLayout>
-					<Control height="1" bkcolor="#FF708090" />
-					<HorizontalLayout height="44" visible="false">
-						<Label text="取货方式大号字体" width="260" />
-						<CheckBox name="setting_printer_quhuo_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="订单号大号字体" width="260" />
-						<CheckBox name="setting_printer_dingdanhao_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="下单时间大号字体" width="260" />
-						<CheckBox name="setting_printer_xiadanshijian_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44" visible="false">
-						<Label text="配送(自取)时间大号字体" width="260" />
-						<CheckBox name="setting_printer_peisongshijian_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="姓名大号字体" width="260" />
-						<CheckBox name="setting_printer_name_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="电话大号字体" width="260" />
-						<CheckBox name="setting_printer_phone_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="地址大号字体" width="260" />
-						<CheckBox name="setting_printer_address_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="商品大号字体" width="260" />
-						<CheckBox name="setting_printer_shangpin_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="备注大号字体" width="260" />
-						<CheckBox name="setting_printer_memo_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="价格大号字体" width="260" />
-						<CheckBox name="setting_printer_price_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="付款方式大号字体" width="260" />
-						<CheckBox name="setting_printer_pay_big" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
+					<Include source="setting_print.xml" />
 				</VerticalLayout>
 				
 				<VerticalLayout bkcolor="#FFFFFFFF" padding="0,20,20,20" inset="15,15,15,15" vscrollbar="true">
-					<HorizontalLayout height="44">
-						<Label text="新订单自动打印标签纸" width="260" />
-						<CheckBox name="setting_is_new_waimai_biaoqian_printer" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-
-					<HorizontalLayout height="44" name="setting_biaoqian_printer_usb_layout">
-						<Label text="标签打印机usb端口选择" width="260"/>
-						<Combo name="setting_biaoqian_printer_usb" padding="0,9,0,0" width="800" height="26" tooltip="请点击这里选择您的标签打印机usb端口" normalimage="file='Setting_Combox_Normal.png' corner='2,2,24,2'" hotimage="file='Setting_Combox_Hover.png' corner='2,2,24,2'" pushedimage="Setting_Combox_Click.png' corner='2,2,24,2'" textpadding="10,1,1,1" >
-						</Combo>
-					</HorizontalLayout>
-					
-					<HorizontalLayout height="44">
-						<Label text="标签纸尺寸规格" width="260"/>
-						<Combo name="setting_biaoqian_printer_guige" padding="0,9,0,0" width="140" height="26" tooltip="请点击这里选择您的标签纸尺寸规格" normalimage="file='Setting_Combox_Normal.png' corner='2,2,24,2'" hotimage="file='Setting_Combox_Hover.png' corner='2,2,24,2'" pushedimage="Setting_Combox_Click.png' corner='2,2,24,2'" textpadding="10,1,1,1" >
-							<ListLabelElement text="40*30mm" selected="true" />
-							<ListLabelElement text="35*25mm" />
-							<ListLabelElement text="30*25mm" />
-							<ListLabelElement text="30*20mm" />
-						</Combo>
-					</HorizontalLayout>
-					
-					<HorizontalLayout height="44">
-						<Label text="出纸方向" width="260"/>
-						<Combo name="setting_biaoqian_printer_fangxiang" padding="0,9,0,0" width="140" height="26" tooltip="请点击这里选择您的标签纸出纸方向" normalimage="file='Setting_Combox_Normal.png' corner='2,2,24,2'" hotimage="file='Setting_Combox_Hover.png' corner='2,2,24,2'" pushedimage="Setting_Combox_Click.png' corner='2,2,24,2'" textpadding="10,1,1,1" >
-							<ListLabelElement text="正方向" selected="true" />
-							<ListLabelElement text="反方向" />
-						</Combo>
-					</HorizontalLayout>
+					<Include source="setting_biaoqian_print.xml" />
 				</VerticalLayout>
 
 				<VerticalLayout bkcolor="#FFFFFFFF" padding="0,20,20,20" inset="15,15,15,15">
-					<HorizontalLayout height="44">
-						<Label text="新订单自动厨房打印" width="260" />
-						<CheckBox name="setting_is_new_waimai_chufang_printer" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44" padding="0,30,0,20">
-						<Button name="setting_new_chufang_printer_btn" align="center" width="200" height="38" padding="0,3,0,3" 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'" />
-					</HorizontalLayout>
-					<List name="setting_chufang_printer_list" bordersize="1" bordercolor="#FF000000" itemlinecolor="#FF000000" vscrollbar="true" hscrollbar="true">
-						<ListHeader />
-						<ListHeaderItem text="打印机名称" width="180" align="center" />
-						<ListHeaderItem text="IP地址" width="150" align="center" />
-						<ListHeaderItem text="打印机规格" width="150" align="center" />
-						<ListHeaderItem text="商品分单打印" width="150" align="center" />
-						<ListHeaderItem text="按商品分类打印" width="150" align="center" />
-						<ListHeaderItem text="关联商品分类" width="300" align="center" />
-						<ListHeaderItem text="操作" width="200" align="center"/>
-					</List> 
+					<Include source="setting_chufang_print.xml" />
+				</VerticalLayout>
+				
+				<VerticalLayout bkcolor="#FFFFFFFF" padding="0,20,20,20" inset="15,15,15,15">
+					<Include source="setting_xianshi.xml" />
 				</VerticalLayout>
 
 				<VerticalLayout bkcolor="#FFFFFFFF" padding="0,20,20,20" inset="15,15,15,15">
-					<HorizontalLayout height="44">
-						<Label text="开机自动启动" width="260" />
-						<CheckBox name="setting_is_auto_start" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="启动时自动登录" width="260" />
-						<CheckBox name="setting_is_auto_login" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
-					<HorizontalLayout height="44">
-						<Label text="点击关闭时,最小化到系统托盘" width="260" />
-						<CheckBox name="setting_is_close_min" width="72" height="45" normalimage="file='switchbutton.png' source='0,0,143,91'" selectedimage="file='switchbutton.png' source='0,182,143,273'"/>
-					</HorizontalLayout>
+					<Include source="setting_system.xml" />
 				</VerticalLayout>
 
 				<VerticalLayout bkcolor="#FFFFFFFF" padding="0,20,20,20" inset="15,15,15,15">

File diff suppressed because it is too large
+ 94 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_print.xml


File diff suppressed because it is too large
+ 17 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_system.xml


File diff suppressed because it is too large
+ 13 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_waimai_tixing.xml


File diff suppressed because it is too large
+ 15 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting_xianshi.xml


+ 25 - 14
zhipuzi_pos_windows/control/CDiandanFoodItemUI.cpp

@@ -70,14 +70,17 @@ void CDiandanFoodItemUI::UpdateShow()
 {
 	if (m_is_taocan)
 	{
-		CControlUI* pImage = static_cast<CControlUI*>(this->FindSubControl(_T("image")));
-
-		//获取本地图片的路径
-		std::wstring imagepath = m_foodpackageinfo.getImageTmpPath();
-		if (CSystem::IsFileExist(imagepath.c_str()))
+		if (m_is_youtu)
 		{
-			//图片已经存在,直接显示
-			pImage->SetBkImage(imagepath.c_str());
+			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")));
@@ -95,14 +98,17 @@ void CDiandanFoodItemUI::UpdateShow()
 	}
 	else
 	{
-		CControlUI* pImage = static_cast<CControlUI*>(this->FindSubControl(_T("image")));
-
-		//获取本地图片的路径
-		std::wstring imagepath = m_foodinfo.getImageTmpPath();
-		if (CSystem::IsFileExist(imagepath.c_str()))
+		if (m_is_youtu)
 		{
-			//图片已经存在,直接显示
-			pImage->SetBkImage(imagepath.c_str());
+			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")));
@@ -142,3 +148,8 @@ void CDiandanFoodItemUI::UpdateShow()
 		}
 	}
 }
+
+void CDiandanFoodItemUI::SetYoutuModel(bool is_youtu)
+{
+	m_is_youtu = is_youtu;
+}

+ 5 - 0
zhipuzi_pos_windows/control/CDiandanFoodItemUI.h

@@ -28,10 +28,15 @@ public:
 	//Ë¢ÐÂÏÔʾ
 	void UpdateShow();
 
+	void SetYoutuModel(bool is_youtu);
+
 private:
 	CFood m_foodinfo;
 	CFoodpackage m_foodpackageinfo;
 
 	bool m_is_taocan = false;
+
+	//ĬÈÏÓÐͼģʽ
+	bool m_is_youtu = true;
 };
 

+ 107 - 32
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -52,6 +52,25 @@ void CDiandanPageUI::InitShow()
 	this->ShowXuangouPage();
 }
 
+void CDiandanPageUI::RefreshShow()
+{
+	//初始化商品显示(因为这里要刷新商品库存状态)
+	this->InitFoodShow();
+
+	//清空购物车
+	m_cur_diandan_order.Clear();
+	this->ClearDiandanOrderItemShow();
+
+	//初始化结算页面相关的展示,把所有活动清零
+	this->InitJiesuanShow();
+
+	//计算所有活动优惠,并且调整所有与价格相关的展示
+	this->UpdateJiesuanInfo();
+
+	//展示选购页面
+	this->ShowXuangouPage();
+}
+
 void CDiandanPageUI::InitFoodtypeShow()
 {
 	//初始化商品渲染相关的信息
@@ -75,6 +94,8 @@ void CDiandanPageUI::InitFoodtypeShow()
 		}
 	}
 
+	m_curFoodtypeOption = NULL;
+
 	//先判断有没有套餐分类
 	if (m_nFoodpackageNum > 0)
 	{
@@ -89,6 +110,11 @@ void CDiandanPageUI::InitFoodtypeShow()
 		pItem->SetGroup(L"diandan_foodtype");
 
 		m_foodtypeLayout->Add(pItem);
+
+		if (m_cur_type_id == "taocan")
+		{
+			m_curFoodtypeOption = pItem;
+		}
 	}
 
 	//接下来开始处理商品分类
@@ -106,6 +132,16 @@ void CDiandanPageUI::InitFoodtypeShow()
 		pItem->SetGroup(L"diandan_foodtype");
 
 		m_foodtypeLayout->Add(pItem);
+
+		if (m_cur_type_id == type.id)
+		{
+			m_curFoodtypeOption = pItem;
+		}
+	}
+
+	if (m_curFoodtypeOption != NULL)
+	{
+		m_curFoodtypeOption->SetBkColor(0xFF3CB371);
 	}
 
 	//如果不是一个分类都没有,选中第一个分类
@@ -118,10 +154,41 @@ void CDiandanPageUI::InitFoodtypeShow()
 }
 
 void CDiandanPageUI::InitFoodShow()
-{
+{	
+	bool is_youtu;
+	if (CSetting::GetParam("setting_xianshi_is_youtu") == "1")
+	{
+		is_youtu = true;
+	}
+	else
+	{
+		is_youtu = false;
+	}
+
 	m_foodLayout = static_cast<CTileLayoutUI*>(this->FindSubControl(_T("diandan_foodlist")));
 	m_foodLayout->RemoveAll();
 
+	std::wstring xml_name;
+
+	if (is_youtu)
+	{
+		SIZE itemsize;
+		itemsize.cx = 170;
+		itemsize.cy = 260;
+		m_foodLayout->SetItemSize(itemsize);
+
+		xml_name = _T("diandan_fooditem.xml");
+	}
+	else
+	{
+		SIZE itemsize;
+		itemsize.cx = 170;
+		itemsize.cy = 105;
+		m_foodLayout->SetItemSize(itemsize);
+
+		xml_name = _T("diandan_fooditem_wutu.xml");
+	}
+
 	//如果当前一个分类都没有,那么就不处理了
 	if (m_cur_type_id == "")
 	{
@@ -140,8 +207,9 @@ void CDiandanPageUI::InitFoodShow()
 			CDialogBuilder builder;
 			CDialogBuilderCallbackEx cb;
 
-			CDiandanFoodItemUI* pItem = static_cast<CDiandanFoodItemUI*>(builder.Create(_T("diandan_fooditem.xml"), (UINT)0, &cb, m_pManager));
+			CDiandanFoodItemUI* pItem = static_cast<CDiandanFoodItemUI*>(builder.Create(xml_name.c_str(), (UINT)0, &cb, m_pManager));
 
+			pItem->SetYoutuModel(is_youtu);
 			pItem->SetFoodpackageInfo(food);
 			pItem->UpdateShow();
 
@@ -160,8 +228,9 @@ void CDiandanPageUI::InitFoodShow()
 			CDialogBuilder builder;
 			CDialogBuilderCallbackEx cb;
 
-			CDiandanFoodItemUI* pItem = static_cast<CDiandanFoodItemUI*>(builder.Create(_T("diandan_fooditem.xml"), (UINT)0, &cb, m_pManager));
+			CDiandanFoodItemUI* pItem = static_cast<CDiandanFoodItemUI*>(builder.Create(xml_name.c_str(), (UINT)0, &cb, m_pManager));
 
+			pItem->SetYoutuModel(is_youtu);
 			pItem->SetFoodInfo(food);
 			pItem->UpdateShow();
 
@@ -175,10 +244,6 @@ void CDiandanPageUI::InitJiesuanShow()
 {
 	CShopinfo shopinfo = CShopinfo::m_shopinfo;
 
-	//清空购物车
-	m_cur_diandan_order.Clear();
-	this->ClearDiandanOrderItemShow();
-
 	//先清空会员登录状态
 	m_is_member = false;
 
@@ -622,11 +687,21 @@ void CDiandanPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
 		CFoodtypeOptionUI* typeUI = static_cast<CFoodtypeOptionUI*>(curOption);
 		std::string id = typeUI->GetTypeId();
 
-		m_cur_type_id = id;
+		if (m_cur_type_id != id)
+		{
+			//切换了商品分类
+			m_curFoodtypeOption->SetBkColor(0xFFECECEC);
 
-		this->InitFoodShow();
+			msg.pSender->SetBkColor(0xFF3CB371);
 
-		return;
+			m_curFoodtypeOption = static_cast<CControlUI*>(msg.pSender);
+
+			m_cur_type_id = id;
+
+			this->InitFoodShow();
+
+			return;
+		}
 	}
 	else if (groupname == L"diandan_jiesuan_moling")
 	{
@@ -2330,7 +2405,7 @@ void CDiandanPageUI::StartWeixinzhifuShoukuan()
 			this->UpdateFoodStock(pShoukuanWnd->m_kucun_string);
 
 			//初始化页面信息
-			InitShow();
+			RefreshShow();
 
 			//处理打印
 
@@ -2388,7 +2463,7 @@ void CDiandanPageUI::StartHuiyuanShoukuan()
 			this->UpdateFoodStock(pShoukuanWnd->m_kucun_string);
 
 			//初始化页面信息
-			InitShow();
+			RefreshShow();
 
 			//处理打印
 
@@ -2447,7 +2522,7 @@ void CDiandanPageUI::StartXianjinShoukuan()
 			this->UpdateFoodStock(pShoukuanWnd->m_kucun_string);
 
 			//初始化页面信息
-			InitShow();
+			RefreshShow();
 
 			//处理打印
 
@@ -2505,7 +2580,7 @@ void CDiandanPageUI::StartFulikaShoukuan()
 			this->UpdateFoodStock(pShoukuanWnd->m_kucun_string);
 
 			//初始化页面信息
-			InitShow();
+			RefreshShow();
 
 			//处理打印
 
@@ -2517,23 +2592,6 @@ void CDiandanPageUI::StartFulikaShoukuan()
 	}
 }
 
-void CDiandanPageUI::UpdateFoodStock(std::string food_stock)
-{
-	rapidjson::Document doc;
-	rapidjson::Document::AllocatorType &allocator = doc.GetAllocator(); //获取分配器
-
-	Value& data = CLewaimaiJson::StringToJson(food_stock, allocator);
-
-	for (rapidjson::SizeType i = 0; i < data.Size(); ++i)
-	{
-		std::string food_id = data[i]["food_id"].GetString();
-		std::string stock = data[i]["stock"].GetString();
-
-		CSqlite3 sqlite;
-		sqlite.UpdateFoodStock(food_id, stock);
-	}
-}
-
 void CDiandanPageUI::StartZidingyiShoukuan(std::wstring name, std::wstring selfpay_id)
 {
 	if (m_is_show_shoukuan == true)
@@ -2583,7 +2641,7 @@ void CDiandanPageUI::StartZidingyiShoukuan(std::wstring name, std::wstring selfp
 			this->UpdateFoodStock(pShoukuanWnd->m_kucun_string);
 
 			//初始化页面信息
-			InitShow();
+			RefreshShow();
 
 			//处理打印
 
@@ -2593,4 +2651,21 @@ void CDiandanPageUI::StartZidingyiShoukuan(std::wstring name, std::wstring selfp
 
 		m_is_show_shoukuan = false;
 	}
+}
+
+void CDiandanPageUI::UpdateFoodStock(std::string food_stock)
+{
+	rapidjson::Document doc;
+	rapidjson::Document::AllocatorType &allocator = doc.GetAllocator(); //获取分配器
+
+	Value& data = CLewaimaiJson::StringToJson(food_stock, allocator);
+
+	for (rapidjson::SizeType i = 0; i < data.Size(); ++i)
+	{
+		std::string food_id = data[i]["food_id"].GetString();
+		std::string stock = data[i]["stock"].GetString();
+
+		CSqlite3 sqlite;
+		sqlite.UpdateFoodStock(food_id, stock);
+	}
 }

+ 5 - 1
zhipuzi_pos_windows/page/CDiandanPageUI.h

@@ -17,9 +17,12 @@ public:
 	~CDiandanPageUI();
 
 	//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
-	//收款一个订单成功,准备开始收款第2个订单的时候,也会调用
 	void InitShow();
 
+	//收款一个订单成功,准备开始收款第2个订单的时候调用
+	void RefreshShow();
+
+	//初始化商品分类的显示
 	void InitFoodtypeShow();
 
 	//根据当前选择的分类,刷新商品展示
@@ -155,6 +158,7 @@ private:
 
 	//当前选中的商品分类ID,为空表示没选中任何分类,为taocan表示选中套餐分类,如果选中普通商品分类就是分类ID
 	std::string m_cur_type_id = "";
+	CControlUI* m_curFoodtypeOption;
 
 	//当前点击的哪个商品
 	CDiandanFoodItemUI* m_cur_click_food_item;

+ 73 - 52
zhipuzi_pos_windows/page/CSettingPageUI.cpp

@@ -43,17 +43,6 @@ void CSettingPageUI::InitShow()
 		box->Selected(false, false);
 	}
 
-	box = static_cast<CCheckBoxUI*>(this->FindSubControl(_T("setting_is_new_waimai_dialog")));
-
-	if (CSetting::GetParam("setting_is_new_waimai_dialog") == "1")
-	{
-		box->Selected(true, false);
-	}
-	else
-	{
-		box->Selected(false, false);
-	}
-
 	box = static_cast<CCheckBoxUI*>(this->FindSubControl(_T("setting_is_new_waimai_printer")));
 
 	if (CSetting::GetParam("setting_is_new_waimai_printer") == "1")
@@ -458,59 +447,64 @@ void CSettingPageUI::InitShow()
 
 	//获取当前店铺的商品分类信息,用于设置厨房打印机的分类打印
 
-	//先清空一次分类(主要考虑退出登陆重新登录的情况)
-	CSetting::ClearFoodtype();
-
-	std::string shop_id = CShopinfo::m_shopinfo.m_shop_id;
-	if (shop_id != "0")
+	while (1)
 	{
-		std::map<string, string> params;
-		params["shop_id"] = shop_id;
+		//先清空一次分类(主要考虑退出登陆重新登录的情况)
+		CSetting::ClearFoodtype();
 
-		std::string response;
+		std::string shop_id = CShopinfo::m_shopinfo.m_shop_id;
+		if (shop_id != "0")
+		{
+			std::map<string, string> params;
+			params["shop_id"] = shop_id;
 
-		std::string url = "/goodstype/getlist";
+			std::string response;
 
-		CZhipuziHttpClient::Request(url.c_str(), params, response);
+			std::string url = "/goodstype/getlist";
 
-		rapidjson::Document document;
-		document.Parse(response.c_str());
+			CZhipuziHttpClient::Request(url.c_str(), params, response);
 
-		if (document.HasParseError())
-		{
-			LOG_INFO("parse response error!");
-			return;
-		}
+			rapidjson::Document document;
+			document.Parse(response.c_str());
 
-		if (!document.HasMember("errcode") || !document.HasMember("errmsg") || !document.HasMember("data"))
-		{
-			LOG_INFO("json error!");
-			return;
-		}
+			if (document.HasParseError())
+			{
+				LOG_INFO("parse response error!");
+				break;
+			}
 
-		rapidjson::Value& v_errcode = document["errcode"];
-		int errcode = v_errcode.GetInt();
+			if (!document.HasMember("errcode") || !document.HasMember("errmsg") || !document.HasMember("data"))
+			{
+				LOG_INFO("json error!");
+				break;
+			}
 
-		if (errcode != 0)
-		{
-			LOG_INFO("response failed! message:" << document["errmsg"].GetString());
-			return;
-		}
+			rapidjson::Value& v_errcode = document["errcode"];
+			int errcode = v_errcode.GetInt();
 
-		//获得数据成功,把分类信息保存起来
-		rapidjson::Value& data = document["data"];
+			if (errcode != 0)
+			{
+				LOG_INFO("response failed! message:" << document["errmsg"].GetString());
+				break;
+			}
 
-		rapidjson::Value& v_rows = data["goods_types"];
+			//获得数据成功,把分类信息保存起来
+			rapidjson::Value& data = document["data"];
 
-		for (rapidjson::SizeType i = 0; i < v_rows.Size(); ++i)
-		{
-			rapidjson::Value& v_row_i = v_rows[i];
+			rapidjson::Value& v_rows = data["goods_types"];
+
+			for (rapidjson::SizeType i = 0; i < v_rows.Size(); ++i)
+			{
+				rapidjson::Value& v_row_i = v_rows[i];
 
-			std::string type_id = v_row_i["type_id"].GetString();
-			std::string name = v_row_i["name"].GetString();
+				std::string type_id = v_row_i["type_id"].GetString();
+				std::string name = v_row_i["name"].GetString();
 
-			CSetting::AddFoodtype(name, type_id);
+				CSetting::AddFoodtype(name, type_id);
+			}
 		}
+
+		break;
 	}
 
 	//获取厨房打印机的集合
@@ -604,6 +598,20 @@ void CSettingPageUI::InitShow()
 		pEle->AddCustomAttribute(L"date", CLewaimaiString::UTF8ToUnicode(newPrinter.date).c_str());
 		pPrinterList->Add(pEle);
 	}
+
+	//初始化展示设置
+	CCheckBoxUI* box_youtu = static_cast<CCheckBoxUI*>(this->FindSubControl(_T("xianshi_setting_youtu")));
+	CCheckBoxUI* box_wutu = static_cast<CCheckBoxUI*>(this->FindSubControl(_T("xianshi_setting_wutu")));
+	if (CSetting::GetParam("setting_xianshi_is_youtu") == "1")
+	{
+		box_youtu->Selected(true, false);
+		box_wutu->Selected(false, false);
+	}
+	else
+	{
+		box_youtu->Selected(false, false);
+		box_wutu->Selected(true, false);
+	}
 }
 
 //处理按钮点击类事件
@@ -1071,7 +1079,7 @@ void CSettingPageUI::HandleClickMsg(TNotifyUI& msg)
 	}
 }
 
-//处理option切换事件
+//处理option切换事件,radio事件
 void CSettingPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
 {
 	CDuiString name = msg.pSender->GetName();
@@ -1097,16 +1105,29 @@ void CSettingPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
 		CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(this->FindSubControl(_T("setting_switch")));
 		pControl->SelectItem(3);
 	}
-	else if (name == _T("setting_system_switch"))
+	else if (name == _T("setting_xianshi_switch"))
 	{
 		CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(this->FindSubControl(_T("setting_switch")));
 		pControl->SelectItem(4);
 	}
-	else if (name == _T("setting_system_about"))
+	else if (name == _T("setting_system_switch"))
 	{
 		CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(this->FindSubControl(_T("setting_switch")));
 		pControl->SelectItem(5);
 	}
+	else if (name == _T("setting_system_about"))
+	{
+		CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(this->FindSubControl(_T("setting_switch")));
+		pControl->SelectItem(6);
+	}
+	if (name == _T("xianshi_setting_youtu"))
+	{
+		CSetting::SetParam("setting_xianshi_is_youtu", "1");
+	}
+	if (name == _T("xianshi_setting_wutu"))
+	{
+		CSetting::SetParam("setting_xianshi_is_youtu", "0");
+	}
 }
 
 //处理下拉框、radio的切换事件

+ 7 - 0
zhipuzi_pos_windows/tool/CSetting.cpp

@@ -341,6 +341,13 @@ void CSetting::Init()
 		m_paramsMap[setting_is_close_min] = "1";
 	}
 
+	//显示相关的(默认有图模式)
+	std::string setting_xianshi_is_youtu = "setting_xianshi_is_youtu";
+	if (m_paramsMap.find(setting_xianshi_is_youtu) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_xianshi_is_youtu] = "1";
+	}
+
 	m_mutex.unlock();
 
 	//设置好默认参数之后,将默认参数写回到数据库

+ 3 - 0
zhipuzi_pos_windows/wnd/CChengzhongWnd.cpp

@@ -225,6 +225,9 @@ void CChengzhongWnd::ReadChuankouValue()
 	bool ret = m_serial.openComm();
 	if (!ret)
 	{
+		//这里不设置后面没法退出了
+		m_is_watching = true;
+
 		CLabelUI* pErrorInfo = static_cast<CLabelUI*>(m_pm.FindControl(_T("errinfo")));
 		pErrorInfo->SetText(L"串口打开失败!");
 		pErrorInfo->SetVisible(true);