张洋 12 часов назад
Родитель
Сommit
6e6224e930

+ 11 - 4
DuiLib/Layout/UITileLayout.cpp

@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+#include "StdAfx.h"
 #include "UITileLayout.h"
 
 namespace DuiLib
@@ -85,9 +85,16 @@ namespace DuiLib
 		if( m_nColumns == 0 ) m_nColumns = 1;
 
 		int cyNeeded = 0;
-		int cxWidth = (rc.right - rc.left) / m_nColumns;
-		if( m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible() ) 
-			cxWidth = (rc.right - rc.left + m_pHorizontalScrollBar->GetScrollRange() ) / m_nColumns; ;
+		int cxWidth = szItem.cx + m_iChildPadding;  // 固定列宽
+
+		if (m_pHorizontalScrollBar && m_pHorizontalScrollBar->IsVisible())
+		{
+			// 考虑滚动条的情况
+			int nTotalWidth = rc.right - rc.left + m_pHorizontalScrollBar->GetScrollRange();
+			m_nColumns = nTotalWidth / cxWidth;
+			if (m_nColumns == 0) m_nColumns = 1;
+		}
+
 
 		int cyHeight = 0;
 		int iCount = 0;

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_fooditem.xml

@@ -4,7 +4,7 @@
 	<Font id="1" name="微软雅黑" size="14" />
 	
 	<!-- 宽度130,高度90,图片高度也是130-->
-	<DiandanFoodItem name="diandan_fooditem" bkcolor="#FFFFFFFF" padding="0,0,5,5">
+	<DiandanFoodItem name="diandan_fooditem" bkcolor="#FFFFFFFF" padding="0,0,0,0" width="130" height="230">
 		<Control name="image" height="130" bkimage="file='food_image_default.png'" padding="0,0,0,0"></Control>
 		<Label name="foodname" width="130" height="64" multiline="true" endellipsis="true"></Label>
 		<Label name="price" height="26" font="daindan_price" textcolor="#FFFF7F50" align="left"></Label>

+ 3 - 3
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_page.xml

@@ -101,12 +101,12 @@
 			
 			<VerticalLayout name="diandan_food_layout">
 				<VerticalLayout name="diandan_fenlei_layout_scrolllayout" vscrollbar="true">
-					<HorizontalLayout name="diandan_fenlei_layout" padding="0,0,0,0" bkcolor="#FFFFFFFF" layout="AbsoluteLayout">
+					<Container name="diandan_fenlei_layout" padding="0,0,0,0" bkcolor="#FFFFFFFF" width="fill" height="wrap" autocalcsize="true">
 
-					</HorizontalLayout>
+					</Container>
 				</VerticalLayout>
 				
-				<TileLayout name="diandan_foodlist" padding="0,0,0,0" inset="10,10,0,10" childpadding="1" vscrollbar="true" hscrollbar="false">
+				<TileLayout name="diandan_foodlist" padding="0,0,0,0" inset="10,10,0,10" itemsize="140,230" childpadding="30" vscrollbar="true" hscrollbar="false">
 				
 				</TileLayout>
 				

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/foodtype_option.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Window>
-	<FoodtypeOption endellipsis="true" align="center" valign="center" width="120" height="42" float="true" padding="15,19,0,0" bkcolor="#FFECECEC" selectedtextcolor="#FFFFFFFF">
+	<FoodtypeOption endellipsis="true" align="center" valign="center" width="120" height="42" float="true" padding="15,19,0,0" bkcolor="#FFECECEC" selectedtextcolor="#FFFFFFFF" selectedbkcolor="#FF3CB371">
 	</FoodtypeOption>
 </Window>

BIN
dll/debug/DuiLib_d.dll


+ 4 - 4
zhipuzi_pos_windows/control/CDiandanFoodItemUI.h

@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
 
 #include "../pch/pch.h"
 
@@ -7,7 +7,7 @@
 
 
 /**
- * 商品和商品套餐的ITEM,都用这个
+ * 商品和商品套餐的ITEM,都用这个
  */
 class CDiandanFoodItemUI : public CVerticalLayoutUI
 {
@@ -25,7 +25,7 @@ public:
 	CFoodpackage GetFoodpackageInfo();
 	bool GetIsTaocan();
 
-	//刷新显示
+	//鍒锋柊鏄剧ず
 	void UpdateShow();
 
 	void SetYoutuModel(bool is_youtu);
@@ -36,7 +36,7 @@ private:
 
 	bool m_is_taocan = false;
 
-	//默认有图模式
+	//榛樿�鏈夊浘妯″紡
 	bool m_is_youtu = true;
 };
 

+ 1 - 1
zhipuzi_pos_windows/control/CFoodtypeOptionUI.cpp

@@ -1,4 +1,4 @@
-#include "CFoodtypeOptionUI.h"
+#include "CFoodtypeOptionUI.h"
 
 
 

+ 1 - 1
zhipuzi_pos_windows/control/CFoodtypeOptionUI.h

@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
 
 #include "../pch/pch.h"
 

+ 22 - 24
zhipuzi_pos_windows/page/CDiandanPageUI.cpp

@@ -2,7 +2,6 @@
 #include "CDiandanPageUI.h"
 
 #include "../control/ControlEx.h"
-
 #include "../tool/CSqlite3.h"
 
 #include "../wnd/CDiandanNatureWnd.h"
