Просмотр исходного кода

订单详情页基本上调整好了

zhangyang 6 лет назад
Родитель
Сommit
1826702151

BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/GameRes/chatmsgbk.png


BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/GameRes/gameicons.png


BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/GameRes/tab_close.png


BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/GameRes/tree_expand.png


BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/GameRes/tree_hot.bmp


BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/GameRes/tree_select.bmp


BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/GameRes/tree_top.png


BIN
bin/Win32/Debug/zhipuzi_pos_windows/skin/GameRes/vip.png


+ 49 - 51
bin/Win32/Debug/zhipuzi_pos_windows/skin/GameRes/waimaiorder_info.xml

@@ -4,62 +4,60 @@
 		<HorizontalLayout height="50" bkcolor="#FFFFFFFF" padding="0,0,0,0">
 			<Button name="waimai_order_info_page_return" float="true" pos="20,10,120,40" text="返回" textcolor="#FFFF0000" bkcolor="#FFFFFF00"/>
 		</HorizontalLayout>
-		
-		<HorizontalLayout vscrollbar="true">
-			<VerticalLayout padding="20,20,20,20" vscrollbar="true" inset="2,2,2,2">
-				<VerticalLayout bkcolor="#FFFFFFFF" inset="2,2,2,2">
-					<HorizontalLayout height="50">
-						<Label float="true" name="waimai_order_info_page_liushuihao" text="#1" pos="10, 10, 30, 40" />
-						<Label float="true" name="waimai_order_info_page_order_no" text="订单号:" pos="50, 10, 500, 40" />
-					</HorizontalLayout>
-					
-					<Control height="1" bkcolor="#FF708090" />
-					
-					<List name="waimai_order_info_page_foodlist">
-						<ListHeader height="30" />
-						<ListHeaderItem text="商品" align="left" />
-						<ListHeaderItem text="数量" width="200" align="center" />
-						<ListHeaderItem text="单价" width="200" align="center" />
-					</List>  
-					
-					<Control height="10" />
-					
-					<Label name="waimaorder_info_page_memo" height="38" text="备注:" />
-					
-					<Control height="1" bkcolor="#FF708090" />
-					
-					<Label name="waimai_order_info_page_delivery_fee" height="38" text="配送费:" />
-					<Label name="waimai_order_info_page_dabao_fee" height="38" text="打包费:" />
-					
-					<VerticalLayout name="waimai_order_info_page_addservice">
-					
-					</VerticalLayout>
-					
-					<Label name="waimai_order_info_page_discount" height="38" text="店铺折扣:" />
-					<Label name="waimai_order_info_page_memberfee" height="38" text="会员优惠:" />
-					<Label name="waimai_order_info_page_firstcut" height="38" text="首单优惠:" />
-					<Label name="waimai_order_info_page_manjian" height="38" text="满减优惠:" />
-					<Label name="waimai_order_info_page_coupon" height="38" text="优惠券:" />
-					<Label name="waimai_order_info_page_goodscoupon" height="38" text="商品券:" />
+
+		<HorizontalLayout>
+			<VerticalLayout name="waimai_order_info_page_orderlayout" padding="20,20,20,20" bkcolor="#FFFFFFFF" vscrollbar="true" inset="0,2,0,2">	
+				<HorizontalLayout height="50">
+					<Label float="true" name="waimai_order_info_page_liushuihao" text="#1" pos="10, 10, 30, 40" />
+					<Label float="true" name="waimai_order_info_page_order_no" text="订单号:" pos="50, 10, 500, 40" />
+				</HorizontalLayout>
+
+				<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>  
+
+				<Control height="10" />
+
+				<Label name="waimaorder_info_page_memo" minheight="30" multiline="true" text="备注:" />
+
+				<Control height="1" bkcolor="#FF708090" />
+
+				<VerticalLayout name="waimai_order_info_page_fees">				
+
 				</VerticalLayout>
 				
