Forráskód Böngészése

加入sqllite相关的东西

zhangyang 6 éve
szülő
commit
5f51cd9169

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 195 - 0
bin/Win32/Debug/zhipuzi_pos_windows/log/pos.log


+ 5 - 9
bin/Win32/Debug/zhipuzi_pos_windows/skin/main.xml

@@ -19,6 +19,7 @@
     				<Control />
     				<Option name="main_waimai" text="外卖" width="64" group="menubar" selected="true" hotimage="tab_back.bmp" selectedimage="headerctrl_down.bmp" selectedhotimage="headerctrl_hot.bmp" />
 					<Option name="main_setting" text="设置" width="64" group="menubar" hotimage="tab_back.bmp" selectedimage="headerctrl_down.bmp" selectedhotimage="headerctrl_hot.bmp" />
+					<Option name="main_contact" text="联系我们" width="64" group="menubar" hotimage="tab_back.bmp" selectedimage="headerctrl_down.bmp" selectedhotimage="headerctrl_hot.bmp" />
     			</HorizontalLayout>
     			<HorizontalLayout width="94" >
     				<Button name="minbtn" maxwidth="26" maxheight="18" normalimage="file='frame_btn_min.bmp' source='0,0,26,18' mask='#FFFF00FF'" hotimage="file='frame_btn_min.bmp' source='26,0,52,18' mask='#FFFF00FF'" pushedimage="file='frame_btn_min.bmp' source='52,0,78,18' mask='#FFFF00FF'"/>
@@ -62,20 +63,15 @@
 				<HorizontalLayout vscrollbar="true">
 					<Include source="waimaiorder_info.xml" />
 				</HorizontalLayout>
-				
-				<!--扫码下单-->
-				<HorizontalLayout bkcolor="#FFC0C0C0">
-					<Label text="还没开发扫码下单" />
-				</HorizontalLayout>	
 
 				<!--设置-->
-				<HorizontalLayout bkcolor="#FFC0C0C0">
-					<Label text="还没开发设置" />
+				<HorizontalLayout>
+					<Include source="setting.xml" />
 				</HorizontalLayout>
 
-				<!--官网-->
+				<!--联系我们-->
 				<HorizontalLayout bkcolor="#FFC0C0C0">
-					<Label text="还没开发官网" />
+					<Label text="还没开联系我们" />
 				</HorizontalLayout>
 			</TabLayout>
         </VerticalLayout>

+ 32 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/setting.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Window>
+	<Setting name="setting_page" bkcolor="#FFEFF6EE">
+		<HorizontalLayout>
+			<HorizontalLayout width="250" padding="20,20,20,0">
+				<VerticalLayout height="400" bkcolor="#FFFFFFFF" childpadding="15" inset="20,20,20,0">
+					<Option name="waimai_order_switch" selected="true" text="外卖接单设置" group="setting_switch" align="center" height="38" normalimage="file='Btn_White.png' corner='5,5,5,5'" selectedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" hottextcolor="#CC1010" selectedtextcolor="#FFFFFFFF" />
+					<Option name="printer_switch" text="小票打印设置" group="setting_switch" align="center" height="38" normalimage="file='Btn_White.png' corner='5,5,5,5'" selectedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" hottextcolor="#CC1010" selectedtextcolor="#FFFFFFFF" />
+					<Option name="chufang_printer_switch" text="厨房打印设置" group="setting_switch" align="center" height="38" normalimage="file='Btn_White.png' corner='5,5,5,5'" selectedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" hottextcolor="#CC1010" selectedtextcolor="#FFFFFFFF" />
+					<Option name="system_switch" text="系统设置" group="setting_switch" align="center" height="38" normalimage="file='Btn_White.png' corner='5,5,5,5'" selectedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" hotimage="file='Btn_White_Hover.png' corner='5,5,5,5'" hottextcolor="#CC1010" selectedtextcolor="#FFFFFFFF" />
+				</VerticalLayout>
+			</HorizontalLayout>
+			
+			<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">
+						<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>
+				</VerticalLayout>
+			</TabLayout>
+		</HorizontalLayout>
+	</Setting>
+</Window>

BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/switchbutton.png


BIN
bin/Win32/Debug/zhipuzi_pos_windows/zhipuzi_pos_windows.exe


BIN
dll/debug/sqlite3.dll


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 11753 - 0
include/sqlite3/sqlite3.h


+ 19 - 0
lewaimai_dispatch/control/CSettingUI.cpp

@@ -0,0 +1,19 @@
+#include "../pch/pch.h"
+#include "CSettingUI.h"
+
+
+
+CSettingUI::CSettingUI()
+{
+
+}
+
+
+CSettingUI::~CSettingUI()
+{
+}
+
+void CSettingUI::DoEvent(TEventUI& event)
+{
+	CVerticalLayoutUI::DoEvent(event);
+}

+ 13 - 0
lewaimai_dispatch/control/CSettingUI.h

@@ -0,0 +1,13 @@
+#pragma once
+
+#include "../pch/pch.h"
+
+class CSettingUI : public CVerticalLayoutUI
+{
+public:
+	CSettingUI();
+	~CSettingUI();
+
+	void DoEvent(TEventUI& event);
+};
+

+ 5 - 0
lewaimai_dispatch/control/ControlEx.h

@@ -5,6 +5,7 @@
 #include "CWaimaiOrderItemUI.h"
 #include "OrderListUI.h"
 #include "CWaimaiOrderInfoUI.h"
