支持拉卡拉多渠道支付和测试充值
This commit is contained in:
@@ -29,6 +29,7 @@ const filterEnvironment = ref('')
|
||||
const providerOptions = [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '乐刷支付', value: 'leshua' },
|
||||
{ label: '拉卡拉支付', value: 'lakala' },
|
||||
{ label: '模拟支付', value: 'mock' },
|
||||
]
|
||||
|
||||
@@ -91,6 +92,10 @@ function handleEdit(row: PaymentConfig) {
|
||||
}
|
||||
|
||||
async function handleDelete(row: PaymentConfig) {
|
||||
if (!canDeleteConfig(row)) {
|
||||
ElMessage.warning('该配置已有交易记录,需要保留用于退款、查询和回调验签')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm(`确定要删除配置"${row.name}"吗?`, '确认删除', {
|
||||
type: 'warning',
|
||||
@@ -118,6 +123,7 @@ function handleSaved() {
|
||||
function formatProvider(provider: string) {
|
||||
const map: Record<string, string> = {
|
||||
leshua: '乐刷支付',
|
||||
lakala: '拉卡拉支付',
|
||||
mock: '模拟支付',
|
||||
}
|
||||
return map[provider] || provider
|
||||
@@ -152,6 +158,14 @@ function getStatusType(status: string) {
|
||||
}
|
||||
return map[status] || 'info'
|
||||
}
|
||||
|
||||
function canDeleteConfig(row: PaymentConfig) {
|
||||
return row.total_transactions <= 0
|
||||
}
|
||||
|
||||
function deleteDisabledReason(row: PaymentConfig) {
|
||||
return canDeleteConfig(row) ? '删除配置' : '已有交易记录,需要保留用于退款、查询和回调验签'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -159,7 +173,7 @@ function getStatusType(status: string) {
|
||||
<div class="page-header">
|
||||
<p class="eyebrow">Payment Configs</p>
|
||||
<h1>支付配置管理</h1>
|
||||
<p>管理多个支付商户配置,支持乐刷支付等多种支付渠道。</p>
|
||||
<p>管理多个支付商户配置,支持乐刷、拉卡拉等多种支付渠道。</p>
|
||||
</div>
|
||||
|
||||
<div class="filter-bar">
|
||||
@@ -230,9 +244,19 @@ function getStatusType(status: string) {
|
||||
<el-button class="action-button edit" size="small" :icon="Edit" @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button class="action-button delete" size="small" :icon="Delete" @click="handleDelete(row)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-tooltip :content="deleteDisabledReason(row)" placement="top">
|
||||
<span>
|
||||
<el-button
|
||||
class="action-button delete"
|
||||
size="small"
|
||||
:icon="Delete"
|
||||
:disabled="!canDeleteConfig(row)"
|
||||
@click="handleDelete(row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
Reference in New Issue
Block a user