-				<VerticalLayout padding="0, 15, 0, 0" bkcolor="#FFFFFFFF" inset="2,2,2,2">
-					<Label float="true" height="500" name="waimai_order_info_page_name" text="姓名:" textcolor="#FF558CC4" pos="0,6,182,36" mouse="false" />
-					<Label float="true" name="waimai_order_info_page_phone" text="电话:" textcolor="#FF558CC4" pos="200,6,350,36" mouse="false" />
-					<Label float="true" name="waimai_order_info_page_address" text="地址:" textcolor="#FF558CC4" pos="0,36,182,66" mouse="false" />
-					<Label float="true" name="waimai_order_info_page_init_date" text="下单时间:" textcolor="#FF558CC4" pos="0,66,182,96" mouse="false" />
-				</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 padding="0, 15, 0, 0" bkcolor="#FFFFFFFF">
-					<Label name="waimai_order_info_page_type" height="30" text="订单来源:" />
-					<Label name="waimai_order_info_page_pay_type" height="30" text="付款方式:" />
-					<Label name="waimai_order_info_page_delivery_type" height="30" text="配送方式:" />
-					<Label name="waimai_order_info_page_delivery_time" height="30" text="配送时间:" />
-					
-					<VerticalLayout name="waimai_order_info_page_field" />
+				<Control height="15" bkcolor="#FFD3D3D3" />
+
+				<Label text="顾客信息" height="30" />
+				<Control height="1" bkcolor="#FF708090" />
+				<Label name="waimai_order_info_page_name" text="姓名:" height="30" textcolor="#FF558CC4" mouse="false" />
+				<Label name="waimai_order_info_page_phone" text="电话:" height="30" textcolor="#FF558CC4" mouse="false" />
+				<Label name="waimai_order_info_page_address" text="地址:" height="30" textcolor="#FF558CC4" mouse="false" />
+				<Label name="waimai_order_info_page_init_date" text="下单时间:" height="30" textcolor="#FF558CC4" mouse="false" />
+
+				<Control height="15" bkcolor="#FFD3D3D3" />
+
+				<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="付款方式:" />
+				<Label name="waimai_order_info_page_delivery_type" height="30" text="配送方式:" />
+				<Label name="waimai_order_info_page_delivery_time" height="30" text="配送时间:" />
+
+				<VerticalLayout name="waimai_order_info_page_field">
+
 				</VerticalLayout>
 			</VerticalLayout>
-			
+
 			<HorizontalLayout width="300" height="500" bkcolor="#FFFFFFFF" padding="0,20,0,0">
 				<Button name="waimai_order_info_page_print" float="true" pos="20,60,120,90" text="打印" textcolor="#FFFF0000" bkcolor="#FFFFFF00"/>
 				<Button name="waimai_order_info_page_confirme" float="true" pos="20,100,120,130" text="确认" textcolor="#FFFF0000" bkcolor="#FFFFFF00"/>

BIN
bin/Win32/Debug/zhipuzi_pos_windows/zhipuzi_pos_windows.exe


+ 88 - 52
lewaimai_dispatch/wnd/CWaimaiOrderInfoUI.cpp

@@ -41,41 +41,46 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 		pFoodList->Add(pEle);
 	}
 
-	pFoodList->SetFixedHeight(1000);
+	//重设商品列表的高度
+	pFoodList->SetFixedHeight((order.m_order_items.size() + 1) * 30);
 
 	CLabelUI *pMemo = static_cast<CLabelUI *>(this->FindSubControl(_T("waimaorder_info_page_memo")));
 	wstring memo = _T("备注:") + CLewaimaiString::UTF8ToUnicode(order.m_memo);
 	pMemo->SetText(memo.c_str());
 
 	//开始展示各种费用
