|
|
@@ -41,6 +41,10 @@ void CZhengcanPageUI::HandleClickMsg(TNotifyUI& msg)
|
|
|
{
|
|
|
this->CancelZhuanTai();
|
|
|
}
|
|
|
+ else if (name == L"zhengcan_zhuantai_queding")
|
|
|
+ {
|
|
|
+ this->QurenZhuantai();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//处理option切换事件
|
|
|
@@ -423,56 +427,87 @@ void CZhengcanPageUI::ClickTableAction()
|
|
|
std::string order_id = m_cur_click_table_item->GetOrderId();
|
|
|
std::string table_name = m_cur_click_table_item->GetTableName();
|
|
|
|
|
|
- if (status == "0")
|
|
|
+ if (m_nModel == 1)
|
|
|
{
|
|
|
- //未开台,弹框进行人数选择
|
|
|
- CZhengcanKaitaiWnd* pKaitaiDlg = new CZhengcanKaitaiWnd();
|
|
|
-
|
|
|
- if (pKaitaiDlg != NULL)
|
|
|
+ if (status == "0")
|
|
|
{
|
|
|
- pKaitaiDlg->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE);
|
|
|
- pKaitaiDlg->SetIcon(IDI_ICON_DUILIB);
|
|
|
- pKaitaiDlg->CenterWindow();
|
|
|
+ //未开台,弹框进行人数选择
|
|
|
+ CZhengcanKaitaiWnd* pKaitaiDlg = new CZhengcanKaitaiWnd();
|
|
|
|
|
|
- pKaitaiDlg->SetTitle(CLewaimaiString::UTF8ToUnicode(table_name));
|
|
|
-
|
|
|
- UINT ret = pKaitaiDlg->ShowModal();
|
|
|
-
|
|
|
- if (ret == IDOK)
|
|
|
+ if (pKaitaiDlg != NULL)
|
|
|
{
|
|
|
- //这说明人数输入了
|
|
|
- std::string renshu = pKaitaiDlg->getContent();
|
|
|
+ pKaitaiDlg->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE);
|
|
|
+ pKaitaiDlg->SetIcon(IDI_ICON_DUILIB);
|
|
|
+ pKaitaiDlg->CenterWindow();
|
|
|
+
|
|
|
+ pKaitaiDlg->SetTitle(CLewaimaiString::UTF8ToUnicode(table_name));
|
|
|
|
|
|
- bool ret = this->Kaitai(table_id, renshu);
|
|
|
+ UINT ret = pKaitaiDlg->ShowModal();
|
|
|
|
|
|
- if (ret == true)
|
|
|
+ if (ret == IDOK)
|
|
|
{
|
|
|
- //开台成功,进入桌子
|
|
|
- this->EnterTable(table_id);
|
|
|
+ //这说明人数输入了
|
|
|
+ std::string renshu = pKaitaiDlg->getContent();
|
|
|
+
|
|
|
+ bool ret = this->Kaitai(table_id, renshu);
|
|
|
+
|
|
|
+ if (ret == true)
|
|
|
+ {
|
|
|
+ //开台成功,进入桌子
|
|
|
+ this->EnterTable(table_id);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ this->m_pMainWnd->ShowToast(L"开台失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ delete pKaitaiDlg;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- this->m_pMainWnd->ShowToast(L"开台失败!");
|
|
|
- }
|
|
|
-
|
|
|
- delete pKaitaiDlg;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- delete pKaitaiDlg;
|
|
|
+ delete pKaitaiDlg;
|
|
|
|
|
|
- return;
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ else if (status == "1")
|
|
|
+ {
|
|
|
+ //预约中
|
|
|
+ }
|
|
|
+ else if (status == "2")
|
|
|
+ {
|
|
|
+ //已开台
|
|
|
+ this->EnterTable(table_id);
|
|
|
+ }
|
|
|
}
|
|
|
- else if (status == "1")
|
|
|
- {
|
|
|
- //预约中
|
|
|
- }
|
|
|
- else if (status == "2")
|
|
|
+ else if (m_nModel == 2)
|
|
|
{
|
|
|
- //已开台
|
|
|
- this->EnterTable(table_id);
|
|
|
+ if (status == "0")
|
|
|
+ {
|
|
|
+ if (m_cur_zhuanru_item != NULL)
|
|
|
+ {
|
|
|
+ m_cur_zhuanru_item->ShowZhuanru(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ //未开台,正常选中
|
|
|
+ m_cur_zhuanru_item = m_cur_click_table_item;
|
|
|
+
|
|
|
+ m_cur_zhuanru_item->ShowZhuanru(true);
|
|
|
+
|
|
|
+ CButtonUI* zhuantaiQuerenBtn = static_cast<CButtonUI*>(this->FindSubControl(L"zhengcan_zhuantai_queding"));
|
|
|
+ zhuantaiQuerenBtn->SetEnabled(true);
|
|
|
+ }
|
|
|
+ else if (status == "1")
|
|
|
+ {
|
|
|
+ //预约中
|
|
|
+ m_pMainWnd->ShowToast(L"只有未开台的桌子才能转入");
|
|
|
+ }
|
|
|
+ else if (status == "2")
|
|
|
+ {
|
|
|
+ //已开台
|
|
|
+ m_pMainWnd->ShowToast(L"只有未开台的桌子才能转入");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -562,6 +597,12 @@ void CZhengcanPageUI::ShowZhuanTai()
|
|
|
|
|
|
CHorizontalLayoutUI* pZhuantaiLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("zhengcan_zhuantai_layout")));
|
|
|
pZhuantaiLayout->SetVisible(true);
|
|
|
+
|
|
|
+ //初始化转出没选中
|
|
|
+ m_cur_zhuanru_item = NULL;
|
|
|
+
|
|
|
+ CButtonUI* zhuantaiQuerenBtn = static_cast<CButtonUI*>(this->FindSubControl(L"zhengcan_zhuantai_queding"));
|
|
|
+ zhuantaiQuerenBtn->SetEnabled(false);
|
|
|
}
|
|
|
|
|
|
void CZhengcanPageUI::CancelZhuanTai()
|
|
|
@@ -580,4 +621,75 @@ void CZhengcanPageUI::CancelZhuanTai()
|
|
|
|
|
|
CHorizontalLayoutUI* pZhuantaiLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("zhengcan_zhuantai_layout")));
|
|
|
pZhuantaiLayout->SetVisible(false);
|
|
|
+
|
|
|
+ if (m_cur_zhuanru_item != NULL)
|
|
|
+ {
|
|
|
+ m_cur_zhuanru_item->ShowZhuanru(false);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void CZhengcanPageUI::QurenZhuantai()
|
|
|
+{
|
|
|
+ if (m_nModel != 2)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (m_cur_zhuanru_item == NULL)
|
|
|
+ {
|
|
|
+ m_pMainWnd->ShowToast(L"还未选择转入桌子,无法确认");
|
|
|
+ }
|
|
|
+
|
|
|
+ std::string ZhuanruTableId = m_cur_zhuanru_item->GetTableId();
|
|
|
+
|
|
|
+ std::map<string, string> params;
|
|
|
+ params["old_table_id"] = m_HuantaiTableId;
|
|
|
+ params["new_table_id"] = ZhuanruTableId;
|
|
|
+
|
|
|
+ std::string response;
|
|
|
+
|
|
|
+ std::string url = "/dinnercash/changetable";
|
|
|
+ bool ret = CZhipuziHttpClient::GetInstance()->Request(url.c_str(), params, response);
|
|
|
+ if (ret == false)
|
|
|
+ {
|
|
|
+ m_pMainWnd->ShowToast(L"服务器错误,转台失败");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ rapidjson::Document document;
|
|
|
+ document.Parse(response.c_str());
|
|
|
+
|
|
|
+ if (document.HasParseError())
|
|
|
+ {
|
|
|
+ m_pMainWnd->ShowToast(L"服务器错误,转台失败");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!document.HasMember("errcode") || !document.HasMember("errmsg"))
|
|
|
+ {
|
|
|
+ m_pMainWnd->ShowToast(L"服务器错误,转台失败");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ rapidjson::Value& v_errcode = document["errcode"];
|
|
|
+ int errcode = v_errcode.GetInt();
|
|
|
+ if (errcode != 0)
|
|
|
+ {
|
|
|
+ m_pMainWnd->ShowToast(L"服务器错误,转台失败");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!document.HasMember("data"))
|
|
|
+ {
|
|
|
+ m_pMainWnd->ShowToast(L"服务器错误,转台失败");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ rapidjson::Value& data = document["data"];
|
|
|
+
|
|
|
+ //走到这里说明转台成功了
|
|
|
+
|
|
|
+ m_nModel = 1;
|
|
|
+
|
|
|
+ InitShow();
|
|
|
}
|