统一状态码,优化对应逻辑

This commit is contained in:
not-like-juvenile
2026-02-09 16:53:20 +08:00
parent 3ea0f008b5
commit f46ec4c461
19 changed files with 591 additions and 236 deletions

View File

@@ -39,7 +39,7 @@
<view class="timeline-content">
<view class="event-title-row">
<text v-for="(seg, i) in filterPhone(event.event_text)" :key="i" class="event-text" :class="{active: index === 0}">{{ seg }}</text>
<text v-for="(seg, i) in getProcessedText(event.event_text, event.status_code)" :key="i" class="event-text" :class="{active: index === 0}">{{ seg }}</text>
</view>
<text class="event-time">{{ event.event_time }}</text>
@@ -121,15 +121,7 @@
this.statusHistory = await mockService.getMockTracking(this.orderNo)
},
getStatusText(status: string) : string {
const maps = {
'PENDING': '待发货',
'SHIPPED': '已发货',
'IN_TRANSIT': '运输中',
'DELIVERED': '已签收',
'OUT_FOR_DELIVERY': '派送中',
'EXCEPTION': '异常'
}
return (maps[status] != null) ? maps[status] : status
return mockService.getStatusText(status)
},
async refreshLogistics() {
if (this.order.status === 'DELIVERED') {
@@ -152,8 +144,13 @@
urls: urls
})
},
getProcessedText(text: string, status: string): string[] {
const displayMsg = mockService.getDisplayMessage(text, status)
return this.filterPhone(displayMsg)
},
filterPhone(text: string): string[] {
// 商家端不展示手机号
// 依照需求文档 1. 敏感信息展示差异:商家端不展示手机号
// 直接移除所有手机号
return [text.replace(/(1[3-9]\d{9})/g, '')]
}
}