SystemRuleUtil.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //系统检查方法
  2. //商品分类
  3. const systemMenus = [1, 2, 3]; //好评,折扣,点单必读
  4. const menuTips = {
  5. 1: ["systemClassification1", "systemClassification2"],
  6. 2: ["systemClassification3", "systemClassification4"],
  7. 3: ["systemClassification5", "systemClassification6"],
  8. };
  9. //好评,折扣,点单必读
  10. export function getClassificationByName(name) {
  11. if (name == "好评") {
  12. return 1;
  13. } else if (name == "折扣") {
  14. return 2;
  15. } else if (name == "点单必读") {
  16. return 3;
  17. }
  18. }
  19. //商品分类
  20. export class ClassificationUtil {
  21. constructor(classification) {
  22. let { name, id, goodsIds, isOpen, type } = classification || {};
  23. this.name = name || "";
  24. this.id = id || "";
  25. this.goodsIds = goodsIds || "";
  26. this.isOpen = isOpen || false;
  27. this.allInfo = classification || {};
  28. this.type = type || "";
  29. }
  30. checkSystem() {
  31. return systemMenus.indexOf(this.type) != -1;
  32. }
  33. getMenuTipsList() {
  34. return menuTips[this.type] || [];
  35. }
  36. getType() {
  37. return this.type;
  38. }
  39. }
  40. //账单类别
  41. const FinancialTypes = ["BUY", "INCOME", "REFUND", "WITHDRAW"];
  42. // BUY("购买"),
  43. // INCOME("收入"),
  44. // REFUND("退款"),
  45. // WITHDRAW("提现");