浏览代码

订单详情页的显示优化

zhangyang 6 年之前
父节点
当前提交
baecc788d5

二进制
bin/Win32/Debug/zhipuzi_pos_windows/db/pos.db


+ 2 - 2
bin/Win32/Debug/zhipuzi_pos_windows/skin/waimai_order_fail_reason_dlg.xml

@@ -2,7 +2,7 @@
 <Window size="600,300" caption="0,0,0,36" roundcorner="4,4" >
 	<VerticalLayout bkimage="file='Dialog_BG1.png' corner='4,50,4,4'">
 		<HorizontalLayout height="40" inset="10,2,10,0">
-			<Label name="waimai_order_fail_dlg_title" text="填写订单失败原因" width="100" />
+			<Label name="waimai_order_fail_dlg_title" text="填写订单失败原因" width="150" />
 			<Control />
 			<Button name="waimai_order_fail_dlg_closebtn" padding="0,4,0,0" width="22" height="22" tooltip="关闭" normalimage="file='Login_TopBar_Close_Btn.png'" hotimage="file='Login_TopBar_Close_Btn_Hover.png'" pushedimage="file='Login_TopBar_Close_Btn_Click.png'"/>
 		</HorizontalLayout>
@@ -10,7 +10,7 @@
 			<Control height="20" />
 
 			<HorizontalLayout height="56">
-				<Label text="订单商标原因" width="160"/>
+				<Label text="订单失败原因" width="160"/>
 				<Edit name="waimai_order_fail_dlg_reason" width="400" height="32" padding="0,12,0,12" normalimage="file='Chat_InputBox_BG.png' corner='4,4,4,4'" hotimage="file='Chat_InputBox_BG_Hover.png' corner='4,4,4,4'" />
 			</HorizontalLayout>
 		</VerticalLayout>

+ 45 - 44
bin/Win32/Debug/zhipuzi_pos_windows/skin/waimaiorder_info.xml

@@ -6,66 +6,67 @@
 		</HorizontalLayout>
 
 		<HorizontalLayout>
-			<VerticalLayout name="waimai_order_info_page_orderlayout" padding="20,20,20,20" bkcolor="#FFFFFFFF" vscrollbar="true">	
-				<HorizontalLayout height="50">
-					<Label float="true" name="waimai_order_info_page_liushuihao" text="#1" pos="10, 10, 60, 40" />
-					<Label float="true" name="waimai_order_info_page_order_no" text="订单号:" pos="80, 10, 500, 40" />
-				</HorizontalLayout>
+			<VerticalLayout name="waimai_order_info_page_orderlayout" padding="20,20,20,20" vscrollbar="true">
+				<VerticalLayout name="waimai_order_info_page_layout_1" bkcolor="#FFFFFFFF" padding="0,0,0,20" inset="10,0,10,0">
+					<HorizontalLayout height="50">
+						<Label float="true" name="waimai_order_info_page_liushuihao" text="#1" pos="10, 10, 60, 40" />
+						<Label float="true" name="waimai_order_info_page_order_no" text="订单号:" pos="80, 10, 500, 40" />
+					</HorizontalLayout>
 
-				<Control height="1" bkcolor="#FF708090" />
+					<Control height="1" bkcolor="#FF708090" />
 
-				<List name="waimai_order_info_page_foodlist">
-					<ListHeader />
-					<ListHeaderItem text="商品" align="left" />
-					<ListHeaderItem text="数量" width="200" align="center" />
-					<ListHeaderItem text="单价" width="200" align="center" />
-				</List>  
+					<List name="waimai_order_info_page_foodlist">
+						<ListHeader />
+						<ListHeaderItem text="商品" align="left" />
+						<ListHeaderItem text="数量" width="200" align="center" />
+						<ListHeaderItem text="单价" width="200" align="center" />
+					</List>  
 
-				<Control height="10" />
+					<Control height="10" />
 
-				<Label name="waimaorder_info_page_memo" minheight="30" multiline="true" text="备注:" />
+					<Label name="waimaorder_info_page_memo" minheight="30" multiline="true" text="备注:" />
 
-				<Control height="1" bkcolor="#FF708090" />
+					<Control height="1" bkcolor="#FF708090" />
 
-				<VerticalLayout name="waimai_order_info_page_fees">				
+					<VerticalLayout name="waimai_order_info_page_fees">				
 
