feat(jd-order): 添加订单历史记录换绑和失败状态支持

- 新增换绑订单状态图标和颜色配置
- 添加cookie失效和京东下单失败状态处理
- 简化订单状态显示文本
- 更新订单状态筛选选项文本
This commit is contained in:
danial
2025-10-18 23:36:26 +08:00
parent b3169ae4d1
commit b7138c38ed
3 changed files with 40 additions and 19 deletions

View File

@@ -47,6 +47,10 @@
v-else-if="isSendType(item.changeType)" v-else-if="isSendType(item.changeType)"
:style="{ color: '#722ed1', fontSize: '16px' }" :style="{ color: '#722ed1', fontSize: '16px' }"
/> />
<icon-refresh
v-else-if="item.changeType === 'replace'"
:style="{ color: '#722ed1', fontSize: '16px' }"
/>
<icon-more v-else :style="{ color: '#86909c', fontSize: '16px' }" /> <icon-more v-else :style="{ color: '#86909c', fontSize: '16px' }" />
</template> </template>
@@ -114,6 +118,7 @@ import {
IconClockCircle, IconClockCircle,
IconCloseCircle, IconCloseCircle,
IconSync, IconSync,
IconRefresh,
IconMore IconMore
} from '@arco-design/web-vue/es/icon'; } from '@arco-design/web-vue/es/icon';
import { jdOrderClient } from '@/api'; import { jdOrderClient } from '@/api';
@@ -199,7 +204,8 @@ const getStatusColor = (changeType?: string): string => {
pay: 'green', // 支付 pay: 'green', // 支付
expire: 'red', // 过期 expire: 'red', // 过期
invalid: 'gray', // 失效 invalid: 'gray', // 失效
send: 'purple' // 替换 send: 'purple', // 发货
replace: 'purple' // 换绑
}; };
return colorMap[changeType || ''] || 'gray'; return colorMap[changeType || ''] || 'gray';
}; };
@@ -207,13 +213,14 @@ const getStatusColor = (changeType?: string): string => {
// 获取状态文本 // 获取状态文本
const getStatusText = (changeType?: string): string => { const getStatusText = (changeType?: string): string => {
const textMap: Record<string, string> = { const textMap: Record<string, string> = {
create: '创建订单', create: '创建',
bind: '绑定订单', bind: '绑定',
unbind: '解绑订单', unbind: '解绑',
pay: '支付完成', pay: '支付',
expire: '订单过期', expire: '过期',
invalid: '订单失效', invalid: '失效',
send: '发货' send: '发货',
replace: '换绑'
}; };
return textMap[changeType || ''] || '未知状态'; return textMap[changeType || ''] || '未知状态';
}; };
@@ -227,7 +234,8 @@ const getTimelineDotColor = (changeType?: string): string => {
pay: '#00b42a', // 支付 pay: '#00b42a', // 支付
expire: '#f53f3f', // 过期 expire: '#f53f3f', // 过期
invalid: '#86909c', // 失效 invalid: '#86909c', // 失效
send: '#722ed1' // 发货 send: '#722ed1', // 发货
replace: '#722ed1' // 换绑
}; };
return colorMap[changeType || ''] || '#86909c'; return colorMap[changeType || ''] || '#86909c';
}; };

View File

