| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- //系统检查方法
- //商品分类
- const systemMenus = [1, 2, 3]; //好评,折扣,点单必读
- const menuTips = {
- 1: ["systemClassification1", "systemClassification2"],
- 2: ["systemClassification3", "systemClassification4"],
- 3: ["systemClassification5", "systemClassification6"],
- };
- //好评,折扣,点单必读
- export function getClassificationByName(name) {
- if (name == "好评") {
- return 1;
- } else if (name == "折扣") {
- return 2;
- } else if (name == "点单必读") {
- return 3;
- }
- }
- export class ClassificationUtil {
- constructor(classification) {
- let { name, id, goodsIds, isOpen, type } = classification || {};
- this.name = name || "";
- this.id = id || "";
- this.goodsIds = goodsIds || "";
- this.isOpen = isOpen || false;
- this.allInfo = classification || {};
- this.type = type || "";
- }
- checkSystem() {
- return systemMenus.indexOf(this.type) != -1;
- }
- getMenuTipsList() {
- return menuTips[this.type] || [];
- }
- getType() {
- return this.type;
- }
- }
|