Jelajahi Sumber

继续优化正餐

zhangyang 3 tahun lalu
induk
melakukan
b5dd4807fd

+ 6 - 5
bin/Win32/Debug/zhipuzi_pos_windows/skin/zhengcan_tableitem.xml

@@ -3,12 +3,13 @@
 	<Font id="1" name="微软雅黑" size="14" />
 	
 	<ZhengcanTableItem name="zhengcan_tableitem" bkcolor="#FFFFFFFF" width="177" height="140">
-		<Label name="tablename" width="145" height="60" multiline="true" endellipsis="true" font="20"></Label>
-		<Label name="status" height="30" font="16" textcolor="#FFFF7F50" align="left"></Label>
+		<Label name="tablename" float="true" pos="10,15,170,60" multiline="true" endellipsis="true" font="16"></Label>
+		<Label name="status" font="14" float="true" pos="10,70,170,100" align="left"></Label>
 		
-		<HorizontalLayout height="32">
-			<Label name="renshu" visible="true" width="50" height="26" font="14" text="6人" float="true" pos="33,5,63,30" textcolor="#FFFFFFFF"  align="center"></Label>		
-			<Label name="shijian" visible="true" width="50" height="26" font="14" text="50分钟" float="true" pos="133,5,163,30" textcolor="#FFFFFFFF" align="center"></Label>	
+		<Control></Control>
+		<HorizontalLayout height="32" bkcolor="#FFF1F1F1">
+			<Label name="renshu" visible="true" width="50" height="26" font="14" text="6人" float="true" pos="33,5,63,30" align="center"></Label>		
+			<Label name="shijian" visible="true" width="50" height="26" font="14" text="50分钟" float="true" pos="110,5,160,30" align="center"></Label>	
 		</HorizontalLayout>
 	</ZhengcanTableItem>
 </Window>

+ 29 - 0
zhipuzi_pos_windows/control/CZhengcanTableItemUI.cpp

@@ -34,7 +34,36 @@ void CZhengcanTableItemUI::DoEvent(TEventUI& event)
 	CVerticalLayoutUI::DoEvent(event);
 }
 
+void CZhengcanTableItemUI::SetInfo(std::string table_id, std::string table_name, std::string type_id, std::string status, std::string order_init_time, std::string from_type, std::string order_status)
+{
+	m_table_id = table_id;
+	m_table_name = table_name;
+	m_type_id = type_id;
+	m_status = status;
+	m_order_init_time = order_init_time;
+	m_from_type = from_type;
+	m_order_status = order_status;
+}
+
 void CZhengcanTableItemUI::UpdateShow()
 {
+	CLabelUI* pName = static_cast<CLabelUI*>(this->FindSubControl(_T("tablename")));
+	pName->SetText(CLewaimaiString::UTF8ToUnicode(m_table_name).c_str());
 
+	CLabelUI* pStatus = static_cast<CLabelUI*>(this->FindSubControl(_T("status")));
+
+	if (m_status == "0")
+	{
+		//未开台
+		pStatus->SetText(L"未开台");
+	}
+	else if (m_status == "1")
+	{
+		//预约中
+	}
+	else if (m_status == "2")
+	{
+		//已开台
+		pStatus->SetText(L"已开台");
+	}
 }

+ 9 - 1
zhipuzi_pos_windows/control/CZhengcanTableItemUI.h

@@ -13,10 +13,18 @@ public:
 
 	void DoEvent(TEventUI& event);
 
+	void SetInfo(std::string table_id, std::string table_name, std::string type_id, std::string status, std::string order_init_time, std::string from_type, std::string order_status);
+
 	//刷新显示
 	void UpdateShow();
 
 private:
-
+	std::string m_table_id;
+	std::string m_table_name;
+	std::string m_type_id;
+	std::string m_status;
+	std::string m_order_init_time;
+	std::string m_from_type;
+	std::string m_order_status;
 };
 

+ 2 - 0
zhipuzi_pos_windows/page/CZhengcanPageUI.cpp

@@ -330,6 +330,8 @@ void CZhengcanPageUI::InitTableShow()
 
 		CZhengcanTableItemUI* pItem = static_cast<CZhengcanTableItemUI*>(builder.Create(_T("zhengcan_tableitem.xml"), (UINT)0, &cb, m_pManager));
 
+		pItem->SetInfo(CLewaimaiJson::ToString(tableinfo["table_id"]), CLewaimaiJson::ToString(tableinfo["name"]), CLewaimaiJson::ToString(tableinfo["type_id"]), CLewaimaiJson::ToString(tableinfo["status"]), CLewaimaiJson::ToString(tableinfo["order_init_time"]), CLewaimaiJson::ToString(tableinfo["from_type"]), CLewaimaiJson::ToString(tableinfo["order_status"]));
+
 		pItem->UpdateShow();
 
 		m_tableLayout->Add(pItem);