OrderListUI.cpp 804 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "../pch/pch.h"
  2. #include "OrderListUI.h"
  3. void OrderListUI::Refresh()
  4. {
  5. COptionUI* waimai_open_op = static_cast<COptionUI*>(m_pManager->FindControl(L"waimai_open_switch"));
  6. if (waimai_open_op->IsSelected())
  7. {
  8. //请求外卖的未处理订单
  9. std::map<string, string> params;
  10. params["page"] = "1";
  11. std::string response;
  12. CZhipuziHttpClient::RequestOld("/waimaiorder/getopenlist", params, response);
  13. }
  14. CDialogBuilder builder;
  15. CContainerUI* pDesk = static_cast<CContainerUI*>(builder.Create(_T("desk.xml"), (UINT)0));
  16. if (pDesk != NULL) {
  17. for (int i = 0; i < 20; ++i)
  18. {
  19. if (pDesk == NULL) pDesk = static_cast<CContainerUI*>(builder.Create());
  20. if (pDesk != NULL) {
  21. this->Add(pDesk);
  22. pDesk = NULL;
  23. }
  24. else {
  25. this->RemoveAll();
  26. return;
  27. }
  28. }
  29. }
  30. }