浏览代码

外卖订单列表的一些优化

zhangyang 6 年之前
父节点
当前提交
c4a27764a9

二进制
bin/Win32/Debug/zhipuzi_pos_windows/db/pos.db


+ 10 - 10
bin/Win32/Debug/zhipuzi_pos_windows/skin/main.xml

@@ -43,19 +43,19 @@
 					<HorizontalLayout>
 						<HorizontalLayout width="250" padding="20,20,20,0">
 							<VerticalLayout height="400" bkcolor="#FFFFFFFF" childpadding="15" inset="20,20,20,0">
-								<Option name="waimai_open_switch" selected="true" text="未处理" group="waimai_status_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="waimai_confirmed_switch" text="已确认" group="waimai_status_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="waimai_delivery_switch" text="配送中" group="waimai_status_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="waimai_success_switch" text="成功" group="waimai_status_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="waimai_fail_switch" text="失败"  group="waimai_status_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="waimai_cancel_switch" text="已取消"  group="waimai_status_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="waimai_refund_switch" text="退款中" group="waimai_status_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="waimai_open_switch" selected="true" text="未处理" group="waimai_status_switch" align="center" height="36" 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="waimai_confirmed_switch" text="已确认" group="waimai_status_switch" align="center" height="36" 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="waimai_delivery_switch" text="配送中" group="waimai_status_switch" align="center" height="36" 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="waimai_success_switch" text="成功" group="waimai_status_switch" align="center" height="36" 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="waimai_fail_switch" text="失败"  group="waimai_status_switch" align="center" height="36" 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="waimai_cancel_switch" text="已取消"  group="waimai_status_switch" align="center" height="36" 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="waimai_refund_switch" text="退款中" group="waimai_status_switch" align="center" height="36" 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>
+												
+						<WaimaiOrderList name="orderlist" vscrollbar="true">
 						
-						<VerticalLayout>						
-							<DeskList name="orderlist" vscrollbar="true" childpadding="20" />
-						</VerticalLayout>
+						</WaimaiOrderList>
 					</HorizontalLayout>
 				</VerticalLayout>
 				

+ 2 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/waimai_order_item.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Window>
-	<WaimaiOrderItem height="200" padding="0,0,0,0" bkcolor="#FFFFFFFF">
+	<WaimaiOrderItem height="200" bkcolor="#FFFFFFFF" padding="0,20,20,0">
 		<HorizontalLayout>
 			<Label float="true" name="waimai_order_list_order_no" text="订单号:" pos="10,6,320,36" />
 			<Label float="true" name="waimai_order_list_name" text="姓名:" pos="10,36,182,66" />
@@ -14,6 +14,7 @@
 			
 			<Label float="true" name="waimai_order_list_price" text="价格:" pos="350,6,482,36" />
 		</HorizontalLayout>
+		
 		<HorizontalLayout width="200">
 			<Button name="waimai_order_list_info" float="true" pos="100,6,180,44" 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'"/>
 			<Button name="waimai_order_list_print" float="true" pos="100,54,180,92" 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'"/>

+ 7 - 7
bin/Win32/Debug/zhipuzi_pos_windows/skin/waimaiorder_info.xml

@@ -68,15 +68,15 @@
 				<Label name="waimai_order_info_page_refund_status" height="30" text="退款状态:" />
 			</VerticalLayout>
 
-			<HorizontalLayout width="250" height="400" bkcolor="#FFFFFFFF" padding="0,20,0,0">
-				<Button name="waimai_order_info_page_print" float="true" pos="60,60,190,98" 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 width="250" height="400" bkcolor="#FFFFFFFF" padding="0,20,20,0">
+				<Button name="waimai_order_info_page_print" float="true" pos="50,60,200,98" 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'" />
 				
-				<Button name="waimai_order_info_page_confirme" float="true" pos="60,108,190,146" text="确认" textcolor="#FFFF0FFFF" />
-				<Button name="waimai_order_info_page_success" float="true" pos="60,108,190,146" text="设为成功" textcolor="#FFFF0FFFF" />
-				<Button name="waimai_order_info_page_fail" float="true" pos="60,156,190,192" text="设为失败" textcolor="#FFFFFFFF" normalimage="file='Btn_Red.png' corner='5,5,5,5'" hotimage="file='Btn_Red_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" />
+				<Button name="waimai_order_info_page_confirme" float="true" pos="50,108,200,146" text="确认" textcolor="#FFFF0FFFF" />
+				<Button name="waimai_order_info_page_success" float="true" pos="50,108,200,146" text="设为成功" textcolor="#FFFF0FFFF" />
+				<Button name="waimai_order_info_page_fail" float="true" pos="50,156,200,192" text="设为失败" textcolor="#FFFFFFFF" normalimage="file='Btn_Red.png' corner='5,5,5,5'" hotimage="file='Btn_Red_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" />
 				
