修复订单列表返回状态丢失
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { readError } from '@/shared/utils/error'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
import {
|
||||
adminCloseOrder,
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
readSnapshot,
|
||||
readSnapshotResources,
|
||||
} from '@/features/orders/composables/useOrderSnapshot'
|
||||
import { adminPath } from '@/shared/utils/adminPath'
|
||||
import { adminPath, isAdminPath } from '@/shared/utils/adminPath'
|
||||
import { centToYuan, formatCentWithSymbol } from '@/shared/utils/money'
|
||||
import {
|
||||
disputeStatusLabel,
|
||||
@@ -46,6 +46,7 @@ import { formatDateTime } from '@/shared/utils/time'
|
||||
import { formatGameName, formatListingNo } from '@/shared/utils/listingDisplay'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const loading = ref(false)
|
||||
const submitting = ref(false)
|
||||
const order = ref<Order | null>(null)
|
||||
@@ -122,6 +123,15 @@ const returnLabel = computed(() =>
|
||||
? '返回会话'
|
||||
: '返回列表'
|
||||
)
|
||||
|
||||
function goBackToList() {
|
||||
const back = (window.history.state as { back?: string | null } | null)?.back
|
||||
if (back && isAdminPath(back)) {
|
||||
router.back()
|
||||
return
|
||||
}
|
||||
void router.push(returnTarget.value)
|
||||
}
|
||||
const refunding = ref(false)
|
||||
|
||||
const snapshotText = computed(() => JSON.stringify(order.value?.account_snapshot || {}, null, 2))
|
||||
@@ -910,9 +920,7 @@ function paymentPaidAt(record: AdminPayment) {
|
||||
</p>
|
||||
</div>
|
||||
<div class="toolbar-actions">
|
||||
<RouterLink :to="returnTarget">
|
||||
<el-button>{{ returnLabel }}</el-button>
|
||||
</RouterLink>
|
||||
<el-button @click="goBackToList">{{ returnLabel }}</el-button>
|
||||
<el-button v-if="canResetHandoff" type="success" @click="openAction('reset')">
|
||||
{{ resetActionLabel }}
|
||||
</el-button>
|
||||
|
||||
Reference in New Issue
Block a user