@@ -98,7 +97,7 @@ void CDiandanPageUI::RefreshShow()
 void CDiandanPageUI::InitFoodtypeShow()
 {
 	//初始化商品渲染相关的信息
-	m_foodtypeLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_fenlei_layout")));
+	m_foodtypeLayout = static_cast<CContainerUI*>(this->FindSubControl(_T("diandan_fenlei_layout")));
 	m_foodtypeLayout->RemoveAll();
 
 	std::string is_ai_shibie = CSetting::GetInstance()->GetParam("setting_is_ai_recognition_open");
@@ -172,7 +171,7 @@ void CDiandanPageUI::InitFoodtypeShow()
 		if (m_cur_type_id == "taocan")
 		{
 			m_curFoodtypeOption = pItem;
-		}
+		} 
 	}
 
 	//接下来开始处理商品分类
@@ -199,15 +198,7 @@ void CDiandanPageUI::InitFoodtypeShow()
 
 	if (m_curFoodtypeOption != NULL)
 	{
-		m_curFoodtypeOption->SetBkColor(0xFF3CB371);
-	}
-
-	//如果不是一个分类都没有,选中第一个分类
-	if (m_cur_type_id != "")
-	{
-		CFoodtypeOptionUI* curTypeUI = static_cast<CFoodtypeOptionUI*>(m_foodtypeLayout->GetItemAt(0));
-
-		curTypeUI->Selected(true, false);
+		m_curFoodtypeOption->Selected(true, true);
 	}
 
 	UpdateFoodtypePos();
@@ -239,7 +230,7 @@ void CDiandanPageUI::UpdateFoodtypePos()
 
 	int num = 0;
 
-	CHorizontalLayoutUI* pFenleiLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_fenlei_layout")));
+	CContainerUI* pFenleiLayout = static_cast<CContainerUI*>(this->FindSubControl(_T("diandan_fenlei_layout")));
 	for (int i = 0; i < nFoodtypeNum; i++)
 	{
 		CButtonUI* curItem = static_cast<CButtonUI*>(pFenleiLayout->GetItemAt(i));
@@ -253,11 +244,14 @@ void CDiandanPageUI::UpdateFoodtypePos()
 		rect.top = (curRow - 1) * 52 + 10;
 		rect.bottom = rect.top + 42;
 
-		curItem->SetFloat(true);
-		curItem->SetPos(rect);
+		// 强制设置固定大小和位置
+		SIZE size;
+		size.cx = rect.left;
+		size.cy = rect.top;
+		curItem->SetFixedXY(size);
 
-		//CRect rc = curItem->GetPos();
-		//OutputDebugStringA(("控件位置:" + std::to_string(rc.left) + "," + std::to_string(rc.top) + "\n").c_str());
+		curItem->SetFixedWidth(rect.right - rect.left);
+		curItem->SetFixedHeight(rect.bottom - rect.top);
 
 		num++;
 	}
@@ -296,6 +290,8 @@ void CDiandanPageUI::InitFoodShow()
 	m_foodLayout = static_cast<CTileLayoutUI*>(this->FindSubControl(_T("diandan_foodlist")));
 	m_foodLayout->RemoveAll();
 
+	m_foodLayout->SetChildPadding(0);
+
 	std::wstring xml_name;
 
 	if (is_youtu)
@@ -701,7 +697,14 @@ void CDiandanPageUI::UpdateJiesuanZhifuPos()
 		rect.top = (curRow - 1) * 100 + 20;
 		rect.bottom = rect.top + 80;
 
-		curItem->SetPos(rect);
+		// 强制设置固定大小和位置
+		SIZE size;
+		size.cx = rect.left;
+		size.cy = rect.top;
+		curItem->SetFixedXY(size);
+
+		curItem->SetFixedWidth(rect.right - rect.left);
+		curItem->SetFixedHeight(rect.bottom - rect.top);
 
 		num++;
 	}
@@ -977,12 +980,7 @@ void CDiandanPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
 		if (m_cur_type_id != id)
 		{
 			//切换了商品分类
-			m_curFoodtypeOption->SetBkColor(0xFFECECEC);
-
-			msg.pSender->SetBkColor(0xFF3CB371);
-
-			m_curFoodtypeOption = static_cast<CControlUI*>(msg.pSender);
-
+			m_curFoodtypeOption = static_cast<CFoodtypeOptionUI*>(msg.pSender);
 			m_cur_type_id = id;
 
 			this->InitFoodShow();

+ 3 - 2
zhipuzi_pos_windows/page/CDiandanPageUI.h

@@ -8,6 +8,7 @@
 #include "../zhipuzi/CFoodpackage.h"
 
 #include "../control/CDiandanFoodItemUI.h"
+#include "../control/CFoodtypeOptionUI.h"
 #include "../zhipuzi/CDiandanOrder.h"
 
 #include "../wnd/CModalWnd.h"
@@ -209,7 +210,7 @@ private:
 
 private:
 	CTileLayoutUI* m_foodLayout;
-	CHorizontalLayoutUI* m_foodtypeLayout;
+	CContainerUI* m_foodtypeLayout;
 
 	bool m_is_ai_shibie = false;
 
@@ -223,7 +224,7 @@ private:
 
 	//当前选中的商品分类ID,为空表示没选中任何分类,为taocan表示选中套餐分类,如果选中普通商品分类就是分类ID
 	std::string m_cur_type_id = "";
-	CControlUI* m_curFoodtypeOption;
+	CFoodtypeOptionUI* m_curFoodtypeOption;
 
 	//商品搜索相关
 	std::string m_type_id_before_sousuo;

+ 16 - 4
zhipuzi_pos_windows/page/CGengduoPageUI.cpp

@@ -411,8 +411,14 @@ void CGengduoPageUI::UpdateItemPos()
 			rect.top = (curRow - 1) * 175 + 15;
 			rect.bottom = rect.top + 160;
 
-			curItem->SetFloat(true);
-			curItem->SetPos(rect);
+			// 强制设置固定大小和位置
+			SIZE size;
+			size.cx = rect.left;
+			size.cy = rect.top;
+			curItem->SetFixedXY(size);
+
+			curItem->SetFixedWidth(rect.right - rect.left);
+			curItem->SetFixedHeight(rect.bottom - rect.top);
 
 			num++;
 		}
