import { Recordable } from '@/config/interface'

//菜单主题类型
export enum ThemeEnum {
    LIGHT = 'light',
    DARK = 'dark'
}

// 客户端
export enum ClientEnum {
    MP_WEIXIN = 1, // 微信-小程序
    OA_WEIXIN = 2, // 微信-公众号
    H5 = 3, // H5
    IOS = 5, //苹果
    ANDROID = 6, //安卓
    MP_DOUYIN = 7 //抖音
}

export enum SMSEnum {
    LOGIN = 101,
    BIND_MOBILE = 102,
    CHANGE_MOBILE = 103,
    FIND_PASSWORD = 104
}

export enum SearchTypeEnum {
    HISTORY = 'history'
}

// 用户资料
export enum FieldType {
    NONE = '',
    AVATAR = 'avatar',
    USERNAME = 'username',
    NICKNAME = 'nickname',
    SEX = 'sex',
    defalutNickname = '粤好生活会员'
}

// 支付页面
export const PayEnum = {
    '1': 'orderBuy', // 确认下单支付
    '2': 'orderList', // 订单列表支付
    '3': 'orderDetail' // 订单详情支付
}

// 支付结果
export enum PayStatusEnum {
    SUCCESS = 'success',
    FAIL = 'fail',
    PENDING = 'pending'
}

// 页面状态
export enum PageStatusEnum {
    LOADING = 'loading', // 加载中
    NORMAL = 'normal', // 正常
    ERROR = 'error', // 异常
    EMPTY = 'empty' // 为空
}

// 支付来源类型
export enum PayFromType {
    ORDER = 'order',
    USERRECHARGE = 'user_recharge'
}

// 支付方式类型
export enum PayWayType {
    WALLET = 1,
    WECHAT = 2,
    ALIPAY = 3
}
export enum WithDrawEnum {
    PEDDING = 0,
    SUCCESS = 1
}
export const withDrawMap: Recordable<number, string> = {
    [WithDrawEnum.PEDDING]: '申请中',
    [WithDrawEnum.SUCCESS]: '提现成功'
}

export enum CouponEnum {
    NO_GET = 0, //未领取
    NO_APPLY = 1, //未使用
    ALIPAY = 2, //已使用
    OVERDUE = 3 //已过期
}
export enum UseGoodsTypeEnum {
    ALL = 1, //通用券
    CATEGORY = 2, //品类券
    CATEGOYR_PART = 3 //商品券
}
export enum CouponStatusEnum {
    AVALIABLE = 1,
    UN_AVALIABLE = 2
}
export enum UseConditionEnum {
    NO_CONDITION = 1, //无使用门槛
    CONDITION = 2 //有使用门槛
}
export enum OrderStatusEnum {
    NO_PAYMENT = 0, //未支付
    PAYMENNT = 1 //已支付
}
export const CouponStatusMap: Recordable<number, string> = {
    [CouponEnum.ALIPAY]: '已使用',
    [CouponEnum.OVERDUE]: '已过期'
}

export const NavigateMap: Recordable<number, string> = {
    [UseGoodsTypeEnum.ALL]: '/pages/index/index',
    [UseGoodsTypeEnum.CATEGORY]: '/bundle/pages/category_goods_coupon/goods_category',
    [UseGoodsTypeEnum.CATEGOYR_PART]: '/bundle/pages/category_goods_coupon/goods'
}

export const CouponCountMap: Recordable<string, string> = {
    availableCount: '可用优惠券',
    notAvailableCount: '不可用优惠券'
}
export const useGoodsTypeMap: Recordable<string, string> = {
    [UseGoodsTypeEnum.ALL]: '所有',
    [UseGoodsTypeEnum.CATEGORY]: '相应品类',
    [UseGoodsTypeEnum.CATEGOYR_PART]: '相应商品'
}
export const conditions = [
    { useGoodsType: UseGoodsTypeEnum.ALL, conditionType: UseConditionEnum.NO_CONDITION },
    { useGoodsType: UseGoodsTypeEnum.ALL, conditionType: UseConditionEnum.CONDITION },
    { useGoodsType: UseGoodsTypeEnum.CATEGORY, conditionType: UseConditionEnum.NO_CONDITION },
    { useGoodsType: UseGoodsTypeEnum.CATEGORY, conditionType: UseConditionEnum.CONDITION },
    { useGoodsType: UseGoodsTypeEnum.CATEGOYR_PART, conditionType: UseConditionEnum.NO_CONDITION },
    { useGoodsType: UseGoodsTypeEnum.CATEGOYR_PART, conditionType: UseConditionEnum.CONDITION }
]

// 多少天即将过期时，在优惠券右上方显示“快失效”字样，默认3天
export const showExpiringSoonDays = 3

// 提现状态
export enum WithdrawStatusEnum {
    WITHDRAWING = 0,
    SUCCESS = 1,
    FAIL = 2
}
export const WithdrawStatusMap: Recordable<number, string> = {
    [WithdrawStatusEnum.WITHDRAWING]: '提现中',
    [WithdrawStatusEnum.SUCCESS]: '提现成功',
    [WithdrawStatusEnum.FAIL]: '提现失败'
}
export enum PriceEnum {
    CUSTOMER_PRICE = 0, //固定价格
    TEACHER_PRICE = 1 // 价格区间
}