@@ -31,7 +31,7 @@
<a-option :value="3">已发货</a-option> <a-option :value="3">已发货</a-option>
<a-option :value="4">已过期</a-option> <a-option :value="4">已过期</a-option>
<a-option :value="5">已取消</a-option> <a-option :value="5">已取消</a-option>
<a-option :value="6">Cookie账号Ck失败</a-option> <a-option :value="6">Ck失败</a-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -94,9 +94,7 @@
<a-tag v-else-if="record.status === 3" color="blue">已发货</a-tag> <a-tag v-else-if="record.status === 3" color="blue">已发货</a-tag>
<a-tag v-else-if="record.status === 4" color="red">已过期</a-tag> <a-tag v-else-if="record.status === 4" color="red">已过期</a-tag>
<a-tag v-else-if="record.status === 5" color="gray">已取消</a-tag> <a-tag v-else-if="record.status === 5" color="gray">已取消</a-tag>
<a-tag v-else-if="record.status === 6" color="purple"> <a-tag v-else-if="record.status === 6" color="purple">Ck失败</a-tag>
Cookie账号Ck失败
</a-tag>
<a-tag v-else color="gray">未知</a-tag> <a-tag v-else color="gray">未知</a-tag>
</template> </template>
<template #amount="{ record }"> <template #amount="{ record }">
@@ -560,7 +558,7 @@ const getStatusText = (status: number): string => {
3: '已发货', 3: '已发货',
4: '已过期', 4: '已过期',
5: '已取消', 5: '已取消',
6: 'Cookie账号Ck失败' 6: 'Ck失败'
}; };
return statusMap[status] || '未知'; return statusMap[status] || '未知';
}; };

View File

@@ -35,6 +35,14 @@
v-else-if="item.changeType === 'expire'" v-else-if="item.changeType === 'expire'"
:style="{ color: '#f53f3f', fontSize: '16px' }" :style="{ color: '#f53f3f', fontSize: '16px' }"
/> />
<icon-close-circle
v-else-if="item.changeType === 'ck_failed'"
:style="{ color: '#ff7d00', fontSize: '16px' }"
/>
<icon-exclamation-circle
v-else-if="item.changeType === 'jd_order_failed'"
:style="{ color: '#f53f3f', fontSize: '16px' }"
/>
<icon-more v-else :style="{ color: '#86909c', fontSize: '16px' }" /> <icon-more v-else :style="{ color: '#86909c', fontSize: '16px' }" />
</template> </template>
@@ -101,6 +109,7 @@ import {
IconCheckCircle, IconCheckCircle,
IconClockCircle, IconClockCircle,
IconCloseCircle, IconCloseCircle,
IconExclamationCircle,
IconSync, IconSync,
IconMore IconMore
} from '@arco-design/web-vue/es/icon'; } from '@arco-design/web-vue/es/icon';
@@ -181,7 +190,9 @@ const getStatusColor = (changeType?: string): string => {
create: 'green', // 创建 create: 'green', // 创建
rebind: 'blue', // 重新绑定 rebind: 'blue', // 重新绑定
pay: 'green', // 支付 pay: 'green', // 支付
expire: 'red' // 过期 expire: 'red', // 过期
ck_failed: 'orange', // cookie失效
jd_order_failed: 'red' // 下单京东订单失败
}; };
return colorMap[changeType || ''] || 'gray'; return colorMap[changeType || ''] || 'gray';
}; };
@@ -189,10 +200,12 @@ const getStatusColor = (changeType?: string): string => {
// 获取状态文本 // 获取状态文本
const getStatusText = (changeType?: string): string => { const getStatusText = (changeType?: string): string => {
const textMap: Record<string, string> = { const textMap: Record<string, string> = {
create: '创建订单', create: '创建',
rebind: '重新绑定', rebind: '重新绑定',
pay: '支付完成', pay: '支付',
expire: '订单过期' expire: '过期',
ck_failed: 'cookie失效',
jd_order_failed: '下单京东订单失败'
}; };
return textMap[changeType || ''] || '未知状态'; return textMap[changeType || ''] || '未知状态';
}; };
@@ -203,7 +216,9 @@ const getTimelineDotColor = (changeType?: string): string => {
create: '#00b42a', // 创建 create: '#00b42a', // 创建
rebind: '#165dff', // 重新绑定 rebind: '#165dff', // 重新绑定
pay: '#00b42a', // 支付 pay: '#00b42a', // 支付
expire: '#f53f3f' // 过期 expire: '#f53f3f', // 过期
ck_failed: '#ff7d00', // cookie失效
jd_order_failed: '#f53f3f' // 下单京东订单失败
}; };
return colorMap[changeType || ''] || '#86909c'; return colorMap[changeType || ''] || '#86909c';
}; };