-				<Button name="waimai_order_info_page_agree" float="true" pos="60,108,190,146" text="同意退款" textcolor="#FFFF0FFFF" />
-				<Button name="waimai_order_info_page_disagree" float="true" pos="60,156,190,192" text="拒绝退款" textcolor="#FFFFFFFF" normalimage="file='Btn_Red.png' corner='5,5,5,5'" hotimage="file='Btn_Red_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" />
+				<Button name="waimai_order_info_page_agree" float="true" pos="50,108,200,146" text="同意退款" textcolor="#FFFF0FFFF" />
+				<Button name="waimai_order_info_page_disagree" float="true" pos="50,156,200,192" text="拒绝退款" textcolor="#FFFFFFFF" normalimage="file='Btn_Red.png' corner='5,5,5,5'" hotimage="file='Btn_Red_Hover.png' corner='5,5,5,5'" pushedimage="file='Btn_Red_Click.png' corner='5,5,5,5'" />
 			</HorizontalLayout>
 		</HorizontalLayout>
 	</WaimaiOrderInfo>

二进制
bin/Win32/Debug/zhipuzi_pos_windows/zhipuzi_pos_windows.exe


+ 1 - 1
lewaimai_dispatch/control/ControlEx.h

@@ -12,7 +12,7 @@ class CDialogBuilderCallbackEx : public IDialogBuilderCallback
 public:
 	CControlUI* CreateControl(LPCTSTR pstrClass)
 	{
-		if (_tcscmp(pstrClass, _T("DeskList")) == 0)
+		if (_tcscmp(pstrClass, _T("WaimaiOrderList")) == 0)
 		{
 			return new OrderListUI;
 		}

+ 1 - 126
lewaimai_dispatch/control/OrderListUI.cpp

@@ -172,130 +172,5 @@ void OrderListUI::NextPage()
 
 void OrderListUI::DoEvent(TEventUI& event)
 {
-	if (!IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND)
-	{
-		if (m_pParent != NULL)
-		{
-			m_pParent->DoEvent(event);
-		}
-		else
-		{
-			CListUI::DoEvent(event);
-		}
-		return;
-	}
-
-	if (event.Type == UIEVENT_TIMER && event.wParam == SCROLL_TIMERID)
-	{
-		if ((m_uButtonState & UISTATE_CAPTURED) != 0)
-		{
-			POINT pt = m_pManager->GetMousePos();
-			LONG cy = (pt.y - m_ptLastMouse.y);
-			m_ptLastMouse = pt;
-			SIZE sz = GetScrollPos();
-			sz.cy -= cy;
-			SetScrollPos(sz);
-			return;
-		}
-		else if (m_dwDelayLeft > 0)
-		{
-			--m_dwDelayLeft;
-			SIZE sz = GetScrollPos();
-			LONG lDeltaY = (LONG)(CalculateDelay((double)m_dwDelayLeft / m_dwDelayNum) * m_dwDelayDeltaY);
-			if ((lDeltaY > 0 && sz.cy != 0) || (lDeltaY < 0 && sz.cy != GetScrollRange().cy))
-			{
-				sz.cy -= lDeltaY;
-				SetScrollPos(sz);
-				return;
-			}
-		}
-		m_dwDelayDeltaY = 0;
-		m_dwDelayNum = 0;
-		m_dwDelayLeft = 0;
-		m_pManager->KillTimer(this, SCROLL_TIMERID);
-		return;
-	}
-	if (event.Type == UIEVENT_BUTTONDOWN && IsEnabled())
-	{
-		m_uButtonState |= UISTATE_CAPTURED;
-		m_ptLastMouse = event.ptMouse;
-		m_dwDelayDeltaY = 0;
-		m_dwDelayNum = 0;
-		m_dwDelayLeft = 0;
-		::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND)));
-		m_pManager->SetTimer(this, SCROLL_TIMERID, 50U);
-		return;
-	}
-	if (event.Type == UIEVENT_BUTTONUP)
-	{
-		if ((m_uButtonState & UISTATE_CAPTURED) != 0)
-		{
-			m_uButtonState &= ~UISTATE_CAPTURED;
-			::SetCursor(::LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW)));
-			if (m_ptLastMouse.y != event.ptMouse.y)
-			{
-				m_dwDelayDeltaY = (event.ptMouse.y - m_ptLastMouse.y);
-				if (m_dwDelayDeltaY > 120)
-				{
-					m_dwDelayDeltaY = 120;
-				}
-				else if (m_dwDelayDeltaY < -120)
-				{
-					m_dwDelayDeltaY = -120;
-				}
-				m_dwDelayNum = (DWORD)sqrt((double)abs(m_dwDelayDeltaY)) * 5;
-				m_dwDelayLeft = m_dwDelayNum;
-			}
-			else
-			{
-				m_pManager->KillTimer(this, SCROLL_TIMERID);
-			}
-		}
-		return;
-	}
-	if (event.Type == UIEVENT_SCROLLWHEEL)
-	{
-		LONG lDeltaY = 0;
-		if (m_dwDelayNum > 0)
-		{
-			lDeltaY = (LONG)(CalculateDelay((double)m_dwDelayLeft / m_dwDelayNum) * m_dwDelayDeltaY);
-		}
-		switch (LOWORD(event.wParam))
-		{
-		case SB_LINEUP:
-			if (m_dwDelayDeltaY >= 0)
-			{
-				m_dwDelayDeltaY = lDeltaY + 8;
-			}
-			else
-			{
-				m_dwDelayDeltaY = lDeltaY + 12;
-			}
-			break;
-		case SB_LINEDOWN:
-			if (m_dwDelayDeltaY <= 0)
-			{
-				m_dwDelayDeltaY = lDeltaY - 8;
-			}
-			else
-			{
-				m_dwDelayDeltaY = lDeltaY - 12;
-			}
-			break;
-		}
-		if (m_dwDelayDeltaY > 100)
-		{
-			m_dwDelayDeltaY = 100;
-		}
-		else if (m_dwDelayDeltaY < -100)
-		{
-			m_dwDelayDeltaY = -100;
-		}
-		m_dwDelayNum = (DWORD)sqrt((double)abs(m_dwDelayDeltaY)) * 5;
-		m_dwDelayLeft = m_dwDelayNum;
-		m_pManager->SetTimer(this, SCROLL_TIMERID, 50U);
-		return;
-	}
-
-	CListUI::DoEvent(event);
+	CVerticalLayoutUI::DoEvent(event);
 }

