CFood.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #include <string>
  3. #include <vector>
  4. class CFood
  5. {
  6. public:
  7. std::string id;
  8. std::string shop_id;
  9. std::string name;
  10. std::string price;
  11. std::string tag;
  12. std::string status;
  13. std::string type_id;
  14. std::string is_dabao;
  15. std::string dabao_money;
  16. std::string is_nature;
  17. std::string nature;
  18. std::string autostocknum;
  19. std::string goods_img;
  20. std::string unit;
  21. std::string barcode;
  22. std::string member_price_used;
  23. std::string member_price;
  24. std::string buying_price;
  25. std::string stock;
  26. std::string stockvalid;
  27. std::string stock_warning;
  28. std::string is_shouyinji_show;
  29. std::string is_waimai_show;
  30. std::string is_tangshi_show;
  31. std::string is_zhengcan_show;
  32. std::string expiration_date;
  33. std::string is_weight;
  34. std::string member_price_json;
  35. std::string weight_plu_code;
  36. std::string weight_food_code;
  37. std::string jiagong_type;
  38. std::string cost_mode;
  39. //获得图片完整的下载地址
  40. std::wstring getImageUrl()
  41. {
  42. if (goods_img.size() == 0)
  43. {
  44. return L"";
  45. }
  46. std::string url_goods_img = "http://img.zhipuzi.com" + goods_img;
  47. std::wstring ws_url_goods_img = CLewaimaiString::UTF8ToUnicode(url_goods_img);
  48. return ws_url_goods_img;
  49. }
  50. //获取图片的本地临时目录存放路径
  51. std::wstring getImageTmpPath()
  52. {
  53. if (goods_img.size() == 0)
  54. {
  55. return L"";
  56. }
  57. //纯文件名
  58. std::string file_name = CLewaimaiString::GetPathOrURLShortName(goods_img);
  59. //根据文件名,计算文件临时路径
  60. wstring folderPath = CSystem::GetProgramDir() + L"\\tmp\\image\\";
  61. wstring imagePath = folderPath + CLewaimaiString::UTF8ToUnicode(file_name);
  62. return imagePath;
  63. }
  64. };