完善设置页面UI设计

This commit is contained in:
2026-06-02 17:34:44 +08:00
parent 881262940c
commit 714e63e12a
21 changed files with 697 additions and 850 deletions

View File

@@ -655,6 +655,9 @@ function mapOrderToCase(order: ServiceOrderType): HomeServiceCaseType {
const displayStatus = getHomecareOrderDisplayStatus(order)
let statusText = displayStatus
let statusTone = getCaseTone(order.status)
if (displayStatus == '已超时未支付') {
statusTone = 'danger'
}
if (order.dispatchStatus == HOMECARE_DISPATCH_STATUS_FAILED) {
statusTone = 'danger'
}
@@ -1181,4 +1184,4 @@ export async function fetchAdminHomeServiceApplications(): Promise<Array<HomeSer
export async function fetchAdminHomeServiceOverview(): Promise<Array<HomeServiceOverviewCardType>> {
await delay()
return ADMIN_OVERVIEW.map((item) => ({ ...item }))
}
}

View File

@@ -951,6 +951,9 @@ export function buildAddressSnapshot(address: UserAddress, latitude: number, lon
}
export function getHomecareOrderDisplayStatus(order: ServiceOrderType): string {
if (order.paymentStatus == 1 && order.status == 'created' && isHomecarePaymentExpired(order)) {
return '已超时未支付'
}
if (order.paymentStatus == 1 && order.status == 'created') {
return '待付款'
}
@@ -969,6 +972,21 @@ export function getHomecareOrderDisplayStatus(order: ServiceOrderType): string {
return getServiceOrderStatusText(order.status)
}
function isHomecarePaymentExpired(order: ServiceOrderType): boolean {
if (order.paymentStatus != 1 || order.status != 'created') {
return false
}
const payExpireAt = order.payExpireAt != null ? order.payExpireAt : ''
if (payExpireAt == '') {
return false
}
const expireMs = Date.parse(payExpireAt)
if (isNaN(expireMs)) {
return false
}
return expireMs <= Date.now()
}
export async function dispatchPaidHomecareOrder(orderId: string): Promise<HomecareDispatchResult> {
if (orderId == null || orderId.trim() == '') {
return {
@@ -1346,4 +1364,4 @@ export async function rejectServiceOrderAcceptance(orderId: string, content: str
export async function getCurrentConsumerUser() {
return await getCurrentUser()
}
}