| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- // 系统检查方法
- // 商品分类
- const systemMenus = [1, 2, 3]; // 好评,折扣,点单必读
- const menuTips = {
- 1: ["systemClassification1", "systemClassification2"],
- 2: ["systemClassification3", "systemClassification4"],
- 3: ["systemClassification5", "systemClassification6"],
- };
- // 好评,折扣,点单必读
- export function getClassificationByName(name) {
- if (name === "好评") {
- return 1;
- } if (name === "折扣") {
- return 2;
- } if (name === "点单必读") {
- return 3;
- }
- return 0
-
- }
- // 商品分类
- export class ClassificationUtil {
- constructor(classification) {
- const { 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;
- }
- }
- // 账单类别
- // const FinancialTypes = ["BUY", "INCOME", "REFUND", "WITHDRAW"];
- // BUY("购买"),
- // INCOME("收入"),
- // REFUND("退款"),
- // WITHDRAW("提现");
|