+#include "CSettingUI.h"
 
 class CDialogBuilderCallbackEx : public IDialogBuilderCallback
 {
@@ -23,6 +24,10 @@ public:
 		{
 			return new CWaimaiOrderInfoUI;
 		}
+		else if (_tcscmp(pstrClass, _T("Setting")) == 0)
+		{
+			return new CSettingUI;
+		}
 
 		return NULL;
 	}

+ 3 - 1
lewaimai_dispatch/lewaimai_dispatch_windows.vcxproj

@@ -132,7 +132,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <AdditionalLibraryDirectories>$(SolutionDir)lib\debug</AdditionalLibraryDirectories>
-      <AdditionalDependencies>DuiLib_ud.lib;log4cplusUD.lib;dbghelp.lib;libcurl.dll.a;setupapi.lib;libboost_date_time-vc141-mt-gd-x32-1_70.lib;libboost_regex-vc141-mt-gd-x32-1_70.lib;GdiPlus.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>DuiLib_ud.lib;log4cplusUD.lib;dbghelp.lib;libcurl.dll.a;setupapi.lib;libboost_date_time-vc141-mt-gd-x32-1_70.lib;libboost_regex-vc141-mt-gd-x32-1_70.lib;sqlite3.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
       <IgnoreSpecificDefaultLibraries>
       </IgnoreSpecificDefaultLibraries>
@@ -198,6 +198,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="control\CWaimaiOrderInfoUI.h" />
+    <ClInclude Include="control\CSettingUI.h" />
     <ClInclude Include="network\CMessagePush.h" />
     <ClInclude Include="order\CWaimaiOrder.h" />
     <ClInclude Include="tool\CPosPrinter.h" />
@@ -221,6 +222,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="control\CWaimaiOrderInfoUI.cpp" />
+    <ClCompile Include="control\CSettingUI.cpp" />
     <ClCompile Include="network\CMessagePush.cpp" />
     <ClCompile Include="order\CWaimaiOrder.cpp" />
     <ClCompile Include="tool\CPosPrinter.cpp" />

+ 6 - 0
lewaimai_dispatch/lewaimai_dispatch_windows.vcxproj.filters

@@ -78,6 +78,9 @@
     <ClInclude Include="control\OrderListUI.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="control\CSettingUI.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">
@@ -137,6 +140,9 @@
     <ClCompile Include="control\CWaimaiOrderItemUI.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="control\CSettingUI.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="resource\duilib.ico">

+ 0 - 1
lewaimai_dispatch/pch/pch.h

@@ -54,7 +54,6 @@ using namespace std;
 #include <zmouse.h>
 #include <exdisp.h>
 #include <comdef.h>
-#include <gdiplus.h>
 
  /*
   *UI库用到的一些东西

+ 2 - 10
lewaimai_dispatch/wnd/CMainWnd.cpp

@@ -388,7 +388,7 @@ void CMainWnd::HandleSelectChangeMsg(TNotifyUI& msg)
             pControl->SelectItem(0);
         }
     }
-    else if(name == _T("main_saomaxiadan"))
+    else if(name == _T("main_setting"))
     {
         CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
         if(pControl && pControl->GetCurSel() != 2)
@@ -396,7 +396,7 @@ void CMainWnd::HandleSelectChangeMsg(TNotifyUI& msg)
             pControl->SelectItem(2);
         }
     }
-    else if(name == _T("main_setting"))
+    else if(name == _T("main_contact"))
     {
         CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
         if(pControl && pControl->GetCurSel() != 3)
@@ -404,14 +404,6 @@ void CMainWnd::HandleSelectChangeMsg(TNotifyUI& msg)
             pControl->SelectItem(3);
         }
     }
-    else if(name == _T("main_web"))
-    {
-        CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
-        if(pControl && pControl->GetCurSel() != 4)
-        {
-            pControl->SelectItem(4);
-        }
-    }
 
     //判断外卖的tab
     else if(name == _T("waimai_open_switch") || name == _T("waimai_confirmed_switch") || name == _T("waimai_delivery_switch") || name == _T("waimai_success_switch") || name == _T("waimai_fail_switch") || name == _T("waimai_cancel_switch") || name == _T("waimai_refund_switch"))

+ 24 - 6
lewaimai_dispatch/zhipuzi_pos_windows.cpp

@@ -1,9 +1,10 @@
 #include "pch/pch.h"
 
 #include "wnd/CLoginWnd.h"
-
 #include "network/CMessagePush.h"
 
+#include <sqlite3/sqlite3.h>
+
 int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
                       _In_opt_ HINSTANCE hPrevInstance,
                       _In_ LPWSTR    lpCmdLine,
@@ -16,13 +17,30 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
     //读取配置文件
     CConfigReader::ReadConfigFile();
 
-	//由这个对象来处理消息推送
-	boost::asio::io_context io_context;
+    //读取sqlite里面的设置信息
+    sqlite3 *db;
+    int rc;
+
+    rc = sqlite3_open("db/pos.db", &db);
+
+    if(rc)
+    {
+        LOG_INFO("Can't open database: " << sqlite3_errmsg(db));
+        return -1;
+    }
+    else
+    {
+        LOG_INFO("Opened database successfully");
+    }
+
+    sqlite3_close(db);
 
-	CMessagePush push(io_context);
-	push.Start();
+    //由这个对象来处理消息推送
+    boost::asio::io_context io_context;
+    CMessagePush push(io_context);
+    push.Start();
 
-	//开始展示窗口
+    //开始展示窗口
     CPaintManagerUI::SetInstance(hInstance);
 #if 0
     CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin"));

BIN
lib/debug/sqlite3.lib