consumerm模块完成度90%,完善消费者和商家端数据库表,商品、聊天、订单数据对接好了supabase,和商家端对接了聊天功能,安卓端编译通过了css样式,剩余几个页面在处理函数规范问题
This commit is contained in:
@@ -251,7 +251,7 @@ export const ORDER_STATUS = {
|
||||
CANCELLED: 6,
|
||||
REFUNDING: 7,
|
||||
REFUNDED: 8
|
||||
} as const
|
||||
}
|
||||
|
||||
// 优惠券类型枚举
|
||||
export const COUPON_TYPE = {
|
||||
@@ -263,7 +263,7 @@ export const COUPON_TYPE = {
|
||||
CATEGORY: 6, // 品类券
|
||||
MERCHANT: 7, // 商家券
|
||||
LIMITED_TIME: 8 // 限时券
|
||||
} as const
|
||||
}
|
||||
|
||||
// 支付方式枚举
|
||||
export const PAYMENT_METHOD = {
|
||||
@@ -271,7 +271,7 @@ export const PAYMENT_METHOD = {
|
||||
ALIPAY: 2,
|
||||
UNIONPAY: 3,
|
||||
BALANCE: 4
|
||||
} as const
|
||||
}
|
||||
|
||||
// 配送状态枚举
|
||||
export const DELIVERY_STATUS = {
|
||||
@@ -281,7 +281,7 @@ export const DELIVERY_STATUS = {
|
||||
IN_TRANSIT: 4,
|
||||
DELIVERED: 5,
|
||||
FAILED: 6
|
||||
} as const
|
||||
}
|
||||
|
||||
// 用户类型枚举
|
||||
export const MALL_USER_TYPE = {
|
||||
@@ -290,7 +290,7 @@ export const MALL_USER_TYPE = {
|
||||
DELIVERY: 3, // 配送员
|
||||
SERVICE: 4, // 客服
|
||||
ADMIN: 5 // 管理员
|
||||
} as const
|
||||
}
|
||||
|
||||
// 用户状态枚举
|
||||
export const USER_STATUS = {
|
||||
@@ -305,7 +305,7 @@ export const VERIFICATION_STATUS = {
|
||||
UNVERIFIED: 0, // 未认证
|
||||
VERIFIED: 1, // 已认证
|
||||
FAILED: 2 // 认证失败
|
||||
} as const
|
||||
}
|
||||
|
||||
// 地址标签枚举
|
||||
export const ADDRESS_LABEL = {
|
||||
@@ -313,13 +313,13 @@ export const ADDRESS_LABEL = {
|
||||
OFFICE: 'office', // 公司
|
||||
SCHOOL: 'school', // 学校
|
||||
OTHER: 'other' // 其他
|
||||
} as const
|
||||
}
|
||||
|
||||
// 收藏类型枚举
|
||||
export const FAVORITE_TYPE = {
|
||||
PRODUCT: 'product', // 商品
|
||||
SHOP: 'shop' // 店铺
|
||||
} as const
|
||||
}
|
||||
|
||||
// =========================
|
||||
// 订阅相关类型与枚举
|
||||
@@ -329,7 +329,7 @@ export const FAVORITE_TYPE = {
|
||||
export const SUBSCRIPTION_PERIOD = {
|
||||
MONTHLY: 'monthly',
|
||||
YEARLY: 'yearly'
|
||||
} as const
|
||||
}
|
||||
|
||||
// 订阅状态枚举
|
||||
export const SUBSCRIPTION_STATUS = {
|
||||
@@ -338,7 +338,7 @@ export const SUBSCRIPTION_STATUS = {
|
||||
PAST_DUE: 'past_due',
|
||||
CANCELED: 'canceled',
|
||||
EXPIRED: 'expired'
|
||||
} as const
|
||||
}
|
||||
|
||||
// 软件订阅方案类型
|
||||
export type SubscriptionPlanType = {
|
||||
@@ -349,7 +349,7 @@ export type SubscriptionPlanType = {
|
||||
features: UTSJSONObject | null // { featureKey: description }
|
||||
price: number // 单位:元(或分,取决于后端;前端以显示为准)
|
||||
currency: string | null // 'CNY' | 'USD' ...
|
||||
billing_period: keyof typeof SUBSCRIPTION_PERIOD | string // 'monthly' | 'yearly'
|
||||
billing_period: string // 'monthly' | 'yearly'
|
||||
trial_days: number | null
|
||||
is_active: boolean
|
||||
sort_order?: number | null
|
||||
@@ -362,7 +362,7 @@ export type UserSubscriptionType = {
|
||||
id: string
|
||||
user_id: string
|
||||
plan_id: string
|
||||
status: keyof typeof SUBSCRIPTION_STATUS | string
|
||||
status: string
|
||||
start_date: string
|
||||
end_date: string | null
|
||||
next_billing_date: string | null
|
||||
@@ -372,76 +372,6 @@ export type UserSubscriptionType = {
|
||||
created_at?: string
|
||||
updated_at?: string
|
||||
}
|
||||
export interface Product {
|
||||
id: string
|
||||
name: string
|
||||
description: string | null // 允许null
|
||||
price: number
|
||||
original_price: number | null // 允许null
|
||||
images: string[]
|
||||
// ... 其他属性
|
||||
}
|
||||
// types/mall-types.uts
|
||||
export interface ProductType {
|
||||
id: string
|
||||
name: string
|
||||
description: string
|
||||
price: number
|
||||
original_price: number
|
||||
images: string[]
|
||||
category_id: string
|
||||
status: number
|
||||
stock: number
|
||||
sales: number
|
||||
tags: string[]
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface CategoryType {
|
||||
id: string
|
||||
name: string
|
||||
icon_url: string
|
||||
parent_id: string | null
|
||||
is_active: boolean
|
||||
sort_order: number
|
||||
}
|
||||
|
||||
export interface BannerType {
|
||||
id: string
|
||||
title: string
|
||||
image_url: string
|
||||
link_url: string
|
||||
sort_order: number
|
||||
status: number
|
||||
}
|
||||
|
||||
export interface CouponTemplateType {
|
||||
id: string
|
||||
name: string
|
||||
discount_value: number
|
||||
min_order_amount: number
|
||||
start_time: string
|
||||
end_time: string
|
||||
status: number
|
||||
per_user_limit: number
|
||||
}
|
||||
|
||||
export interface CartItemType {
|
||||
id: string
|
||||
user_id: string
|
||||
product_id: string
|
||||
quantity: number
|
||||
created_at: string
|
||||
}
|
||||
|
||||
// Mock 数据类型
|
||||
export interface MockData {
|
||||
banners: BannerType[]
|
||||
categories: CategoryType[]
|
||||
coupons: CouponTemplateType[]
|
||||
products: ProductType[]
|
||||
}
|
||||
|
||||
// 用户基础信息类型 (兼容 pages/user/types.uts)
|
||||
export type UserProfile = {
|
||||
|
||||
Reference in New Issue
Block a user