|
|
@@ -8,6 +8,7 @@
|
|
|
#include "../control/CWaimaiOrderInfoUI.h"
|
|
|
|
|
|
#include "../network/CMessagePush.h"
|
|
|
+#include "CWaimaiOrderFailReasonWnd.h"
|
|
|
|
|
|
void CMainWnd::Init()
|
|
|
{
|
|
|
@@ -174,16 +175,29 @@ void CMainWnd::HandleClickMsg(TNotifyUI& msg)
|
|
|
CWaimaiOrderItemUI* item = static_cast<CWaimaiOrderItemUI*>(msg.pSender->GetParent()->GetParent());
|
|
|
std::string waimai_order_id = item->getOrderID();
|
|
|
|
|
|
- CWaimaiOrder order;
|
|
|
- bool ret = order.FailOrder(waimai_order_id, CLewaimaiString::UnicodeToUTF8(L"windows收银机设置"));
|
|
|
+ CWaimaiOrderFailReasonWnd* pWaimaiFailFrame = new CWaimaiOrderFailReasonWnd();
|
|
|
+ pWaimaiFailFrame->Create(this->GetHWND(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE);
|
|
|
+ pWaimaiFailFrame->SetIcon(IDI_ICON_DUILIB);
|
|
|
+ pWaimaiFailFrame->CenterWindow();
|
|
|
+ UINT ret = pWaimaiFailFrame->ShowModal();
|
|
|
|
|
|
- if(ret)
|
|
|
- {
|
|
|
- //如果设为失败成功,将被设为失败的订单删除掉
|
|
|
- OrderListUI* orderlist = static_cast<OrderListUI*>(m_pm.FindControl(_T("orderlist")));
|
|
|
- int index = orderlist->GetItemIndex(item);
|
|
|
- orderlist->RemoveAt(index);
|
|
|
- }
|
|
|
+ if (ret == IDOK)
|
|
|
+ {
|
|
|
+ std::string sReason = pWaimaiFailFrame->getReason();
|
|
|
+
|
|
|
+ CWaimaiOrder order;
|
|
|
+ bool ret = order.FailOrder(waimai_order_id, sReason);
|
|
|
+
|
|
|
+ if (ret)
|
|
|
+ {
|
|
|
+ //如果设为失败成功,将被设为失败的订单删除掉
|
|
|
+ OrderListUI* orderlist = static_cast<OrderListUI*>(m_pm.FindControl(_T("orderlist")));
|
|
|
+ int index = orderlist->GetItemIndex(item);
|
|
|
+ orderlist->RemoveAt(index);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ delete pWaimaiFailFrame;
|
|
|
}
|
|
|
|
|
|
else if(name == _T("waimai_order_list_agree"))
|
|
|
@@ -338,20 +352,33 @@ void CMainWnd::HandleClickMsg(TNotifyUI& msg)
|
|
|
std::string waimai_order_id = order_info_page->m_order.m_order_id;
|
|
|
std::string waimai_order_no = order_info_page->m_order.m_order_no;
|
|
|
|
|
|
- CWaimaiOrder order;
|
|
|
- bool ret = order.FailOrder(waimai_order_id, "Windwos收银机测试");
|
|
|
+ CWaimaiOrderFailReasonWnd* pWaimaiFailFrame = new CWaimaiOrderFailReasonWnd();
|
|
|
+ pWaimaiFailFrame->Create(this->GetHWND(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE);
|
|
|
+ pWaimaiFailFrame->SetIcon(IDI_ICON_DUILIB);
|
|
|
+ pWaimaiFailFrame->CenterWindow();
|
|
|
+ UINT ret = pWaimaiFailFrame->ShowModal();
|
|
|
|
|
|
- if(ret)
|
|
|
- {
|
|
|
- //订单设为失败,这里怎么处理
|
|
|
- //请求服务器,获取订单数据
|
|
|
- CWaimaiOrder new_order;
|
|
|
- new_order.InitData(waimai_order_id, waimai_order_no);
|
|
|
+ if (ret == IDOK)
|
|
|
+ {
|
|
|
+ std::string sReason = pWaimaiFailFrame->getReason();
|
|
|
+
|
|
|
+ CWaimaiOrder order;
|
|
|
+ bool ret = order.FailOrder(waimai_order_id, sReason);
|
|
|
+
|
|
|
+ if (ret)
|
|
|
+ {
|
|
|
+ //订单设为失败,这里怎么处理
|
|
|
+ //请求服务器,获取订单数据
|
|
|
+ CWaimaiOrder new_order;
|
|
|
+ new_order.InitData(waimai_order_id, waimai_order_no);
|
|
|
+
|
|
|
+ //刷新订单详情页数据
|
|
|
+ order_info_page->SetDate(new_order);
|
|
|
+ order_info_page->Refresh(new_order);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- //刷新订单详情页数据
|
|
|
- order_info_page->SetDate(new_order);
|
|
|
- order_info_page->Refresh(new_order);
|
|
|
- }
|
|
|
+ delete pWaimaiFailFrame;
|
|
|
}
|
|
|
|
|
|
else if(name == _T("waimai_order_info_page_agree"))
|
|
|
@@ -1209,6 +1236,9 @@ LRESULT CMainWnd::OnTrayIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHan
|
|
|
|
|
|
void CMainWnd::InitSettingStatus()
|
|
|
{
|
|
|
+ CLabelUI* version = static_cast<CLabelUI*>(m_pm.FindControl(_T("setting_version")));
|
|
|
+ version->SetText((L"版本号:" + CLewaimaiString::UTF8ToUnicode(CSystem::GetVersion())).c_str());
|
|
|
+
|
|
|
CCheckBoxUI* box = NULL;
|
|
|
CComboUI* com = NULL;
|
|
|
|