支持微信支付宝独立支付渠道
This commit is contained in:
@@ -29,6 +29,7 @@ const dialogMode = ref<'create' | 'edit' | 'view'>('create')
|
||||
const currentConfig = ref<PaymentConfig | null>(null)
|
||||
|
||||
const filterProvider = ref('')
|
||||
const filterPayWay = ref('')
|
||||
const filterStatus = ref('')
|
||||
const filterEnvironment = ref('')
|
||||
|
||||
@@ -46,6 +47,12 @@ const statusOptions = [
|
||||
{ label: '测试中', value: 'testing' },
|
||||
]
|
||||
|
||||
const payWayOptions = [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '支付宝', value: 'ZFBZF' },
|
||||
{ label: '微信', value: 'WXZF' },
|
||||
]
|
||||
|
||||
const environmentOptions = [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '生产环境', value: 'production' },
|
||||
@@ -65,6 +72,7 @@ async function loadConfigs() {
|
||||
try {
|
||||
const res = await fetchPaymentConfigs({
|
||||
provider: filterProvider.value || undefined,
|
||||
pay_way: filterPayWay.value || undefined,
|
||||
status: filterStatus.value || undefined,
|
||||
environment: filterEnvironment.value || undefined,
|
||||
page: currentPage.value,
|
||||
@@ -161,7 +169,7 @@ async function handleImportFile(event: Event) {
|
||||
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
'导入会按服务商和商户号新增或更新配置,并恢复备份中的启用配置。备份文件包含支付密钥明文,请确认来源可信。',
|
||||
'导入会按服务商、商户号和支付方式新增或更新配置,并恢复备份中的启用配置。备份文件包含支付密钥明文,请确认来源可信。',
|
||||
'导入支付配置备份',
|
||||
{
|
||||
type: 'warning',
|
||||
@@ -213,6 +221,24 @@ function formatProvider(provider: string) {
|
||||
return map[provider] || provider
|
||||
}
|
||||
|
||||
// formatPayWay 将支付方式编码展示为运营可读名称。
|
||||
function formatPayWay(payWay: string) {
|
||||
const map: Record<string, string> = {
|
||||
ZFBZF: '支付宝',
|
||||
WXZF: '微信',
|
||||
}
|
||||
return map[payWay] || payWay || '-'
|
||||
}
|
||||
|
||||
// getPayWayType 按支付方式返回标签颜色。
|
||||
function getPayWayType(payWay: string) {
|
||||
const map: Record<string, 'success' | 'primary' | 'info'> = {
|
||||
ZFBZF: 'primary',
|
||||
WXZF: 'success',
|
||||
}
|
||||
return map[payWay] || 'info'
|
||||
}
|
||||
|
||||
function formatStatus(status: string) {
|
||||
const map: Record<string, string> = {
|
||||
active: '启用',
|
||||
@@ -257,7 +283,7 @@ function deleteDisabledReason(row: PaymentConfig) {
|
||||
<div class="page-header">
|
||||
<p class="eyebrow">Payment Configs</p>
|
||||
<h1>支付配置管理</h1>
|
||||
<p>管理多个支付商户配置,支持乐刷、拉卡拉等多种支付渠道,同一时间仅一个配置启用。</p>
|
||||
<p>管理多个支付商户配置,支付宝和微信可分别启用默认渠道。</p>
|
||||
</div>
|
||||
|
||||
<div class="filter-bar">
|
||||
@@ -274,6 +300,19 @@ function deleteDisabledReason(row: PaymentConfig) {
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="filterPayWay"
|
||||
placeholder="支付方式"
|
||||
style="width: 120px"
|
||||
@change="loadConfigs"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in payWayOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="filterStatus"
|
||||
placeholder="状态"
|
||||
@@ -325,6 +364,13 @@ function deleteDisabledReason(row: PaymentConfig) {
|
||||
{{ formatProvider(row.provider) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pay_way" label="支付方式" width="104" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="getPayWayType(row.pay_way)" size="small">
|
||||
{{ formatPayWay(row.pay_way) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="merchant_id" label="商户号" min-width="150" />
|
||||
<el-table-column prop="environment" label="环境" width="86" align="center">
|
||||
<template #default="{ row }">
|
||||
|
||||
Reference in New Issue
Block a user