feat(user): 新增收货地址管理及售后申请页面
- 新增地址类型定义,增强前端地址数据结构 - 新增地址编辑页面,支持地址智能识别和定位选点功能 - 地址编辑支持省市区选择及默认地址设置 - 新增地址列表页面,支持地址展示、删除、编辑和选择功能 - 实现售后申请页面,支持选择售后类型和退款原因 - 售后申请支持商品选择、退款金额计算和凭证上传 - 新增售后详情页面,支持售后状态展示及申请取消 - 优化页面加载和用户交互体验,增加错误提示和权限处理
This commit is contained in:
96
src_bak/api/shop/shopEvent/model/index.ts
Normal file
96
src_bak/api/shop/shopEvent/model/index.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* 赛事模型
|
||||
*/
|
||||
|
||||
export type EventStatus = 'upcoming' | 'registering' | 'closed' | 'ended'
|
||||
|
||||
/** 动态报名表单字段配置 */
|
||||
export interface EventFormField {
|
||||
/** 字段唯一标识 */
|
||||
key: string
|
||||
/** 显示名称(后台可自定义) */
|
||||
label: string
|
||||
/** 字段类型:text-文本 number-数字 idcard-身份证 phone-手机号 select-下拉选择 radio-单选 */
|
||||
type: 'text' | 'number' | 'idcard' | 'phone' | 'select' | 'radio'
|
||||
/** 是否必填 1=必填 0=选填 */
|
||||
required: number
|
||||
/** 选项列表(type=select/radio时有效) */
|
||||
options?: string[]
|
||||
/** 占位提示文字 */
|
||||
placeholder?: string
|
||||
/** 排序号 */
|
||||
sort: number
|
||||
}
|
||||
|
||||
export interface ShopEvent {
|
||||
id: number
|
||||
name: string
|
||||
description: string
|
||||
image?: string
|
||||
banner?: string
|
||||
eventDate: string
|
||||
location?: string
|
||||
maxParticipants: number
|
||||
entryFee: number
|
||||
/** 动态表单字段配置(JSON字符串或数组) */
|
||||
formFields?: string | EventFormField[]
|
||||
status: number | EventStatus
|
||||
isHot: number
|
||||
tenantId?: number
|
||||
createTime: string
|
||||
paidCount: number
|
||||
}
|
||||
|
||||
export interface ShopEventParam {
|
||||
page?: number
|
||||
limit?: number
|
||||
status?: number
|
||||
isHot?: number
|
||||
tenantId?: number
|
||||
}
|
||||
|
||||
export interface EventRegisterParams {
|
||||
eventId: number
|
||||
/** 动态表单数据,key-value 形式 */
|
||||
formData?: Record<string, string>
|
||||
}
|
||||
|
||||
export interface EventRegistration {
|
||||
id: number
|
||||
eventId: number
|
||||
userId: number
|
||||
/** 动态表单提交的数据 */
|
||||
formData?: string | Record<string, string>
|
||||
entryFee: number
|
||||
payStatus: number // 0=待缴费 1=已缴费 2=已取消
|
||||
orderNo?: string
|
||||
paidAt?: string
|
||||
createTime: string
|
||||
eventName?: string
|
||||
}
|
||||
|
||||
export interface RegistrationStatus {
|
||||
registered: boolean
|
||||
payStatus: number | null
|
||||
registrationId?: number
|
||||
}
|
||||
|
||||
// 状态映射
|
||||
export function getEventStatusLabel(status: number): { label: string; color: string } {
|
||||
const map: Record<number, { label: string; color: string }> = {
|
||||
0: { label: '未开始', color: 'text-blue-500' },
|
||||
1: { label: '报名中', color: 'text-green-500' },
|
||||
2: { label: '已截止', color: 'text-orange-400' },
|
||||
3: { label: '已结束', color: 'text-gray-400' },
|
||||
}
|
||||
return map[status] ?? { label: '未知', color: 'text-gray-400' }
|
||||
}
|
||||
|
||||
export function getPayStatusLabel(payStatus: number): { label: string; color: string } {
|
||||
const map: Record<number, { label: string; color: string }> = {
|
||||
0: { label: '待缴费', color: 'text-orange-500' },
|
||||
1: { label: '已缴费', color: 'text-green-500' },
|
||||
2: { label: '已取消', color: 'text-gray-400' },
|
||||
}
|
||||
return map[payStatus] ?? { label: '未知', color: 'text-gray-400' }
|
||||
}
|
||||
Reference in New Issue
Block a user