#include "../pch/pch.h" #include "OrderListUI.h" void OrderListUI::Refresh() { COptionUI* waimai_open_op = static_cast(m_pManager->FindControl(L"waimai_open_switch")); if (waimai_open_op->IsSelected()) { //请求外卖的未处理订单 std::map params; params["page"] = "1"; std::string response; CZhipuziHttpClient::RequestOld("/waimaiorder/getopenlist", params, response); } CDialogBuilder builder; CContainerUI* pDesk = static_cast(builder.Create(_T("desk.xml"), (UINT)0)); if (pDesk != NULL) { for (int i = 0; i < 20; ++i) { if (pDesk == NULL) pDesk = static_cast(builder.Create()); if (pDesk != NULL) { this->Add(pDesk); pDesk = NULL; } else { this->RemoveAll(); return; } } } }