diff --git a/pages/furniture_customer/components/ServiceList.vue b/pages/furniture_customer/components/ServiceList.vue
index 22a36c1..59551da 100644
--- a/pages/furniture_customer/components/ServiceList.vue
+++ b/pages/furniture_customer/components/ServiceList.vue
@@ -42,6 +42,11 @@
{{ item.date }}
+ 录音时长:{{ formatDuration(item.duration) }}
+
+
+ 记录名称:
+ {{ item.recordingName }}
{{ item.description }}
@@ -177,6 +182,18 @@
}
// 触发列表项点击事件,打开详情页面
this.$emit('itemClick', item);
+ },
+ // 格式化时长(分钟转换为时分秒格式)
+ formatDuration(minutes) {
+ // 确保是数字类型,后端返回的单位是分钟
+ const numMinutes = Number(minutes);
+ if (isNaN(numMinutes) || numMinutes < 0) return '00:00:00';
+ // 将分钟转换为总秒数,然后格式化为时分秒
+ const totalSeconds = Math.floor(numMinutes * 60); // 将分钟转为秒,向下取整
+ const hours = Math.floor(totalSeconds / 3600);
+ const mins = Math.floor((totalSeconds % 3600) / 60);
+ const secs = totalSeconds % 60;
+ return `${String(hours).padStart(2, '0')}:${String(mins).padStart(2, '0')}:${String(secs).padStart(2, '0')}`;
}
}
}
@@ -355,13 +372,14 @@
.service-meta {
display: flex;
align-items: center;
+ flex-wrap: wrap;
margin-bottom: 16rpx;
+ gap: 16rpx;
}
.service-date {
font-size: 24rpx;
color: #999;
- margin-right: 16rpx;
}
.service-duration {
@@ -369,6 +387,23 @@
color: #999;
}
+ .service-recording-name {
+ display: flex;
+ align-items: center;
+ margin-bottom: 16rpx;
+ font-size: 24rpx;
+ color: #666;
+ }
+
+ .recording-name-label {
+ color: #999;
+ margin-right: 8rpx;
+ }
+
+ .recording-name-value {
+ color: #333;
+ }
+
.service-content {
margin-bottom: 24rpx;
}
diff --git a/pages/furniture_customer/furniture_customer.vue b/pages/furniture_customer/furniture_customer.vue
index 2cdadf1..5d5ff06 100644
--- a/pages/furniture_customer/furniture_customer.vue
+++ b/pages/furniture_customer/furniture_customer.vue
@@ -2275,15 +2275,24 @@
formattedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
+ // 处理录音时长:确保转换为数字,如果是 null/undefined 则保留为 null
+ let durationValue = null;
+ if (item.duration !== null && item.duration !== undefined && item.duration !== '') {
+ const numDuration = Number(item.duration);
+ durationValue = isNaN(numDuration) ? null : numDuration;
+ }
+
return {
- id: item.id,
- title: `${item.salesName || ''}的服务记录`,
- date: formattedTime ? `时间:${formattedTime}` : '',
- description: item.summary || '',
- customerName: item.customerName || '',
- // 保留原始数据,用于详情页
- rawData: item
- };
+ id: item.id,
+ title: `${item.salesName || ''}的服务记录`,
+ date: formattedTime ? `时间:${formattedTime}` : '',
+ description: item.summary || '',
+ customerName: item.customerName || '',
+ recordingName: item.recordingName || '', // 记录名称
+ duration: durationValue, // 录音时长(分钟),数字类型,null 表示无数据
+ // 保留原始数据,用于详情页
+ rawData: item
+ };
});
// 分页:第一页或刷新时重置,其他情况追加
if (this.serviceListPage.current === 1) {