Explorar o código

1、增加字体大小设置
2、并口阻塞导致不打印的问题

zhangyang %!s(int64=6) %!d(string=hai) anos
pai
achega
ad2b36fd86

+ 51 - 3
bin/Win32/Debug/lewaimai_pos_windows/skin/setting.xml

@@ -30,7 +30,7 @@
 					</HorizontalLayout>
 				</VerticalLayout>
 
-				<VerticalLayout bkcolor="#FFFFFFFF" padding="0,20,20,20" inset="15,15,15,15">
+				<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'"/>
@@ -51,6 +51,54 @@
 							<ListLabelElement text="4联" />
 						</Combo>
 					</HorizontalLayout>
+					<HorizontalLayout height="44" padding="0,20,0,0">
+						<Label text="小票格式设置" width="260" />
+					</HorizontalLayout>
+					<Control height="1" bkcolor="#FF708090" />
+					<HorizontalLayout height="44">
+						<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">
+						<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>
 				</VerticalLayout>
 
 				<VerticalLayout bkcolor="#FFFFFFFF" padding="0,20,20,20" inset="15,15,15,15">
@@ -63,8 +111,8 @@
 					</HorizontalLayout>
 					<List name="setting_chufang_printer_list" bordersize="1" bordercolor="#FF000000" itemlinecolor="#FF000000" vscroll="true">
 						<ListHeader />
-						<ListHeaderItem text="打印机名称" width="200" align="center" />
-						<ListHeaderItem text="IP地址" width="200" align="center" />
+						<ListHeaderItem text="打印机名称" width="180" align="center" />
+						<ListHeaderItem text="IP地址" width="160" align="center" />
 						<ListHeaderItem text="打印机规格" width="100" align="center" />
 						<ListHeaderItem text="商品分单打印" width="100" align="center" />
 						<ListHeaderItem text="操作" align="center" />

+ 2 - 2
bin/Win32/Debug/lewaimai_pos_windows/skin/setting_chufang_printer_item.xml

@@ -3,8 +3,8 @@
 <Window> 
 	<ListContainerElement name="setting_chufang_printer_item" height="80"> 
 		<HorizontalLayout> 
-			<Label name="setting_chufang_printer_item_name" width="200" align="center"/> 
-			<Label name="setting_chufang_printer_item_ip" width="200" align="center"/> 
+			<Label name="setting_chufang_printer_item_name" width="180" align="center"/> 
+			<Label name="setting_chufang_printer_item_ip" width="160" align="center"/> 
 			<Label name="setting_chufang_printer_guige" width="100" align="center"/>
 			<Label name="setting_chufang_printer_fendan" width="100" align="center"/>
 			<HorizontalLayout name="setting_chufang_printer_caozuo" align="center">

+ 1 - 1
bin/Win32/Debug/lewaimai_pos_windows/skin/waimai_order_item.xml

@@ -7,7 +7,7 @@
 			
 			<Label float="true" name="waimai_order_list_name" text="姓名:" pos="10,36,182,66" />
 			<Label float="true" name="waimai_order_list_phone" text="电话:" pos="350,36,600,66" />
-			<Label float="true" name="waimai_order_list_address" text="地址:" pos="10,66,550,96" />
+			<Label float="true" name="waimai_order_list_address" text="地址:" pos="10,66,700,96" />
 			
 			<Label float="true" name="waimai_order_list_init_date" text="下单时间:" pos="10,96,220,126" />
 			<Label float="true" name="waimai_order_list_price" text="价格:" pos="350,96,500,126" />

BIN=BIN
bin/Win32/Release/lewaimai_pos_windows/db/pos.db


BIN=BIN
bin/Win32/Release/lewaimai_pos_windows/lewaimai_pos_windows.exe


+ 0 - 5
bin/Win32/Release/lewaimai_pos_windows/log/pos.log

@@ -1,5 +0,0 @@
-2019-06-01 09:42:13[INFO] - folderPath:D:\work\lewaimai_pos_windows\bin\Win32\Release\lewaimai_pos_windows\db,没有找到对应的目录,即将创建 [d:\work\lewaimai_pos_windows\lewaimai_pos_windows\tool\csqlite3.cpp:11]
-2019-06-01 09:42:13[INFO] - 新建 db 目录成功! [d:\work\lewaimai_pos_windows\lewaimai_pos_windows\tool\csqlite3.cpp:18]
-2019-06-01 09:42:13[INFO] - Opened database successfully [d:\work\lewaimai_pos_windows\lewaimai_pos_windows\tool\csqlite3.cpp:35]
-2019-06-01 09:42:13[INFO] - Opened database successfully [d:\work\lewaimai_pos_windows\lewaimai_pos_windows\tool\csqlite3.cpp:35]
-2019-06-01 09:42:13[INFO] - save params success [d:\work\lewaimai_pos_windows\lewaimai_pos_windows\tool\csqlite3.cpp:327]

