修复了bug

This commit is contained in:
dzl
2025-09-01 17:42:19 +08:00
parent d593ac5c7f
commit b8974a7c6a

View File

@@ -103,7 +103,7 @@
<!-- 订单操作 --> <!-- 订单操作 -->
<div class="order-actions"> <div class="order-actions">
<el-button <el-button
v-if="order.status === 'pending'" v-if="order.status === 'pre_order'"
type="primary" type="primary"
size="small" size="small"
@click="goToPay(order.id)" @click="goToPay(order.id)"
@@ -323,6 +323,7 @@ const submittingReview = ref(false)
const statusTabs = ref([ const statusTabs = ref([
{ label: '全部', value: 'all', count: 0 }, { label: '全部', value: 'all', count: 0 },
{ label: '待支付', value: 'pending', count: 0 }, { label: '待支付', value: 'pending', count: 0 },
{ label: '待发货', value: 'pre_order', count: 0 },
{ label: '已发货', value: 'shipped', count: 0 }, { label: '已发货', value: 'shipped', count: 0 },
{ label: '已完成', value: 'completed', count: 0 }, { label: '已完成', value: 'completed', count: 0 },
{ label: '已取消', value: 'cancelled', count: 0 } { label: '已取消', value: 'cancelled', count: 0 }
@@ -344,7 +345,8 @@ const selectStatus = (status) => {
const getEmptyText = () => { const getEmptyText = () => {
const textMap = { const textMap = {
all: '暂无订单', all: '暂无订单',
pending: '暂无待支付订单', pending: '暂无待发货订单',
pre_order: '暂无待支付订单',
shipped: '暂无已发货订单', shipped: '暂无已发货订单',
completed: '暂无已完成订单', completed: '暂无已完成订单',
cancelled: '暂无已取消订单' cancelled: '暂无已取消订单'
@@ -355,6 +357,7 @@ const getEmptyText = () => {
const getStatusType = (status) => { const getStatusType = (status) => {
const typeMap = { const typeMap = {
pending: 'warning', pending: 'warning',
pre_order: 'warning',
shipped: 'primary', shipped: 'primary',
completed: 'success', completed: 'success',
cancelled: 'danger' cancelled: 'danger'
@@ -364,7 +367,7 @@ const getStatusType = (status) => {
const mapOrderStatus = (backendStatus) => { const mapOrderStatus = (backendStatus) => {
const statusMap = { const statusMap = {
'pre_order': 'pending', 'pre_order': 'pre_order',
'pending': 'pending', 'pending': 'pending',
'shipped': 'shipped', 'shipped': 'shipped',
'completed': 'completed', 'completed': 'completed',
@@ -375,7 +378,8 @@ const mapOrderStatus = (backendStatus) => {
const getStatusText = (status) => { const getStatusText = (status) => {
const textMap = { const textMap = {
pending: '待支付', pending: '待发货',
pre_order: '待支付',
shipped: '已发货', shipped: '已发货',
completed: '已完成', completed: '已完成',
cancelled: '已取消' cancelled: '已取消'
@@ -437,7 +441,7 @@ const confirmReceive = async (orderId) => {
type: 'info' type: 'info'
}) })
await api.put(`/orders/${orderId}/receive`) await api.put(`/orders/${orderId}/confirm`)
// 更新订单状态 // 更新订单状态
const order = orders.value.find(o => o.id === orderId) const order = orders.value.find(o => o.id === orderId)