@@ -457,8 +463,14 @@ void CGengduoPageUI::UpdateItemPos()
 			rect.top = (curRow - 1) * 175 + 15;
 			rect.bottom = rect.top + 160;
 
-			curItem->SetFloat(true);
-			curItem->SetPos(rect);
+			// 强制设置固定大小和位置
+			SIZE size;
+			size.cx = rect.left;
+			size.cy = rect.top;
+			curItem->SetFixedXY(size);
+
+			curItem->SetFixedWidth(rect.right - rect.left);
+			curItem->SetFixedHeight(rect.bottom - rect.top);
 
 			num++;
 		}

+ 8 - 2
zhipuzi_pos_windows/page/CJiaobanPageUI.cpp

@@ -364,8 +364,14 @@ void CJiaobanPageUI::SetPos(RECT rc, bool bNeedInvalidate)
 		rect.top = (curRow - 1) * 146 + 20;
 		rect.bottom = rect.top + 126;
 
-		curItem->SetFloat(true);
-		curItem->SetPos(rect);
+		// 强制设置固定大小和位置
+		SIZE size;
+		size.cx = rect.left;
+		size.cy = rect.top;
+		curItem->SetFixedXY(size);
+
+		curItem->SetFixedWidth(rect.right - rect.left);
+		curItem->SetFixedHeight(rect.bottom - rect.top);
 
 		num++;
 	}

+ 8 - 2
zhipuzi_pos_windows/page/CShangpinPageUI.cpp

@@ -123,8 +123,14 @@ void CShangpinPageUI::UpdateFoodtypePos()
 		rect.top = (curRow - 1) * 52 + 10;
 		rect.bottom = rect.top + 42;
 
-		curItem->SetFloat(true);
-		curItem->SetPos(rect);
+		// 强制设置固定大小和位置
+		SIZE size;
+		size.cx = rect.left;
+		size.cy = rect.top;
+		curItem->SetFixedXY(size);
+
+		curItem->SetFixedWidth(rect.right - rect.left);
+		curItem->SetFixedHeight(rect.bottom - rect.top);
 
 		num++;
 	}

+ 97 - 90
zhipuzi_pos_windows/page/CShoukuanPageUI.cpp

@@ -1,4 +1,4 @@
-#include "../pch/pch.h"
+#include "../pch/pch.h"
 #include "CShoukuanPageUI.h"
 
 #include "../control/ControlEx.h"
@@ -24,7 +24,7 @@ CShoukuanPageUI::~CShoukuanPageUI()
 
 }
 
-//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
+//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
 void CShoukuanPageUI::InitShow()
 {
 	InitMoney();
@@ -33,17 +33,17 @@ void CShoukuanPageUI::InitShow()
 
 	if (m_is_zidingyizhifu_init == false)
 	{
-		//初始化结算页面的支付方式
+		//鍒濆�鍖栫粨绠楅〉闈㈢殑鏀�粯鏂瑰紡
 		this->InitJiesuanZhifu();
 
 		m_is_zidingyizhifu_init = true;
 	}
 
-	//更新结算按钮位置
+	//鏇存柊缁撶畻鎸夐挳浣嶇疆
 	UpdateJiesuanZhifuPos();
 }
 
-//处理按钮点击类事件
+//处理按钮点击类事件
 void CShoukuanPageUI::HandleClickMsg(TNotifyUI& msg)
 {
 	CDuiString senderName = msg.pSender->GetName();
@@ -98,27 +98,27 @@ void CShoukuanPageUI::HandleClickMsg(TNotifyUI& msg)
 	}
 	else if (senderName == L"diandan_jiesuan_zhifufangshi_weixinzhifu_btn")
 	{
-		//点击微信支付
+		//鐐瑰嚮寰�俊鏀�粯
 		this->StartWeixinzhifuShoukuan();
 	}
 	else if (senderName == L"diandan_jiesuan_zhifufangshi_shoukuan_btn")
 	{
-		//点击会员支付
+		//鐐瑰嚮浼氬憳鏀�粯
 		this->StartHuiyuanShoukuan();
 	}
 	else if (senderName == L"diandan_jiesuan_zhifufangshi_xianjin_btn")
 	{
-		//点击现金收款
+		//鐐瑰嚮鐜伴噾鏀舵�
 		this->StartXianjinShoukuan();
 	}
 	else if (senderName == L"diandan_jiesuan_zhifufangshi_fulika_btn")
 	{
-		//福利卡收款
+		//福利卡收款
 		this->StartFulikaShoukuan();
 	}
 	else if (senderName == L"diandan_jiesuan_zhifufangshi_zidingyi_btn")
 	{
-		//自定义支付
+		//自定义支付
 		std::wstring name = msg.pSender->GetText();
 		std::wstring selfpay_id = msg.pSender->GetCustomAttribute(L"selfpay_id");
 
@@ -126,25 +126,25 @@ void CShoukuanPageUI::HandleClickMsg(TNotifyUI& msg)
 	}
 }
 
-//处理option切换事件
+//澶勭悊option鍒囨崲浜嬩欢
 void CShoukuanPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
 {
 
 }
 
-//处理下拉框、radio的切换事件
+//处理下拉框、radio的切换事件
 void CShoukuanPageUI::HandleItemSelectMsg(TNotifyUI& msg)
 {
 
 }
 
-//处理编辑框输入内容改变事件
+//处理编辑框输入内容改变事件
 void CShoukuanPageUI::HandleTextChangedMsg(TNotifyUI& msg)
 {
 	
 }
 