-	CLabelUI *pDlieveryFee = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_delivery_fee")));
+	CVerticalLayoutUI* pFeesLayout = static_cast<CVerticalLayoutUI *>(this->FindSubControl(_T("waimai_order_info_page_fees")));
+	pFeesLayout->RemoveAll();
+
+	int fees_num = 0;
+	
 	if (order.m_delivery > 0)
 	{
-		pDlieveryFee->SetVisible(true);
+		CLabelUI *pDlieveryFee = new CLabelUI;
+		pDlieveryFee->SetFixedHeight(30);
+
 		wstring delivery_fee = L"配送费:" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_delivery, 2));
 		pDlieveryFee->SetText(delivery_fee.c_str());
-	}
-	else
-	{
-		pDlieveryFee->SetVisible(false);
+
+		pFeesLayout->Add(pDlieveryFee);
+
+		fees_num++;
 	}
 
-	CLabelUI *pDabaoFee = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_dabao_fee")));
 	if (order.m_is_dabao == "1")
 	{
-		pDabaoFee->SetVisible(true);
+		CLabelUI *pDabaoFee = new CLabelUI;
+		pDabaoFee->SetFixedHeight(30);
+
 		wstring dabao_fee = L"打包费:" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_delivery, 2));
 		pDabaoFee->SetText(dabao_fee.c_str());
-	}
-	else
-	{
-		pDabaoFee->SetVisible(false);
+
+		pFeesLayout->Add(pDabaoFee);
+
+		fees_num++;
 	}
 
 	//增值服务费
-	CVerticalLayoutUI* pAddserviceLayout = static_cast<CVerticalLayoutUI *>(this->FindSubControl(_T("waimai_order_info_page_addservice")));
-	pAddserviceLayout->RemoveAll();
-
 	if (order.m_addservie.size() > 0)
 	{
 		for (std::vector<CWaimaiOrderField>::iterator it = order.m_addservie.begin(); it != order.m_addservie.end(); it++)
@@ -85,95 +90,118 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 			CLabelUI* newField = new CLabelUI();
 
 			newField->SetText(addservice.c_str());
-			newField->SetFixedHeight(38);
+			newField->SetFixedHeight(30);
+
+			pFeesLayout->Add(newField);
 
-			pAddserviceLayout->Add(newField);
+			fees_num++;
 		}
 	}
 
 	//店铺折扣
-	CLabelUI *pDiscountFee = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_discount")));
 	if (order.m_discount < 10)
 	{
-		pDiscountFee->SetVisible(true);
+		CLabelUI *pDiscountFee = new CLabelUI;
+		pDiscountFee->SetFixedHeight(30);
+
 		wstring discount = L"店铺折扣:" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_discount, 2)) + L"折";
 		pDiscountFee->SetText(discount.c_str());
-	}
-	else
-	{
-		pDiscountFee->SetVisible(false);
+
+		pFeesLayout->Add(pDiscountFee);
+
+		fees_num++;
 	}
 
 	//会员优惠
-	CLabelUI *pMemberFee = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_memberfee")));
 	if (order.m_is_member_discount == "1")
 	{
-		pMemberFee->SetVisible(true);
+		CLabelUI *pMemberFee = new CLabelUI;
+		pMemberFee->SetFixedHeight(30);
+
 		wstring memberfee = L"会员优惠:-" + CLewaimaiString::UTF8ToUnicode(order.m_member_discount);
-		pDiscountFee->SetText(memberfee.c_str());
-	}
-	else
-	{
-		pMemberFee->SetVisible(false);
+		pMemberFee->SetText(memberfee.c_str());
+
+		pFeesLayout->Add(pMemberFee);
+
+		fees_num++;
 	}
 
 	//首单优惠
-	CLabelUI *pFirstCut = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_firstcut")));
 	if (order.m_is_firstcut == "1")
 	{
-		pFirstCut->SetVisible(true);
+		CLabelUI *pFirstCut = new CLabelUI;
+		pFirstCut->SetFixedHeight(30);
+
 		wstring firstcut = L"首单优惠:-" + CLewaimaiString::UTF8ToUnicode(order.m_firstcut_value);
 		pFirstCut->SetText(firstcut.c_str());
-	}
-	else
-	{
-		pFirstCut->SetVisible(false);
+
+		pFeesLayout->Add(pFirstCut);
+
+		fees_num++;
 	}
 
 	//满减
