|
|
@@ -39,113 +39,44 @@ void CShangpinFoodItemUI::SetFoodInfo(CFood info)
|
|
|
m_foodinfo = info;
|
|
|
}
|
|
|
|
|
|
-void CShangpinFoodItemUI::SetFoodpackageInfo(CFoodpackage info)
|
|
|
-{
|
|
|
- m_foodpackageinfo = info;
|
|
|
-
|
|
|
- m_is_taocan = true;
|
|
|
-}
|
|
|
-
|
|
|
-void CShangpinFoodItemUI::SetIsTaocan(bool is_taocan)
|
|
|
-{
|
|
|
- m_is_taocan = is_taocan;
|
|
|
-}
|
|
|
-
|
|
|
CFood CShangpinFoodItemUI::GetFoodInfo()
|
|
|
{
|
|
|
return m_foodinfo;
|
|
|
}
|
|
|
|
|
|
-CFoodpackage CShangpinFoodItemUI::GetFoodpackageInfo()
|
|
|
-{
|
|
|
- return m_foodpackageinfo;
|
|
|
-}
|
|
|
-
|
|
|
-bool CShangpinFoodItemUI::GetIsTaocan()
|
|
|
-{
|
|
|
- return m_is_taocan;
|
|
|
-}
|
|
|
-
|
|
|
void CShangpinFoodItemUI::UpdateShow()
|
|
|
{
|
|
|
- if (m_is_taocan)
|
|
|
+ if (m_is_youtu)
|
|
|
{
|
|
|
- if (m_is_youtu)
|
|
|
- {
|
|
|
- CControlUI* pImage = static_cast<CControlUI*>(this->FindSubControl(_T("image")));
|
|
|
-
|
|
|
- //获取本地图片的路径
|
|
|
- std::wstring imagepath = m_foodpackageinfo.getImageTmpPath();
|
|
|
- if (CSystem::IsFileExist(imagepath.c_str()))
|
|
|
- {
|
|
|
- //图片已经存在,直接显示
|
|
|
- pImage->SetBkImage(imagepath.c_str());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- CLabelUI* pName = static_cast<CLabelUI*>(this->FindSubControl(_T("foodname")));
|
|
|
- pName->SetText(CLewaimaiString::UTF8ToUnicode(m_foodpackageinfo.name).c_str());
|
|
|
-
|
|
|
- CLabelUI* pPrice = static_cast<CLabelUI*>(this->FindSubControl(_T("price")));
|
|
|
+ CControlUI* pImage = static_cast<CControlUI*>(this->FindSubControl(_T("image")));
|
|
|
|
|
|
- wstring price = L"¥" + CLewaimaiString::UTF8ToUnicode(m_foodpackageinfo.price);
|
|
|
-
|
|
|
- pPrice->SetText(price.c_str());
|
|
|
-
|
|
|
- //属性商品,显示多属性标签
|
|
|
- CLabelUI* pNature = static_cast<CLabelUI*>(this->FindSubControl(_T("nature")));
|
|
|
- pNature->SetVisible(true);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (m_is_youtu)
|
|
|
+ //获取本地图片的路径
|
|
|
+ std::wstring imagepath = m_foodinfo.getImageTmpPath();
|
|
|
+ if (CSystem::IsFileExist(imagepath.c_str()))
|
|
|
{
|
|
|
- CControlUI* pImage = static_cast<CControlUI*>(this->FindSubControl(_T("image")));
|
|
|
-
|
|
|
- //获取本地图片的路径
|
|
|
- std::wstring imagepath = m_foodinfo.getImageTmpPath();
|
|
|
- if (CSystem::IsFileExist(imagepath.c_str()))
|
|
|
- {
|
|
|
- //图片已经存在,直接显示
|
|
|
- pImage->SetBkImage(imagepath.c_str());
|
|
|
- }
|
|
|
+ //图片已经存在,直接显示
|
|
|
+ pImage->SetBkImage(imagepath.c_str());
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- CLabelUI* pName = static_cast<CLabelUI*>(this->FindSubControl(_T("foodname")));
|
|
|
- pName->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.name).c_str());
|
|
|
-
|
|
|
- CLabelUI* pPrice = static_cast<CLabelUI*>(this->FindSubControl(_T("price")));
|
|
|
+ CLabelUI* pName = static_cast<CLabelUI*>(this->FindSubControl(_T("foodname")));
|
|
|
+ pName->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.name).c_str());
|
|
|
|
|
|
- wstring price = L"¥" + CLewaimaiString::UTF8ToUnicode(m_foodinfo.price);
|
|
|
- if (m_foodinfo.is_nature == "1")
|
|
|
- {
|
|
|
- price += L"起";
|
|
|
- }
|
|
|
+ CLabelUI* pPrice = static_cast<CLabelUI*>(this->FindSubControl(_T("price")));
|
|
|
|
|
|
- pPrice->SetText(price.c_str());
|
|
|
+ wstring price = L"¥" + CLewaimaiString::UTF8ToUnicode(m_foodinfo.price);
|
|
|
+ if (m_foodinfo.is_nature == "1")
|
|
|
+ {
|
|
|
+ price += L"起";
|
|
|
+ }
|
|
|
|
|
|
- if (m_foodinfo.is_weight == "1")
|
|
|
- {
|
|
|
- //称重商品,显示称重的标签(称重的标签与属性的标签不同时存在,优先显示称重的)
|
|
|
- CLabelUI* pChenzhong = static_cast<CLabelUI*>(this->FindSubControl(_T("chengzhong")));
|
|
|
- pChenzhong->SetVisible(true);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (m_foodinfo.is_nature == "1")
|
|
|
- {
|
|
|
- //属性商品,显示多属性标签
|
|
|
- CLabelUI* pNature = static_cast<CLabelUI*>(this->FindSubControl(_T("nature")));
|
|
|
- pNature->SetVisible(true);
|
|
|
- }
|
|
|
- }
|
|
|
+ pPrice->SetText(price.c_str());
|
|
|
|
|
|
- if (m_foodinfo.stockvalid == "1" && atof(m_foodinfo.stock.c_str()) < 0.001)
|
|
|
- {
|
|
|
- //库存为0了
|
|
|
- CLabelUI* pKucun = static_cast<CLabelUI*>(this->FindSubControl(_T("kucun")));
|
|
|
- pKucun->SetVisible(true);
|
|
|
- }
|
|
|
+ if (m_foodinfo.stockvalid == "1" && atof(m_foodinfo.stock.c_str()) < 0.001)
|
|
|
+ {
|
|
|
+ //库存为0了
|
|
|
+ CLabelUI* pKucun = static_cast<CLabelUI*>(this->FindSubControl(_T("kucun")));
|
|
|
+ pKucun->SetVisible(true);
|
|
|
}
|
|
|
}
|
|
|
|