-//处理扫码枪捕捉到的扫码信息
+//处理扫码枪捕捉到的扫码信息
 void CShoukuanPageUI::HandleTextCapture(std::string content)
 {
 	if (m_is_show_modal_wnd == true)
@@ -153,14 +153,14 @@ void CShoukuanPageUI::HandleTextCapture(std::string content)
 		return;
 	}
 
-	//按付款码处理
+	//鎸変粯娆剧爜澶勭悊
 	std::string s_Fukuanma = content;
 
 	int length = s_Fukuanma.size();
 	if (length != 18 && length != 19)
 	{
-		//肯定不是付款码
-		m_pMainWnd->ShowToast(L"无效的条码!");
+		//肯定不是付款码
+		m_pMainWnd->ShowToast(L"鏃犳晥鐨勬潯鐮侊紒");
 		return;
 	}
 
@@ -169,8 +169,8 @@ void CShoukuanPageUI::HandleTextCapture(std::string content)
 		char c = *(s_Fukuanma.c_str() + i);
 		if (isdigit(c) == 0)
 		{
-			//不是数字
-			m_pMainWnd->ShowToast(L"无效的条码!");
+			//涓嶆槸鏁板瓧
+			m_pMainWnd->ShowToast(L"鏃犳晥鐨勬潯鐮侊紒");
 			return;
 		}
 	}
@@ -182,7 +182,7 @@ void CShoukuanPageUI::HandleTextCapture(std::string content)
 		|| s_Fukuanma.find("14") == 0 \
 		|| s_Fukuanma.find("15") == 0)
 	{
-		//微信付款码
+		//微信付款码
 	}
 	else if (s_Fukuanma.find("25") == 0 \
 		|| s_Fukuanma.find("26") == 0 \
@@ -191,19 +191,19 @@ void CShoukuanPageUI::HandleTextCapture(std::string content)
 		|| s_Fukuanma.find("29") == 0 \
 		|| s_Fukuanma.find("30") == 0)
 	{
-		//支付宝付款码
+		//鏀�粯瀹濅粯娆剧爜
 	}
 	else if (s_Fukuanma.find("62") == 0)
 	{
-		//云闪付付款码
+		//浜戦棯浠樹粯娆剧爜
 	}
 	else
 	{
-		m_pMainWnd->ShowToast(L"无效的条码!");
+		m_pMainWnd->ShowToast(L"鏃犳晥鐨勬潯鐮侊紒");
 		return;
 	}
 
-	//代码能走到这里,说明肯定就是付款码了,默认唤起支付
+	//代码能走到这里,说明肯定就是付款码了,默认唤起支付
 	this->StartWeixinzhifuShoukuan(content);
 }
 
@@ -336,7 +336,7 @@ void CShoukuanPageUI::InitJiesuanZhifu()
 	CHorizontalLayoutUI* pWeixinLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_weixinzhifu")));
 	if (CShopinfo::GetInstance()->m_is_online_pay_open == "1")
 	{
-		//展示微信支付,并且调整位置
+		//展示微信支付,并且调整位置
 		pWeixinLayout->SetVisible(true);
 
 		num++;
@@ -346,7 +346,7 @@ void CShoukuanPageUI::InitJiesuanZhifu()
 		pZhifufangshiLayout->RemoveAt(num);
 	}
 
-	//会员支付
+	//浼氬憳鏀�粯
 	CHorizontalLayoutUI* pHuiyuanLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_huiyuan")));
 	if (CShopinfo::GetInstance()->m_is_vip_pay_open == "1")
 	{
@@ -359,7 +359,7 @@ void CShoukuanPageUI::InitJiesuanZhifu()
 		pZhifufangshiLayout->RemoveAt(num);
 	}
 
-	//现金支付
+	//鐜伴噾鏀�粯
 	CHorizontalLayoutUI* pXianjinLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_xianjin")));
 	if (CShopinfo::GetInstance()->m_is_cash_pay_open == "1")
 	{
@@ -373,7 +373,7 @@ void CShoukuanPageUI::InitJiesuanZhifu()
 	}
 
 	/*
-	//购物卡
+	//购物卡
 	CHorizontalLayoutUI* pGouwukaLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_gouwuka")));
 	if (CShopinfo::GetInstance()->m_is_giftcard_pay_open == "1")
 	{
@@ -386,7 +386,7 @@ void CShoukuanPageUI::InitJiesuanZhifu()
 		pGouwukaLayout->SetVisible(false);
 	}
 
-	//美食城临时卡
+	//缇庨�鍩庝复鏃跺崱
 	CHorizontalLayoutUI* pMeishichengLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_meishicheng")));
 	if (CShopinfo::GetInstance()->m_is_food_town_card_pay_open == "1")
 	{
@@ -400,7 +400,7 @@ void CShoukuanPageUI::InitJiesuanZhifu()
 	}
 	*/
 
-	//福利卡
+	//福利卡
 	CHorizontalLayoutUI* pFulikaLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_fulika")));
 	if (CShopinfo::GetInstance()->m_is_open_fulika_pay == "1")
 	{
@@ -413,7 +413,7 @@ void CShoukuanPageUI::InitJiesuanZhifu()
 		pZhifufangshiLayout->RemoveAt(num);
 	}
 
