修改导入样式及增加我也参与此球局

This commit is contained in:
筱野
2025-09-25 22:44:09 +08:00
parent 76d26831ca
commit e35e5068db
9 changed files with 42 additions and 21 deletions

View File

@@ -42,7 +42,7 @@ const defaultFormData: PublishBallFormData = {
players: {
min: 1,
max: 1,
is_participate: true
organizer_joined: true
},
skill_level: [1.0, 5.0],
descriptionInfo: {
@@ -262,7 +262,7 @@ const PublishBall: React.FC = () => {
return
}
const { activityInfo, descriptionInfo, timeRange, players, skill_level, image_list, wechat, ...rest } = formData[0];
const { min, max, is_participate } = players;
const { min, max, organizer_joined } = players;
const options = {
...rest,
...activityInfo,
@@ -270,7 +270,7 @@ const PublishBall: React.FC = () => {
...timeRange,
max_players: max,
min_players: min,
is_participate: is_participate,
organizer_joined,
skill_level_min: skill_level[0],
skill_level_max: skill_level[1],
image_list: image_list.map(item => item.url),
@@ -311,7 +311,7 @@ const PublishBall: React.FC = () => {
}
const options = formData.map((item) => {
const { activityInfo, descriptionInfo, timeRange, players, skill_level, ...rest } = item;
const { min, max, is_participate } = players;
const { min, max, organizer_joined } = players;
return {
...rest,
...activityInfo,
@@ -319,7 +319,7 @@ const PublishBall: React.FC = () => {
...timeRange,
max_players: max,
min_players: min,
is_participate: is_participate,
organizer_joined,
skill_level_min: skill_level[0],
skill_level_max: skill_level[1],
image_list: item.image_list.map(img => img.url)
@@ -390,7 +390,7 @@ const PublishBall: React.FC = () => {
...(description_tag ? { description_tag } : {}),
},
...(skill_level_max && skill_level_min ? { skill_level: [skill_level_min, skill_level_max] } : {}),
...(max_players && min_players ? { players: { min: min_players, max: max_players, is_participate: true } } : {}),
...(max_players && min_players ? { players: { min: min_players, max: max_players, organizer_joined: true } } : {}),
wechat: { ...defaultFormData.wechat, default_wechat_contact: userPhone }
}
}