+					</VerticalLayout>
+					
+					<Control name="waimai_order_info_page_fees_line" height="1" bkcolor="#FF708090" />
+					
+					<Label name="waimai_order_info_page_totalprice" height="40" padding="0,0,30,0" align="right" text="总计:" />
 				</VerticalLayout>
-				
-				<Control name="waimai_order_info_page_fees_line" height="1" bkcolor="#FF708090" />
-				
-				<Label name="waimai_order_info_page_totalprice" height="40" padding="0,0,30,0" align="right" text="总计:" />
-				
-				<Control height="15" bkcolor="#FFEFF6EE" />
-
-				<Label text="顾客信息" height="30" />
-				<Control height="1" bkcolor="#FF708090" />
-				<Label name="waimai_order_info_page_name" text="姓名:" height="30" />
-				<Label name="waimai_order_info_page_phone" text="电话:" height="30" />
-				<Label name="waimai_order_info_page_address" text="地址:" height="30" />
-				<Label name="waimai_order_info_page_init_date" text="下单时间:" height="30" />
-				
-				<VerticalLayout name="waimai_order_info_page_qishouinfo">
-					<Control height="15" bkcolor="#FFEFF6EE" />
 
+				<VerticalLayout name="waimai_order_info_page_layout_2" height="150" bkcolor="#FFFFFFFF" padding="0,0,0,20" inset="10,0,10,0">
+					<Label text="顾客信息" height="30" />
+					<Control height="1" bkcolor="#FF708090" />
+					<Label name="waimai_order_info_page_name" text="姓名:" height="30" />
+					<Label name="waimai_order_info_page_phone" text="电话:" height="30" />
+					<Label name="waimai_order_info_page_address" text="地址:" height="30" />
+					<Label name="waimai_order_info_page_init_date" text="下单时间:" height="30" />
+				</VerticalLayout>
+					
+				<VerticalLayout name="waimai_order_info_page_qishouinfo" height="120" bkcolor="#FFFFFFFF" padding="0,0,0,20" inset="10,0,10,0">
 					<Label text="骑手信息" height="30" />
 					<Control height="1" bkcolor="#FF708090" />
 					<Label name="waimai_order_info_page_qishou_name" text="骑手姓名:" height="30" />
 					<Label name="waimai_order_info_page_qishou_phone" text="骑手电话:" height="30" />
 					<Label name="waimai_order_info_page_qishou_type" text="骑手类型:" height="30" />
-				</VerticalLayout>
-
-				<Control height="15" bkcolor="#FFEFF6EE" />
-
-				<Label text="订单信息" height="30" />
-				<Control height="1" bkcolor="#FF708090" />
-				<Label name="waimai_order_info_page_type" height="30" text="订单来源:" />
-				<Label name="waimai_order_info_page_pay_type" height="30" text="付款方式:" />
-				<VerticalLayout name="waimai_order_info_page_field">
+				</VerticalLayout>				
+				
+				<VerticalLayout name="waimai_order_info_page_layout_3" bkcolor="#FFFFFFFF" padding="0,0,0,20" inset="10,0,10,0">
+					<Label text="订单信息" height="30" />
+					<Control height="1" bkcolor="#FF708090" />
+					<Label name="waimai_order_info_page_status" height="30" text="订单状态:" />
+					<Label name="waimai_order_info_page_type" height="30" text="订单来源:" />
+					<Label name="waimai_order_info_page_pay_type" height="30" text="付款方式:" />
+					<VerticalLayout name="waimai_order_info_page_field">
 
+					</VerticalLayout>
+					<Label name="waimai_order_info_page_delivery_type" height="30" text="配送方式:" />
+					<Label name="waimai_order_info_page_delivery_time" height="30" text="配送时间:" />
+					<Label name="waimai_order_info_page_refund_status" height="30" text="退款状态:" />
 				</VerticalLayout>
-				<Label name="waimai_order_info_page_delivery_type" height="30" text="配送方式:" />
-				<Label name="waimai_order_info_page_delivery_time" height="30" text="配送时间:" />
-				<Label name="waimai_order_info_page_refund_status" height="30" text="退款状态:" />
 			</VerticalLayout>
 
 			<HorizontalLayout width="250" height="400" bkcolor="#FFFFFFFF" padding="0,20,20,0">

二进制
bin/Win32/Debug/zhipuzi_pos_windows/zhipuzi_pos_windows.exe


+ 42 - 1
zhipuzi_pos_windows/control/CWaimaiOrderInfoUI.cpp

@@ -42,7 +42,8 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 	}
 
 	//重设商品列表的高度
