feat(custom): 订单列表改版

This commit is contained in:
2023-11-14 20:45:30 +08:00
parent 1ea4b218af
commit ba00cf26a6
10 changed files with 125 additions and 71 deletions

View File

@@ -84,7 +84,6 @@
<script setup>
import api from './api'
import { NEllipsis } from 'naive-ui'
const loading = ref(false)
@@ -142,27 +141,54 @@ const columns = ref([
{
title: '用户',
align: 'center',
key: 'user_name',
slot: 'user',
render: (row) => {
return [
h(
'div',
{},
{
default: () => row.User.nickName,
}
),
]
},
},
{
title: '手机号',
title: '用户电话',
align: 'center',
key: 'phone',
slot: 'phone',
render: (row) => {
return [
h(
'div',
{},
{
default: () => row.User.phone,
}
),
]
},
},
{
title: '商品名称',
align: 'center',
slot: 'goods_name',
render: (row) => {
return h(
NEllipsis,
{
style: 'max-width: 240px',
},
{
default: () => row.goods_name,
}
)
const el = []
row.OrderGoods.forEach((item) => {
el.push(
h(
'div',
{},
{
default: () =>
`${item.Goods.name}|${item.pay_price}元或${item.pay_integral}积分|X${item.number}`,
}
)
)
})
return el
},
},
{
@@ -171,9 +197,22 @@ const columns = ref([
key: 'count',
},
{
title: '商品总价',
title: '订单总价',
align: 'center',
key: 'number',
slot: 'number',
render: (row) => h('span', row.pay_type === 1 ? `${row.price}` : `${row.exchange}积分`),
},
{
title: '支付方式',
align: 'center',
slot: 'pay_type',
render: (row) => h('span', row.pay_type === 1 ? '微信' : '积分'),
},
{
title: '订单总价',
align: 'center',
slot: 'number',
render: (row) => h('span', row.pay_type === 1 ? `${row.price}` : `${row.exchange}积分`),
},
{
title: '订单状态',
@@ -184,9 +223,9 @@ const columns = ref([
case 0:
return h('span', '待付款')
case 1:
return h('span', '待使用')
return h('span', '待核销')
case 2:
return h('span', '已完成')
return h('span', '已核销')
case 3:
return h('span', '已过期')
}
@@ -195,17 +234,17 @@ const columns = ref([
{
title: '赠送豆子',
align: 'center',
key: 'pulse_number',
key: 'gift_pulse',
},
{
title: '赠送积分',
align: 'center',
key: 'integral',
key: 'gift_integral',
},
{
title: '推广积分',
align: 'center',
key: 'commission_number',
key: 'commission_integral',
},
{
title: '分佣类型',