+ 0 - 0
bin/Win32/Release/lewaimai_pos_windows/log/pos_error.log


BIN=BIN
bin/Win32/Release/lewaimai_pos_windows/skin/skin.lwm


BIN=BIN
bin/Win32/Release/setup/lewaimai_pos_windows_setup_1.0.0.6.exe


+ 1 - 1
bin/Win32/Release/setup/乐外卖接单软件安装脚本.nsi

@@ -2,7 +2,7 @@
 
 ; HM NIS Edit Wizard helper defines
 !define PRODUCT_NAME "乐外卖接单软件"
-!define PRODUCT_VERSION "1.0.0.6"
+!define PRODUCT_VERSION "1.0.0.7"
 !define PRODUCT_PUBLISHER "深圳市迅享科技有限公司"
 !define PRODUCT_WEB_SITE "https://www.lewaimai.com"
 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_NAME}.exe"

+ 2 - 2
lewaimai_pos_windows/network/CLewaimaiHttpClient.cpp

@@ -140,12 +140,12 @@ bool CLewaimaiHttpClient::Request(std::string url, std::map<string, string> para
 		}
 	}
 
-	LOG_INFO("postString:" << postString.c_str());
+	//LOG_INFO("postString:" << postString.c_str());
 
 	CHttpClient m_httpClient;
 	int ret = m_httpClient.Posts(m_client.m_url + url, postString, response, NULL);
 
-	LOG_INFO("response:" << response.c_str());
+	//LOG_INFO("response:" << response.c_str());
 
 	if (ret == 0)
 	{

BIN=BIN
lewaimai_pos_windows/resource/lewaimai_pos_windows.aps


BIN=BIN
lewaimai_pos_windows/resource/lewaimai_pos_windows.rc


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 273 - 275
lewaimai_pos_windows/tool/CPosPrinter.cpp


+ 66 - 0
lewaimai_pos_windows/tool/CSetting.cpp

@@ -161,6 +161,72 @@ void CSetting::Init()
 		m_paramsMap[setting_printer_lianshu] = "1";
 	}
 
+	std::string setting_printer_quhuo_big = "setting_printer_quhuo_big";
+	if (m_paramsMap.find(setting_printer_quhuo_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_quhuo_big] = "0";
+	}
+
+	std::string setting_printer_dingdanhao_big = "setting_printer_dingdanhao_big";
+	if (m_paramsMap.find(setting_printer_dingdanhao_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_dingdanhao_big] = "0";
+	}
+
+	std::string setting_printer_xiadanshijian_big = "setting_printer_xiadanshijian_big";
+	if (m_paramsMap.find(setting_printer_xiadanshijian_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_xiadanshijian_big] = "0";
+	}
+
+	std::string setting_printer_peisongshijian_big = "setting_printer_peisongshijian_big";
+	if (m_paramsMap.find(setting_printer_peisongshijian_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_peisongshijian_big] = "0";
+	}
+
+	std::string setting_printer_name_big = "setting_printer_name_big";
+	if (m_paramsMap.find(setting_printer_name_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_name_big] = "0";
+	}
+
+	std::string setting_printer_phone_big = "setting_printer_phone_big";
+	if (m_paramsMap.find(setting_printer_phone_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_phone_big] = "0";
+	}
+
+	std::string setting_printer_address_big = "setting_printer_address_big";
+	if (m_paramsMap.find(setting_printer_address_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_address_big] = "0";
+	}
+
+	std::string setting_printer_shangpin_big = "setting_printer_shangpin_big";
+	if (m_paramsMap.find(setting_printer_shangpin_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_shangpin_big] = "0";
+	}
+
+	std::string setting_printer_memo_big = "setting_printer_memo_big";
+	if (m_paramsMap.find(setting_printer_memo_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_memo_big] = "0";
+	}
+
+	std::string setting_printer_price_big = "setting_printer_price_big";
+	if (m_paramsMap.find(setting_printer_price_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_price_big] = "0";
+	}
+
+	std::string setting_printer_pay_big = "setting_printer_pay_big";
+	if (m_paramsMap.find(setting_printer_pay_big) == m_paramsMap.end())
+	{
+		m_paramsMap[setting_printer_pay_big] = "0";
+	}
+
 	//³ø·¿´òÓ¡µÄĬÈϲÎÊý
 	std::string setting_is_new_waimai_chufang_printer = "setting_is_new_waimai_chufang_printer";
 	if (m_paramsMap.find(setting_is_new_waimai_chufang_printer) == m_paramsMap.end())

+ 1 - 1
lewaimai_pos_windows/tool/CSqlite3.cpp

@@ -324,7 +324,7 @@ bool CSqlite3::SaveParams(std::map<std::string, std::string>& params)
 
     if(result == SQLITE_OK)
     {
-        LOG_INFO("save params success");
+        //LOG_INFO("save params success");
         return true;
     }
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 271 - 153
lewaimai_pos_windows/wnd/CMainWnd.cpp