统一状态码,优化对应逻辑
This commit is contained in:
@@ -46,7 +46,9 @@
|
||||
<text class="event-text">{{ event.event_text }}</text>
|
||||
<view class="event-meta">
|
||||
<text class="meta-tag blue">代码: {{ event.event_code }}</text>
|
||||
<text class="meta-tag orange">映射状态: {{ getStatusMapping(event.status_code) }}</text>
|
||||
<text class="meta-tag orange" v-if="index === 0 || event.status_code !== events[index - 1].status_code">
|
||||
映射状态: {{ getStatusMapping(event.status_code) }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="raw-box" v-if="showRaw[index]">
|
||||
<text class="raw-text">{{ JSON.stringify(event.raw_payload, null, 2) }}</text>
|
||||
@@ -119,26 +121,10 @@
|
||||
this.showRaw[index] = !current
|
||||
},
|
||||
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)
|
||||
},
|
||||
getStatusMapping(code: string) : string {
|
||||
const maps = {
|
||||
'SHIPPED': '已揽收',
|
||||
'IN_TRANSIT': '运输中',
|
||||
'ARRIVED_HUB': '到达分拨中心',
|
||||
'OUT_FOR_DELIVERY': '正在派送',
|
||||
'DELIVERED': '已签收',
|
||||
'EXCEPTION': '包裹异常'
|
||||
}
|
||||
return (maps[code] != null) ? maps[code] : code
|
||||
return mockService.getStatusText(code)
|
||||
},
|
||||
async runScenario(type: string) {
|
||||
if (this.waybillInfo == null) return
|
||||
|
||||
Reference in New Issue
Block a user