You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
898 B
JavaScript
32 lines
898 B
JavaScript
export function formatTime(dateStr) {
|
|
if (!dateStr) return ''
|
|
return dateStr.replace(/:\d{2}$/, '').replace('T', ' ')
|
|
}
|
|
|
|
export function formatDate(dateStr) {
|
|
if (!dateStr) return ''
|
|
return dateStr.substring(0, 10)
|
|
}
|
|
|
|
export function getGenderText(gender) {
|
|
if (gender === 1) return '男'
|
|
if (gender === 2) return '女'
|
|
return '未知'
|
|
}
|
|
|
|
export function getStatusText(status) {
|
|
const map = { 0: '待预约', 1: '已预约', 2: '已到检', 3: '已完成', 4: '已取消', 5: '爽约' }
|
|
return map[status] || '未知'
|
|
}
|
|
|
|
export function getStatusClass(status) {
|
|
const map = { 0: 'status-pending', 1: 'status-booked', 2: 'status-booked', 3: 'status-done', 4: 'status-cancel', 5: 'status-cancel' }
|
|
return map[status] || 'status-cancel'
|
|
}
|
|
|
|
export function getPaymentText(status) {
|
|
if (status === 1) return '已支付'
|
|
if (status === 0) return '未支付'
|
|
return '未知'
|
|
}
|