feat: 包场预约网格改为1小时粒度+动态价格显示+锁场状态
- 时间线位置 /30 改为 /60 - 价格预览改为按格子累加 slot_prices - 格子内显示价格(¥xx) - 新增 locked(锁场)和 no_price(无价格)格子状态 - API映射层移除 unit_price,新增 slot_prices 和 source_type - 确认页半小时段改为时段
This commit is contained in:
@@ -46,10 +46,8 @@ const toPrivateBookingOptions = (backendData = {}) => ({
|
||||
court_type_label: backendData.court_type_label || '',
|
||||
open_time: backendData.open_time || '',
|
||||
close_time: backendData.close_time || '',
|
||||
unit_price: backendData.unit_price || '0.00',
|
||||
duration_units: toNumber(backendData.duration_units, 2),
|
||||
duration_units: toNumber(backendData.duration_units, 1),
|
||||
duration_minutes: toNumber(backendData.duration_minutes, 60),
|
||||
amount_per_court: backendData.amount_per_court || '0.00',
|
||||
total_court_count: toNumber(backendData.total_court_count),
|
||||
time_options: toArray(backendData.time_options).map(toPrivateTimeOption)
|
||||
})
|
||||
@@ -67,7 +65,8 @@ const toGridSlot = (backendSlot = {}) => ({
|
||||
const toGridOccupation = (backendOcc = {}) => ({
|
||||
court_id: backendOcc.court_id ?? null,
|
||||
start_at: backendOcc.start_at || '',
|
||||
end_at: backendOcc.end_at || ''
|
||||
end_at: backendOcc.end_at || '',
|
||||
source_type: backendOcc.source_type || ''
|
||||
})
|
||||
|
||||
const toPrivateBookingGrid = (backendData = {}) => ({
|
||||
@@ -76,10 +75,10 @@ const toPrivateBookingGrid = (backendData = {}) => ({
|
||||
court_type_label: backendData.court_type_label || '',
|
||||
open_time: backendData.open_time || '',
|
||||
close_time: backendData.close_time || '',
|
||||
unit_price: backendData.unit_price || '0.00',
|
||||
courts: toArray(backendData.courts).map(toGridCourt),
|
||||
time_slots: toArray(backendData.time_slots).map(toGridSlot),
|
||||
occupations: toArray(backendData.occupations).map(toGridOccupation)
|
||||
occupations: toArray(backendData.occupations).map(toGridOccupation),
|
||||
slot_prices: backendData.slot_prices || {}
|
||||
})
|
||||
|
||||
export const privateBookingApi = {
|
||||
|
||||
Reference in New Issue
Block a user