完善设置页面UI设计
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user