-	pFoodList->SetFixedHeight((order.m_order_items.size() + 1) * 30);
+	int order_item_height = (order.m_order_items.size() + 1) * 30;
+	pFoodList->SetFixedHeight(order_item_height);
 
 	CLabelUI *pMemo = static_cast<CLabelUI *>(this->FindSubControl(_T("waimaorder_info_page_memo")));
 	wstring memo = _T("备注:") + CLewaimaiString::UTF8ToUnicode(order.m_memo);
@@ -186,22 +187,31 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 		fees_num++;
 	}
 
+	int fees_height;
 	if (fees_num == 0)
 	{
 		pFeesLayout->SetVisible(false);
 		this->FindSubControl(_T("waimai_order_info_page_fees_line"))->SetVisible(false);
+
+		fees_height = 0;
 	}
 	else
 	{
 		pFeesLayout->SetVisible(true);
 		this->FindSubControl(_T("waimai_order_info_page_fees_line"))->SetVisible(true);
 		pFeesLayout->SetFixedHeight(fees_num * 30);
+
+		fees_height = fees_num * 30;
 	}
 
 	CLabelUI *pTotalPrice = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_totalprice")));
 	wstring price = L"总计:¥" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString(order.m_price, 2));
 	pTotalPrice->SetText(price.c_str());
 
+	int nTotalHeight = order_item_height + fees_height + 133;
+	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());
 
@@ -247,6 +257,7 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 		this->FindSubControl(_T("waimai_order_info_page_qishouinfo"))->SetVisible(false);
 	}
 
+	//开始处理订单信息
 	if (order.m_is_selftake == "1")
 	{
 		CLabelUI *pDeliveryType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_delivery_type")));
@@ -260,6 +271,14 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 		pDeliveryType->SetText(wsDeliveryType.c_str());
 	}
 
+	CLabelUI *pStatus = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_status")));
+	wstring wsStatus = _T("订单状态:") + CLewaimaiString::UTF8ToUnicode(order.m_order_status);
+	if (CLewaimaiString::UTF8ToUnicode(order.m_order_status) == _T("交易失败"))
+	{
+		wsStatus += _T(",失败原因:") + CLewaimaiString::UTF8ToUnicode(order.m_failed_reason);
+	}
+	pStatus->SetText(wsStatus.c_str());
+
 	CLabelUI *pType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_type")));
 	wstring wsType = _T("订单来源:") + CLewaimaiString::UTF8ToUnicode(order.m_from_type);
 	pType->SetText(wsType.c_str());
@@ -268,6 +287,7 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 	CVerticalLayoutUI* pLayout = static_cast<CVerticalLayoutUI *>(this->FindSubControl(_T("waimai_order_info_page_field")));
 	pLayout->RemoveAll();
 
+	int order_filed_height;
 	if (order.m_order_field.size() > 1)
 	{
 		for (std::vector<CWaimaiOrderField>::iterator it = order.m_order_field.begin(); it != order.m_order_field.end() - 1; it++)
@@ -285,10 +305,14 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 		//这里预设选项默认有一个配送时间,所以要减1
 		pLayout->SetFixedHeight((order.m_order_field.size() - 1) * 30);
 
+		order_filed_height = (order.m_order_field.size() - 1) * 30;
+
 		pLayout->SetVisible(true);
 	}
 	else
 	{
+		order_filed_height = 0;
+
 		pLayout->SetVisible(false);
 	}
 
@@ -320,6 +344,7 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 
 	CLabelUI *pRefundStatus = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_refund_status")));
 
+	int refundHeight = 0;
 	if (_tcscmp(CLewaimaiString::UTF8ToUnicode(order.m_order_status).c_str(), _T("未处理")) == 0)
 	{
 		confirm_button->SetVisible(true);
@@ -400,6 +425,8 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 
 		pRefundStatus->SetVisible(true);
 
+		refundHeight = 30;
+
 		std::wstring refund_status_text = L"退款状态:";
 		if (refund_status == "1")
 		{
@@ -421,7 +448,21 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 		{
 			refund_status_text += L"顾客再次发起退款,等待客服介入处理中";
 		}
+		else if (refund_status == "10")
+		{
+			refund_status_text += L"退款处理中,等待退款结果";
+		}
+		else if (refund_status == "11")
+		{
+			refund_status_text += L"退款已完成";
+		}
+		else if (refund_status == "12")
+		{
+			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_layout_3"))->SetFixedHeight(order_filed_height + refundHeight + 181);
 }