fix: 优化交接记录显示,将技术标识转换为用户友好文字

问题:
- 交接记录显示原始技术标识(owner_handoff, renter_checkout 等)
- 用户体验不佳,难以理解记录含义

改进:
- 添加 formatHandoffRecordType 函数统一格式化交接记录类型
- 映射关系:
  - owner_handoff → 卖家交接
  - renter_checkout → 买家结账
  - owner_counter_checkout → 卖家反驳结账
  - renter_confirm_checkout → 买家确认结账
  - owner_accept_checkout → 卖家接受结账
- 同时优化PC端订单详情和管理后台订单详情

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
yml
2026-06-05 10:38:52 +08:00
co-authored by Claude Opus 4.7
parent 5d5bd5af77
commit ac5d1ea25d
2 changed files with 24 additions and 2 deletions
@@ -113,6 +113,17 @@ function refundStatusLabel(status: string) {
} }
return map[status] || status || '未退款' return map[status] || status || '未退款'
} }
function formatHandoffRecordType(type: string) {
const typeMap: Record<string, string> = {
owner_handoff: '卖家交接',
renter_checkout: '买家结账',
owner_counter_checkout: '卖家反驳结账',
renter_confirm_checkout: '买家确认结账',
owner_accept_checkout: '卖家接受结账',
}
return typeMap[type] || type
}
</script> </script>
<template> <template>
@@ -176,7 +187,7 @@ function refundStatusLabel(status: string) {
<h2>交接记录</h2> <h2>交接记录</h2>
<el-empty v-if="handoffRecords.length === 0" description="暂无交接记录" /> <el-empty v-if="handoffRecords.length === 0" description="暂无交接记录" />
<div v-for="record in handoffRecords" :key="record.id" class="timeline-item"> <div v-for="record in handoffRecords" :key="record.id" class="timeline-item">
<strong>{{ record.type }}</strong> <strong>{{ formatHandoffRecordType(record.type) }}</strong>
<p>{{ record.content }}</p> <p>{{ record.content }}</p>
<span>{{ formatDateTime(record.created_at) }}</span> <span>{{ formatDateTime(record.created_at) }}</span>
</div> </div>
@@ -611,6 +611,17 @@ function linesToList(value: string) {
.map((item) => item.trim()) .map((item) => item.trim())
.filter(Boolean) .filter(Boolean)
} }
function formatHandoffRecordType(type: string) {
const typeMap: Record<string, string> = {
owner_handoff: '卖家交接',
renter_checkout: '买家结账',
owner_counter_checkout: '卖家反驳结账',
renter_confirm_checkout: '买家确认结账',
owner_accept_checkout: '卖家接受结账',
}
return typeMap[type] || type
}
</script> </script>
<template> <template>
@@ -708,7 +719,7 @@ function linesToList(value: string) {
placement="top" placement="top"
> >
<div class="timeline-content"> <div class="timeline-content">
<div class="timeline-title">{{ record.type }}</div> <div class="timeline-title">{{ formatHandoffRecordType(record.type) }}</div>
<div class="timeline-body">{{ record.content }}</div> <div class="timeline-body">{{ record.content }}</div>
</div> </div>
</el-timeline-item> </el-timeline-item>