+ 1 - 19
lewaimai_dispatch/control/OrderListUI.h

@@ -1,20 +1,8 @@
 #pragma once
 
-inline double CalculateDelay(double state)
-{
-    return pow(state, 2);
-}
-
-class OrderListUI : public CListUI
+class OrderListUI : public CVerticalLayoutUI
 {
 public:
-    enum { SCROLL_TIMERID = 10 };
-
-    OrderListUI() : m_uButtonState(0), m_dwDelayDeltaY(0), m_dwDelayNum(0), m_dwDelayLeft(0)
-    {
-        //SetItemSize(CSize(1000, 200));
-    }
-
     //刷新当前页面的内容,注意这个函数不会改变当前的订单状态以及“页数”
     void Refresh();
 
@@ -35,12 +23,6 @@ public:
 	}
 
 private:
-    UINT m_uButtonState;
-    POINT m_ptLastMouse;
-    LONG m_dwDelayDeltaY;
-    DWORD m_dwDelayNum;
-    DWORD m_dwDelayLeft;
-
     int m_status = 1; //1:未处理 2:已确认 3:配送中 4:成功 5:失败 6:已取消 7:退款中
 	int m_page = 1;
 

+ 3 - 2
lewaimai_dispatch/lewaimai_dispatch_windows.vcxproj

@@ -30,7 +30,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v141_xp</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
     <UseOfMfc>false</UseOfMfc>
   </PropertyGroup>
@@ -44,7 +44,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v141_xp</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
@@ -107,6 +107,7 @@
       <AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
       <AdditionalLibraryDirectories>$(SolutionDir)lib\debug\grpc;$(SolutionDir)lib;$(SolutionDir)lib\debug</AdditionalLibraryDirectories>
       <AdditionalDependencies>log4cplusUD.lib;aliyun-mns.lib;libcurl_debug.lib;libeay32.lib;ssleay32.lib;mysqlcppconn.lib;Dbghelp.lib;libprotobufd.lib;grpc.lib;grpc++.lib;cares.lib;gpr.lib;zlibd.lib;address_sorting.lib;ssl.lib;crypto.lib;DuiLib_ud.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <MinimumRequiredVersion>5.02</MinimumRequiredVersion>
     </Link>
     <PostBuildEvent>
       <Command>mkdir $(SolutionDir)bin\$(Platform)\$(Configuration)\$(ProjectName)\