-	//接着添加自定义支付的
+	//鎺ョ潃娣诲姞鑷�畾涔夋敮浠樼殑
 	for (std::vector<SelfPay>::iterator it = CShopinfo::GetInstance()->m_self_pay.begin(); it != CShopinfo::GetInstance()->m_self_pay.end(); it++)
 	{
 		SelfPay selfpay = *it;
@@ -430,12 +430,12 @@ void CShoukuanPageUI::InitJiesuanZhifu()
 			newButton->SetBorderColor(0xFFC1C1C1);
 			newButton->SetBkColor(0xFFF7F7F7);
 
-			//设置定义属性,在点击按钮的时候好区分
+			//璁剧疆瀹氫箟灞炴€э紝鍦ㄧ偣鍑绘寜閽�殑鏃跺€欏ソ鍖哄垎
 			newButton->SetAttribute(L"name", L"diandan_jiesuan_zhifufangshi_zidingyi_btn");
 			newButton->AddCustomAttribute(L"selfpay_id", CLewaimaiString::UTF8ToUnicode(selfpay.id).c_str());
 			newButton->SetAttribute(L"float", L"true");
 
-			//必须先Add,才能调用下面的SetPos,否则无效
+			//必须先Add,才能调用下面的SetPos,否则无效
 			pZhifufangshiLayout->Add(newButton);
 
 			num++;
@@ -447,7 +447,7 @@ void CShoukuanPageUI::InitJiesuanZhifu()
 
 void CShoukuanPageUI::UpdateJiesuanZhifuPos()
 {
-	//添加支付方式
+	//娣诲姞鏀�粯鏂瑰紡
 	int nWidth = m_nPageWidth;
 	if (nWidth == 0)
 	{
@@ -462,7 +462,7 @@ void CShoukuanPageUI::UpdateJiesuanZhifuPos()
 	CVerticalLayoutUI* pZhangdanLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(L"diandan_page_jiesuan_zhangdan_layout"));
 	pZhangdanLayout->SetFixedWidth(nZhangdanWidth);
 
-	//根据宽度计算每行显示的数量
+	//根据宽度计算每行显示的数量
 	int nMeihangNum = (nZhangdanWidth) / 144;
 	if (nMeihangNum < 1)
 	{
@@ -485,17 +485,24 @@ void CShoukuanPageUI::UpdateJiesuanZhifuPos()
 		rect.top = (curRow - 1) * 100 + 20;
 		rect.bottom = rect.top + 80;
 
-		curItem->SetPos(rect);
+		// 强制设置固定大小和位置
+		SIZE size;
+		size.cx = rect.left;
+		size.cy = rect.top;
+		curItem->SetFixedXY(size);
+
+		curItem->SetFixedWidth(rect.right - rect.left);
+		curItem->SetFixedHeight(rect.bottom - rect.top);
 
 		num++;
 	}
 
-	//调整区域高度
+	//璋冩暣鍖哄煙楂樺害
 	int lastRow = (num - 1) / nMeihangNum + 1;
 	pZhifufangshiLayout->SetFixedHeight(lastRow * 105);
 }
 
-//初始化收款金额
+//初始化收款金额
 void CShoukuanPageUI::InitMoney()
 {
 	CEditUI* pMoneyEdit = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
@@ -513,7 +520,7 @@ std::string CShoukuanPageUI::GetMoney()
 
 void CShoukuanPageUI::UpdateJiesuanInfo()
 {
-	//再刷新账单明细展示
+	//再刷新账单明细展示
 	CVerticalLayoutUI* pmingxiLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhangdanmingxi_jiage_layout")));
 	pmingxiLayout->RemoveAll();
 
@@ -521,7 +528,7 @@ void CShoukuanPageUI::UpdateJiesuanInfo()
 
 	int item_num = 0;
 
-	//先显示基础价格
+	//鍏堟樉绀哄熀纭€浠锋牸
 	if (true)
 	{
 		CDialogBuilder builder;
@@ -532,8 +539,8 @@ void CShoukuanPageUI::UpdateJiesuanInfo()
 		CLabelUI* pName = static_cast<CLabelUI*>(pItem->FindSubControl(_T("name")));
 		CLabelUI* pValue = static_cast<CLabelUI*>(pItem->FindSubControl(_T("value")));
 
-		pName->SetText(L"原价:");
-		pValue->SetText((CLewaimaiString::UTF8ToUnicode(money) + L"元").c_str());
+		pName->SetText(L"原价:");
+		pValue->SetText((CLewaimaiString::UTF8ToUnicode(money) + L"元").c_str());
 
 		item_num++;
 	}
@@ -541,10 +548,10 @@ void CShoukuanPageUI::UpdateJiesuanInfo()
 	pmingxiLayout->SetFixedHeight(item_num * 40);
 
 	CLabelUI* pYingshou = static_cast<CLabelUI*>(this->FindSubControl(_T("diandan_jiesuan_total_yingshou")));
-	pYingshou->SetText((L"应收金额:" + CLewaimaiString::UTF8ToUnicode(money) + L"元").c_str());
+	pYingshou->SetText((L"应收金额:" + CLewaimaiString::UTF8ToUnicode(money) + L"元").c_str());
 }
 
-//开始进行微信支付收款,如果fukuanma不为空,默认自动唤起支付
+//寮€濮嬭繘琛屽井淇℃敮浠樻敹娆撅紝濡傛灉fukuanma涓嶄负绌猴紝榛樿�鑷�姩鍞よ捣鏀�粯
 void CShoukuanPageUI::StartWeixinzhifuShoukuan(std::string fukuanma)
 {
 	if (m_is_show_modal_wnd == true)
@@ -554,7 +561,7 @@ void CShoukuanPageUI::StartWeixinzhifuShoukuan(std::string fukuanma)
 
 	if (atof(GetMoney().c_str()) < 0.0001)
 	{
-		m_pMainWnd->ShowToast(L"收款金额不能为0");
+		m_pMainWnd->ShowToast(L"收款金额不能为0");
 
 		return;
 	}
@@ -575,7 +582,7 @@ void CShoukuanPageUI::StartWeixinzhifuShoukuan(std::string fukuanma)
 		std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
 		pShoukuanWnd->InitMoney(watchValue);
 
-		//这里要对提交订单的参数进行组装,然后方便请求
+		//杩欓噷瑕佸�鎻愪氦璁㈠崟鐨勫弬鏁拌繘琛岀粍瑁咃紝鐒跺悗鏂逛究璇锋眰
 		pShoukuanWnd->SetCommonParams(GetSendorderParams());
 
 		if (fukuanma != "")
@@ -602,10 +609,10 @@ void CShoukuanPageUI::StartWeixinzhifuShoukuan(std::string fukuanma)
 				zhifu_type = "yunshanfu";
 			}
 
-			//说明收款成功了,需要进行一些后续的处理
+			//璇存槑鏀舵�鎴愬姛浜嗭紝闇€瑕佽繘琛屼竴浜涘悗缁�殑澶勭悊
 			this->StartWorkAfterShoukuan(pShoukuanWnd->m_show_trade_no, zhifu_type);
 
-			m_pMainWnd->ShowToast(L"收款成功!");
+			m_pMainWnd->ShowToast(L"收款成功!");
 		}
 		else
 		{
@@ -617,7 +624,7 @@ void CShoukuanPageUI::StartWeixinzhifuShoukuan(std::string fukuanma)
 	}
 }
 
