/** * WebPosLogin 组件类型定义 * @description WebPOS 登录流程组件,包含登录、店铺选择、设备选择三个步骤 */ /// import type { DeviceLinkedParams } from '../saasDevice/appDevicePlanning/types'; /** * 店铺数据结构 * @description 从租户列表接口返回的店铺信息 */ export interface StoreItem { /** 店铺ID */ id: number; /** 租户ID */ tenant_id: number; /** 账户ID */ account_id: number; /** 类型 */ type: string; /** 昵称 */ nickname: string; /** 状态 */ status: string; /** 创建时间 */ created_at?: string; /** 更新时间 */ updated_at?: string; /** 租户详情 */ tenant: { /** 租户ID */ id: number; /** 父租户ID */ tenant_id?: number; /** 账户ID */ account_id?: number; /** 类型 */ type?: string; /** 名称(多语言) */ name: { en?: string | null; 'zh-CN'?: string | null; 'zh-HK'?: string | null; original: string; }; /** Logo图片 */ logo?: string; /** 图标 */ icon?: string; /** Favicon */ favicon?: string; /** 默认域名 */ default_domain: string; /** 私有域名 */ private_domain?: string | null; /** 货币代码 */ currency_code?: string | null; /** 国家代码 */ country_code?: string | null; /** 语言 */ locale?: string; /** 时区 */ timezone?: string; /** 状态 */ status?: string; }; } /** * 设备客户端信息 * @description 设备绑定的客户端详情 */ export interface DeviceClient { /** 客户端ID */ id: number; /** 店铺ID */ shop_id: number; /** 设备ID */ device_id: number; /** 客户端编号 */ number: string; /** 客户端名称 */ name: string; /** 客户端类型 */ type: string; /** 设备型号 */ model?: string; /** 系统版本 */ version?: string; /** 设备详细数据 */ data?: { battery?: { is_charging?: boolean; visible_percent?: string; }; hardware?: { country?: string; datetime?: string; language?: string; timezone?: string; }; application?: { name?: string; type?: string; version?: string; language?: string; bundle_id?: string; }; connectivity?: { ip?: string; type?: string; wifi_details?: any[]; }; }; /** 最后刷新时间 */ refreshed_at?: string; /** 创建时间 */ created_at?: string; /** 更新时间 */ updated_at?: string; } /** * 设备数据结构 * @description 从设备列表接口返回的设备信息 */ export interface DeviceItem { /** 设备ID */ id: number; /** 店铺ID */ shop_id: number; /** 设备类型 */ type: string; /** 设备编号 */ number: string; /** 设备名称 */ name: string; /** 设备描述 */ description?: string; /** 设备设置 */ setting?: any[]; /** 创建时间 */ created_at?: string; /** 更新时间 */ updated_at?: string; /** 绑定的客户端信息(null 表示未被使用) */ client?: DeviceClient | null; } /** * 用户信息 * @description 当前登录用户的基本信息 */ export interface UserInfo { /** 用户名称 */ name: string; /** 用户头像 */ avatar?: string; } /** * 品牌区轮播项 * @description 左侧品牌区的轮播内容配置 */ export interface CarouselItem { /** 内容类型:图片或视频 */ type: 'image' | 'video'; /** 资源URL */ url: string; } /** * 品牌区配置 * @description 左侧品牌展示区域的配置 */ export interface BrandConfig { /** 轮播内容列表(图片/视频) */ carouselItems?: CarouselItem[]; /** 默认Logo(当无轮播时显示) */ logo?: string; /** 品牌标语 */ slogan?: string; } /** * 登录流程步骤 */ export declare type LoginStep = 'login' | 'store' | 'device'; /** * 支持的语言类型 */ export declare type LocaleType = 'en' | 'zh-CN' | 'zh-HK'; /** * WebPosLogin 主组件 Props * @description WebPOS 登录组件的所有配置项 */ export interface WebPosLoginCptProps { /** 自定义类名 */ className?: string; /** 自定义样式 */ style?: React.CSSProperties; /** 背景图片URL */ backgroundImage?: string; /** 品牌区配置 */ brandConfig?: BrandConfig; /** 当前步骤:login-登录 | store-店铺选择 | device-设备选择 */ step?: LoginStep; /** 是否显示返回按钮(默认 true) */ showBackButton?: boolean; /** 店铺列表数据 */ storeList?: StoreItem[]; /** 设备列表数据 */ deviceList?: DeviceItem[]; /** 当前用户信息 */ userInfo?: UserInfo; /** 当前选中的店铺 */ selectedStore?: StoreItem; /** 上次使用的店铺ID(用于显示 Last used 标签) */ lastUsedStoreId?: number; /** 上次使用的设备ID(用于显示 Last used 标签) */ lastUsedDeviceId?: number; /** 语言设置 */ locale?: LocaleType; /** 加载状态 */ loading?: boolean; /** 登录配置 */ loginConfig?: any; /** 登录页插槽 */ loginSlot?: React.ReactNode; /** 渠道列表 */ channelList?: ChannelItem[]; /** 店铺选择回调 */ onStoreSelect?: (store: StoreItem) => void; /** 设备选择回调 */ onDeviceSelect?: (device: DeviceItem) => void; /** 切换账号回调 */ onChangeAccount?: () => void; /** 切换店铺回调 */ onChangeStore?: () => void; /** 返回上一步回调 */ onBack?: () => void; /** 登录成功回调 */ onLoginSuccess?: (data: any) => void; /** IOT 设备绑定完成回调 */ onIotDeviceLinked?: (params: DeviceLinkedParams) => void; /** IOT 返回上一步回调 */ onIotBack?: () => void; } /** * BrandPanel 品牌区组件 Props */ export interface BrandPanelProps { /** 品牌配置 */ config?: BrandConfig; /** 自定义类名 */ className?: string; } /** * SelectStore 店铺选择组件 Props */ export interface SelectStoreProps { /** 店铺列表 */ storeList?: StoreItem[]; /** 语言 */ locale?: LocaleType; /** 加载状态 */ loading?: boolean; /** 上次使用的店铺ID */ lastUsedStoreId?: number; /** 选择店铺回调 */ onSelect?: (store: StoreItem) => void; } /** * SelectDevice 设备选择组件 Props */ export interface SelectDeviceProps { /** 设备列表 */ deviceList?: DeviceItem[]; /** 语言 */ locale?: LocaleType; /** 加载状态 */ loading?: boolean; /** 选择设备回调 */ onSelect?: (device: DeviceItem) => void; } /** * UserFooter 底部用户信息组件 Props */ export interface UserFooterProps { /** 用户信息 */ userInfo?: UserInfo; /** 当前选中的店铺 */ selectedStore?: StoreItem; /** 当前步骤 */ step?: LoginStep; /** 语言 */ locale?: LocaleType; /** 切换账号回调 */ onChangeAccount?: () => void; /** 切换店铺回调 */ onChangeStore?: () => void; } export interface ChannelItem { name: string; description?: string; code: string; } /** * SelectChannel 渠道选择组件 Props */ export interface SelectChannelProps { /** 语言 */ locale?: LocaleType; /** 渠道列表 */ channelList?: ChannelItem[]; /** 加载状态 */ loading?: boolean; /** 选择渠道回调 */ onSelect?: (channel: ChannelItem) => void; } export declare const DefaultChannelList: ChannelItem[];