|
|
@@ -47,77 +47,7 @@ void CGameFrameWnd::Notify(TNotifyUI& msg)
|
|
|
}
|
|
|
else if(msg.sType == _T("selectchanged"))
|
|
|
{
|
|
|
- CDuiString name = msg.pSender->GetName();
|
|
|
-
|
|
|
- //先判断主页面的tab
|
|
|
- if (name == _T("main_waimai"))
|
|
|
- {
|
|
|
- CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
|
|
|
- if (pControl && pControl->GetCurSel() != 0)
|
|
|
- {
|
|
|
- pControl->SelectItem(0);
|
|
|
- }
|
|
|
- }
|
|
|
- else if (name == _T("main_saomaxiadan"))
|
|
|
- {
|
|
|
- CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
|
|
|
- if (pControl && pControl->GetCurSel() != 2)
|
|
|
- {
|
|
|
- pControl->SelectItem(2);
|
|
|
- }
|
|
|
- }
|
|
|
- else if (name == _T("main_setting"))
|
|
|
- {
|
|
|
- CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
|
|
|
- if (pControl && pControl->GetCurSel() != 3)
|
|
|
- {
|
|
|
- pControl->SelectItem(3);
|
|
|
- }
|
|
|
- }
|
|
|
- else if (name == _T("main_web"))
|
|
|
- {
|
|
|
- CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
|
|
|
- if (pControl && pControl->GetCurSel() != 4)
|
|
|
- {
|
|
|
- pControl->SelectItem(4);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //判断外卖的tab
|
|
|
- else if(name == _T("waimai_open_switch") || name == _T("waimai_confirmed_switch") || name == _T("waimai_delivery_switch") || name == _T("waimai_success_switch") || name == _T("waimai_fail_switch") || name == _T("waimai_refund_switch"))
|
|
|
- {
|
|
|
- OrderListUI* orderlist = static_cast<OrderListUI*>(m_pm.FindControl(_T("orderlist")));
|
|
|
-
|
|
|
- //切换状态全部重新开始从第1页
|
|
|
- orderlist->SetPage(1);
|
|
|
-
|
|
|
- if (name == _T("waimai_open_switch"))
|
|
|
- {
|
|
|
- orderlist->SetStatus(1);
|
|
|
- }
|
|
|
- else if (name == _T("waimai_confirmed_switch"))
|
|
|
- {
|
|
|
- orderlist->SetStatus(2);
|
|
|
- }
|
|
|
- else if (name == _T("waimai_delivery_switch"))
|
|
|
- {
|
|
|
- orderlist->SetStatus(3);
|
|
|
- }
|
|
|
- else if (name == _T("waimai_success_switch"))
|
|
|
- {
|
|
|
- orderlist->SetStatus(4);
|
|
|
- }
|
|
|
- else if (name == _T("waimai_fail_switch"))
|
|
|
- {
|
|
|
- orderlist->SetStatus(5);
|
|
|
- }
|
|
|
- else if (name == _T("waimai_refund_switch"))
|
|
|
- {
|
|
|
- orderlist->SetStatus(6);
|
|
|
- }
|
|
|
-
|
|
|
- orderlist->Refresh();
|
|
|
- }
|
|
|
+ HandleSelectChangeMsg(msg);
|
|
|
}
|
|
|
else if(msg.sType == _T("itemclick"))
|
|
|
{
|
|
|
@@ -242,6 +172,38 @@ void CGameFrameWnd::HandleClickMsg(TNotifyUI& msg)
|
|
|
orderlist->RemoveAt(index);
|
|
|
}
|
|
|
}
|
|
|
+ else if (name == _T("waimai_order_list_agree"))
|
|
|
+ {
|
|
|
+ CWaimaiOrderItemUI* item = static_cast<CWaimaiOrderItemUI*>(msg.pSender->GetParent()->GetParent());
|
|
|
+ std::string waimai_order_id = item->getOrderID();
|
|
|
+
|
|
|
+ CWaimaiOrder order;
|
|
|
+ bool ret = order.AgreeRefund(waimai_order_id);
|
|
|
+
|
|
|
+ if (ret)
|
|
|
+ {
|
|
|
+ //同意退款之后,订单变为失败状态
|
|
|
+ OrderListUI* orderlist = static_cast<OrderListUI*>(m_pm.FindControl(_T("orderlist")));
|
|
|
+ int index = orderlist->GetItemIndex(item);
|
|
|
+ orderlist->RemoveAt(index);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (name == _T("waimai_order_list_disagree"))
|
|
|
+ {
|
|
|
+ CWaimaiOrderItemUI* item = static_cast<CWaimaiOrderItemUI*>(msg.pSender->GetParent()->GetParent());
|
|
|
+ std::string waimai_order_id = item->getOrderID();
|
|
|
+
|
|
|
+ CWaimaiOrder order;
|
|
|
+ bool ret = order.DisagreeRefund(waimai_order_id);
|
|
|
+
|
|
|
+ if (ret)
|
|
|
+ {
|
|
|
+ //不同意退款,订单还是退款中,等待第三方客服处理
|
|
|
+ //OrderListUI* orderlist = static_cast<OrderListUI*>(m_pm.FindControl(_T("orderlist")));
|
|
|
+ //int index = orderlist->GetItemIndex(item);
|
|
|
+ //orderlist->RemoveAt(index);
|
|
|
+ }
|
|
|
+ }
|
|
|
else if (name == _T("waimai_order_list_info"))
|
|
|
{
|
|
|
CWaimaiOrderItemUI* item = static_cast<CWaimaiOrderItemUI*>(msg.pSender->GetParent()->GetParent());
|
|
|
@@ -254,6 +216,7 @@ void CGameFrameWnd::HandleClickMsg(TNotifyUI& msg)
|
|
|
|
|
|
//刷新订单详情页数据
|
|
|
CWaimaiOrderInfoUI* order_info_page = static_cast<CWaimaiOrderInfoUI*>(m_pm.FindControl(_T("waimaiorder_info_page")));
|
|
|
+ order_info_page->SetDate(order);
|
|
|
order_info_page->Refresh(order);
|
|
|
|
|
|
//显示订单详情页的内容
|
|
|
@@ -291,6 +254,85 @@ void CGameFrameWnd::HandleClickMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void CGameFrameWnd::HandleSelectChangeMsg(TNotifyUI& msg)
|
|
|
+{
|
|
|
+ CDuiString name = msg.pSender->GetName();
|
|
|
+
|
|
|
+ //先判断主页面的tab
|
|
|
+ if (name == _T("main_waimai"))
|
|
|
+ {
|
|
|
+ CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
|
|
|
+ if (pControl && pControl->GetCurSel() != 0)
|
|
|
+ {
|
|
|
+ pControl->SelectItem(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (name == _T("main_saomaxiadan"))
|
|
|
+ {
|
|
|
+ CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
|
|
|
+ if (pControl && pControl->GetCurSel() != 2)
|
|
|
+ {
|
|
|
+ pControl->SelectItem(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (name == _T("main_setting"))
|
|
|
+ {
|
|
|
+ CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
|
|
|
+ if (pControl && pControl->GetCurSel() != 3)
|
|
|
+ {
|
|
|
+ pControl->SelectItem(3);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (name == _T("main_web"))
|
|
|
+ {
|
|
|
+ CTabLayoutUI* pControl = static_cast<CTabLayoutUI*>(m_pm.FindControl(_T("switch")));
|
|
|
+ if (pControl && pControl->GetCurSel() != 4)
|
|
|
+ {
|
|
|
+ pControl->SelectItem(4);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //判断外卖的tab
|
|
|
+ else if (name == _T("waimai_open_switch") || name == _T("waimai_confirmed_switch") || name == _T("waimai_delivery_switch") || name == _T("waimai_success_switch") || name == _T("waimai_fail_switch") || name == _T("waimai_cancel_switch") || name == _T("waimai_refund_switch"))
|
|
|
+ {
|
|
|
+ OrderListUI* orderlist = static_cast<OrderListUI*>(m_pm.FindControl(_T("orderlist")));
|
|
|
+
|
|
|
+ //切换状态全部重新开始从第1页
|
|
|
+ orderlist->SetPage(1);
|
|
|
+
|
|
|
+ if (name == _T("waimai_open_switch"))
|
|
|
+ {
|
|
|
+ orderlist->SetStatus(1);
|
|
|
+ }
|
|
|
+ else if (name == _T("waimai_confirmed_switch"))
|
|
|
+ {
|
|
|
+ orderlist->SetStatus(2);
|
|
|
+ }
|
|
|
+ else if (name == _T("waimai_delivery_switch"))
|
|
|
+ {
|
|
|
+ orderlist->SetStatus(3);
|
|
|
+ }
|
|
|
+ else if (name == _T("waimai_success_switch"))
|
|
|
+ {
|
|
|
+ orderlist->SetStatus(4);
|
|
|
+ }
|
|
|
+ else if (name == _T("waimai_fail_switch"))
|
|
|
+ {
|
|
|
+ orderlist->SetStatus(5);
|
|
|
+ }
|
|
|
+ else if (name == _T("waimai_cancel_switch"))
|
|
|
+ {
|
|
|
+ orderlist->SetStatus(6);
|
|
|
+ }
|
|
|
+ else if (name == _T("waimai_refund_switch"))
|
|
|
+ {
|
|
|
+ orderlist->SetStatus(7);
|
|
|
+ }
|
|
|
+
|
|
|
+ orderlist->Refresh();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
LRESULT CGameFrameWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
|
{
|
|
|
LRESULT lRes = 0;
|