-//开始进行会员收款
+//开始进行会员收款
 void CShoukuanPageUI::StartHuiyuanShoukuan()
 {
 	if (m_is_show_modal_wnd == true)
@@ -627,7 +634,7 @@ void CShoukuanPageUI::StartHuiyuanShoukuan()
 
 	if (atof(GetMoney().c_str()) < 0.0001)
 	{
-		m_pMainWnd->ShowToast(L"收款金额不能为0");
+		m_pMainWnd->ShowToast(L"收款金额不能为0");
 
 		return;
 	}
@@ -636,11 +643,11 @@ void CShoukuanPageUI::StartHuiyuanShoukuan()
 
 	if (m_is_member == false)
 	{
-		//说明登录失败了
+		//说明登录失败了
 		return;
 	}
 
-	//登录成功了,马上开始进行支付确认
+	//登录成功了,马上开始进行支付确认
 	CHuiyuanShoukuanWnd* pShoukuanWnd = new CHuiyuanShoukuanWnd();
 	if (pShoukuanWnd != NULL)
 	{
@@ -657,10 +664,10 @@ void CShoukuanPageUI::StartHuiyuanShoukuan()
 		std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
 		pShoukuanWnd->InitMoney(watchValue);
 
-		//把会员登录的信息传递进去
+		//把会员登录的信息传递进去
 		pShoukuanWnd->SetMemberInfo(m_member_id, m_card_no, m_balance, m_member_name, m_member_level_name);
 
-		//这里要对提交订单的参数进行组装,然后方便请求
+		//杩欓噷瑕佸�鎻愪氦璁㈠崟鐨勫弬鏁拌繘琛岀粍瑁咃紝鐒跺悗鏂逛究璇锋眰
 		pShoukuanWnd->SetCommonParams(GetSendorderParams());
 
 		/*
@@ -676,21 +683,21 @@ void CShoukuanPageUI::StartHuiyuanShoukuan()
 			std::string balance = pShoukuanWnd->m_balance;
 			std::string member_number = pShoukuanWnd->m_member_number;
 
-			//说明收款成功了,需要进行一些后续的处理
+			//璇存槑鏀舵�鎴愬姛浜嗭紝闇€瑕佽繘琛屼竴浜涘悗缁�殑澶勭悊
 			this->StartWorkAfterShoukuan(pShoukuanWnd->m_show_trade_no, "huiyuanzhifu", balance, member_number);
 
-			m_pMainWnd->ShowToast(L"收款成功!");
+			m_pMainWnd->ShowToast(L"收款成功!");
 		}
 
 		m_is_show_modal_wnd = false;
 		delete pShoukuanWnd;
 
-		//不管是会员支付成功还是失败,都清空之前登录的会员信息
+		//涓嶇�鏄�細鍛樻敮浠樻垚鍔熻繕鏄�け璐ワ紝閮芥竻绌轰箣鍓嶇櫥褰曠殑浼氬憳淇℃伅
 		this->ClickMemberLogout();
 	}
 }
 
-//开始进行现金收款
+//开始进行现金收款
 void CShoukuanPageUI::StartXianjinShoukuan()
 {
 	if (m_is_show_modal_wnd == true)
@@ -700,7 +707,7 @@ void CShoukuanPageUI::StartXianjinShoukuan()
 
 	if (atof(GetMoney().c_str()) < 0.0001)
 	{
-		m_pMainWnd->ShowToast(L"收款金额不能为0");
+		m_pMainWnd->ShowToast(L"收款金额不能为0");
 
 		return;
 	}
@@ -721,7 +728,7 @@ void CShoukuanPageUI::StartXianjinShoukuan()
 		std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
 		pShoukuanWnd->InitMoney(watchValue);
 
-		//这里要对提交订单的参数进行组装,然后方便请求
+		//杩欓噷瑕佸�鎻愪氦璁㈠崟鐨勫弬鏁拌繘琛岀粍瑁咃紝鐒跺悗鏂逛究璇锋眰
 		pShoukuanWnd->SetCommonParams(GetSendorderParams());
 
 		/*
@@ -737,10 +744,10 @@ void CShoukuanPageUI::StartXianjinShoukuan()
 			m_shishou_value = pShoukuanWnd->m_shishou;
 			m_zhaoling_value = pShoukuanWnd->m_zhaoling;
 
-			//说明收款成功了,需要进行一些后续的处理
+			//璇存槑鏀舵�鎴愬姛浜嗭紝闇€瑕佽繘琛屼竴浜涘悗缁�殑澶勭悊
 			this->StartWorkAfterShoukuan(pShoukuanWnd->m_show_trade_no, "xianjinzhifu");
 
-			m_pMainWnd->ShowToast(L"收款成功!");
+			m_pMainWnd->ShowToast(L"收款成功!");
 		}
 
 		m_is_show_modal_wnd = false;
@@ -748,7 +755,7 @@ void CShoukuanPageUI::StartXianjinShoukuan()
 	}
 }
 
-//开始进行福利卡收款
+//寮€濮嬭繘琛岀�鍒╁崱鏀舵�
 void CShoukuanPageUI::StartFulikaShoukuan()
 {
 	if (m_is_show_modal_wnd == true)
@@ -758,7 +765,7 @@ void CShoukuanPageUI::StartFulikaShoukuan()
 
 	if (atof(GetMoney().c_str()) < 0.0001)
 	{
-		m_pMainWnd->ShowToast(L"收款金额不能为0");
+		m_pMainWnd->ShowToast(L"收款金额不能为0");
 
 		return;
 	}
@@ -779,7 +786,7 @@ void CShoukuanPageUI::StartFulikaShoukuan()
 		std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
 		pShoukuanWnd->InitMoney(watchValue);
 
-		//这里要对提交订单的参数进行组装,然后方便请求
+		//杩欓噷瑕佸�鎻愪氦璁㈠崟鐨勫弬鏁拌繘琛岀粍瑁咃紝鐒跺悗鏂逛究璇锋眰
 		pShoukuanWnd->SetCommonParams(GetSendorderParams());
 
 		/*
@@ -792,10 +799,10 @@ void CShoukuanPageUI::StartFulikaShoukuan()
 		UINT ret = pShoukuanWnd->ShowModal();
 		if (ret == IDOK)
 		{
-			//说明收款成功了,需要进行一些后续的处理
+			//璇存槑鏀舵�鎴愬姛浜嗭紝闇€瑕佽繘琛屼竴浜涘悗缁�殑澶勭悊
 			this->StartWorkAfterShoukuan(pShoukuanWnd->m_show_trade_no, "fulikazhifu");
 
-			m_pMainWnd->ShowToast(L"收款成功!");
+			m_pMainWnd->ShowToast(L"收款成功!");
 		}
 
 		m_is_show_modal_wnd = false;
@@ -803,7 +810,7 @@ void CShoukuanPageUI::StartFulikaShoukuan()
 	}
 }
 
-//开始自定义支付收款
+//寮€濮嬭嚜瀹氫箟鏀�粯鏀舵�
 void CShoukuanPageUI::StartZidingyiShoukuan(std::wstring name, std::wstring selfpay_id)
 {
 	if (m_is_show_modal_wnd == true)
@@ -813,7 +820,7 @@ void CShoukuanPageUI::StartZidingyiShoukuan(std::wstring name, std::wstring self
 
 	if (atof(GetMoney().c_str()) < 0.0001)
 	{
-		m_pMainWnd->ShowToast(L"收款金额不能为0");
+		m_pMainWnd->ShowToast(L"收款金额不能为0");
 
 		return;
 	}
@@ -834,7 +841,7 @@ void CShoukuanPageUI::StartZidingyiShoukuan(std::wstring name, std::wstring self
 		std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
 		pShoukuanWnd->InitMoney(watchValue);
 
-		//这里要对提交订单的参数进行组装,然后方便请求
+		//杩欓噷瑕佸�鎻愪氦璁㈠崟鐨勫弬鏁拌繘琛岀粍瑁咃紝鐒跺悗鏂逛究璇锋眰
 		pShoukuanWnd->SetCommonParams(GetSendorderParams());
 
 		/*
@@ -850,10 +857,10 @@ void CShoukuanPageUI::StartZidingyiShoukuan(std::wstring name, std::wstring self
 		UINT ret = pShoukuanWnd->ShowModal();
 		if (ret == IDOK)
 		{
-			//说明收款成功了,需要进行一些后续的处理
+			//璇存槑鏀舵�鎴愬姛浜嗭紝闇€瑕佽繘琛屼竴浜涘悗缁�殑澶勭悊
 			this->StartWorkAfterShoukuan(pShoukuanWnd->m_show_trade_no, "zidingyizhifu");
 
-			m_pMainWnd->ShowToast(L"收款成功!");
+			m_pMainWnd->ShowToast(L"收款成功!");
 		}
 
 		m_is_show_modal_wnd = false;
@@ -861,8 +868,8 @@ void CShoukuanPageUI::StartZidingyiShoukuan(std::wstring name, std::wstring self
 	}
 }
 
-//获取通用参数,任何支付方式都要用到的参数,个性化参数在弹框里面处理
-//参考文档 http://apidoc.zhipuzi.com/index.php/home/item/show?item_id=4
+//获取通用参数,任何支付方式都要用到的参数,个性化参数在弹框里面处理
+//参考文档 http://apidoc.zhipuzi.com/index.php/home/item/show?item_id=4
 std::map<std::string, std::string> CShoukuanPageUI::GetSendorderParams()
 {
 	std::map<std::string, std::string> params;
@@ -880,29 +887,29 @@ std::map<std::string, std::string> CShoukuanPageUI::GetSendorderParams()
 
 void CShoukuanPageUI::StartWorkAfterShoukuan(std::string show_trade_no, std::string shoukuan_type, std::string balance, std::string member_number)
 {
-	//针对现金收款成功,单独做一个打开钱箱的判断处理
+	//针对现金收款成功,单独做一个打开钱箱的判断处理
 	if (shoukuan_type == "xianjinzhifu")
 	{
 		std::string setting_is_diannei_xianjin_qianxiang = CSetting::GetInstance()->GetParam("setting_is_diannei_xianjin_qianxiang");
 		if (setting_is_diannei_xianjin_qianxiang == "1")
 		{
-			//打开钱箱
+			//鎵撳紑閽辩�
 			CPosPrinter printer;
 			printer.OpenQianxiang();
 		}
 	}
 
-	//处理小票打印
-	//处理打印
+	//澶勭悊灏忕エ鎵撳嵃
+	//澶勭悊鎵撳嵃
 	CShoukuanOrder order = this->GetPrintOrderinfo(show_trade_no, shoukuan_type, balance, member_number);
 
 	CPosPrinter printer;
 	printer.PrintShoukuanOrder(order);
 
-	//最后还原收款金额
+	//最后还原收款金额
 	this->InitMoney();
 
-	//还原会员状态
+	//还原会员状态
 	this->ClickMemberLogout();
 
 	this->UpdateJiesuanInfo();
@@ -921,31 +928,31 @@ CShoukuanOrder CShoukuanPageUI::GetPrintOrderinfo(std::string show_trade_no, std
 
 	if (shoukuan_type == "weixinzhifu")
 	{
-		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"微信支付");
+		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"寰�俊鏀�粯");
 	}
 	else if (shoukuan_type == "zhifubao")
 	{
-		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"支付宝");
+		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"支付宝");
 	}
 	else if (shoukuan_type == "yunshanfu")
 	{
-		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"云闪付");
+		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"云闪付");
 	}
 	else if (shoukuan_type == "huiyuanzhifu")
 	{
-		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"会员支付");
+		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"浼氬憳鏀�粯");
 	}
 	else if (shoukuan_type == "xianjinzhifu")
 	{
-		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"现金支付");
+		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"鐜伴噾鏀�粯");
 	}
 	else if (shoukuan_type == "fulikazhifu")
 	{
-		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"福利卡支付");
+		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"福利卡支付");
 	}
 	else if (shoukuan_type == "zidingyizhifu")
 	{
-		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"自定义支付");
+		newOrder.shoukuan_type = CLewaimaiString::UnicodeToUTF8(L"自定义支付");
 	}
 
 	newOrder.order_from = 1;
@@ -960,7 +967,7 @@ void CShoukuanPageUI::SetPos(RECT rc, bool bNeedInvalidate)
 {
 	m_nPageWidth = rc.right - rc.left;
 
-	//拖动窗口的时候,更新位置
+	//鎷栧姩绐楀彛鐨勬椂鍊欙紝鏇存柊浣嶇疆
 	UpdateJiesuanZhifuPos();
 
 	CContainerUI::SetPos(rc, bNeedInvalidate);
@@ -988,7 +995,7 @@ void CShoukuanPageUI::ClickMemberLogin()
 
 		if (ret == IDOK)
 		{
-			//这说明会员登录成功了
+			//杩欒�鏄庝細鍛樼櫥褰曟垚鍔熶簡
 			m_is_member = true;
 
 			m_member_name = pMemberLoginDlg->m_name;
@@ -1024,7 +1031,7 @@ void CShoukuanPageUI::ClickMemberLogin()
 	}
 }
 
-//处理会员退出登陆
+//处理会员退出登陆
 void CShoukuanPageUI::ClickMemberLogout()
 {
 	m_is_member = false;

+ 16 - 3
zhipuzi_pos_windows/page/CZhengcanDiandanPageUI.cpp

@@ -336,8 +336,14 @@ void CZhengcanDiandanPageUI::UpdateFoodtypePos()
 		rect.top = (curRow - 1) * 52 + 10;
 		rect.bottom = rect.top + 42;
 
-		curItem->SetFloat(true);
-		curItem->SetPos(rect);
+		// 强制设置固定大小和位置
+		SIZE size;
+		size.cx = rect.left;
+		size.cy = rect.top;
+		curItem->SetFixedXY(size);
+
+		curItem->SetFixedWidth(rect.right - rect.left);
+		curItem->SetFixedHeight(rect.bottom - rect.top);
 
 		num++;
 	}
@@ -742,7 +748,14 @@ void CZhengcanDiandanPageUI::UpdateJiesuanZhifuPos()
 		rect.top = (curRow - 1) * 100 + 20;
 		rect.bottom = rect.top + 80;
 
-		curItem->SetPos(rect);
+		// 强制设置固定大小和位置
+		SIZE size;
+		size.cx = rect.left;
+		size.cy = rect.top;
+		curItem->SetFixedXY(size);
+
+		curItem->SetFixedWidth(rect.right - rect.left);
+		curItem->SetFixedHeight(rect.bottom - rect.top);
 
 		num++;
 	}

+ 8 - 1
zhipuzi_pos_windows/wnd/CHuiyuanChongzhiWnd.cpp

@@ -1495,7 +1495,14 @@ void CHuiyuanChongzhiWnd::UpdateJiesuanZhifuPos()
 		rect.top = (curRow - 1) * 100 + 20;
 		rect.bottom = rect.top + 80;
 
-		curItem->SetPos(rect);
+		// 强制设置固定大小和位置
+		SIZE size;
+		size.cx = rect.left;
+		size.cy = rect.top;
+		curItem->SetFixedXY(size);
+
+		curItem->SetFixedWidth(rect.right - rect.left);
+		curItem->SetFixedHeight(rect.bottom - rect.top);
 
 		num++;
 	}

+ 1 - 0
zhipuzi_pos_windows/wnd/CMainWnd.cpp

@@ -1110,6 +1110,7 @@ void CMainWnd::UpdateGongnengDaohang()
 		newOption->SetTextPadding(padding);
 
 		newOption->SetSelectedTextColor(0xFFFFFFFF);
+		newOption->SetSelectedBkColor(0xFF3CB371);
 
 		std::string curName = changyongVector[i];