-	CLabelUI *pManjian = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_manjian")));
 	string::size_type position = order.m_promotion.find(":");
 	if (position != order.m_promotion.npos)
 	{
-		pManjian->SetVisible(true);
+		CLabelUI *pManjian = new CLabelUI;
+		pManjian->SetFixedHeight(30);
 
 		string promotion_value;
 		promotion_value.assign(order.m_promotion, position + 1);
 
 		wstring promotion = L"满减优惠:-" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)(atof(promotion_value.c_str())), 2));
 		pManjian->SetText(promotion.c_str());
-	}
-	else
-	{
-		pManjian->SetVisible(false);
+
+		pFeesLayout->Add(pManjian);
+
+		fees_num++;
 	}
 
 	//优惠券
-	CLabelUI *pCoupon = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_coupon")));
 	if (order.m_coupon > 0)
 	{
-		pCoupon->SetVisible(true);
+		CLabelUI *pCoupon = new CLabelUI;
+		pCoupon->SetMaxHeight(30);
+
 		wstring coupon = L"优惠券:-" + CLewaimaiString::UTF8ToUnicode(CLewaimaiString::DoubleToString((double)order.m_coupon, 2));
 		pCoupon->SetText(coupon.c_str());
-	}
-	else
-	{
-		pCoupon->SetVisible(false);
+
+		pFeesLayout->Add(pCoupon);
+
+		fees_num++;
 	}
 
 	//商品券
-	CLabelUI *pGoodsCoupon = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_goodscoupon")));
 	if (atof(order.m_goods_coupon_value.c_str()) > 0.0001)
 	{
-		pGoodsCoupon->SetVisible(true);
+		CLabelUI *pGoodsCoupon = new CLabelUI;
+		pGoodsCoupon->SetFixedHeight(30);
+
 		wstring goods_coupon = L"商品券:-" + CLewaimaiString::UTF8ToUnicode(order.m_goods_coupon_value);
 		pGoodsCoupon->SetText(goods_coupon.c_str());
+
+		pFeesLayout->Add(pGoodsCoupon);
+
+		fees_num++;
+	}
+
+	if (fees_num == 0)
+	{
+		pFeesLayout->SetVisible(false);
+		this->FindSubControl(_T("waimai_order_info_page_fees_line"))->SetVisible(false);
 	}
 	else
 	{
-		pGoodsCoupon->SetVisible(false);
+		pFeesLayout->SetVisible(true);
+		this->FindSubControl(_T("waimai_order_info_page_fees_line"))->SetVisible(true);
+		pFeesLayout->SetFixedHeight(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());
+
 	std::wstring name_show = L"姓名:" + CLewaimaiString::UTF8ToUnicode(order.m_customer_name);
 	this->FindSubControl(_T("waimai_order_info_page_name"))->SetText(name_show.c_str());
 
@@ -222,6 +250,8 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 		}
 	}
 
+	pLayout->SetFixedHeight(order.m_order_field.size() * 30);
+
 	//配送时间
 	wstring delivery_date;
 	if (order.m_is_selftake == "1")
@@ -239,4 +269,10 @@ void CWaimaiOrderInfoUI::Refresh(CWaimaiOrder& order)
 	CLabelUI *pPayType = static_cast<CLabelUI *>(this->FindSubControl(_T("waimai_order_info_page_pay_type")));
 	wstring wsPayType = _T("付款方式:") + CLewaimaiString::UTF8ToUnicode(order.m_pay_type);
 	pPayType->SetText(wsPayType.c_str());
+
+	CVerticalLayoutUI* pOrderinfoLayout = static_cast<CVerticalLayoutUI *>(this->FindSubControl(_T("waimai_order_info_page_orderlayout")));
+	int a = pOrderinfoLayout->GetSepHeight();
+	int b = pOrderinfoLayout->GetFixedHeight();
+	int c = pOrderinfoLayout->GetHeight();
+	int d = 1;
 }