|
|
@@ -7,6 +7,59 @@
|
|
|
|
|
|
#include "../print/CPosPrinter.h"
|
|
|
|
|
|
+// =====================================================================
|
|
|
+// R76d · 字段行辅助
|
|
|
+// 字段行 = 80px 灰标签(#8A9099) + 深色值(#1F2329),用两个纯文本 Label 实现。
|
|
|
+// 原因:DuiLib 富文本 <c #xxxxxx> / <x i> 在本项目中渲染为空(全代码库仅本页使用),
|
|
|
+// 因此改用与 MakeFeeRow 同构的“双 Label”方案,完全不走 DrawHtmlText。
|
|
|
+// =====================================================================
|
|
|
+static CHorizontalLayoutUI* MakeFieldRow(const std::wstring& wsLabel, const std::wstring& wsValue, LPCTSTR pszValueColor = _T("#FF1F2329"))
|
|
|
+{
|
|
|
+ CHorizontalLayoutUI* pRow = new CHorizontalLayoutUI;
|
|
|
+ pRow->SetFixedHeight(31);
|
|
|
+
|
|
|
+ CLabelUI* pLab = new CLabelUI;
|
|
|
+ pLab->SetAttribute(_T("font"), _T("13"));
|
|
|
+ pLab->SetAttribute(_T("textcolor"), _T("#FF8A9099"));
|
|
|
+ pLab->SetFixedHeight(31);
|
|
|
+ pLab->SetFixedWidth(80);
|
|
|
+ pLab->SetText(wsLabel.c_str());
|
|
|
+
|
|
|
+ CLabelUI* pVal = new CLabelUI;
|
|
|
+ pVal->SetAttribute(_T("font"), _T("13"));
|
|
|
+ pVal->SetAttribute(_T("textcolor"), pszValueColor);
|
|
|
+ pVal->SetFixedHeight(31);
|
|
|
+ pVal->SetText(wsValue.empty() ? L"-" : wsValue.c_str());
|
|
|
+
|
|
|
+ pRow->Add(pLab);
|
|
|
+ pRow->Add(pVal);
|
|
|
+ return pRow;
|
|
|
+}
|
|
|
+
|
|
|
+// 费用行:标签靠左(灰) + 金额靠右(深),两端对齐
|
|
|
+static CHorizontalLayoutUI* MakeFeeRow(const std::wstring& wsLabel, const std::wstring& wsValue)
|
|
|
+{
|
|
|
+ CHorizontalLayoutUI* pRow = new CHorizontalLayoutUI;
|
|
|
+ pRow->SetFixedHeight(30);
|
|
|
+
|
|
|
+ CLabelUI* pLab = new CLabelUI;
|
|
|
+ pLab->SetAttribute(_T("font"), _T("13"));
|
|
|
+ pLab->SetAttribute(_T("textcolor"), _T("#FF8A9099"));
|
|
|
+ pLab->SetAttribute(_T("align"), _T("left"));
|
|
|
+ pLab->SetFixedWidth(160);
|
|
|
+ pLab->SetText(wsLabel.c_str());
|
|
|
+
|
|
|
+ CLabelUI* pVal = new CLabelUI;
|
|
|
+ pVal->SetAttribute(_T("font"), _T("13"));
|
|
|
+ pVal->SetAttribute(_T("textcolor"), _T("#FF1F2329"));
|
|
|
+ pVal->SetAttribute(_T("align"), _T("right"));
|
|
|
+ pVal->SetText(wsValue.c_str());
|
|
|
+
|
|
|
+ pRow->Add(pLab);
|
|
|
+ pRow->Add(pVal);
|
|
|
+ return pRow;
|
|
|
+}
|
|
|
+
|
|
|
CWaimaiOrderInfoPageUI::CWaimaiOrderInfoPageUI()
|
|
|
{
|
|
|
|
|
|
@@ -245,12 +298,15 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
}
|
|
|
|
|
|
//重设商品列表的高度
|
|
|
- int order_item_height = (show_num + 1) * 30;
|
|
|
+ //R76:表头 35 + 每行 34(33 文本 + 1px 底部分隔线)
|
|
|
+
|
|
|
+ int order_item_height = 35 + show_num * 34;
|
|
|
pFoodList->SetFixedHeight(order_item_height);
|
|
|
|
|
|
- CLabelUI *pMemo = static_cast<CLabelUI *>(this->FindSubControl(_T("waimaorder_info_page_memo")));
|
|
|
- std::wstring memo = _T("备注:") + CLewaimaiString::UTF8ToUnicode(order.m_memo);
|
|
|
- pMemo->SetText(memo.c_str());
|
|
|
+ {
|
|
|
+ std::wstring memo = CLewaimaiString::UTF8ToUnicode(order.m_memo);
|
|
|
+ this->FindSubControl(_T("waimaorder_info_page_memo_val"))->SetText(memo.empty() ? _T("-") : memo.c_str());
|
|
|
+ }
|
|
|
|
|
|
//开始展示各种费用
|
|
|
CVerticalLayoutUI* pFeesLayout = static_cast<CVerticalLayoutUI *>(this->FindSubControl(_T("waimai_order_info_page_fees")));
|
|
|
@@ -260,26 +316,14 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
|
|
|
if (order.m_delivery > 0)
|
|
|
{
|
|
|
- CLabelUI *pDlieveryFee = new CLabelUI;
|
|
|
- pDlieveryFee->SetFixedHeight(30);
|
|
|
-
|
|
|
- std::wstring delivery_fee = L"配送费:" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_delivery, 2));
|
|
|
- pDlieveryFee->SetText(delivery_fee.c_str());
|
|
|
-
|
|
|
- pFeesLayout->Add(pDlieveryFee);
|
|
|
+ pFeesLayout->Add(MakeFeeRow(L"配送费", CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_delivery, 2))));
|
|
|
|
|
|
fees_num++;
|
|
|
}
|
|
|
|
|
|
if (order.m_is_dabao == "1")
|
|
|
{
|
|
|
- CLabelUI *pDabaoFee = new CLabelUI;
|
|
|
- pDabaoFee->SetFixedHeight(30);
|
|
|
-
|
|
|
- std::wstring dabao_fee = L"打包费:" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_delivery, 2));
|
|
|
- pDabaoFee->SetText(dabao_fee.c_str());
|
|
|
-
|
|
|
- pFeesLayout->Add(pDabaoFee);
|
|
|
+ pFeesLayout->Add(MakeFeeRow(L"打包费", CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_delivery, 2))));
|
|
|
|
|
|
fees_num++;
|
|
|
}
|
|
|
@@ -289,14 +333,7 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
{
|
|
|
for (std::vector<CWaimaiOrderField>::iterator it = order.m_addservie.begin(); it != order.m_addservie.end(); it++)
|
|
|
{
|
|
|
- std::wstring addservice = CLewaimaiString::UTF8ToUnicode((*it).name) + L":" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)atof((*it).value.c_str()), 2));
|
|
|
-
|
|
|
- CLabelUI* newField = new CLabelUI();
|
|
|
-
|
|
|
- newField->SetText(addservice.c_str());
|
|
|
- newField->SetFixedHeight(30);
|
|
|
-
|
|
|
- pFeesLayout->Add(newField);
|
|
|
+ pFeesLayout->Add(MakeFeeRow(CLewaimaiString::UTF8ToUnicode((*it).name), CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)atof((*it).value.c_str()), 2))));
|
|
|
|
|
|
fees_num++;
|
|
|
}
|
|
|
@@ -305,13 +342,7 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
//店铺折扣
|
|
|
if (order.m_discount < 10)
|
|
|
{
|
|
|
- CLabelUI *pDiscountFee = new CLabelUI;
|
|
|
- pDiscountFee->SetFixedHeight(30);
|
|
|
-
|
|
|
- std::wstring discount = L"店铺折扣:" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_discount, 2)) + L"折";
|
|
|
- pDiscountFee->SetText(discount.c_str());
|
|
|
-
|
|
|
- pFeesLayout->Add(pDiscountFee);
|
|
|
+ pFeesLayout->Add(MakeFeeRow(L"店铺折扣", CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_discount, 2)) + L"折"));
|
|
|
|
|
|
fees_num++;
|
|
|
}
|
|
|
@@ -319,13 +350,7 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
//会员优惠
|
|
|
if (order.m_is_member_discount == "1")
|
|
|
{
|
|
|
- CLabelUI *pMemberFee = new CLabelUI;
|
|
|
- pMemberFee->SetFixedHeight(30);
|
|
|
-
|
|
|
- std::wstring memberfee = L"会员优惠:-" + CLewaimaiString::UTF8ToUnicode(order.m_member_discount);
|
|
|
- pMemberFee->SetText(memberfee.c_str());
|
|
|
-
|
|
|
- pFeesLayout->Add(pMemberFee);
|
|
|
+ pFeesLayout->Add(MakeFeeRow(L"会员优惠", L"-" + CLewaimaiString::UTF8ToUnicode(order.m_member_discount)));
|
|
|
|
|
|
fees_num++;
|
|
|
}
|
|
|
@@ -333,13 +358,7 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
//首单优惠
|
|
|
if (order.m_is_firstcut == "1")
|
|
|
{
|
|
|
- CLabelUI *pFirstCut = new CLabelUI;
|
|
|
- pFirstCut->SetFixedHeight(30);
|
|
|
-
|
|
|
- std::wstring firstcut = L"首单优惠:-" + CLewaimaiString::UTF8ToUnicode(order.m_firstcut_value);
|
|
|
- pFirstCut->SetText(firstcut.c_str());
|
|
|
-
|
|
|
- pFeesLayout->Add(pFirstCut);
|
|
|
+ pFeesLayout->Add(MakeFeeRow(L"首单优惠", L"-" + CLewaimaiString::UTF8ToUnicode(order.m_firstcut_value)));
|
|
|
|
|
|
fees_num++;
|
|
|
}
|
|
|
@@ -348,16 +367,10 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
std::string::size_type position = order.m_promotion.find(":");
|
|
|
if (position != order.m_promotion.npos)
|
|
|
{
|
|
|
- CLabelUI *pManjian = new CLabelUI;
|
|
|
- pManjian->SetFixedHeight(30);
|
|
|
-
|
|
|
std::string promotion_value;
|
|
|
promotion_value.assign(order.m_promotion, position + 1);
|
|
|
|
|
|
- std::wstring promotion = L"满减优惠:-" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)(atof(promotion_value.c_str())), 2));
|
|
|
- pManjian->SetText(promotion.c_str());
|
|
|
-
|
|
|
- pFeesLayout->Add(pManjian);
|
|
|
+ pFeesLayout->Add(MakeFeeRow(L"满减优惠", L"-" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)(atof(promotion_value.c_str())), 2))));
|
|
|
|
|
|
fees_num++;
|
|
|
}
|
|
|
@@ -365,13 +378,7 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
//优惠券
|
|
|
if (order.m_coupon > 0)
|
|
|
{
|
|
|
- CLabelUI *pCoupon = new CLabelUI;
|
|
|
- pCoupon->SetMaxHeight(30);
|
|
|
-
|
|
|
- std::wstring coupon = L"优惠券:-" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_coupon, 2));
|
|
|
- pCoupon->SetText(coupon.c_str());
|
|
|
-
|
|
|
- pFeesLayout->Add(pCoupon);
|
|
|
+ pFeesLayout->Add(MakeFeeRow(L"优惠券", L"-" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_coupon, 2))));
|
|
|
|
|
|
fees_num++;
|
|
|
}
|
|
|
@@ -379,13 +386,7 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
//商品券
|
|
|
if (atof(order.m_goods_coupon_value.c_str()) > 0.0001)
|
|
|
{
|
|
|
- CLabelUI *pGoodsCoupon = new CLabelUI;
|
|
|
- pGoodsCoupon->SetFixedHeight(30);
|
|
|
-
|
|
|
- std::wstring goods_coupon = L"商品券:-" + CLewaimaiString::UTF8ToUnicode(order.m_goods_coupon_value);
|
|
|
- pGoodsCoupon->SetText(goods_coupon.c_str());
|
|
|
-
|
|
|
- pFeesLayout->Add(pGoodsCoupon);
|
|
|
+ pFeesLayout->Add(MakeFeeRow(L"商品券", L"-" + CLewaimaiString::UTF8ToUnicode(order.m_goods_coupon_value)));
|
|
|
|
|
|
fees_num++;
|
|
|
}
|
|
|
@@ -407,114 +408,128 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
fees_height = fees_num * 30;
|
|
|
}
|
|
|
|
|
|
- CLabelUI *pTotalPrice = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_totalprice")));
|
|
|
- std::wstring price = L"总计:¥" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(order.m_price, 2));
|
|
|
- pTotalPrice->SetText(price.c_str());
|
|
|
+ //R76d:总计 = 「总计:」+ 绿色加粗金额(两个纯文本 Label)
|
|
|
+ {
|
|
|
+ std::wstring price = CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(order.m_price, 2));
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_totalprice_val"))->SetText(price.c_str());
|
|
|
+ }
|
|
|
+
|
|
|
+ //R76:卡1 = 标题41 + 线1 + 空12 + List + 空12 + 备注30 + 费用 + 线1 + 总计36 + 底8
|
|
|
|
|
|
- int nTotalHeight = order_item_height + fees_height + 133;
|
|
|
+ int nTotalHeight = order_item_height + fees_height + 141;
|
|
|
this->FindSubControl(_T("waimai_order_info_page_layout_1"))->SetFixedHeight(nTotalHeight);
|
|
|
|
|
|
//开始显示顾客信息
|
|
|
- std::wstring name_show = L"姓名:" + CLewaimaiString::UTF8ToUnicode(order.m_customer_name);
|
|
|
- this->FindSubControl(_T("waimai_order_info_page_name"))->SetText(name_show.c_str());
|
|
|
-
|
|
|
- std::wstring phone_show = L"电话:" + CLewaimaiString::UTF8ToUnicode(order.m_phone);
|
|
|
- this->FindSubControl(_T("waimai_order_info_page_phone"))->SetText(phone_show.c_str());
|
|
|
-
|
|
|
- std::wstring address_show = L"地址:" + CLewaimaiString::UTF8ToUnicode(order.m_address);
|
|
|
- this->FindSubControl(_T("waimai_order_info_page_address"))->SetText(address_show.c_str());
|
|
|
-
|
|
|
- std::wstring order_date_show = L"下单时间:" + CLewaimaiString::UTF8ToUnicode(order.m_order_date);
|
|
|
- this->FindSubControl(_T("waimai_order_info_page_init_date"))->SetText(order_date_show.c_str());
|
|
|
-
|
|
|
- //开始处理骑手信息
|
|
|
- if (atoi(order.m_courier_id.c_str()) > 0)
|
|
|
{
|
|
|
- //有人接单了
|
|
|
- this->FindSubControl(_T("waimai_order_info_page_qishouinfo"))->SetVisible(true);
|
|
|
-
|
|
|
- std::wstring qishou_name = L"骑手姓名:" + CLewaimaiString::UTF8ToUnicode(order.m_courier_name);
|
|
|
- this->FindSubControl(_T("waimai_order_info_page_qishou_name"))->SetText(qishou_name.c_str());
|
|
|
+ std::wstring v = CLewaimaiString::UTF8ToUnicode(order.m_customer_name);
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_name_val"))->SetText(v.empty() ? _T("-") : v.c_str());
|
|
|
+ }
|
|
|
+ {
|
|
|
+ std::wstring v = CLewaimaiString::UTF8ToUnicode(order.m_phone);
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_phone_val"))->SetText(v.empty() ? _T("-") : v.c_str());
|
|
|
+ }
|
|
|
+ {
|
|
|
+ std::wstring v = CLewaimaiString::UTF8ToUnicode(order.m_address);
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_address_val"))->SetText(v.empty() ? _T("-") : v.c_str());
|
|
|
+ }
|
|
|
+ {
|
|
|
+ std::wstring v = CLewaimaiString::UTF8ToUnicode(order.m_order_date);
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_init_date_val"))->SetText(v.empty() ? _T("-") : v.c_str());
|
|
|
+ }
|
|
|
|
|
|
- std::wstring qishou_phone = L"骑手电话:" + CLewaimaiString::UTF8ToUnicode(order.m_courier_phone);
|
|
|
- this->FindSubControl(_T("waimai_order_info_page_qishou_phone"))->SetText(qishou_phone.c_str());
|
|
|
+ //开始处理骑手信息 R76:卡片常显,无骑手时值为 "-"(与设计稿一致)
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_qishouinfo"))->SetVisible(true);
|
|
|
+ {
|
|
|
+ std::wstring wsCourierName;
|
|
|
+ std::wstring wsCourierPhone;
|
|
|
+ std::wstring wsCourierType;
|
|
|
|
|
|
- std::wstring qishou_type;
|
|
|
- if (order.m_courier_type == "3")
|
|
|
- {
|
|
|
- qishou_type = L"骑手类型:快服务骑手";
|
|
|
- }
|
|
|
- else if (order.m_courier_type == "5")
|
|
|
+ if (atoi(order.m_courier_id.c_str()) > 0)
|
|
|
{
|
|
|
- qishou_type = L"骑手类型:达达骑手";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- qishou_type = L"骑手类型:商家自配送骑手";
|
|
|
+ //有人接单了
|
|
|
+ wsCourierName = CLewaimaiString::UTF8ToUnicode(order.m_courier_name);
|
|
|
+ wsCourierPhone = CLewaimaiString::UTF8ToUnicode(order.m_courier_phone);
|
|
|
+
|
|
|
+ if (order.m_courier_type == "3")
|
|
|
+ {
|
|
|
+ wsCourierType = L"快服务骑手";
|
|
|
+ }
|
|
|
+ else if (order.m_courier_type == "5")
|
|
|
+ {
|
|
|
+ wsCourierType = L"达达骑手";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ wsCourierType = L"商家自配送骑手";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- this->FindSubControl(_T("waimai_order_info_page_qishou_type"))->SetText(qishou_type.c_str());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- this->FindSubControl(_T("waimai_order_info_page_qishouinfo"))->SetVisible(false);
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_qishou_name_val"))->SetText(wsCourierName.empty() ? _T("-") : wsCourierName.c_str());
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_qishou_phone_val"))->SetText(wsCourierPhone.empty() ? _T("-") : wsCourierPhone.c_str());
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_qishou_type_val"))->SetText(wsCourierType.empty() ? _T("-") : wsCourierType.c_str());
|
|
|
}
|
|
|
|
|
|
//开始处理订单信息
|
|
|
if (order.m_is_selftake == "1")
|
|
|
{
|
|
|
- CLabelUI *pDeliveryType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_delivery_type")));
|
|
|
- std::wstring wsDeliveryType = _T("配送方式:到店自取(取餐号:") + CLewaimaiString::UTF8ToUnicode(order.m_take_food_code) + _T(")");
|
|
|
+ CLabelUI *pDeliveryType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_delivery_type_val")));
|
|
|
+ std::wstring wsDeliveryType = std::wstring(L"到店自取(取餐号:") + CLewaimaiString::UTF8ToUnicode(order.m_take_food_code) + L")";
|
|
|
pDeliveryType->SetText(wsDeliveryType.c_str());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- CLabelUI *pDeliveryType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_delivery_type")));
|
|
|
- std::wstring wsDeliveryType = _T("配送方式:外卖配送");
|
|
|
- pDeliveryType->SetText(wsDeliveryType.c_str());
|
|
|
+ CLabelUI *pDeliveryType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_delivery_type_val")));
|
|
|
+ pDeliveryType->SetText(_T("外卖配送"));
|
|
|
}
|
|
|
|
|
|
- CLabelUI *pShopname = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_shopname")));
|
|
|
- std::wstring wsShopname = _T("店铺名字:") + CLewaimaiString::UTF8ToUnicode(order.m_shop_name);
|
|
|
- pShopname->SetText(wsShopname.c_str());
|
|
|
+ CLabelUI *pShopname = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_shopname_val")));
|
|
|
+ {
|
|
|
+ std::wstring wsShopname = CLewaimaiString::UTF8ToUnicode(order.m_shop_name);
|
|
|
+ pShopname->SetText(wsShopname.empty() ? _T("-") : wsShopname.c_str());
|
|
|
+ }
|
|
|
|
|
|
+ //R76:取餐号常显,非自取订单值为 "-"(与设计稿一致)
|
|
|
int nTakeFoodCodeHeight = 0;
|
|
|
- CLabelUI *pTakeFoodCode = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_take_food_code")));
|
|
|
- if (order.m_is_selftake == "1")
|
|
|
+ CControlUI *pTakeFoodCode = this->FindSubControl(_T("waimai_order_info_page_take_food_code"));
|
|
|
{
|
|
|
- //自取订单,显示取餐号
|
|
|
+ std::wstring wsTakeLabel;
|
|
|
+ std::wstring wsTakeVal;
|
|
|
if (CShopinfo::GetInstance()->m_version_type == "1")
|
|
|
{
|
|
|
- std::wstring wsTakeFoodCode = _T("取餐号:") + CLewaimaiString::UTF8ToUnicode(order.m_take_food_code);
|
|
|
- pTakeFoodCode->SetText(wsTakeFoodCode.c_str());
|
|
|
+ wsTakeLabel = L"取餐号";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- std::wstring wsTakeFoodCode = _T("取单号:") + CLewaimaiString::UTF8ToUnicode(order.m_take_food_code);
|
|
|
- pTakeFoodCode->SetText(wsTakeFoodCode.c_str());
|
|
|
+ wsTakeLabel = L"取单号";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (order.m_is_selftake == "1")
|
|
|
+ {
|
|
|
+ //自取订单,显示取餐号
|
|
|
+ wsTakeVal = CLewaimaiString::UTF8ToUnicode(order.m_take_food_code);
|
|
|
}
|
|
|
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_take_food_code_lab"))->SetText(wsTakeLabel.c_str());
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_take_food_code_val"))->SetText(wsTakeVal.empty() ? _T("-") : wsTakeVal.c_str());
|
|
|
pTakeFoodCode->SetVisible(true);
|
|
|
- nTakeFoodCodeHeight = 30;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- pTakeFoodCode->SetVisible(false);
|
|
|
- nTakeFoodCodeHeight = 0;
|
|
|
+ nTakeFoodCodeHeight = 31;
|
|
|
}
|
|
|
|
|
|
- CLabelUI *pStatus = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_status")));
|
|
|
- std::wstring wsStatus = _T("订单状态:") + CLewaimaiString::UTF8ToUnicode(order.m_order_status);
|
|
|
+ CLabelUI *pStatus = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_status_val")));
|
|
|
+ std::wstring wsStatusVal = CLewaimaiString::UTF8ToUnicode(order.m_order_status);
|
|
|
|
|
|
if (CLewaimaiString::UTF8ToUnicode(order.m_order_status) == _T("交易失败"))
|
|
|
{
|
|
|
- wsStatus += _T(",失败原因:") + CLewaimaiString::UTF8ToUnicode(order.m_failed_reason);
|
|
|
+ wsStatusVal += L",失败原因:" + CLewaimaiString::UTF8ToUnicode(order.m_failed_reason);
|
|
|
}
|
|
|
- pStatus->SetText(wsStatus.c_str());
|
|
|
+ //R76d:订单状态 = 灰标签 + 绿色值(纯文本,无富文本、无背景胶囊)
|
|
|
+ pStatus->SetText(wsStatusVal.empty() ? _T("-") : wsStatusVal.c_str());
|
|
|
|
|
|
- CLabelUI *pType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_type")));
|
|
|
- std::wstring wsType = _T("订单来源:") + CLewaimaiString::UTF8ToUnicode(order.m_from_type);
|
|
|
- pType->SetText(wsType.c_str());
|
|
|
+ CLabelUI *pType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_type_val")));
|
|
|
+ {
|
|
|
+ std::wstring wsType = CLewaimaiString::UTF8ToUnicode(order.m_from_type);
|
|
|
+ pType->SetText(wsType.empty() ? _T("-") : wsType.c_str());
|
|
|
+ }
|
|
|
|
|
|
//预设选项
|
|
|
CVerticalLayoutUI* pLayout = static_cast<CVerticalLayoutUI *>(this->FindSubControl(_T("waimai_order_info_page_field")));
|
|
|
@@ -525,20 +540,13 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
{
|
|
|
for (std::vector<CWaimaiOrderField>::iterator it = order.m_order_field.begin(); it != order.m_order_field.end() - 1; it++)
|
|
|
{
|
|
|
- std::wstring order_field = CLewaimaiString::UTF8ToUnicode((*it).name) + L":" + CLewaimaiString::UTF8ToUnicode((*it).value);
|
|
|
-
|
|
|
- CLabelUI* newField = new CLabelUI();
|
|
|
-
|
|
|
- newField->SetText(order_field.c_str());
|
|
|
- newField->SetFixedHeight(30);
|
|
|
-
|
|
|
- pLayout->Add(newField);
|
|
|
+ pLayout->Add(MakeFieldRow(CLewaimaiString::UTF8ToUnicode((*it).name), CLewaimaiString::UTF8ToUnicode((*it).value)));
|
|
|
}
|
|
|
|
|
|
//这里预设选项默认有一个配送时间,所以要减1
|
|
|
- pLayout->SetFixedHeight((order.m_order_field.size() - 1) * 30);
|
|
|
+ pLayout->SetFixedHeight((order.m_order_field.size() - 1) * 31);
|
|
|
|
|
|
- order_filed_height = (order.m_order_field.size() - 1) * 30;
|
|
|
+ order_filed_height = (order.m_order_field.size() - 1) * 31;
|
|
|
|
|
|
pLayout->SetVisible(true);
|
|
|
}
|
|
|
@@ -550,23 +558,18 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
}
|
|
|
|
|
|
//配送时间
|
|
|
- std::wstring delivery_date;
|
|
|
- if (order.m_is_selftake == "1")
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_delivery_time_lab"))->SetText(order.m_is_selftake == "1" ? _T("自取时间") : _T("配送时间"));
|
|
|
{
|
|
|
- delivery_date = L"自取时间:" + CLewaimaiString::UTF8ToUnicode(order.m_delivery_date);
|
|
|
+ std::wstring delivery_date = CLewaimaiString::UTF8ToUnicode(order.m_delivery_date);
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_delivery_time_val"))->SetText(delivery_date.empty() ? _T("-") : delivery_date.c_str());
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ CLabelUI *pPayType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_pay_type_val")));
|
|
|
{
|
|
|
- delivery_date = L"配送时间:" + CLewaimaiString::UTF8ToUnicode(order.m_delivery_date);
|
|
|
+ std::wstring wsPayType = CLewaimaiString::UTF8ToUnicode(order.m_pay_type);
|
|
|
+ pPayType->SetText(wsPayType.empty() ? _T("-") : wsPayType.c_str());
|
|
|
}
|
|
|
|
|
|
- CLabelUI *pTime = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_delivery_time")));
|
|
|
- pTime->SetText(delivery_date.c_str());
|
|
|
-
|
|
|
- CLabelUI *pPayType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_pay_type")));
|
|
|
- std::wstring wsPayType = _T("付款方式:") + CLewaimaiString::UTF8ToUnicode(order.m_pay_type);
|
|
|
- pPayType->SetText(wsPayType.c_str());
|
|
|
-
|
|
|
if (CLewaimaiString::UTF8ToUnicode(order.m_pay_type) == L"货到付款")
|
|
|
{
|
|
|
this->FindSubControl(_T("waimai_order_info_page_huodaofukuan"))->SetVisible(true);
|
|
|
@@ -586,7 +589,7 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
|
|
|
CButtonUI* refund_button = static_cast<CButtonUI *>(m_pManager->FindControl(_T("waimai_order_info_page_refund")));
|
|
|
|
|
|
- CLabelUI *pRefundStatus = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_refund_status")));
|
|
|
+ CControlUI *pRefundStatus = this->FindSubControl(_T("waimai_order_info_page_refund_status"));
|
|
|
|
|
|
int refundHeight = 0;
|
|
|
if (_tcscmp(CLewaimaiString::UTF8ToUnicode(order.m_order_status).c_str(), _T("未处理")) == 0)
|
|
|
@@ -642,9 +645,9 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
if (CLewaimaiString::UTF8ToUnicode(order.m_pay_type) != L"货到付款")
|
|
|
{
|
|
|
pRefundStatus->SetVisible(true);
|
|
|
- refundHeight = 30;
|
|
|
+ refundHeight = 31;
|
|
|
|
|
|
- std::wstring refund_status_text = L"退款状态:";
|
|
|
+ std::wstring refund_status_text = L"";
|
|
|
if (refund_status == "0")
|
|
|
{
|
|
|
refund_button->SetVisible(true);
|
|
|
@@ -666,7 +669,7 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
refund_status_text += L"退款失败,原因:" + CLewaimaiString::UTF8ToUnicode(order.m_refund_failed_reason);
|
|
|
}
|
|
|
|
|
|
- pRefundStatus->SetText(refund_status_text.c_str());
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_refund_status_val"))->SetText(refund_status_text.empty() ? _T("-") : refund_status_text.c_str());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -714,9 +717,9 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
refund_button->SetVisible(false);
|
|
|
|
|
|
pRefundStatus->SetVisible(true);
|
|
|
- refundHeight = 30;
|
|
|
+ refundHeight = 31;
|
|
|
|
|
|
- std::wstring refund_status_text = L"退款状态:";
|
|
|
+ std::wstring refund_status_text = L"";
|
|
|
if (refund_status == "1")
|
|
|
{
|
|
|
refund_status_text += L"顾客申请退款,等待商家处理";
|
|
|
@@ -738,18 +741,18 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
refund_status_text += L"顾客再次发起退款,等待客服介入处理中";
|
|
|
}
|
|
|
|
|
|
- pRefundStatus->SetText(refund_status_text.c_str());
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_refund_status_val"))->SetText(refund_status_text.empty() ? _T("-") : refund_status_text.c_str());
|
|
|
}
|
|
|
|
|
|
int configMemoHeight = 0;
|
|
|
- CLabelUI *pConfigmemo = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_configmemo")));
|
|
|
+ CControlUI *pConfigmemo = this->FindSubControl(_T("waimai_order_info_page_configmemo"));
|
|
|
|
|
|
if (m_order.m_configmemo != "")
|
|
|
{
|
|
|
- configMemoHeight = 30;
|
|
|
+ configMemoHeight = 31;
|
|
|
|
|
|
- std::wstring configMemo = L"商家备注:" + CLewaimaiString::UTF8ToUnicode(order.m_configmemo);
|
|
|
- pConfigmemo->SetText(configMemo.c_str());
|
|
|
+ std::wstring configMemo = CLewaimaiString::UTF8ToUnicode(order.m_configmemo);
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_configmemo_val"))->SetText(configMemo.c_str());
|
|
|
pConfigmemo->SetVisible(true);
|
|
|
}
|
|
|
else
|
|
|
@@ -759,5 +762,7 @@ void CWaimaiOrderInfoPageUI::Refresh(CWaimaiOrder& order)
|
|
|
pConfigmemo->SetVisible(false);
|
|
|
}
|
|
|
|
|
|
- this->FindSubControl(_T("waimai_order_info_page_layout_3"))->SetFixedHeight(nTakeFoodCodeHeight + order_filed_height + refundHeight + configMemoHeight + 211);
|
|
|
+ //R76:卡4 = 标题41 + 线1 + 空12 + 底16 + 31×字段数(固定 6 项 = 186)
|
|
|
+
|
|
|
+ this->FindSubControl(_T("waimai_order_info_page_layout_3"))->SetFixedHeight(nTakeFoodCodeHeight + order_filed_height + refundHeight + configMemoHeight + 256);
|
|
|
}
|