Merge remote-tracking branch 'origin' into feat/liujie
This commit is contained in:
@@ -7,7 +7,6 @@ export type EnvType = 'development' | 'test' | 'production'
|
||||
export interface EnvConfig {
|
||||
name: string
|
||||
apiBaseURL: string
|
||||
apiVersion: string
|
||||
timeout: number
|
||||
enableLog: boolean
|
||||
enableMock: boolean
|
||||
@@ -18,8 +17,7 @@ const envConfigs: Record<EnvType, EnvConfig> = {
|
||||
// 开发环境
|
||||
development: {
|
||||
name: '开发环境',
|
||||
apiBaseURL: 'https://dev-api.playballtogether.com',
|
||||
apiVersion: 'v1',
|
||||
apiBaseURL: 'https://sit.light120.com',
|
||||
timeout: 15000,
|
||||
enableLog: true,
|
||||
enableMock: true
|
||||
@@ -28,8 +26,7 @@ const envConfigs: Record<EnvType, EnvConfig> = {
|
||||
// 测试环境
|
||||
test: {
|
||||
name: '测试环境',
|
||||
apiBaseURL: 'https://test-api.playballtogether.com',
|
||||
apiVersion: 'v1',
|
||||
apiBaseURL: 'https://sit.light120.com',
|
||||
timeout: 12000,
|
||||
enableLog: true,
|
||||
enableMock: false
|
||||
@@ -38,8 +35,7 @@ const envConfigs: Record<EnvType, EnvConfig> = {
|
||||
// 生产环境
|
||||
production: {
|
||||
name: '生产环境',
|
||||
apiBaseURL: 'https://api.playballtogether.com',
|
||||
apiVersion: 'v1',
|
||||
apiBaseURL: 'https://sit.light120.com',
|
||||
timeout: 10000,
|
||||
enableLog: false,
|
||||
enableMock: false
|
||||
|
||||
188
src/config/formSchema/publishBallFormSchema.ts
Normal file
188
src/config/formSchema/publishBallFormSchema.ts
Normal file
@@ -0,0 +1,188 @@
|
||||
// 表单字段类型枚举
|
||||
export enum FieldType {
|
||||
TEXT = 'text',
|
||||
TEXTAREA = 'textarea',
|
||||
SELECT = 'select',
|
||||
DATE = 'date',
|
||||
TIME = 'time',
|
||||
NUMBER = 'number',
|
||||
SWITCH = 'switch',
|
||||
RADIO = 'radio',
|
||||
CHECKBOX = 'checkbox',
|
||||
LOCATION = 'location',
|
||||
UPLOADIMAGE = 'uploadimage',
|
||||
TIMEINTERVAL = 'timeinterval',
|
||||
NUMBERINTERVAL = 'numberinterval',
|
||||
RANGE = 'range',
|
||||
TEXTAREATAG = 'textareaTag',
|
||||
ACTIVITYINFO = 'activityInfo'
|
||||
}
|
||||
|
||||
// 表单字段配置接口
|
||||
export interface FormFieldConfig {
|
||||
key: string
|
||||
label: string
|
||||
type: FieldType
|
||||
placeholder?: string
|
||||
required?: boolean
|
||||
defaultValue?: any
|
||||
options?: Array<{ label: string; value: any }>
|
||||
rules?: Array<{
|
||||
required?: boolean
|
||||
min?: number
|
||||
max?: number
|
||||
pattern?: RegExp
|
||||
message: string
|
||||
}>
|
||||
props?: Record<string, any>
|
||||
description?: string
|
||||
children?: FormFieldConfig[]
|
||||
iconType?: string
|
||||
}
|
||||
|
||||
// 发布球局表单配置
|
||||
export const publishBallFormSchema: FormFieldConfig[] = [
|
||||
{
|
||||
key: 'coverImages',
|
||||
label: '活动封页',
|
||||
type: FieldType.UPLOADIMAGE,
|
||||
placeholder: '请选择活动类型',
|
||||
required: true,
|
||||
props: {
|
||||
maxCount: 9
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'title',
|
||||
label: '',
|
||||
type: FieldType.TEXT,
|
||||
placeholder: '好的标题更吸引人哦',
|
||||
required: true,
|
||||
props: {
|
||||
maxLength: 80
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '请输入活动标题' },
|
||||
{ max: 20, message: '标题不能超过20个字符' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'date',
|
||||
label: '',
|
||||
type: FieldType.TIMEINTERVAL,
|
||||
placeholder: '请选择活动日期',
|
||||
required: true,
|
||||
rules: [
|
||||
{ required: true, message: '请选择活动日期' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'timeRange',
|
||||
label: '活动信息',
|
||||
type: FieldType.ACTIVITYINFO,
|
||||
placeholder: '请选择活动时间',
|
||||
required: true,
|
||||
rules: [
|
||||
{ required: true, message: '请选择活动时间' }
|
||||
],
|
||||
children: [
|
||||
{
|
||||
key: 'fee',
|
||||
label: '费用',
|
||||
iconType: 'ICON_COST',
|
||||
type: FieldType.NUMBER,
|
||||
placeholder: '请输入活动费用(元)',
|
||||
defaultValue: 0,
|
||||
rules: [
|
||||
{ min: 0, message: '费用不能为负数' },
|
||||
{ max: 1000, message: '费用不能超过1000元' }
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'location',
|
||||
label: '地点',
|
||||
iconType: 'ICON_LOCATION',
|
||||
type: FieldType.LOCATION,
|
||||
placeholder: '请选择活动地点',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
key: 'sport',
|
||||
label: '玩法',
|
||||
iconType: 'ICON_GAMEPLAY',
|
||||
type: FieldType.SELECT,
|
||||
placeholder: '请选择玩法',
|
||||
required: true,
|
||||
options: [
|
||||
{ label: '篮球', value: 'basketball' },
|
||||
{ label: '足球', value: 'football' },
|
||||
{ label: '羽毛球', value: 'badminton' },
|
||||
{ label: '网球', value: 'tennis' },
|
||||
{ label: '乒乓球', value: 'pingpong' },
|
||||
{ label: '排球', value: 'volleyball' }
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'minParticipants',
|
||||
label: '人数要求',
|
||||
type: FieldType.NUMBERINTERVAL,
|
||||
placeholder: '请输入最少参与人数',
|
||||
defaultValue: 1,
|
||||
props: {
|
||||
showSummary: true,
|
||||
summary: '最少1人,最多4人',
|
||||
},
|
||||
rules: [
|
||||
{ min: 1, message: '最少参与人数不能为0' },
|
||||
{ max: 4, message: '最少参与人数不能超过100人' }
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
key: 'ntpLevel',
|
||||
label: 'NTRP 水平要求',
|
||||
type: FieldType.RANGE,
|
||||
placeholder: '请选择开始时间',
|
||||
required: true,
|
||||
props: {
|
||||
showTitle: false,
|
||||
showSummary: true,
|
||||
className: 'ntrp-range',
|
||||
step: 0.5,
|
||||
min: 1.0,
|
||||
max: 5.0,
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'additionalRequirements',
|
||||
label: '补充要求(选填)',
|
||||
type: FieldType.TEXTAREATAG,
|
||||
placeholder: '补充性别偏好、特殊要求和注意事项等信息',
|
||||
required: true,
|
||||
options:[
|
||||
{ label: '仅限男生', value: 'beginner' },
|
||||
{ label: '仅限女生', value: 'intermediate' },
|
||||
{ label: '性别不限', value: 'advanced' }
|
||||
],
|
||||
rules: [
|
||||
{ max: 100, message: '补充要求不能超过100个字符' }
|
||||
]
|
||||
},
|
||||
{
|
||||
key: 'autoDegrade',
|
||||
label: '',
|
||||
type: FieldType.CHECKBOX,
|
||||
placeholder: '开启自动候补逻辑',
|
||||
required: true,
|
||||
props:{
|
||||
subTitle: '开启自动候补逻辑',
|
||||
showToast: true,
|
||||
description: '开启后,当活动人数不足时,系统会自动将活动状态改为“候补”,并通知用户。',
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '请选择开启自动候补逻辑' }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -10,4 +10,13 @@ export default {
|
||||
ICON_ARROW_RIGHT: require('@/static/publishBall/icon-arrow-right.svg'),
|
||||
ICON_ARROW_LEFT: require('@/static/publishBall/icon-arrow-left.svg'),
|
||||
ICON_LOGO_GO: require('@/static/publishBall/icon-logo-go.svg'),
|
||||
ICON_SEARCH: require('@/static/publishBall/icon-search.svg'),
|
||||
ICON_MAP: require('@/static/publishBall/icon-map.svg'),
|
||||
ICON_STADIUM: require('@/static/publishBall/icon-stadium.svg'),
|
||||
ICON_ARRORW_SMALL: require('@/static/publishBall/icon-arrow-small.svg'),
|
||||
ICON_MAP_SEARCH: require('@/static/publishBall/icon-map-search.svg'),
|
||||
ICON_HEART_CIRCLE: require('@/static/publishBall/icon-heartcircle.png'),
|
||||
ICON_ADD: require('@/static/publishBall/icon-add.svg'),
|
||||
ICON_COPY: require('@/static/publishBall/icon-arrow-right.svg'),
|
||||
ICON_DELETE: require('@/static/publishBall/icon-delete.svg')
|
||||
}
|
||||
Reference in New Issue
Block a user