UNPKG

@pisell/pisellos

Version:

一个可扩展的前端模块化SDK框架,支持插件系统

63 lines (62 loc) 2.27 kB
import { Module, PisellCore } from '../../types'; import { BaseModule } from '../../modules/BaseModule'; import { Customer, SetDiscountSelectedParams } from './types'; import { Discount } from '../../modules/Discount/types'; export declare class ShopDiscountImpl extends BaseModule implements Module { protected defaultName: string; protected defaultVersion: string; isSolution: boolean; private request; private window; private store; private options; private hooks?; constructor(name?: string, version?: string); initialize(core: PisellCore, options: any): Promise<void>; destroy(): Promise<void>; clear(): Promise<void>; private initializePlugins; private registerDependentModules; private registerEventListeners; getCurrentBookingTime(): string | null; private filterDiscountListByBookingTime; setCustomer(customer: Customer): Promise<void>; setOriginTotalAmount(amount: number): void; setHolders(holders: { form_record_id: number; }[]): void; setBookingSubject(bookingSubject: { type?: 'form' | 'customer'; [key: string]: any; }): void; calcDiscount(productList: Record<string, any>[], options?: SetDiscountSelectedParams): { productList: Record<string, any>[]; discountList: Discount[]; }; setDiscountSelected(params: SetDiscountSelectedParams): { productList: Record<string, any>[]; discountList: Discount[]; }; setProductList(productList: Record<string, any>[]): void; scanCode(code: string, customerId?: number): Promise<{ isAvailable: boolean; productList: Record<string, any>[]; discountList: Discount[]; type: "server" | "clientCalc"; }>; calcDiscountApplicableProductTotalPrice(discount: Discount): number | undefined; private getCustomer; private isWalkIn; private emitDiscountListChange; private setDiscountList; private getDiscountList; private getCustomerWallet; private bestDiscount; loadPrepareConfig(params: { customerId: number; action?: 'create' | 'update'; with_good_pass?: 0 | 1; with_discount_card?: 0 | 1; }): Promise<void>; } export default ShopDiscountImpl;